[Bf-blender-cvs] [26b55532baf] soc-2019-outliner: Outliner: Sync selection state on sync selection toggle

Nathan Craddock noreply at git.blender.org
Tue Jun 18 06:55:06 CEST 2019


Commit: 26b55532baf0664f27c5c43d0102ae887bcae9aa
Author: Nathan Craddock
Date:   Mon Jun 17 22:53:50 2019 -0600
Branches: soc-2019-outliner
https://developer.blender.org/rB26b55532baf0664f27c5c43d0102ae887bcae9aa

Outliner: Sync selection state on sync selection toggle

When turning on synced selection, sync the selection. Previously
this required clicking in the outliner or doing a 3D view selection
operation.

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

M	source/blender/editors/space_outliner/outliner_draw.c
M	source/blender/editors/space_outliner/outliner_intern.h
M	source/blender/editors/space_outliner/outliner_select.c

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

diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 7f4f60d19d2..da498bc1fd4 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -3551,10 +3551,10 @@ void draw_outliner(const bContext *C)
   outliner_build_tree(mainvar, scene, view_layer, soops, ar);  // always
 
   /* Get selection state from view layer if dirty */
-  if ((soops->flag & SO_IS_DIRTY) != 0 && (soops->flag & SO_SYNC_SELECTION)) {
+  if ((soops->flag & SO_IS_DIRTY) && (soops->flag & SO_SYNC_SELECTION)) {
     do_outliner_selection_sync(C, false);
+    soops->flag &= ~SO_IS_DIRTY;
   }
-  soops->flag &= ~SO_IS_DIRTY;
 
   /* force display to pixel coords */
   v2d->flag |= (V2D_PIXELOFS_X | V2D_PIXELOFS_Y);
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index f00686e67e9..0a5bde74a72 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -261,7 +261,7 @@ void outliner_object_mode_toggle(struct bContext *C,
                                  ViewLayer *view_layer,
                                  Base *base);
 
-void do_outliner_selection_sync(struct bContext *C, bool to_view_layer);
+void do_outliner_selection_sync(const struct bContext *C, bool to_view_layer);
 
 /* outliner_edit.c ---------------------------------------------- */
 typedef void (*outliner_operation_cb)(struct bContext *C,
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 52f7edc804a..fb015344a39 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1348,7 +1348,7 @@ static void do_outliner_selection_sync_recursive(SpaceOutliner *soops,
   }
 }
 
-void do_outliner_selection_sync(bContext *C, bool to_view_layer)
+void do_outliner_selection_sync(const bContext *C, bool to_view_layer)
 {
   ViewLayer *view_layer = CTX_data_view_layer(C);
   SpaceOutliner *soops = CTX_wm_space_outliner(C);



More information about the Bf-blender-cvs mailing list