diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2022-02-20 01:52:43 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2022-02-21 16:01:39 +0300 |
commit | fa715a158a4c4576e944e79276864b1365a0ccc9 (patch) | |
tree | 377d0c57dda9799123f614628f76a815b7689bfb /source/blender/modifiers | |
parent | 5c11ca10c0787325ebb5968bcc90f8dcfd841952 (diff) |
Vertex Weight Mix: support Minimum and Maximum mix modes.
The modifier supports arithmetic operations, like Add or Multiply,
but for some reason omits Minimum and Maximum. They are similarly
simple and useful math functions and should be supported.
Differential Revision: https://developer.blender.org/D14164
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_weightvgmix.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c index 1078ebfaeb2..1b6472e2d42 100644 --- a/source/blender/modifiers/intern/MOD_weightvgmix.c +++ b/source/blender/modifiers/intern/MOD_weightvgmix.c @@ -105,6 +105,12 @@ static float mix_weight(float weight, float weight2, char mix_mode) if (mix_mode == MOD_WVG_MIX_AVG) { return (weight + weight2) * 0.5f; } + if (mix_mode == MOD_WVG_MIX_MIN) { + return (weight < weight2 ? weight : weight2); + } + if (mix_mode == MOD_WVG_MIX_MAX) { + return (weight > weight2 ? weight : weight2); + } return weight2; } |