diff options
author | Cody Winchester <CodyWinch> | 2020-02-12 13:04:20 +0300 |
---|---|---|
committer | Bastien Montagne <b.mont29@gmail.com> | 2020-02-12 13:05:35 +0300 |
commit | cd57c9e310e2482298ac61fc9424551bbe6eb61c (patch) | |
tree | 543a9f4e956dcf7b9833ff998f9667e9c5b63e1f /source/blender/modifiers | |
parent | 0e15850a7eedbdf236e977c663efaceff23572e1 (diff) |
Modifiers: Weld Modifier add invert vgroup option
Adds the invert vgroup option to the weld modifier.
Differential Revision: https://developer.blender.org/D6818
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_weld.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_weld.c b/source/blender/modifiers/intern/MOD_weld.c index bd567c52d88..64a0667a41a 100644 --- a/source/blender/modifiers/intern/MOD_weld.c +++ b/source/blender/modifiers/intern/MOD_weld.c @@ -1623,6 +1623,7 @@ 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; @@ -1636,7 +1637,8 @@ static Mesh *weldModifier_doWeld(WeldModifierData *wmd, const ModifierEvalContex dv = &dvert[0]; v_mask = BLI_BITMAP_NEW(totvert, __func__); for (i = 0; i < totvert; i++, dv++) { - const bool found = defvert_find_weight(dv, defgrp_index) > 0.0f; + 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) { BLI_BITMAP_ENABLE(v_mask, i); v_mask_act++; |