Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <b.mont29@gmail.com>2020-03-03 20:41:50 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-03-03 20:41:50 +0300
commit059f3c1a7eb8a48aa06467e19cce4daa29091c1a (patch)
tree1fd631a590bcf0ea14865927c21491559c35e783 /source/blender/modifiers/intern/MOD_wave.c
parent2841b2be3949b7592b50cd2ebd03b9b32a5f2058 (diff)
Modifiers: Wave add invert vgroup option
Adds the invert vgroup option to the Wave modifier. Differential Revision: https://developer.blender.org/D6893
Diffstat (limited to 'source/blender/modifiers/intern/MOD_wave.c')
-rw-r--r--source/blender/modifiers/intern/MOD_wave.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c
index ff5748b968c..d4d8d253254 100644
--- a/source/blender/modifiers/intern/MOD_wave.c
+++ b/source/blender/modifiers/intern/MOD_wave.c
@@ -154,6 +154,7 @@ static void waveModifier_do(WaveModifierData *md,
const int wmd_axis = wmd->flag & (MOD_WAVE_X | MOD_WAVE_Y);
const float falloff = wmd->falloff;
float falloff_fac = 1.0f; /* when falloff == 0.0f this stays at 1.0f */
+ const bool invert_group = (wmd->flag & MOD_WAVE_INVERT_VGROUP) != 0;
if ((wmd->flag & MOD_WAVE_NORM) && (mesh != NULL)) {
mvert = mesh->mvert;
@@ -213,7 +214,8 @@ static void waveModifier_do(WaveModifierData *md,
/* get weights */
if (dvert) {
- def_weight = defvert_find_weight(&dvert[i], defgrp_index);
+ def_weight = invert_group ? 1.0f - defvert_find_weight(&dvert[i], defgrp_index) :
+ defvert_find_weight(&dvert[i], defgrp_index);
/* if this vert isn't in the vgroup, don't deform it */
if (def_weight == 0.0f) {