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-08 04:57:00 +0400
committerJoshua Leung <aligorith@gmail.com>2009-10-08 04:57:00 +0400
commit475ab5ceb4875eb37dd761f7a71ff569dd493395 (patch)
treea545c13c1ea502e60b4c64fb56756c8a3432ed83 /source/blender/blenkernel/intern/action.c
parentfd511eb984a23b63b373e171666667c8213579c0 (diff)
Rotation Modes Bugfix:
Animating rotations using different rotation modes should now work more often than before. Previously, quaternion and axis-angle values were stored in the same variable in DNA, but that was causing problems with other animation curves overwriting the values and causing the rotations to not work as expected. There are still some issues, but I'll track those down later tonight
Diffstat (limited to 'source/blender/blenkernel/intern/action.c')
-rw-r--r--source/blender/blenkernel/intern/action.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 7be763eae9d..25f539a1992 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -446,7 +446,7 @@ bPoseChannel *verify_pose_channel(bPose* pose, const char* name)
strncpy(chan->name, name, 31);
/* init vars to prevent math errors */
- chan->quat[0] = 1.0f;
+ chan->quat[0] = chan->rotAxis[1]= 1.0f;
chan->size[0] = chan->size[1] = chan->size[2] = 1.0f;
chan->limitmin[0]= chan->limitmin[1]= chan->limitmin[2]= -180.0f;
@@ -607,6 +607,8 @@ static void copy_pose_channel_data(bPoseChannel *pchan, const bPoseChannel *chan
VECCOPY(pchan->loc, chan->loc);
VECCOPY(pchan->size, chan->size);
VECCOPY(pchan->eul, chan->eul);
+ VECCOPY(pchan->rotAxis, chan->rotAxis);
+ pchan->rotAngle= chan->rotAngle;
QUATCOPY(pchan->quat, chan->quat);
pchan->rotmode= chan->rotmode;
Mat4CpyMat4(pchan->chan_mat, (float(*)[4])chan->chan_mat);
@@ -975,14 +977,16 @@ void rest_pose(bPose *pose)
memset(pose->stride_offset, 0, sizeof(pose->stride_offset));
memset(pose->cyclic_offset, 0, sizeof(pose->cyclic_offset));
- for (pchan=pose->chanbase.first; pchan; pchan= pchan->next){
+ for (pchan=pose->chanbase.first; pchan; pchan= pchan->next) {
for (i=0; i<3; i++) {
pchan->loc[i]= 0.0f;
pchan->quat[i+1]= 0.0f;
pchan->eul[i]= 0.0f;
pchan->size[i]= 1.0f;
+ pchan->rotAxis[i]= 0.0f;
}
- pchan->quat[0]= 1.0f;
+ pchan->quat[0]= pchan->rotAxis[1]= 1.0f;
+ pchan->rotAngle= 0.0f;
pchan->flag &= ~(POSE_LOC|POSE_ROT|POSE_SIZE);
}