diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-11-05 16:11:01 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-11-06 12:42:14 +0300 |
commit | 28e703b0a104f8c8c64dee835d9fd3e657ac86cf (patch) | |
tree | 1928fe4e7eb41231e634be69aca0e3b91e87fd30 /source/blender/editors/space_outliner/outliner_sync.c | |
parent | 02677ec4e0fadc9b2bec694fd14155ea16e48adf (diff) |
Fix Outliner editbone selection with 'Sync Selection'
When editbones were selected from the Outliner (and they were connected
to a parent) with the 'Sync Selection' option turned ON, they could not
get duplicated.
For duplication to work, the (connected) parent bone's tip also has to
be selected [which was not the case when selection is done from the
Outliner under above circumstances]. The reason being that
armature_duplicate_selected_exec ->
ED_armature_edit_sync_selection clears the BONE_ROOTSEL flag if the
parent bone's BONE_TIPSEL is not set.
Caused by rB71eb65328078 btw.
The correct "parent-tip-selection" would actually happen in activation
- `tree_element_active_ebone`
-- `tree_element_active_ebone__sel`
but for 'Sync Selection' this happens [also] in
- `outliner_sync_selection_from_outliner`
-- `outliner_select_sync_to_edit_bone`
which did not do the "flushing" to the parent bone's tip
Now use existing dedicated function for this.
ref. T82347
Reviewers: Zachman
Differential Revision: https://developer.blender.org/D9470
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_sync.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_sync.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c index 3055d15725b..24fa72fdabf 100644 --- a/source/blender/editors/space_outliner/outliner_sync.c +++ b/source/blender/editors/space_outliner/outliner_sync.c @@ -252,11 +252,13 @@ static void outliner_select_sync_to_edit_bone(ViewLayer *view_layer, if (EBONE_SELECTABLE(arm, ebone)) { if (tselem->flag & TSE_SELECTED) { - ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); - + ED_armature_ebone_select_set(ebone, true); add_selected_item(selected_ebones, ebone); } else if (!is_edit_bone_selected(selected_ebones, ebone)) { + /* Dont flush to parent bone tip, synced selection is iterating the whole tree so deselecting + * potential children with 'ED_armature_ebone_select_set(ebone, false)' would leave own tip + * deselected. */ ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); } } |