diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2011-07-08 11:31:40 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2011-07-08 11:31:40 +0400 |
commit | 5a0f3690d08e14af421cf803836567c67c1bd15c (patch) | |
tree | 6406c006c9bf6e44461e18c907ff2b40f23b2216 | |
parent | 30d41ac9cbd5459ee27d384b2f84d3e7a12b1a32 (diff) |
BGE Animations: Fixing a crash when animating non-armature objects that didn't have shape keys.
-rw-r--r-- | source/gameengine/Ketsji/BL_Action.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/gameengine/Ketsji/BL_Action.cpp b/source/gameengine/Ketsji/BL_Action.cpp index 8ed6a33696a..5aecd2f114f 100644 --- a/source/gameengine/Ketsji/BL_Action.cpp +++ b/source/gameengine/Ketsji/BL_Action.cpp @@ -154,14 +154,16 @@ bool BL_Action::Play(const char* name, BL_DeformableGameObject *obj = (BL_DeformableGameObject*)m_obj; BL_ShapeDeformer *shape_deformer = dynamic_cast<BL_ShapeDeformer*>(obj->GetDeformer()); - obj->GetShape(m_blendinshape); - - // Now that we have the previous blend shape saved, we can clear out the key to avoid any - // further interference. - KeyBlock *kb; - for (kb=(KeyBlock*)shape_deformer->GetKey()->block.first; kb; kb=(KeyBlock*)kb->next) - kb->curval = 0.f; + if (shape_deformer) + { + obj->GetShape(m_blendinshape); + // Now that we have the previous blend shape saved, we can clear out the key to avoid any + // further interference. + KeyBlock *kb; + for (kb=(KeyBlock*)shape_deformer->GetKey()->block.first; kb; kb=(KeyBlock*)kb->next) + kb->curval = 0.f; + } } // Now that we have an action, we have something we can play |