diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-09-11 16:44:09 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-09-11 16:44:09 +0400 |
commit | baf12d3d1712235f94bf7db27aed21421d74efea (patch) | |
tree | a8b32f934c0ad05cdc278515433b41046105ad63 /source/blender/editors/armature/poseobject.c | |
parent | d5009eb1423c3c0359cbc85c7346412c597b8663 (diff) |
2.5 - Rotation work (axis angle bugfixes + cleanups)
* Made transform work better with axis-angle
* Corrected the rotation-type handling code in a few places
Diffstat (limited to 'source/blender/editors/armature/poseobject.c')
-rw-r--r-- | source/blender/editors/armature/poseobject.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index 0ae92de4407..9a404e24e12 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -812,10 +812,17 @@ void pose_copy_menu(Scene *scene) armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat); - if (pchan->rotmode > 0) - Mat4ToEulO(delta_mat, pchan->eul, pchan->rotmode); - else + if (pchan->rotmode == PCHAN_ROT_AXISANGLE) { + float tmp_quat[4]; + + /* need to convert to quat first (in temp var)... */ + Mat4ToQuat(delta_mat, tmp_quat); + QuatToAxisAngle(tmp_quat, &pchan->quat[1], &pchan->quat[0]); + } + else if (pchan->rotmode == PCHAN_ROT_QUAT) Mat4ToQuat(delta_mat, pchan->quat); + else + Mat4ToEulO(delta_mat, pchan->eul, pchan->rotmode); } break; case 11: /* Visual Size */ @@ -991,6 +998,7 @@ static int pose_paste_exec (bContext *C, wmOperator *op) pchan->flag= chan->flag; /* check if rotation modes are compatible (i.e. do they need any conversions) */ + // FIXME: add axis-angle here too... if (pchan->rotmode == chan->rotmode) { /* copy the type of rotation in use */ if (pchan->rotmode > 0) { |