[Bf-blender-cvs] [fe7528ee919] master: Fix T74332: selection sync replacing parent selection

Nathan Craddock noreply at git.blender.org
Thu Mar 5 15:41:32 CET 2020


Commit: fe7528ee919ba75a1216aad3257faede33cbac14
Author: Nathan Craddock
Date:   Wed Mar 4 23:01:23 2020 -0700
Branches: master
https://developer.blender.org/rBfe7528ee919ba75a1216aad3257faede33cbac14

Fix T74332: selection sync replacing parent selection

Selecting certain child datablocks also selects the parent (e.g.
selecting a pose bone selects the armature). The base was selected, but
the outliner tree element was left unselected. The subsequent selection
sync would then deselect the parent base because it was not flagged as
selected in the outliner.

This led to issues like T74332 where selecting a pose bone in the
outliner did not show drivers in the driver editor unless the armature
was explicitly added to the selection afterwards.

The solution is to also flag the outliner elements as selected when
selecting parent bases.

Differential Revision: https://developer.blender.org/D7029

===================================================================

M	source/blender/editors/space_outliner/outliner_select.c

===================================================================

diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index fd0dbd63c89..715b554b154 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -308,6 +308,7 @@ static eOLDrawState tree_element_set_active_object(bContext *C,
                                                    bool recursive)
 {
   TreeStoreElem *tselem = TREESTORE(te);
+  TreeStoreElem *parent_tselem;
   Scene *sce;
   Base *base;
   Object *ob = NULL;
@@ -318,7 +319,9 @@ static eOLDrawState tree_element_set_active_object(bContext *C,
   }
   else {
     ob = (Object *)outliner_search_back(soops, te, ID_OB);
-    if (ob == OBACT(view_layer)) {
+
+    /* Don't return when activating children of the previous active object. */
+    if (ob == OBACT(view_layer) && set == OL_SETSEL_NONE) {
       return OL_DRAWSEL_NONE;
     }
   }
@@ -352,14 +355,17 @@ static eOLDrawState tree_element_set_active_object(bContext *C,
     }
   }
 
+  parent_tselem = TREESTORE(outliner_find_id(soops, &soops->tree, (ID *)ob));
   if (base) {
     if (set == OL_SETSEL_EXTEND) {
       /* swap select */
       if (base->flag & BASE_SELECTED) {
         ED_object_base_select(base, BA_DESELECT);
+        parent_tselem->flag &= ~TSE_SELECTED;
       }
       else {
         ED_object_base_select(base, BA_SELECT);
+        parent_tselem->flag |= TSE_SELECTED;
       }
     }
     else {
@@ -375,6 +381,7 @@ static eOLDrawState tree_element_set_active_object(bContext *C,
         BKE_view_layer_base_deselect_all(view_layer);
       }
       ED_object_base_select(base, BA_SELECT);
+      parent_tselem->flag |= TSE_SELECTED;
     }
 
     if (recursive) {



More information about the Bf-blender-cvs mailing list