From 10bd3fb4cb186f927d8839d2da28eeb90d6722f3 Mon Sep 17 00:00:00 2001 From: Germano Cavalcante Date: Fri, 27 Mar 2020 22:14:38 -0300 Subject: Fix T74604: A.N.T Landscape Erode function reports error Although indicated, the `rna_Object_active_vertex_group_set` function was missing. --- source/blender/makesrna/intern/rna_object.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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"); -- cgit v1.2.3