Commit: 63076a7d7f5e51ee2c565dcd02d8ace387054a06
Author: Nathan Craddock
Date:   Mon Jul 8 22:10:57 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB63076a7d7f5e51ee2c565dcd02d8ace387054a06

Outliner: Move active element code

Moves code for setting active element to activate function
rather than select function as this makes more sense

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

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 fa3401f49c0..6b6774f19a9 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1123,6 +1123,10 @@ static void 
do_outliner_item_activate_tree_element(bContext *C,
                                                    const bool extend,
                                                    const bool recursive)
 {
+  /* Set TreeStore flags for active element */
+  outliner_flag_set(&soops->tree, TSE_ACTIVE, false);
+  tselem->flag |= TSE_ACTIVE;
+
   /* Always makes active object, except for some specific types. */
   if (ELEM(tselem->type,
            TSE_SEQUENCE,
@@ -1236,16 +1240,12 @@ void outliner_item_select(SpaceOutliner *soops,
                           const bool toggle)
 {
   TreeStoreElem *tselem = TREESTORE(te);
-  const short new_flag = (toggle && (tselem->flag & TSE_ACTIVE)) ? 
(tselem->flag ^ TSE_SELECTED) :
-                                                                   
(tselem->flag | TSE_SELECTED);
-
-  // Change active element
-  outliner_flag_set(&soops->tree, TSE_ACTIVE, false);
+  const short new_flag = toggle ? (tselem->flag ^ TSE_SELECTED) : 
(tselem->flag | TSE_SELECTED);
 
   if (extend == false) {
     outliner_flag_set(&soops->tree, TSE_SELECTED, false);
   }
-  tselem->flag = new_flag | TSE_ACTIVE;
+  tselem->flag = new_flag;
 }
 
 static void do_outliner_range_select_recursive(ListBase *lb,
@@ -1681,7 +1681,7 @@ static void do_outliner_select_walk(
   }
 
   /* Activate rather than just setting flags to support mode switching */
-  outliner_item_select(soops, active, extend, extend);
+  outliner_item_select(soops, active, extend, false);
   do_outliner_item_activate_tree_element(
       C, scene, view_layer, soops, active, tselem_new, extend, false);
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to