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:
authorDaniel Genrich <daniel.genrich@gmx.net>2012-06-06 17:30:05 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2012-06-06 17:30:05 +0400
commit0499200e39204a349fda12fdd44c409c6e4e6fc8 (patch)
tree406339dc919451c2c316498a31ea2dd0bd46e602 /source/blender/makesrna/intern/rna_cloth.c
parentd6ebba4c9e1c0239db34a0fda5ca9ad810ef504e (diff)
Cloth: Add support for "Self Collision Vertex Group".
Self collision vertex groups enable artists to exclude selected vertices from getting involved in self collisions. This speeds simulations and it also resolves some self collision issues.
Diffstat (limited to 'source/blender/makesrna/intern/rna_cloth.c')
-rw-r--r--source/blender/makesrna/intern/rna_cloth.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_cloth.c b/source/blender/makesrna/intern/rna_cloth.c
index 37795edb884..82a838010f6 100644
--- a/source/blender/makesrna/intern/rna_cloth.c
+++ b/source/blender/makesrna/intern/rna_cloth.c
@@ -155,6 +155,25 @@ static void rna_ClothSettings_bend_vgroup_set(PointerRNA *ptr, const char *value
rna_object_vgroup_name_index_set(ptr, value, &sim->vgroup_bend);
}
+
+static void rna_CollSettings_selfcol_vgroup_get(PointerRNA *ptr, char *value)
+{
+ ClothCollSettings *coll = (ClothCollSettings *)ptr->data;
+ rna_object_vgroup_name_index_get(ptr, value, coll->vgroup_selfcol);
+}
+
+static int rna_CollSettings_selfcol_vgroup_length(PointerRNA *ptr)
+{
+ ClothCollSettings *coll = (ClothCollSettings *)ptr->data;
+ return rna_object_vgroup_name_index_length(ptr, coll->vgroup_selfcol);
+}
+
+static void rna_CollSettings_selfcol_vgroup_set(PointerRNA *ptr, const char *value)
+{
+ ClothCollSettings *coll = (ClothCollSettings *)ptr->data;
+ rna_object_vgroup_name_index_set(ptr, value, &coll->vgroup_selfcol);
+}
+
static PointerRNA rna_ClothSettings_rest_shape_key_get(PointerRNA *ptr)
{
Object *ob = (Object *)ptr->id.data;
@@ -523,6 +542,13 @@ static void rna_def_cloth_collision_settings(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Collision Group", "Limit colliders to this Group");
RNA_def_property_update(prop, 0, "rna_cloth_update");
+
+ prop = RNA_def_property(srna, "vertex_group_self_collisions", PROP_STRING, PROP_NONE);
+ RNA_def_property_string_funcs(prop, "rna_CollSettings_selfcol_vgroup_get", "rna_CollSettings_selfcol_vgroup_length",
+ "rna_CollSettings_selfcol_vgroup_set");
+ RNA_def_property_ui_text(prop, "Selfcollision Vertex Group",
+ "Vertex group to define vertices which are not used during self collisions.");
+ RNA_def_property_update(prop, 0, "rna_cloth_update");
}
void RNA_def_cloth(BlenderRNA *brna)