diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-10-12 20:55:15 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-10-12 20:55:15 +0300 |
commit | 3b9b6a80ba6311281bb90e2a2e63a8c34a0b575d (patch) | |
tree | a3068a0a57c431e85b971b892ded8f21b2a92d6e /source/blender/editors/armature/pose_edit.c | |
parent | dba7312f5eaa05ebc1e15332e41b369993361915 (diff) |
Multi-Objects: POSE_OT_rotation_mode_set
Diffstat (limited to 'source/blender/editors/armature/pose_edit.c')
-rw-r--r-- | source/blender/editors/armature/pose_edit.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index b4651c82f5c..8df712cd8d8 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -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; } |