[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38218] branches/soc-2011-pepper/source/ gameengine/Ketsji/BL_Action.cpp: BGE Animations: Fixing a crash when animating non-armature objects that didn' t have shape keys.

Mitchell Stokes mogurijin at gmail.com
Fri Jul 8 09:31:41 CEST 2011


Revision: 38218
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38218
Author:   moguri
Date:     2011-07-08 07:31:40 +0000 (Fri, 08 Jul 2011)
Log Message:
-----------
BGE Animations: Fixing a crash when animating non-armature objects that didn't have shape keys.

Modified Paths:
--------------
    branches/soc-2011-pepper/source/gameengine/Ketsji/BL_Action.cpp

Modified: branches/soc-2011-pepper/source/gameengine/Ketsji/BL_Action.cpp
===================================================================
--- branches/soc-2011-pepper/source/gameengine/Ketsji/BL_Action.cpp	2011-07-08 06:51:12 UTC (rev 38217)
+++ branches/soc-2011-pepper/source/gameengine/Ketsji/BL_Action.cpp	2011-07-08 07:31:40 UTC (rev 38218)
@@ -154,14 +154,16 @@
 		BL_DeformableGameObject *obj = (BL_DeformableGameObject*)m_obj;
 		BL_ShapeDeformer *shape_deformer = dynamic_cast<BL_ShapeDeformer*>(obj->GetDeformer());
 		
-		obj->GetShape(m_blendinshape);
+		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 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




More information about the Bf-blender-cvs mailing list