diff options
author | Sergej Reich <sergej.reich@googlemail.com> | 2013-10-03 20:12:02 +0400 |
---|---|---|
committer | Sergej Reich <sergej.reich@googlemail.com> | 2013-10-03 20:12:02 +0400 |
commit | f372d1417369af96687436a7f5979ab12da58133 (patch) | |
tree | 5a1723749874103bc264b0bca19780c15ce0c768 /source/blender/makesrna/intern/rna_rigidbody.c | |
parent | 51f7f82a42f15eb12062960fbba5d57a6ededbfd (diff) |
rigidbody: Flag bodies for validation when changing shape
This fixes a pretty old crash that occurs when changing the collision
shape to a mesh shape during simulation.
Thanks to Thomas Beck (plasmasolutions) for the report.
svn merge -r60310:60311 ^/branches/soc-2013-rigid_body_sim
Diffstat (limited to 'source/blender/makesrna/intern/rna_rigidbody.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_rigidbody.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_rigidbody.c b/source/blender/makesrna/intern/rna_rigidbody.c index cb27261c7bf..cc14e60f45a 100644 --- a/source/blender/makesrna/intern/rna_rigidbody.c +++ b/source/blender/makesrna/intern/rna_rigidbody.c @@ -167,6 +167,14 @@ static void rna_RigidBodyOb_type_set(PointerRNA *ptr, int value) rbo->flag |= RBO_FLAG_NEEDS_VALIDATE; } +static void rna_RigidBodyOb_shape_set(PointerRNA *ptr, int value) +{ + RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; + + rbo->shape = value; + rbo->flag |= RBO_FLAG_NEEDS_VALIDATE; +} + static void rna_RigidBodyOb_disabled_set(PointerRNA *ptr, int value) { RigidBodyOb *rbo = (RigidBodyOb *)ptr->data; @@ -771,6 +779,7 @@ 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_object_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"); |