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:
authorGermano Cavalcante <germano.costa@ig.com.br>2020-03-28 04:14:38 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2020-03-28 04:14:47 +0300
commit10bd3fb4cb186f927d8839d2da28eeb90d6722f3 (patch)
tree82966ccde61f85fad257fd65a8eda890d36f4509 /source/blender/makesrna/intern/rna_object.c
parent79b391f3a009418005e2731b43315a98c2cbedef (diff)
Fix T74604: A.N.T Landscape Erode function reports error
Although indicated, the `rna_Object_active_vertex_group_set` function was missing.
Diffstat (limited to 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r--source/blender/makesrna/intern/rna_object.c19
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");