rigidbody: Don't allow collision shape to be animated
authorSergej Reich <sergej.reich@googlemail.com>
Mon, 4 Feb 2013 23:50:34 +0000 (23:50 +0000)
committerSergej Reich <sergej.reich@googlemail.com>
Mon, 4 Feb 2013 23:50:34 +0000 (23:50 +0000)
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

index 938ef7a50321134ae102fc8f714e61bc5706b346..71ff7bfd6ec22fa2b1cf78adea1c965e9cc40315 100644 (file)
@@ -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);