diff options
author | Cody Winchester <CodyWinch> | 2020-05-26 21:53:38 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-05-26 21:56:27 +0300 |
commit | de257b6366455ba6a3604c0830a92245df11f7bc (patch) | |
tree | 239c022c52cbb655ce2116fddb151c3f55549ed6 /source/blender/modifiers/intern/MOD_weightvgedit.c | |
parent | 00674c12cc0f08254e5643ad18120b2e9e710a94 (diff) |
Modifiers: Add normalize weights option to vertex weight modifiers
Original patch by Cody Winchester (@CodyWinch), several fixes and
cleanup by Bastien Montagne (@mont29).
Differential revision: https://developer.blender.org/D7656
Diffstat (limited to 'source/blender/modifiers/intern/MOD_weightvgedit.c')
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvgedit.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c index 1ff8dfbdcca..8ce1aaee942 100644 --- a/source/blender/modifiers/intern/MOD_weightvgedit.c +++ b/source/blender/modifiers/intern/MOD_weightvgedit.c @@ -239,6 +239,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * /* Do mapping. */ const bool do_invert_mapping = (wmd->edit_flags & MOD_WVG_INVERT_FALLOFF) != 0; + const bool do_normalize = (wmd->edit_flags & MOD_WVG_EDIT_WEIGHTS_NORMALIZE) != 0; if (do_invert_mapping || wmd->falloff_type != MOD_WVG_MAPPING_NONE) { RNG *rng = NULL; @@ -283,7 +284,8 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * do_add, wmd->add_threshold, do_rem, - wmd->rem_threshold); + wmd->rem_threshold, + do_normalize); /* If weight preview enabled... */ #if 0 /* XXX Currently done in mod stack :/ */ |