diff options
Diffstat (limited to 'source/blender/editors/armature/pose_edit.c')
-rw-r--r-- | source/blender/editors/armature/pose_edit.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index 57c01157f8e..acbf23ecf82 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -1098,16 +1098,18 @@ void POSE_OT_hide(wmOperatorType *ot) RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", ""); } -static int show_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr)) +static int show_pose_bone_cb(Object *ob, Bone *bone, void *data) { + const bool select = GET_INT_FROM_POINTER(data); + bArmature *arm = ob->data; if (arm->layer & bone->layer) { if (bone->flag & BONE_HIDDEN_P) { - bone->flag &= ~BONE_HIDDEN_P; if (!(bone->flag & BONE_UNSELECTABLE)) { - bone->flag |= BONE_SELECTED; + SET_FLAG_FROM_TEST(bone->flag, select, BONE_SELECTED); } + bone->flag &= ~BONE_HIDDEN_P; } } @@ -1115,12 +1117,13 @@ static int show_pose_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr)) } /* active object is armature in posemode, poll checked */ -static int pose_reveal_exec(bContext *C, wmOperator *UNUSED(op)) +static int pose_reveal_exec(bContext *C, wmOperator *op) { Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); bArmature *arm = ob->data; + const bool select = RNA_boolean_get(op->ptr, "select"); - bone_looper(ob, arm->bonebase.first, NULL, show_pose_bone_cb); + bone_looper(ob, arm->bonebase.first, SET_INT_IN_POINTER(select), show_pose_bone_cb); /* note, notifier might evolve */ WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, ob); @@ -1133,7 +1136,7 @@ void POSE_OT_reveal(wmOperatorType *ot) /* identifiers */ ot->name = "Reveal Selected"; ot->idname = "POSE_OT_reveal"; - ot->description = "Unhide all bones that have been tagged to be hidden in Pose Mode"; + ot->description = "Reveal all bones hidden in Pose Mode"; /* api callbacks */ ot->exec = pose_reveal_exec; @@ -1141,6 +1144,8 @@ void POSE_OT_reveal(wmOperatorType *ot) /* flags */ ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + + RNA_def_boolean(ot->srna, "select", true, "Select", ""); } /* ********************************************** */ |