Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-01-21 12:10:08 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-01-21 12:18:48 +0400
commitbe87a65f49300deeb598983e42a1783f6812eba7 (patch)
treebbdd87dcc5a8eb0a71e03d7557ef4528753b2fd2 /source/blender/editors/armature
parent85a3d510781297711efa2c740fa59609dab0c108 (diff)
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.
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r--source/blender/editors/armature/pose_transform.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c
index 993b0cc5e05..6beb442108f 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;