diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-10-22 13:31:07 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-10-22 13:31:07 +0400 |
commit | 06d57fdae05bad63438d360204c890d7ab81387a (patch) | |
tree | da871502636807a0911c394b7fa82f51aa704e6c /source/gameengine/Converter/BL_ShapeDeformer.cpp | |
parent | ddf965b63acd86912d9d1d12633ccd1822198d48 (diff) |
Shape Keys
Internal change to not apply the shape keys to the Mesh vertex coordinates,
but rather use it as part of the derivedmesh/displist evaluation. This only
has one practical advantage right now, which is that you can now make a
linked duplicate and pin it's shape key to a different shape than the first
object.
Further, this makes shape keys correctly fit into the modifier stack design,
which will help implement some other features later. Also it means the mesh
vertex coordinates are now really the orco's.
Diffstat (limited to 'source/gameengine/Converter/BL_ShapeDeformer.cpp')
-rw-r--r-- | source/gameengine/Converter/BL_ShapeDeformer.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/source/gameengine/Converter/BL_ShapeDeformer.cpp b/source/gameengine/Converter/BL_ShapeDeformer.cpp index 20ca7f07f2b..41ff3cc3274 100644 --- a/source/gameengine/Converter/BL_ShapeDeformer.cpp +++ b/source/gameengine/Converter/BL_ShapeDeformer.cpp @@ -148,10 +148,13 @@ bool BL_ShapeDeformer::Update(void) // make sure the vertex weight cache is in line with this object m_pMeshObject->CheckWeightCache(blendobj); - /* we will blend the key directly in mvert array: it is used by armature as the start position */ + /* we will blend the key directly in m_transverts array: it is used by armature as the start position */ /* m_bmesh->key can be NULL in case of Modifier deformer */ if (m_bmesh->key) { - do_rel_key(0, m_bmesh->totvert, m_bmesh->totvert, (char *)m_bmesh->mvert->co, m_bmesh->key, 0); + /* store verts locally */ + VerifyStorage(); + + do_rel_key(0, m_bmesh->totvert, m_bmesh->totvert, (char *)(float *)m_transverts, m_bmesh->key, 0); m_bDynamic = true; } @@ -167,18 +170,12 @@ bool BL_ShapeDeformer::Update(void) bShapeUpdate = true; } // check for armature deform - bSkinUpdate = BL_SkinDeformer::Update(); + bSkinUpdate = BL_SkinDeformer::UpdateInternal(bShapeUpdate && m_bDynamic); // non dynamic deformer = Modifer without armature and shape keys, no need to create storage if (!bSkinUpdate && bShapeUpdate && m_bDynamic) { - // this means that there is no armature, we still need to copy the vertex to m_transverts - // and update the normal (was not done after shape key calculation) - - /* store verts locally */ - VerifyStorage(); - - for (int v =0; v<m_bmesh->totvert; v++) - VECCOPY(m_transverts[v], m_bmesh->mvert[v].co); + // this means that there is no armature, we still need to + // update the normal (was not done after shape key calculation) #ifdef __NLA_DEFNORMALS if (m_recalcNormal) |