Revision: 32705
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32705
Author:   campbellbarton
Date:     2010-10-25 19:08:40 +0200 (Mon, 25 Oct 2010)

Log Message:
-----------
bugfix [#22277] Absolute Shapekeys crash (in BGE)
running a shape actuator on a softbody would crash because it assumed the 
deformer was a BL_MeshDeformer.
Added TODO note, since it would be nice if softbody would work with shape keys 
too.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_view3d/view3d_intern.h
    trunk/blender/source/gameengine/Converter/BL_DeformableGameObject.h
    trunk/blender/source/gameengine/Physics/Bullet/CMakeLists.txt

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_intern.h
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_intern.h   
2010-10-25 15:36:48 UTC (rev 32704)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_intern.h   
2010-10-25 17:08:40 UTC (rev 32705)
@@ -66,7 +66,6 @@
 
 /* view3d_ops.c */
 void view3d_operatortypes(void);
-void view3d_keymap(struct wmKeyConfig *keyconf);
 
 /* view3d_edit.c */
 void VIEW3D_OT_zoom(struct wmOperatorType *ot);
@@ -94,6 +93,7 @@
 void view3d_persp_mat4(struct RegionView3D *rv3d, float mat[][4]);
 
 /* view3d_fly.c */
+void view3d_keymap(struct wmKeyConfig *keyconf);
 void VIEW3D_OT_fly(struct wmOperatorType *ot);
 
 /* drawanim.c */

Modified: trunk/blender/source/gameengine/Converter/BL_DeformableGameObject.h
===================================================================
--- trunk/blender/source/gameengine/Converter/BL_DeformableGameObject.h 
2010-10-25 15:36:48 UTC (rev 32704)
+++ trunk/blender/source/gameengine/Converter/BL_DeformableGameObject.h 
2010-10-25 17:08:40 UTC (rev 32705)
@@ -37,6 +37,7 @@
 #include "DNA_mesh_types.h"
 #include "KX_GameObject.h"
 #include "BL_MeshDeformer.h"
+#include "KX_SoftBodyDeformer.h"
 #include <vector>
 
 class BL_ShapeActionActuator;
@@ -79,7 +80,20 @@
        bool GetShape(vector<float> &shape);
        Key* GetKey()
        {
-               return (m_pDeformer) ? 
((BL_MeshDeformer*)m_pDeformer)->GetMesh()->key : NULL;
+               if(m_pDeformer) {
+                       BL_MeshDeformer *deformer= dynamic_cast<BL_MeshDeformer 
*>(m_pDeformer); // incase its not a MeshDeformer
+                       if(deformer) {
+                               return deformer->GetMesh()->key;
+                       }
+
+#if 0          // TODO. shape keys for softbody, currently they dont store a 
mesh.
+                       KX_SoftBodyDeformer *deformer_soft= 
dynamic_cast<KX_SoftBodyDeformer *>(m_pDeformer);   
+                       if(deformer) {
+                               return deformer->GetMesh()->key;
+                       }
+#endif
+               }
+               return NULL;
        }
        
        virtual void    SetDeformer(class RAS_Deformer* deformer);

Modified: trunk/blender/source/gameengine/Physics/Bullet/CMakeLists.txt
===================================================================
--- trunk/blender/source/gameengine/Physics/Bullet/CMakeLists.txt       
2010-10-25 15:36:48 UTC (rev 32704)
+++ trunk/blender/source/gameengine/Physics/Bullet/CMakeLists.txt       
2010-10-25 17:08:40 UTC (rev 32705)
@@ -24,6 +24,9 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
+# since this includes bullet we get errors from the headers too
+REMOVE_STRICT_FLAGS()
+
 SET(INC
        .
        ../common


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to