[Bf-blender-cvs] [3b9b6a80ba6] blender2.8: Multi-Objects: POSE_OT_rotation_mode_set

Dalai Felinto noreply at git.blender.org
Fri Oct 12 20:27:29 CEST 2018


Commit: 3b9b6a80ba6311281bb90e2a2e63a8c34a0b575d
Author: Dalai Felinto
Date:   Fri Oct 12 14:55:15 2018 -0300
Branches: blender2.8
https://developer.blender.org/rB3b9b6a80ba6311281bb90e2a2e63a8c34a0b575d

Multi-Objects: POSE_OT_rotation_mode_set

===================================================================

M	source/blender/editors/armature/pose_edit.c

===================================================================

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;
 }



More information about the Bf-blender-cvs mailing list