diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-06-05 08:52:32 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-06-05 08:52:32 +0400 |
commit | 3a6adc0ed30be1d940f8069ad5e35bb27140ada6 (patch) | |
tree | 275e2f3399d7d49fa15c00f6c38ac5b8b3e79cfa /source/blender/makesrna/intern/rna_object.c | |
parent | a79072c80dedf987de185ef9fd3f06adf243a27a (diff) |
fix [#27554] vertex group names
- duplicate vertex group names were not being checked for.
- also made the first duplicate end with .001 rather than .000
Diffstat (limited to 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 9305380d06c..8ee8652e2e5 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -454,6 +454,14 @@ static void rna_Object_dup_group_set(PointerRNA *ptr, PointerRNA value) BKE_report(NULL, RPT_ERROR, "Cannot set dupli-group as object belongs in group being instanced thus causing a cycle"); } +void rna_VertexGroup_name_set(PointerRNA *ptr, const char *value) +{ + Object *ob= (Object *)ptr->id.data; + bDeformGroup *dg= (bDeformGroup *)ptr->data; + BLI_strncpy(dg->name, value, sizeof(dg->name)); + defgroup_unique_name(dg, ob); +} + static int rna_VertexGroup_index_get(PointerRNA *ptr) { Object *ob= (Object*)ptr->id.data; @@ -1236,6 +1244,7 @@ static void rna_def_vertex_group(BlenderRNA *brna) prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_ui_text(prop, "Name", "Vertex group name"); RNA_def_struct_name_property(srna, prop); + RNA_def_property_string_funcs(prop, NULL, NULL, "rna_VertexGroup_name_set"); RNA_def_property_update(prop, NC_GEOM|ND_DATA|NA_RENAME, "rna_Object_internal_update_data"); /* update data because modifiers may use [#24761] */ prop= RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED); |