diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-11-01 19:11:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-11-01 20:32:50 +0300 |
commit | 0dd9e55d211453a6571fb5d3838c7d736434c8ee (patch) | |
tree | 11a03a054fd6fa0bb96e67dfd88c1d1d1c2cf113 /source/blender/editors/space_outliner/outliner_sync.c | |
parent | 5840c17970a0ff746663069b46663e3f55dcc162 (diff) |
Fix T71247: Outliner pose toggle looses bone selection
The outliner didn't account for weight-paint + pose-mode,
making it consider all pose bones unselected.
When syncing selection, bones were unselected.
This adds a context argument to passed to drawing functions since
finding the weight-paint pose-object in the drawing loop isn't efficient.
Diffstat (limited to 'source/blender/editors/space_outliner/outliner_sync.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner_sync.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/editors/space_outliner/outliner_sync.c b/source/blender/editors/space_outliner/outliner_sync.c index 29c820bce92..745a527cc15 100644 --- a/source/blender/editors/space_outliner/outliner_sync.c +++ b/source/blender/editors/space_outliner/outliner_sync.c @@ -37,6 +37,7 @@ #include "BKE_context.h" #include "BKE_layer.h" #include "BKE_main.h" +#include "BKE_object.h" #include "BKE_sequencer.h" #include "DEG_depsgraph.h" @@ -129,14 +130,14 @@ static void outliner_sync_select_from_outliner_set_types(bContext *C, SpaceOutliner *soops, SyncSelectTypes *sync_types) { - Object *obact = CTX_data_active_object(C); - Object *obedit = CTX_data_edit_object(C); + TreeViewContext tvc; + outliner_viewcontext_init(C, &tvc); const bool sequence_view = soops->outlinevis == SO_SEQUENCE; sync_types->object = !sequence_view; - sync_types->edit_bone = !sequence_view && (obedit && obedit->type == OB_ARMATURE); - sync_types->pose_bone = !sequence_view && (obact && obact->mode == OB_MODE_POSE); + sync_types->edit_bone = !sequence_view && (tvc.ob_edit && tvc.ob_edit->type == OB_ARMATURE); + sync_types->pose_bone = !sequence_view && (tvc.ob_pose && tvc.ob_pose->mode == OB_MODE_POSE); sync_types->sequence = sequence_view; } @@ -149,16 +150,16 @@ static bool outliner_sync_select_to_outliner_set_types(const bContext *C, SpaceOutliner *soops, SyncSelectTypes *sync_types) { - Object *obact = CTX_data_active_object(C); - Object *obedit = CTX_data_edit_object(C); + TreeViewContext tvc; + outliner_viewcontext_init(C, &tvc); const bool sequence_view = soops->outlinevis == SO_SEQUENCE; sync_types->object = !sequence_view && (soops->sync_select_dirty & WM_OUTLINER_SYNC_SELECT_FROM_OBJECT); - sync_types->edit_bone = !sequence_view && (obedit && obedit->type == OB_ARMATURE) && + sync_types->edit_bone = !sequence_view && (tvc.ob_edit && tvc.ob_edit->type == OB_ARMATURE) && (soops->sync_select_dirty & WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE); - sync_types->pose_bone = !sequence_view && (obact && obact->mode == OB_MODE_POSE) && + sync_types->pose_bone = !sequence_view && (tvc.ob_pose && tvc.ob_pose->mode == OB_MODE_POSE) && (soops->sync_select_dirty & WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE); sync_types->sequence = sequence_view && (soops->sync_select_dirty & WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE); |