Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergej Reich <sergej.reich@googlemail.com>2013-12-26 20:02:28 +0400
committerSergej Reich <sergej.reich@googlemail.com>2013-12-26 21:38:05 +0400
commit2260a7dbc0b6150489832dd94160512d1760fb00 (patch)
tree9427bbe06c1cb5cfeae643883408e46021742a9a /source/blender/makesrna/intern/rna_rigidbody.c
parent55397c690decac67f941f565af2155116b0e6a99 (diff)
Rigidbody: Add option to choose mesh source for collision shapes
The options are: Base: Base mesh Deform: shape keys and deform modifiers Final: All deformations and modifiers It would be nice to have a way of specifying where exactly in the modifier stack the collision shape is generated. However this is not staight forward since the rigid body simulation is not part of the modifier system and would require hacks to make it work.
Diffstat (limited to 'source/blender/makesrna/intern/rna_rigidbody.c')
-rw-r--r--source/blender/makesrna/intern/rna_rigidbody.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_rigidbody.c b/source/blender/makesrna/intern/rna_rigidbody.c
index cc14e60f45a..34b0f6a335a 100644
--- a/source/blender/makesrna/intern/rna_rigidbody.c
+++ b/source/blender/makesrna/intern/rna_rigidbody.c
@@ -76,6 +76,13 @@ EnumPropertyItem rigidbody_constraint_type_items[] = {
{RBC_TYPE_MOTOR, "MOTOR", ICON_NONE, "Motor", "Drive rigid body around or along an axis"},
{0, NULL, 0, NULL, NULL}};
+/* mesh source for collision shape creation */
+EnumPropertyItem rigidbody_mesh_source_items[] = {
+ {RBO_MESH_BASE, "BASE", 0, "Base", "Base mesh"},
+ {RBO_MESH_DEFORM, "DEFORM", 0, "Deform", "Deformations (shaps keys, deform modifiers"},
+ {RBO_MESH_FINAL, "FINAL", 0, "Final", "All modifiers"},
+ {0, NULL, 0, NULL, NULL}};
+
#ifdef RNA_RUNTIME
@@ -769,6 +776,13 @@ static void rna_def_rigidbody_object(BlenderRNA *brna)
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, "mesh_source", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "mesh_source");
+ RNA_def_property_enum_items(prop, rigidbody_mesh_source_items);
+ RNA_def_property_ui_text(prop, "Mesh Source", "Source of the mesh used to create collision shape");
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_update(prop, NC_OBJECT | ND_POINTCACHE, "rna_RigidBodyOb_reset");
+
/* booleans */
prop = RNA_def_property(srna, "enabled", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", RBO_FLAG_DISABLED);