Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Craddock <nzcraddock@gmail.com>2020-04-25 05:22:46 +0300
committerNathan Craddock <nzcraddock@gmail.com>2020-04-25 05:22:46 +0300
commit4ab85a338055b1d53a5a4c4e0cfc04c6300efcc3 (patch)
treedbbf1c6dc5f02ddaa5336369ed5a350992c6646c /source/blender/editors/space_outliner
parent5d14463e1aee44a99d37f6d94804c9e8407ee4fd (diff)
Cleanup: Select sync from outliner
Move the condition to check if selection syncing is enabled to inside the syncing function rather than before each time it is called.
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c4
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c12
-rw-r--r--source/blender/editors/space_outliner/outliner_sync.c5
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c4
4 files changed, 8 insertions, 17 deletions
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 862418be151..469a0065e3a 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -1176,9 +1176,7 @@ static int outliner_select_all_exec(bContext *C, wmOperator *op)
break;
}
- if (soops->flag & SO_SYNC_SELECT) {
- ED_outliner_select_sync_from_outliner(C, soops);
- }
+ ED_outliner_select_sync_from_outliner(C, soops);
DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index 0971d3526ad..e87e71f0689 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -1417,9 +1417,7 @@ static int outliner_item_do_activate_from_cursor(bContext *C,
ED_region_tag_redraw_no_rebuild(region);
}
- if (soops->flag & SO_SYNC_SELECT) {
- ED_outliner_select_sync_from_outliner(C, soops);
- }
+ ED_outliner_select_sync_from_outliner(C, soops);
}
return OPERATOR_FINISHED;
@@ -1509,9 +1507,7 @@ static int outliner_box_select_exec(bContext *C, wmOperator *op)
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
ED_region_tag_redraw(region);
- if (soops->flag & SO_SYNC_SELECT) {
- ED_outliner_select_sync_from_outliner(C, soops);
- }
+ ED_outliner_select_sync_from_outliner(C, soops);
return OPERATOR_FINISHED;
}
@@ -1749,9 +1745,7 @@ static int outliner_walk_select_invoke(bContext *C, wmOperator *op, const wmEven
/* Scroll outliner to focus on walk element */
outliner_walk_scroll(region, walk_element);
- if (soops->flag & SO_SYNC_SELECT) {
- ED_outliner_select_sync_from_outliner(C, soops);
- }
+ ED_outliner_select_sync_from_outliner(C, soops);
ED_region_tag_redraw(region);
return OPERATOR_FINISHED;
diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c
index 35dd91ff061..852773d3979 100644
--- a/source/blender/editors/space_outliner/outliner_sync.c
+++ b/source/blender/editors/space_outliner/outliner_sync.c
@@ -351,8 +351,9 @@ static void outliner_sync_selection_from_outliner(Scene *scene,
/* Set clean outliner and mark other outliners for syncing */
void ED_outliner_select_sync_from_outliner(bContext *C, SpaceOutliner *soops)
{
- /* Don't sync in certain outliner display modes */
- if (ELEM(soops->outlinevis, SO_LIBRARIES, SO_DATA_API, SO_ID_ORPHANS)) {
+ /* Don't sync if not checked or in certain outliner display modes */
+ if (!(soops->flag & SO_SYNC_SELECT) ||
+ ELEM(soops->outlinevis, SO_LIBRARIES, SO_DATA_API, SO_ID_ORPHANS)) {
return;
}
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index e09e1149e7c..1c9998d256b 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -564,9 +564,7 @@ static void merged_element_search_call_cb(struct bContext *C, void *UNUSED(arg1)
outliner_item_select(soops, te, false, false);
outliner_item_do_activate_from_tree_element(C, te, te->store_elem, false, false);
- if (soops->flag & SO_SYNC_SELECT) {
- ED_outliner_select_sync_from_outliner(C, soops);
- }
+ ED_outliner_select_sync_from_outliner(C, soops);
}
/**