From 9d8ec8b30f5d07155912b76127e44df5da8c27b6 Mon Sep 17 00:00:00 2001 From: Sergej Reich Date: Mon, 4 Feb 2013 23:50:34 +0000 Subject: rigidbody: Don't allow collision shape to be animated While it's fun to be able to change collison shape while the simulation is running it can cause crashes in some cases. --- source/blender/makesrna/intern/rna_rigidbody.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'source/blender') diff --git a/source/blender/makesrna/intern/rna_rigidbody.c b/source/blender/makesrna/intern/rna_rigidbody.c index 938ef7a5032..71ff7bfd6ec 100644 --- a/source/blender/makesrna/intern/rna_rigidbody.c +++ b/source/blender/makesrna/intern/rna_rigidbody.c @@ -188,25 +188,6 @@ static void rna_RigidBodyOb_disabled_set(PointerRNA *ptr, int value) #endif } -static void rna_RigidBodyOb_shape_set(PointerRNA *ptr, int value) -{ - RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; - Object *ob = (Object *)ptr->id.data; - - rbo->shape = value; - - /* force creation of new collision shape reflecting this */ - BKE_rigidbody_validate_sim_shape(ob, TRUE); - -#ifdef WITH_BULLET - /* now tell RB sim about it */ - if (rbo->physics_object && rbo->physics_shape) { - RB_body_set_collision_shape(rbo->physics_object, rbo->physics_shape); - } -#endif -} - - static void rna_RigidBodyOb_mass_set(PointerRNA *ptr, float value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; @@ -642,8 +623,8 @@ static void rna_def_rigidbody_object(BlenderRNA *brna) prop = RNA_def_property(srna, "collision_shape", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "shape"); RNA_def_property_enum_items(prop, rigidbody_ob_shape_items); - RNA_def_property_enum_funcs(prop, NULL, "rna_RigidBodyOb_shape_set", NULL); RNA_def_property_ui_text(prop, "Collision Shape", "Collision Shape of object in Rigid Body Simulations"); + RNA_def_property_clear_flag(prop, PROP_ANIMATABLE); RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset"); prop = RNA_def_property(srna, "kinematic", PROP_BOOLEAN, PROP_NONE); -- cgit v1.2.3