[Bf-blender-cvs] [47b478eb682] soc-2019-outliner: Rename vars

Campbell Barton noreply at git.blender.org
Tue Aug 6 17:33:55 CEST 2019


Commit: 47b478eb682b528fb792a7d58654009c153da001
Author: Campbell Barton
Date:   Wed Aug 7 01:23:21 2019 +1000
Branches: soc-2019-outliner
https://developer.blender.org/rB47b478eb682b528fb792a7d58654009c153da001

Rename vars

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

M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/editors/space_outliner/outliner_sync.c
M	source/blender/editors/space_outliner/space_outliner.c
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesdna/DNA_windowmanager_types.h

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

diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index f1f478df3ce..306fd7d8d6a 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3538,7 +3538,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
         for (SpaceLink *space = sa->spacedata.first; space; space = space->next) {
           if (space->spacetype == SPACE_OUTLINER) {
             SpaceOutliner *soutliner = (SpaceOutliner *)space;
-            soutliner->sync_flag |= SO_SYNC_TO_OUTLINER_ANY;
+            soutliner->sync_select_dirty |= WM_OUTLINER_SYNC_SELECT_FROM_ALL;
             soutliner->flag |= SO_SYNC_SELECT;
           }
         }
diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c
index 13543e367d4..5f31a403b57 100644
--- a/source/blender/editors/space_outliner/outliner_sync.c
+++ b/source/blender/editors/space_outliner/outliner_sync.c
@@ -50,31 +50,31 @@
 void ED_outliner_select_sync_from_object_tag(bContext *C)
 {
   wmWindowManager *wm = CTX_wm_manager(C);
-  wm->sync_select_dirty_flag |= WM_SYNC_SELECT_FROM_OBJECT;
+  wm->outliner_sync_select_dirty |= WM_OUTLINER_SYNC_SELECT_FROM_OBJECT;
 }
 
 void ED_outliner_select_sync_from_edit_bone_tag(bContext *C)
 {
   wmWindowManager *wm = CTX_wm_manager(C);
-  wm->sync_select_dirty_flag |= WM_SYNC_SELECT_FROM_EDIT_BONE;
+  wm->outliner_sync_select_dirty |= WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE;
 }
 
 void ED_outliner_select_sync_from_pose_bone_tag(bContext *C)
 {
   wmWindowManager *wm = CTX_wm_manager(C);
-  wm->sync_select_dirty_flag |= WM_SYNC_SELECT_FROM_POSE_BONE;
+  wm->outliner_sync_select_dirty |= WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE;
 }
 
 void ED_outliner_select_sync_from_sequence_tag(bContext *C)
 {
   wmWindowManager *wm = CTX_wm_manager(C);
-  wm->sync_select_dirty_flag |= WM_SYNC_SELECT_FROM_SEQUENCE;
+  wm->outliner_sync_select_dirty |= WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE;
 }
 
 bool ED_outliner_select_sync_is_dirty(const bContext *C)
 {
   wmWindowManager *wm = CTX_wm_manager(C);
-  return wm->sync_select_dirty_flag != 0;
+  return wm->outliner_sync_select_dirty != 0;
 }
 
 void ED_outliner_select_sync_flag_outliners(const bContext *C)
@@ -89,14 +89,14 @@ void ED_outliner_select_sync_flag_outliners(const bContext *C)
           SpaceOutliner *soutliner = (SpaceOutliner *)sl;
 
           /* Mark selection state as dirty */
-          soutliner->sync_flag = wm->sync_select_dirty_flag;
+          soutliner->sync_select_dirty = wm->outliner_sync_select_dirty;
         }
       }
     }
   }
 
   /* Clear global sync flag */
-  wm->sync_select_dirty_flag = 0;
+  wm->outliner_sync_select_dirty = 0;
 }
 
 static void outliner_select_sync_to_object(ViewLayer *view_layer,
@@ -170,7 +170,9 @@ static void outliner_select_sync_to_sequence(Scene *scene, TreeStoreElem *tselem
 }
 
 /* Sync selection and active flags from outliner to active view layer, bones, and sequencer */
-static void outliner_sync_selection_from_outliner(bContext *C, ListBase *tree)
+static void outliner_sync_selection_from_outliner(bContext *C,
+                                                  ListBase *tree,
+                                                  const short sync_select_dirty)
 {
   Scene *scene = CTX_data_scene(C);
   ViewLayer *view_layer = CTX_data_view_layer(C);
@@ -191,7 +193,7 @@ static void outliner_sync_selection_from_outliner(bContext *C, ListBase *tree)
       outliner_select_sync_to_sequence(scene, tselem);
     }
 
-    outliner_sync_selection_from_outliner(C, &te->subtree);
+    outliner_sync_selection_from_outliner(C, &te->subtree, sync_select_dirty);
   }
 }
 
@@ -319,14 +321,14 @@ void ED_outliner_select_sync_from_outliner(bContext *C, SpaceOutliner *soops)
 
   Scene *scene = CTX_data_scene(C);
 
-  outliner_sync_selection_from_outliner(C, &soops->tree);
+  outliner_sync_selection_from_outliner(C, &soops->tree, soops->sync_select_dirty);
 
   ED_outliner_select_sync_from_object_tag(C);
   ED_outliner_select_sync_from_edit_bone_tag(C);
   ED_outliner_select_sync_from_pose_bone_tag(C);
   ED_outliner_select_sync_from_sequence_tag(C);
   ED_outliner_select_sync_flag_outliners(C);
