diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2007-11-05 20:38:07 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2007-11-05 20:38:07 +0300 |
commit | 7d70dd98d625e4f08a750877e4242032bac38305 (patch) | |
tree | 57998e79ce2c213740c8c9045e0a40916e1048d9 /source/blender/blenkernel/intern | |
parent | 86278584f3fb28941705eff2f6a885e6ef06357c (diff) |
Bugfix:
Dual quaternions + armature modifier vgroup didn't work together correct.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index d5eb43fa12e..e362bdbd2dd 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -849,7 +849,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, for(i = 0; i < numVerts; i++) { MDeformVert *dvert; DualQuat sumdq, *dq = NULL; - float *co = vertexCos[i]; + float *co = vertexCos[i], dco[3]; float sumvec[3], summat[3][3]; float *vec = NULL, (*smat)[3] = NULL; float contrib = 0.0f; @@ -938,7 +938,17 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, if(contrib > 0.0001f) { if(use_quaternion) { DQuatNormalize(dq, contrib, armature_weight); - DQuatMulVecfl(dq, co, (defMats)? summat: NULL); + + if(armature_weight != 1.0f) { + VECCOPY(dco, co); + DQuatMulVecfl(dq, dco, (defMats)? summat: NULL); + VecSubf(dco, dco, co); + VecMulf(dco, armature_weight); + VecAddf(co, co, dco); + } + else + DQuatMulVecfl(dq, co, (defMats)? summat: NULL); + smat = summat; } else { |