From e002bcd876082562e197d4c33e8fa10c58447f88 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 Oct 2010 17:08:40 +0000 Subject: [PATCH] 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. --- .../blender/editors/space_view3d/view3d_intern.h | 2 +- .../Converter/BL_DeformableGameObject.h | 16 +++++++++++++++- source/gameengine/Physics/Bullet/CMakeLists.txt | 3 +++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 0cba387169a..0d8b97a66ed 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -66,7 +66,6 @@ void VIEW3D_OT_layers(struct wmOperatorType *ot); /* 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_boxview_copy(ScrArea *sa, ARegion *ar); 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 */ diff --git a/source/gameengine/Converter/BL_DeformableGameObject.h b/source/gameengine/Converter/BL_DeformableGameObject.h index 076bfaeb458..12f641eee96 100644 --- a/source/gameengine/Converter/BL_DeformableGameObject.h +++ b/source/gameengine/Converter/BL_DeformableGameObject.h @@ -37,6 +37,7 @@ #include "DNA_mesh_types.h" #include "KX_GameObject.h" #include "BL_MeshDeformer.h" +#include "KX_SoftBodyDeformer.h" #include class BL_ShapeActionActuator; @@ -79,7 +80,20 @@ public: bool GetShape(vector &shape); Key* GetKey() { - return (m_pDeformer) ? ((BL_MeshDeformer*)m_pDeformer)->GetMesh()->key : NULL; + if(m_pDeformer) { + BL_MeshDeformer *deformer= dynamic_cast(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(m_pDeformer); + if(deformer) { + return deformer->GetMesh()->key; + } +#endif + } + return NULL; } virtual void SetDeformer(class RAS_Deformer* deformer); diff --git a/source/gameengine/Physics/Bullet/CMakeLists.txt b/source/gameengine/Physics/Bullet/CMakeLists.txt index faa9385a745..1954d58df3e 100644 --- a/source/gameengine/Physics/Bullet/CMakeLists.txt +++ b/source/gameengine/Physics/Bullet/CMakeLists.txt @@ -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