[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54308] trunk/blender/source/blender/ makesrna/intern/rna_rigidbody.c: rigidbody: Don' t allow collision shape to be animated

Sergej Reich sergej.reich at googlemail.com
Tue Feb 5 00:50:35 CET 2013


Revision: 54308
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54308
Author:   sergof
Date:     2013-02-04 23:50:34 +0000 (Mon, 04 Feb 2013)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_rigidbody.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_rigidbody.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_rigidbody.c	2013-02-04 23:50:31 UTC (rev 54307)
+++ trunk/blender/source/blender/makesrna/intern/rna_rigidbody.c	2013-02-04 23:50:34 UTC (rev 54308)
@@ -188,25 +188,6 @@
 #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 @@
 	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);




More information about the Bf-blender-cvs mailing list