[Bf-blender-cvs] [1760a6e8cdd] soc-2019-outliner: Add comments and organize ED_outliner functions

Nathan Craddock noreply at git.blender.org
Wed Aug 7 06:36:02 CEST 2019


Commit: 1760a6e8cdd50d08f818e3d2c07cfc52c6209a52
Author: Nathan Craddock
Date:   Tue Aug 6 22:35:33 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB1760a6e8cdd50d08f818e3d2c07cfc52c6209a52

Add comments and organize ED_outliner functions

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

M	source/blender/editors/include/ED_outliner.h
M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_sync.c

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

diff --git a/source/blender/editors/include/ED_outliner.h b/source/blender/editors/include/ED_outliner.h
index 1bd0233c3ae..30e2624604c 100644
--- a/source/blender/editors/include/ED_outliner.h
+++ b/source/blender/editors/include/ED_outliner.h
@@ -37,10 +37,10 @@ void ED_outliner_select_sync_from_edit_bone_tag(struct bContext *C);
 void ED_outliner_select_sync_from_pose_bone_tag(struct bContext *C);
 void ED_outliner_select_sync_from_sequence_tag(struct bContext *C);
 
-void ED_outliner_select_sync_from_outliner(struct bContext *C, struct SpaceOutliner *soops);
-
 bool ED_outliner_select_sync_is_dirty(const struct bContext *C);
 
+void ED_outliner_select_sync_from_outliner(struct bContext *C, struct SpaceOutliner *soops);
+
 void ED_outliner_select_sync_flag_outliners(const struct bContext *C);
 
 #endif /*  __ED_OUTLINER_H__ */
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 9e48102baea..9a2b1feb30e 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -3634,7 +3634,7 @@ void draw_outliner(const bContext *C)
 
   outliner_build_tree(mainvar, scene, view_layer, soops, ar);  // always
 
-  /* If global sync select is dirty flag other outliners */
+  /* If global sync select is dirty, flag other outliners */
   if (ED_outliner_select_sync_is_dirty(C)) {
     ED_outliner_select_sync_flag_outliners(C);
   }
diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c
index bdde764309c..e7fa2f32fa1 100644
--- a/source/blender/editors/space_outliner/outliner_sync.c
+++ b/source/blender/editors/space_outliner/outliner_sync.c
@@ -47,6 +47,7 @@
 
 #include "outliner_intern.h"
 
+/* Functions for tagging outliner selection syncing is dirty from operators */
 void ED_outliner_select_sync_from_object_tag(bContext *C)
 {
   wmWindowManager *wm = CTX_wm_manager(C);
@@ -74,9 +75,10 @@ void ED_outliner_select_sync_from_sequence_tag(bContext *C)
 bool ED_outliner_select_sync_is_dirty(const bContext *C)
 {
   wmWindowManager *wm = CTX_wm_manager(C);
-  return wm->outliner_sync_select_dirty != 0;
+  return wm->outliner_sync_select_dirty & WM_OUTLINER_SYNC_SELECT_FROM_ALL;
 }
 
+/* Copy sync select dirty flag from window manager to all outliners to be synced lazily on draw */
 void ED_outliner_select_sync_flag_outliners(const bContext *C)
 {
   Main *bmain = CTX_data_main(C);
@@ -88,7 +90,6 @@ void ED_outliner_select_sync_flag_outliners(const bContext *C)
         if (sl->spacetype == SPACE_OUTLINER) {
           SpaceOutliner *soutliner = (SpaceOutliner *)sl;
 
-          /* Mark selection state as dirty */
           soutliner->sync_select_dirty |= wm->outliner_sync_select_dirty;
         }
       }



More information about the Bf-blender-cvs mailing list