[Bf-blender-cvs] [9114ebe8509] blender2.8: Multi-Object Pose Fixes for POSE_OT_armature_apply()

Joshua Leung noreply at git.blender.org
Mon Apr 30 16:40:58 CEST 2018


Commit: 9114ebe85094817cd6fe97381193c28840ed16ed
Author: Joshua Leung
Date:   Mon Apr 30 16:40:45 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB9114ebe85094817cd6fe97381193c28840ed16ed

Multi-Object Pose Fixes for POSE_OT_armature_apply()

This operator was only partially converted to multi-object editing,
as on one hand, it was using the new "objects in mode" iterator,
while on the other hand, it was also using the context iterator inside
that, making all selected bones across armatures get included.

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

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

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

diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c
index 030a5b398bb..deed786944b 100644
--- a/source/blender/editors/armature/pose_transform.c
+++ b/source/blender/editors/armature/pose_transform.c
@@ -225,13 +225,13 @@ static int pose_visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	ViewLayer *view_layer = CTX_data_view_layer(C);
 
-	FOREACH_OBJECT_IN_MODE_BEGIN(view_layer, OB_MODE_POSE, ob)
+	FOREACH_OBJECT_IN_MODE_BEGIN(view_layer, OB_MODE_POSE, ob_iter)
 	{
 		/* loop over all selected pchans
 		 *
 		 * TODO, loop over children before parents if multiple bones
 		 * at once are to be predictable*/
-		CTX_DATA_BEGIN(C, bPoseChannel *, pchan, selected_pose_bones)
+		FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN (ob_iter, pchan)
 		{
 			float delta_mat[4][4];
 			
@@ -247,12 +247,12 @@ static int pose_visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op))
 			
 			BKE_pchan_apply_mat4(pchan, delta_mat, true);
 		}
-		CTX_DATA_END;
+		FOREACH_PCHAN_SELECTED_IN_OBJECT_END;
 		
-		DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
+		DEG_id_tag_update(&ob_iter->id, OB_RECALC_DATA);
 
 		/* note, notifier might evolve */
-		WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob);
+		WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob_iter);
 	}
 	FOREACH_OBJECT_IN_MODE_END;



More information about the Bf-blender-cvs mailing list