From 24b5d5aa61682d44376d28097fc0a8f9c5c397bb Mon Sep 17 00:00:00 2001 From: mano-wii Date: Wed, 12 Feb 2020 08:35:27 -0300 Subject: Modifiers: Weld Modifier - simplify invert_vgroup code No functional change --- source/blender/modifiers/intern/MOD_weld.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/blender/modifiers/intern/MOD_weld.c b/source/blender/modifiers/intern/MOD_weld.c index 64a0667a41a..1f641e56c76 100644 --- a/source/blender/modifiers/intern/MOD_weld.c +++ b/source/blender/modifiers/intern/MOD_weld.c @@ -37,6 +37,7 @@ #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" +#include "DNA_modifier_types.h" #include "DNA_object_types.h" #include "BKE_deform.h" @@ -1623,7 +1624,6 @@ static Mesh *weldModifier_doWeld(WeldModifierData *wmd, const ModifierEvalContex const MPoly *mpoly, *mp; uint totvert, totedge, totloop, totpoly; uint i; - const bool invert_vgroup = (wmd->flag & MOD_WELD_INVERT_VGROUP) != 0; mvert = mesh->mvert; totvert = mesh->totvert; @@ -1634,12 +1634,12 @@ static Mesh *weldModifier_doWeld(WeldModifierData *wmd, const ModifierEvalContex MDeformVert *dvert, *dv; dvert = CustomData_get_layer(&mesh->vdata, CD_MDEFORMVERT); if (dvert) { + const bool invert_vgroup = (wmd->flag & MOD_WELD_INVERT_VGROUP) != 0; dv = &dvert[0]; v_mask = BLI_BITMAP_NEW(totvert, __func__); for (i = 0; i < totvert; i++, dv++) { - const bool found = invert_vgroup ? 1.0f - defvert_find_weight(dv, defgrp_index) > 0.0f : - defvert_find_weight(dv, defgrp_index) > 0.0f; - if (found) { + const bool found = defvert_find_weight(dv, defgrp_index) > 0.0f; + if (found != invert_vgroup) { BLI_BITMAP_ENABLE(v_mask, i); v_mask_act++; } -- cgit v1.2.3