forked from bartvdbraak/blender
BGE Animations: Fixing a crash when animating non-armature objects that didn't have shape keys.
This commit is contained in:
parent
30d41ac9cb
commit
5a0f3690d0
@ -154,14 +154,16 @@ bool BL_Action::Play(const char* name,
|
|||||||
BL_DeformableGameObject *obj = (BL_DeformableGameObject*)m_obj;
|
BL_DeformableGameObject *obj = (BL_DeformableGameObject*)m_obj;
|
||||||
BL_ShapeDeformer *shape_deformer = dynamic_cast<BL_ShapeDeformer*>(obj->GetDeformer());
|
BL_ShapeDeformer *shape_deformer = dynamic_cast<BL_ShapeDeformer*>(obj->GetDeformer());
|
||||||
|
|
||||||
obj->GetShape(m_blendinshape);
|
if (shape_deformer)
|
||||||
|
{
|
||||||
// Now that we have the previous blend shape saved, we can clear out the key to avoid any
|
obj->GetShape(m_blendinshape);
|
||||||
// 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 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
|
// Now that we have an action, we have something we can play
|
||||||
|
Loading…
Reference in New Issue
Block a user