[Bf-blender-cvs] [127baac44d5] master: Fix pose-selection from menu not activating the object
Campbell Barton
noreply at git.blender.org
Tue Mar 22 03:44:10 CET 2022
Commit: 127baac44d5c198c8d5159f70cf17167cd2f7e1f
Author: Campbell Barton
Date: Tue Mar 22 13:21:59 2022 +1100
Branches: master
https://developer.blender.org/rB127baac44d5c198c8d5159f70cf17167cd2f7e1f
Fix pose-selection from menu not activating the object
Unlike the regression from T96663 selecting pose bones from menus
never activated the object.
===================================================================
M source/blender/editors/space_view3d/view3d_select.c
===================================================================
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? */
More information about the Bf-blender-cvs
mailing list