Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2019-04-16 22:09:59 +0300
committerDalai Felinto <dfelinto@gmail.com>2019-04-16 22:10:04 +0300
commitd29bd6c6b7b55113d261a409fcfa864d374cd9f3 (patch)
tree76deb7d1af037caf705bf1c944974a28c183db99 /source
parente6151bc4c1f218d506ecc4b577d77e1f86955277 (diff)
Selecing a pose bone in outliner deselect others
This mimics what is now the behaviour for edit bones as well. See e6151bc4c1f2. And it also matches what we do in the viewport when selecting bones.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index d4243da5b1e..9866b43a6a6 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -586,11 +586,27 @@ static eOLDrawState tree_element_active_posechannel(
if (!(pchan->bone->flag & BONE_HIDDEN_P)) {
if (set != OL_SETSEL_EXTEND) {
- bPoseChannel *pchannel;
- /* single select forces all other bones to get unselected */
- for (pchannel = ob->pose->chanbase.first; pchannel; pchannel = pchannel->next) {
- pchannel->bone->flag &= ~(BONE_TIPSEL | BONE_SELECTED | BONE_ROOTSEL);
+ /* Single select forces all other bones to get unselected. */
+ uint objects_len = 0;
+ Object **objects = BKE_view_layer_array_from_objects_in_mode_unique_data(view_layer, NULL, &objects_len, OB_MODE_POSE);
+ for (uint object_index = 0; object_index < objects_len; object_index++) {
+ Object *ob_iter = BKE_object_pose_armature_get(objects[object_index]);
+
+ /* Sanity checks. */
+ if (ELEM(NULL, ob_iter, ob_iter->pose, ob_iter->data)) {
+ continue;
+ }
+
+ bPoseChannel *pchannel;
+ for (pchannel = ob_iter->pose->chanbase.first; pchannel; pchannel = pchannel->next) {
+ pchannel->bone->flag &= ~(BONE_TIPSEL | BONE_SELECTED | BONE_ROOTSEL);
+ }
+
+ if (ob != ob_iter) {
+ DEG_id_tag_update(ob_iter->data, ID_RECALC_SELECT);
+ }
}
+ MEM_freeN(objects);
}
if ((set == OL_SETSEL_EXTEND) && (pchan->bone->flag & BONE_SELECTED)) {