Multi-Objects: POSE_OT_rotation_mode_set

This commit is contained in:
Dalai Felinto 2018-10-12 14:55:15 -03:00
parent dba7312f5e
commit 3b9b6a80ba
Notes: blender-bot 2023-02-14 06:32:27 +01:00
Referenced by issue #54650, Multi-Object-Mode: Pose Tools
1 changed files with 10 additions and 7 deletions

View File

@ -832,20 +832,23 @@ void POSE_OT_autoside_names(wmOperatorType *ot)
static int pose_bone_rotmode_exec(bContext *C, wmOperator *op)
{
Object *ob = CTX_data_active_object(C);
int mode = RNA_enum_get(op->ptr, "type");
const int mode = RNA_enum_get(op->ptr, "type");
Object *prev_ob = NULL;
/* set rotation mode of selected bones */
CTX_DATA_BEGIN (C, bPoseChannel *, pchan, selected_pose_bones)
CTX_DATA_BEGIN_WITH_ID (C, bPoseChannel *, pchan, selected_pose_bones, Object *, ob)
{
pchan->rotmode = mode;
if (prev_ob != ob) {
/* Notifiers and updates. */
DEG_id_tag_update((ID *)ob, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, ob);
prev_ob = ob;
}
}
CTX_DATA_END;
/* notifiers and updates */
DEG_id_tag_update((ID *)ob, OB_RECALC_DATA);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, ob);
return OPERATOR_FINISHED;
}