diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-11-04 03:33:12 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-11-04 03:33:12 +0300 |
commit | 951758c01fe059a62b42252302a656c62ac03c8b (patch) | |
tree | 9a22bf8ae494acf1f3e049401b664ab5921cc5fd /source/blender/editors/object/object_vgroup.c | |
parent | 4d358855b8319417abd45dc5bb103763c536aa58 (diff) | |
parent | 101c3d4ce4554a4d00ff89830c6b500f3e986365 (diff) |
Merge branch 'blender-v2.91-release'
Diffstat (limited to 'source/blender/editors/object/object_vgroup.c')
-rw-r--r-- | source/blender/editors/object/object_vgroup.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 26863fd0848..e92b3323441 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -2692,6 +2692,22 @@ static bool vertex_group_mesh_poll(bContext *C) return (vertex_group_poll(C) && ob->type == OB_MESH); } +static bool vertex_group_mesh_with_dvert_poll(bContext *C) +{ + Object *ob = ED_object_context(C); + + if (!vertex_group_mesh_poll(C)) { + return false; + } + + Mesh *me = ob->data; + if (me->dvert == NULL) { + return false; + } + + return true; +} + static bool UNUSED_FUNCTION(vertex_group_mesh_supported_poll)(bContext *C) { Object *ob = ED_object_context(C); @@ -3313,7 +3329,7 @@ void OBJECT_OT_vertex_group_fix(wmOperatorType *ot) "groups' weights (this tool may be slow for many vertices)"; /* api callbacks */ - ot->poll = vertex_group_mesh_poll; + ot->poll = vertex_group_mesh_with_dvert_poll; ot->exec = vertex_group_fix_exec; /* flags */ |