[Bf-blender-cvs] [be87a65] master: Fix T38251: "Apply Visual Transform to Pose" Offsets bone unpredictably

Bastien Montagne noreply at git.blender.org
Tue Jan 21 09:32:03 CET 2014


Commit: be87a65f49300deeb598983e42a1783f6812eba7
Author: Bastien Montagne
Date:   Tue Jan 21 09:10:08 2014 +0100
https://developer.blender.org/rBbe87a65f49300deeb598983e42a1783f6812eba7

Fix T38251: "Apply Visual Transform to Pose" Offsets bone unpredictably

Code here was using pchan->chan_mat, which for some reason does not work,
we rather have to use pchan->pose_mat, and convert it again from
pose space to bone space, as done by visual keyframing.

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

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 993b0cc..6beb442 100644
--- a/source/blender/editors/armature/pose_transform.c
+++ b/source/blender/editors/armature/pose_transform.c
@@ -213,7 +213,11 @@ static int pose_visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op))
 		 * new raw-transform components, don't recalc the poses yet, otherwise IK result will 
 		 * change, thus changing the result we may be trying to record.
 		 */
-		copy_m4_m4(delta_mat, pchan->chan_mat);
+		/* XXX For some reason, we can't use pchan->chan_mat here, gives odd rotation/offset (see T38251).
+		 *     Using pchan->pose_mat and bringing it back in bone space seems to work as expected!
+		 */
+		BKE_armature_mat_pose_to_bone(pchan, pchan->pose_mat, delta_mat);
+		
 		BKE_pchan_apply_mat4(pchan, delta_mat, TRUE);
 	}
 	CTX_DATA_END;




More information about the Bf-blender-cvs mailing list