[Bf-blender-cvs] [364e7e08495] soc-2019-outliner: Outliner: Cleanup walk select and syncing code

Nathan Craddock noreply at git.blender.org
Sat Aug 3 22:22:39 CEST 2019


Commit: 364e7e08495cde7c108d6af34555afb4c4e723a4
Author: Nathan Craddock
Date:   Sat Aug 3 14:22:17 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB364e7e08495cde7c108d6af34555afb4c4e723a4

Outliner: Cleanup walk select and syncing code

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

M	source/blender/editors/space_outliner/outliner_select.c
M	source/blender/editors/space_outliner/outliner_sync.c
M	source/blender/makesdna/DNA_outliner_types.h

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

diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 6b6272ffee0..b8372dafcec 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1100,8 +1100,8 @@ eOLDrawState tree_element_type_active(bContext *C,
 
 void outliner_element_activate(SpaceOutliner *soops, TreeStoreElem *tselem)
 {
-  outliner_flag_set(&soops->tree, TSE_ACTIVE | TSE_WALK, false);
-  tselem->flag |= TSE_ACTIVE | TSE_WALK;
+  outliner_flag_set(&soops->tree, TSE_ACTIVE | TSE_ACTIVE_WALK, false);
+  tselem->flag |= TSE_ACTIVE | TSE_ACTIVE_WALK;
 }
 
 /**
@@ -1275,17 +1275,17 @@ static void do_outliner_range_select_recursive(ListBase *lb,
 static void do_outliner_range_select(SpaceOutliner *soops, TreeElement *cursor)
 {
   TreeElement *active = outliner_find_element_with_flag(&soops->tree, TSE_ACTIVE);
-  outliner_flag_set(&soops->tree, TSE_WALK, false);
+  outliner_flag_set(&soops->tree, TSE_ACTIVE_WALK, false);
 
   if (!active) {
-    TREESTORE(cursor)->flag |= TSE_SELECTED | TSE_ACTIVE | TSE_WALK;
+    TREESTORE(cursor)->flag |= TSE_SELECTED | TSE_ACTIVE | TSE_ACTIVE_WALK;
     return;
   }
 
   TreeStoreElem *tselem = TREESTORE(active);
   const bool active_selected = (tselem->flag & TSE_SELECTED);
 
-  outliner_flag_set(&soops->tree, TSE_SELECTED | TSE_WALK, false);
+  outliner_flag_set(&soops->tree, TSE_SELECTED | TSE_ACTIVE_WALK, false);
 
   /* Select active if under cursor */
   if (active == cursor) {
@@ -1296,7 +1296,7 @@ static void do_outliner_range_select(SpaceOutliner *soops, TreeElement *cursor)
   /* If active is not selected, just select the element under the cursor */
   if (!active_selected || !outliner_is_element_visible(active)) {
     tselem->flag &= ~TSE_ACTIVE;
-    TREESTORE(cursor)->flag |= TSE_SELECTED | TSE_ACTIVE | TSE_WALK;
+    TREESTORE(cursor)->flag |= TSE_SELECTED | TSE_ACTIVE | TSE_ACTIVE_WALK;
     return;
   }
 
@@ -1677,7 +1677,7 @@ static TreeElement *do_outliner_select_walk(SpaceOutliner *soops,
   if (!extend) {
     outliner_flag_set(&soops->tree, TSE_SELECTED, false);
   }
-  tselem->flag &= ~TSE_WALK;
+  tselem->flag &= ~TSE_ACTIVE_WALK;
 
   switch (direction) {
     case OUTLINER_SELECT_WALK_UP:
@@ -1703,7 +1703,7 @@ static TreeElement *do_outliner_select_walk(SpaceOutliner *soops,
                                                        (tselem->flag | TSE_SELECTED);
   }
 
-  tselem_new->flag |= TSE_SELECTED | TSE_WALK;
+  tselem_new->flag |= TSE_SELECTED | TSE_ACTIVE_WALK;
 
   return walk_element;
 }
@@ -1712,7 +1712,7 @@ static TreeElement *do_outliner_select_walk(SpaceOutliner *soops,
  * Changed is set to true if walk element is found, false if it was set */
 static TreeElement *find_walk_select_start_element(SpaceOutliner *soops, bool *changed)
 {
-  TreeElement *walk_element = outliner_find_element_with_flag(&soops->tree, TSE_WALK);
+  TreeElement *walk_element = outliner_find_element_with_flag(&soops->tree, TSE_ACTIVE_WALK);
 
   *changed = false;
 
@@ -1733,7 +1733,7 @@ static TreeElement *find_walk_select_start_element(SpaceOutliner *soops, bool *c
 
   /* If walk element is not visible, set that element's first visible parent as walk element */
   if (!outliner_is_element_visible(walk_element)) {
-    TREESTORE(walk_element)->flag &= ~TSE_WALK;
+    TREESTORE(walk_element)->flag &= ~TSE_ACTIVE_WALK;
 
     while (!outliner_is_element_visible(walk_element)) {
       walk_element = walk_element->parent;
@@ -1777,7 +1777,7 @@ static int outliner_walk_select_invoke(bContext *C, wmOperator *op, const wmEven
     walk_element = do_outliner_select_walk(soops, walk_element, direction, extend, toggle_all);
   }
   else {
-    TREESTORE(walk_element)->flag |= TSE_SELECTED | TSE_WALK;
+    TREESTORE(walk_element)->flag |= TSE_SELECTED | TSE_ACTIVE_WALK;
   }
 
   /* Scroll outliner to focus on walk element */
diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c
index 10fa564f94b..f0b5fb005af 100644
--- a/source/blender/editors/space_outliner/outliner_sync.c
+++ b/source/blender/editors/space_outliner/outliner_sync.c
@@ -54,9 +54,9 @@ static void outliners_mark_dirty(const bContext *C)
   Main *bmain = CTX_data_main(C);
   for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
     for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
-      for (SpaceLink *space = sa->spacedata.first; space; space = space->next) {
-        if (space->spacetype == SPACE_OUTLINER) {
-          SpaceOutliner *soutliner = (SpaceOutliner *)space;
+      for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+        if (sl->spacetype == SPACE_OUTLINER) {
+          SpaceOutliner *soutliner = (SpaceOutliner *)sl;
 
           /* Mark selection state as dirty */
           soutliner->flag |= SO_IS_DIRTY;
@@ -190,7 +190,7 @@ static void outliner_sync_selection_to_outliner(const bContext *C,
       Bone *bone = pchan->bone;
 
       if (pchan == pchan_active) {
-        tselem->flag |= TSE_ACTIVE | TSE_WALK;
+        tselem->flag |= TSE_ACTIVE | TSE_ACTIVE_WALK;
       }
 
       if (bone->flag & BONE_SELECTED) {
diff --git a/source/blender/makesdna/DNA_outliner_types.h b/source/blender/makesdna/DNA_outliner_types.h
index 1e93e0a63c6..9776063f220 100644
--- a/source/blender/makesdna/DNA_outliner_types.h
+++ b/source/blender/makesdna/DNA_outliner_types.h
@@ -63,7 +63,7 @@ enum {
   /* Needed because outliner-only elements can be active */
   TSE_ACTIVE = (1 << 9),
   /* Needed because walk selection should not activate */
-  TSE_WALK = (1 << 10),
+  TSE_ACTIVE_WALK = (1 << 10),
   TSE_DRAG_ANY = (TSE_DRAG_INTO | TSE_DRAG_BEFORE | TSE_DRAG_AFTER),
 };



More information about the Bf-blender-cvs mailing list