[Bf-blender-cvs] [e72053a201d] master: Outliner: fix unnecessary syncing

Nathan Craddock noreply at git.blender.org
Sat Aug 31 05:17:11 CEST 2019


Commit: e72053a201d5ec6cd4fee85bc407e98cdc373483
Author: Nathan Craddock
Date:   Fri Aug 30 20:49:58 2019 -0600
Branches: master
https://developer.blender.org/rBe72053a201d5ec6cd4fee85bc407e98cdc373483

Outliner: fix unnecessary syncing

Depending on the outliner display mode and the outliner dirty state,
a sync may not be needed on each draw. This commit adds a check
before syncing to prevent syncing when not needed.

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

M	source/blender/editors/space_outliner/outliner_sync.c

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

diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c
index 4b804c3c480..29c820bce92 100644
--- a/source/blender/editors/space_outliner/outliner_sync.c
+++ b/source/blender/editors/space_outliner/outliner_sync.c
@@ -544,12 +544,12 @@ static void get_sync_select_active_data(const bContext *C, SyncSelectActiveData
 /* If outliner is dirty sync selection from view layer and sequwncer */
 void outliner_sync_selection(const bContext *C, SpaceOutliner *soops)
 {
-  if (soops->sync_select_dirty & WM_OUTLINER_SYNC_SELECT_FROM_ALL) {
-    ViewLayer *view_layer = CTX_data_view_layer(C);
+  /* Set which types of data to sync from sync dirty flag and outliner display mode */
+  SyncSelectTypes sync_types;
+  const bool sync_required = outliner_sync_select_to_outliner_set_types(C, soops, &sync_types);
 
-    /* Set which types of data to sync from sync dirty flag and outliner display mode */
-    SyncSelectTypes sync_types;
-    outliner_sync_select_to_outliner_set_types(C, soops, &sync_types);
+  if (sync_required) {
+    ViewLayer *view_layer = CTX_data_view_layer(C);
 
     /* Store active object, bones, and sequence */
     SyncSelectActiveData active_data;



More information about the Bf-blender-cvs mailing list