From e72053a201d5ec6cd4fee85bc407e98cdc373483 Mon Sep 17 00:00:00 2001 From: Nathan Craddock Date: Fri, 30 Aug 2019 20:49:58 -0600 Subject: [PATCH] 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. --- source/blender/editors/space_outliner/outliner_sync.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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;