diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-22 05:21:59 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-22 05:42:37 +0300 |
commit | 127baac44d5c198c8d5159f70cf17167cd2f7e1f (patch) | |
tree | 399109b16ca0b8658fa360ded00360e9631bc1af /source | |
parent | 59870796ea8c659bcb36b5d57377ac64ae1c3e63 (diff) |
Fix pose-selection from menu not activating the object
Unlike the regression from T96663 selecting pose bones from menus
never activated the object.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 826cebe1276..73155a3b52f 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1656,7 +1656,7 @@ static int bone_select_menu_exec(bContext *C, wmOperator *op) BLI_assert(BASE_SELECTABLE(v3d, basact)); - if (basact->object->mode == OB_MODE_EDIT) { + if (basact->object->mode & OB_MODE_EDIT) { EditBone *ebone = (EditBone *)object_mouse_select_menu_data[name_index].item_ptr; ED_armature_edit_select_pick_bone(C, basact, ebone, BONE_SELECTED, ¶ms); } @@ -1677,14 +1677,22 @@ static int bone_select_menu_exec(bContext *C, wmOperator *op) /* In weight-paint, we use selected bone to select vertex-group, * so don't switch to new active object. */ - if (oldbasact && (oldbasact->object->mode & OB_MODE_ALL_WEIGHT_PAINT)) { - /* Prevent activating. - * Selection causes this to be considered the 'active' pose in weight-paint mode. - * Eventually this limitation may be removed. - * For now, de-select all other pose objects deforming this mesh. */ - ED_armature_pose_select_in_wpaint_mode(view_layer, basact); - - basact = NULL; + if (oldbasact) { + if (basact->object->mode & OB_MODE_EDIT) { + /* Pass. */ + } + else if (oldbasact->object->mode & OB_MODE_ALL_WEIGHT_PAINT) { + /* Prevent activating. + * Selection causes this to be considered the 'active' pose in weight-paint mode. + * Eventually this limitation may be removed. + * For now, de-select all other pose objects deforming this mesh. */ + ED_armature_pose_select_in_wpaint_mode(view_layer, basact); + } + else { + if (oldbasact != basact) { + ED_object_base_activate(C, basact); + } + } } /* Undo? */ |