-  soops->sync_flag &= ~SO_SYNC_TO_OUTLINER_ANY;
+  soops->sync_select_dirty &= ~WM_OUTLINER_SYNC_SELECT_FROM_ALL;
 
   /* Update editors */
   DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
@@ -336,12 +338,12 @@ void ED_outliner_select_sync_from_outliner(bContext *C, SpaceOutliner *soops)
 
 void outliner_sync_selection(const bContext *C, SpaceOutliner *soops)
 {
-  /* If outiner is dirty sync from the current view layer and clear the dirty flag */
-  if (soops->sync_flag & SO_SYNC_TO_OUTLINER_ANY) {
+  /* If outliner is dirty sync from the current view layer and clear the dirty flag. */
+  if (soops->sync_select_dirty & WM_OUTLINER_SYNC_SELECT_FROM_ALL) {
     ViewLayer *view_layer = CTX_data_view_layer(C);
 
     outliner_sync_selection_to_outliner(C, view_layer, soops, &soops->tree);
 
-    soops->sync_flag = 0;
+    soops->sync_select_dirty = 0;
   }
 }
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index 14542608216..79880c68120 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -302,7 +302,7 @@ static SpaceLink *outliner_new(const ScrArea *UNUSED(area), const Scene *UNUSED(
   soutliner->filter_id_type = ID_GR;
   soutliner->show_restrict_flags = SO_RESTRICT_ENABLE | SO_RESTRICT_HIDE;
   soutliner->outlinevis = SO_VIEW_LAYER;
-  soutliner->sync_flag |= SO_SYNC_TO_OUTLINER_ANY;
+  soutliner->sync_select_dirty |= WM_OUTLINER_SYNC_SELECT_FROM_ALL;
   soutliner->flag |= SO_SYNC_SELECT;
 
   /* header */
@@ -350,7 +350,7 @@ static SpaceLink *outliner_duplicate(SpaceLink *sl)
   soutlinern->treehash = NULL;
 
   soutlinern->flag |= (soutliner->flag & SO_SYNC_SELECT);
-  soutlinern->sync_flag = SO_SYNC_TO_OUTLINER_ANY;
+  soutlinern->sync_select_dirty = WM_OUTLINER_SYNC_SELECT_FROM_ALL;
 
   return (SpaceLink *)soutlinern;
 }
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h
index 212fe7391a5..36da15e046d 100644
--- a/source/blender/makesdna/DNA_space_types.h
+++ b/source/blender/makesdna/DNA_space_types.h
@@ -247,8 +247,8 @@ typedef struct SpaceOutliner {
   short flag, outlinevis, storeflag;
   char search_flags;
 
-  /* Selection syncing */
-  char sync_flag;
+  /** Selection syncing flag (#WM_OUTLINER_SYNC_SELECT_FROM_OBJECT and similar flags). */
+  char sync_select_dirty;
 
   int filter;
   char filter_state;
@@ -366,17 +366,6 @@ typedef enum eSpaceOutliner_Search_Flags {
   SO_SEARCH_RECURSIVE = (1 << 2),
 } eSpaceOutliner_Search_Flags;
 
-/* SpaceOutliner.sync_flag */
-typedef enum eSpaceOutliner_SyncFlag {
-  SO_SYNC_OBJECT = (1 << 0),
-  SO_SYNC_EDIT_BONE = (1 << 1),
-  SO_SYNC_POSE_BONE = (1 << 2),
-  SO_SYNC_SEQUENCE = (1 << 3),
-} eSpaceOutliner_Sync_Flag;
-
-#define SO_SYNC_TO_OUTLINER_ANY \
-  (SO_SYNC_OBJECT | SO_SYNC_EDIT_BONE | SO_SYNC_POSE_BONE | SO_SYNC_SEQUENCE)
-
 /** \} */
 
 /* -------------------------------------------------------------------- */
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h
index 8d9415eb245..cacc79608ad 100644
--- a/source/blender/makesdna/DNA_windowmanager_types.h
+++ b/source/blender/makesdna/DNA_windowmanager_types.h
@@ -138,7 +138,7 @@ typedef struct wmWindowManager {
   short op_undo_depth;
 
   /** Set after selection to notify outliner to sync. Stores type of selection */
-  short sync_select_dirty_flag;
+  short outliner_sync_select_dirty;
 
   /** Operator registry. */
   ListBase operators;
@@ -189,14 +189,18 @@ enum {
   WM_KEYCONFIG_IS_INITIALIZED = (1 << 1),
 };
 
-/* wmWindowManager.sync_select_dirty_flag */
+/* wmWindowManager.outliner_sync_select_dirty */
 enum {
-  WM_SYNC_SELECT_FROM_OBJECT = (1 << 0),
-  WM_SYNC_SELECT_FROM_EDIT_BONE = (1 << 1),
-  WM_SYNC_SELECT_FROM_POSE_BONE = (1 << 2),
-  WM_SYNC_SELECT_FROM_SEQUENCE = (1 << 3),
+  WM_OUTLINER_SYNC_SELECT_FROM_OBJECT = (1 << 0),
+  WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE = (1 << 1),
+  WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE = (1 << 2),
+  WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE = (1 << 3),
 };
 
+#define WM_OUTLINER_SYNC_SELECT_FROM_ALL \
+  (WM_OUTLINER_SYNC_SELECT_FROM_OBJECT | WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE | \
+   WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE | WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE)
+
 #define WM_KEYCONFIG_STR_DEFAULT "blender"
 
 /* IME is win32 only! */



More information about the Bf-blender-cvs mailing list