diff options
author | Hans Goudey <h.goudey@me.com> | 2021-07-16 19:02:38 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-07-16 19:02:38 +0300 |
commit | 802a59a58affbbb6da77d2b4cf840fb23a7456e6 (patch) | |
tree | 871c09b1b4fb19a935fab78d232461e03d64dfa6 /source/blender | |
parent | 1ab6d5c1dcbeebc0794999d358d483f0b6cac67f (diff) |
Cleanup: Remove redundant logic
The object type was checked twice unnecessarily. Also use a function
for the check to be more explicit.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/armature_deform.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/armature_deform.c b/source/blender/blenkernel/intern/armature_deform.c index 5e9259f05bb..5f721b49361 100644 --- a/source/blender/blenkernel/intern/armature_deform.c +++ b/source/blender/blenkernel/intern/armature_deform.c @@ -501,7 +501,7 @@ static void armature_deform_coords_impl(const Object *ob_arm, BLI_assert(0); } - if (ELEM(ob_target->type, OB_MESH, OB_LATTICE, OB_GPENCIL)) { + if (BKE_object_supports_vertex_groups(ob_target)) { /* get the def_nr for the overall armature vertex group if present */ armature_def_nr = BKE_object_defgroup_name_index(ob_target, defgrp_name); @@ -529,11 +529,9 @@ static void armature_deform_coords_impl(const Object *ob_arm, dverts_len = gps_target->totpoints; } } - } - /* get a vertex-deform-index to posechannel array */ - if (deformflag & ARM_DEF_VGROUP) { - if (ELEM(ob_target->type, OB_MESH, OB_LATTICE, OB_GPENCIL)) { + /* get a vertex-deform-index to posechannel array */ + if (deformflag & ARM_DEF_VGROUP) { /* if we have a Mesh, only use dverts if it has them */ if (em_target) { cd_dvert_offset = CustomData_get_offset(&em_target->bm->vdata, CD_MDEFORMVERT); |