diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-02-07 13:50:35 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-02-07 13:50:35 +0300 |
commit | 1dc11c4fdff477cfd55255e37d3d407d666815ad (patch) | |
tree | efaf2384f9de3469f47384a144b99692a002e0dc /source | |
parent | 2070356a329969be2287e6f8f7575a7e45d13543 (diff) |
Bugfix [#25934] "Apply Visual Transform as Pose" not working?
Simplified the code for Apply Visual Transform as Pose.
This makes it work for IK chains now, since there aren't any
recalculations of the pose involved now, which were contributing to
the pose getting incorrect as the applying process went on, since the
IK chain was getting calculated differently with each successive
change to the chain.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/armature/editarmature.c | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 4fc5064cef0..2cdb2c9a062 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -729,24 +729,18 @@ static int pose_visual_transform_apply_exec (bContext *C, wmOperator *UNUSED(op) * at once are to be predictable*/ CTX_DATA_BEGIN(C, bPoseChannel *, pchan, selected_pose_bones) { - float delta_mat[4][4], imat[4][4], mat[4][4]; - - where_is_pose_bone(scene, ob, pchan, CFRA, 1); - - copy_m4_m4(mat, pchan->pose_mat); - - /* calculate pchan->pose_mat without loc/size/rot & constraints applied */ - where_is_pose_bone(scene, ob, pchan, CFRA, 0); - invert_m4_m4(imat, pchan->pose_mat); - mul_m4_m4m4(delta_mat, mat, imat); - + float delta_mat[4][4]; + + /* chan_mat already contains the delta transform from rest pose to pose-mode pose + * as that is baked into there so that B-Bones will work. Once we've set this as the + * 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); pchan_apply_mat4(pchan, delta_mat, TRUE); - - where_is_pose_bone(scene, ob, pchan, CFRA, 1); } CTX_DATA_END; - - // ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK); + DAG_id_tag_update(&ob->id, OB_RECALC_DATA); /* note, notifier might evolve */ |