diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2020-03-28 04:14:38 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-03-28 04:14:47 +0300 |
commit | 10bd3fb4cb186f927d8839d2da28eeb90d6722f3 (patch) | |
tree | 82966ccde61f85fad257fd65a8eda890d36f4509 | |
parent | 79b391f3a009418005e2731b43315a98c2cbedef (diff) |
Fix T74604: A.N.T Landscape Erode function reports error
Although indicated, the `rna_Object_active_vertex_group_set`
function was missing.
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 959529450f0..112517a92e0 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -760,6 +760,24 @@ static PointerRNA rna_Object_active_vertex_group_get(PointerRNA *ptr) ptr, &RNA_VertexGroup, BLI_findlink(&ob->defbase, ob->actdef - 1)); } +static void rna_Object_active_vertex_group_set(PointerRNA *ptr, + PointerRNA value, + struct ReportList *reports) +{ + Object *ob = (Object *)ptr->owner_id; + int index = BLI_findindex(&ob->defbase, value.data); + if (index == -1) { + BKE_reportf(reports, + RPT_ERROR, + "VertexGroup '%s' not found in object '%s'", + ((bDeformGroup *)value.data)->name, + ob->id.name + 2); + return; + } + + ob->actdef = index + 1; +} + static int rna_Object_active_vertex_group_index_get(PointerRNA *ptr) { Object *ob = (Object *)ptr->owner_id; @@ -2333,6 +2351,7 @@ static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop) "rna_Object_active_vertex_group_set", NULL, NULL); + RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Active Vertex Group", "Vertex groups of the object"); RNA_def_property_update(prop, NC_GEOM | ND_DATA, "rna_Object_internal_update_data"); |