[Bf-blender-cvs] [802a59a58af] master: Cleanup: Remove redundant logic
Hans Goudey
noreply at git.blender.org
Fri Jul 16 18:02:49 CEST 2021
Commit: 802a59a58affbbb6da77d2b4cf840fb23a7456e6
Author: Hans Goudey
Date: Fri Jul 16 12:02:38 2021 -0400
Branches: master
https://developer.blender.org/rB802a59a58affbbb6da77d2b4cf840fb23a7456e6
Cleanup: Remove redundant logic
The object type was checked twice unnecessarily. Also use a function
for the check to be more explicit.
===================================================================
M source/blender/blenkernel/intern/armature_deform.c
===================================================================
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);
More information about the Bf-blender-cvs
mailing list