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:
authorJoshua Leung <aligorith@gmail.com>2009-10-22 06:14:11 +0400
committerJoshua Leung <aligorith@gmail.com>2009-10-22 06:14:11 +0400
commitc825a9aeaa26de781789296edd894a5aacff20bb (patch)
treeef0e74296260865f1bb7329e7ea78f24d899dba0 /source/blender/editors/transform/transform_conversions.c
parent64d4ae639b6f8a6d0ccb2024c58566cac1ad7547 (diff)
Bugfix #19703: Axis Angle wont work
* Transform code was not properly fixed to work with the new way that axis-angle data was stored * The order of the args for the conversion function when switching rotation representations was wrong, causing problems when switching from quaternion to axis angle (i.e. these occurred for newly created bones).
Diffstat (limited to 'source/blender/editors/transform/transform_conversions.c')
-rw-r--r--source/blender/editors/transform/transform_conversions.c50
1 files changed, 43 insertions, 7 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 8998550c6d1..71ce97b2d48 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -575,12 +575,25 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
if (pchan->rotmode > 0) {
td->ext->rot= pchan->eul;
+ td->ext->rotAxis= NULL;
+ td->ext->rotAngle= NULL;
td->ext->quat= NULL;
VECCOPY(td->ext->irot, pchan->eul);
}
+ else if (pchan->rotmode == ROT_MODE_AXISANGLE) {
+ td->ext->rot= NULL;
+ td->ext->rotAxis= pchan->rotAxis;
+ td->ext->rotAngle= &pchan->rotAngle;
+ td->ext->quat= NULL;
+
+ td->ext->irotAngle= pchan->rotAngle;
+ VECCOPY(td->ext->irotAxis, pchan->rotAxis);
+ }
else {
td->ext->rot= NULL;
+ td->ext->rotAxis= NULL;
+ td->ext->rotAngle= NULL;
td->ext->quat= pchan->quat;
QUATCOPY(td->ext->iquat, pchan->quat);
@@ -4195,14 +4208,37 @@ static void ObjectToTransData(bContext *C, TransInfo *t, TransData *td, Object *
td->loc = ob->loc;
VECCOPY(td->iloc, td->loc);
-
- td->ext->rot = ob->rot;
- VECCOPY(td->ext->irot, ob->rot);
- VECCOPY(td->ext->drot, ob->drot);
- td->ext->quat = ob->quat;
- QUATCOPY(td->ext->iquat, ob->quat);
- QUATCOPY(td->ext->dquat, ob->dquat);
+ if (ob->rotmode > 0) {
+ td->ext->rot= ob->rot;
+ td->ext->rotAxis= NULL;
+ td->ext->rotAngle= NULL;
+ td->ext->quat= NULL;
+
+ VECCOPY(td->ext->irot, ob->rot);
+ VECCOPY(td->ext->drot, ob->drot);
+ }
+ else if (ob->rotmode == ROT_MODE_AXISANGLE) {
+ td->ext->rot= NULL;
+ td->ext->rotAxis= ob->rotAxis;
+ td->ext->rotAngle= &ob->rotAngle;
+ td->ext->quat= NULL;
+
+ td->ext->irotAngle= ob->rotAngle;
+ VECCOPY(td->ext->irotAxis, ob->rotAxis);
+ td->ext->drotAngle= ob->drotAngle;
+ VECCOPY(td->ext->drotAxis, ob->drotAxis);
+ }
+ else {
+ td->ext->rot= NULL;
+ td->ext->rotAxis= NULL;
+ td->ext->rotAngle= NULL;
+ td->ext->quat= ob->quat;
+
+ QUATCOPY(td->ext->iquat, ob->quat);
+ QUATCOPY(td->ext->dquat, ob->dquat);
+ }
+ td->rotOrder=ob->rotmode;
td->ext->size = ob->size;
VECCOPY(td->ext->isize, ob->size);