diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-03-01 08:19:07 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-03-01 08:19:07 +0300 |
commit | 26932c21ebca087ad7b71f1cfa2f7f9e16328a44 (patch) | |
tree | c908c158bd3f671f0237ab79d4d3abc693c66df4 /source/blender/blenkernel/intern/fcurve.c | |
parent | da4ab26a478dd6e0f52c8bc8d0c324def048dfd9 (diff) |
Bugfix #21384: Bone Driven Shapekeys Child Evaluation Problem
Transform channel drivers for bones in 'localspace' was using the wrong matrix when getting the transforms. I had been assuming that pchan->chan_mat always contained only the matrix-ised transform values stored in the pchan (which is true while constraints are being evaluated, but not afterwards).
Changes:
- Added a new function to calculate this matrix instead of directly writing it on the pchan->chan_matrix field.
- Also, made the normalisation of the quaternion values during this process be done on a temp var instead of on the stored value. This was a constant source of confusion in the past, so let's see if we can do without it now :)
Unrelated to this commit, I've also fixed a compiler warning with previous commit that I missed (missing include).
Diffstat (limited to 'source/blender/blenkernel/intern/fcurve.c')
-rw-r--r-- | source/blender/blenkernel/intern/fcurve.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index bd29bd55428..807a723685a 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -50,7 +50,7 @@ #include "BKE_fcurve.h" #include "BKE_animsys.h" #include "BKE_action.h" - +#include "BKE_armature.h" #include "BKE_curve.h" #include "BKE_global.h" #include "BKE_idprop.h" @@ -1041,8 +1041,12 @@ static float dvar_eval_transChan (ChannelDriver *driver, DriverVar *dvar) useEulers = 1; } - if (dtar->flag & DTAR_FLAG_LOCALSPACE) - copy_m4_m4(mat, pchan->chan_mat); + if (dtar->flag & DTAR_FLAG_LOCALSPACE) { + /* specially calculate local matrix, since chan_mat is not valid + * since it stores delta transform of pose_mat so that deforms work + */ + pchan_to_mat4(pchan, mat); + } else mul_m4_m4m4(mat, pchan->pose_mat, ob->obmat); } |