diff options
author | Nathan Craddock <nzcraddock@gmail.com> | 2020-06-19 21:35:09 +0300 |
---|---|---|
committer | Nathan Craddock <nzcraddock@gmail.com> | 2020-06-19 21:43:01 +0300 |
commit | 702e00f91088031f83cfed1528d5ed22069a9d35 (patch) | |
tree | 4a97e1ce2e86d9c18086f80f659d6c7a48a33019 /source/blender/editors/space_outliner/outliner_sync.c | |
parent | ec963d9d7d179e3ba12f5bdf748818939c2f17d8 (diff) |
Outliner: Selection cleanup
No functional changes. The outliner selection operators shared many
different functions for selection, activation, mode toggling, and other
actions, but the code paths were not always clear, making any changes
difficult.
This cleans up the code and uses outliner_item_select() as the base
function for selection, activation, mode toggling between the different
selection operators. It also prepares for future features and fixes.
Reviewed By: Severin
Differential Revision: https://developer.blender.org/D5817
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_sync.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_sync.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c index 852773d3979..943738680e6 100644 --- a/source/blender/editors/space_outliner/outliner_sync.c +++ b/source/blender/editors/space_outliner/outliner_sync.c @@ -403,7 +403,8 @@ static void outliner_select_sync_from_object(ViewLayer *view_layer, const bool is_selected = (base != NULL) && ((base->flag & BASE_SELECTED) != 0); if (base && (ob == obact)) { - outliner_element_activate(soops, tselem); + tselem->flag |= TSE_ACTIVE; + outliner_set_walk_element(soops, tselem); } else { tselem->flag &= ~TSE_ACTIVE; @@ -425,7 +426,8 @@ static void outliner_select_sync_from_edit_bone(SpaceOutliner *soops, EditBone *ebone = (EditBone *)te->directdata; if (ebone == ebone_active) { - outliner_element_activate(soops, tselem); + tselem->flag |= TSE_ACTIVE; + outliner_set_walk_element(soops, tselem); } else { tselem->flag &= ~TSE_ACTIVE; @@ -448,7 +450,8 @@ static void outliner_select_sync_from_pose_bone(SpaceOutliner *soops, Bone *bone = pchan->bone; if (pchan == pchan_active) { - outliner_element_activate(soops, tselem); + tselem->flag |= TSE_ACTIVE; + outliner_set_walk_element(soops, tselem); } else { tselem->flag &= ~TSE_ACTIVE; @@ -469,7 +472,8 @@ static void outliner_select_sync_from_sequence(SpaceOutliner *soops, Sequence *seq = (Sequence *)tselem->id; if (seq == sequence_active) { - outliner_element_activate(soops, tselem); + tselem->flag |= TSE_ACTIVE; + outliner_set_walk_element(soops, tselem); } else { tselem->flag &= ~TSE_ACTIVE; @@ -525,7 +529,7 @@ static void outliner_sync_selection_to_outliner(ViewLayer *view_layer, } } else { - tselem->flag &= ~TSE_SELECTED; + tselem->flag &= ~(TSE_SELECTED | TSE_ACTIVE); } /* Sync subtree elements */ |