From c4df8ac1a40c7a98a4244c7c14e19791b1e1e99f Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 16 Jul 2021 12:23:55 -0400 Subject: Fix T89899: Crashes when accessing vertex groups from objects We need to be more strict about trying to retrieve a list of vertex group names from objects now, as only three object types support them. This commit adds a check for vertex group support in a few places, the data transfer operator/modifier, copying vertex groups to selected objects, and the vertex group remove and clear functions. Differential Revision: https://developer.blender.org/D11947 --- source/blender/editors/object/object_vgroup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/object/object_vgroup.c') diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 4ea599fd30e..f64f95c5322 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -3892,7 +3892,7 @@ static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op) int fail = 0; CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) { - if (obact != ob) { + if (obact != ob && BKE_object_supports_vertex_groups(ob)) { if (ED_vgroup_array_copy(ob, obact)) { DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); DEG_relations_tag_update(CTX_data_main(C)); @@ -3909,8 +3909,8 @@ static int vertex_group_copy_to_selected_exec(bContext *C, wmOperator *op) if ((changed_tot == 0 && fail == 0) || fail) { BKE_reportf(op->reports, RPT_ERROR, - "Copy vertex groups to selected: %d done, %d failed (object data must have " - "matching indices)", + "Copy vertex groups to selected: %d done, %d failed (object data must support " + "vertex groups and have matching indices)", changed_tot, fail); } -- cgit v1.2.3