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:
authorCody Winchester <CodyWinch>2020-02-06 13:52:24 +0300
committerBastien Montagne <b.mont29@gmail.com>2020-02-06 13:54:55 +0300
commitdd00e8ecd642cafc6294ec7f0f31c5e0e0fe9870 (patch)
tree4a3f9cb7a409c8d00846588afc715253c4ccaa34 /source/blender/modifiers/intern/MOD_smooth.c
parent8768cd6a6a98a710ed2b6d8b257c43dd0e6e58ee (diff)
Smooth Modifier add invert vgroup option
Adds the invert vertex group option to the smooth modifier. Setup same way as previous modifiers. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D6745
Diffstat (limited to 'source/blender/modifiers/intern/MOD_smooth.c')
-rw-r--r--source/blender/modifiers/intern/MOD_smooth.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c
index c8bc3aaa484..59ed3b0b005 100644
--- a/source/blender/modifiers/intern/MOD_smooth.c
+++ b/source/blender/modifiers/intern/MOD_smooth.c
@@ -101,6 +101,7 @@ static void smoothModifier_do(
const float fac_new = smd->fac;
const float fac_orig = 1.0f - fac_new;
+ const bool invert_vgroup = (smd->flag & MOD_SMOOTH_INVERT_VGROUP) != 0;
MEdge *medges = mesh->medge;
const int num_edges = mesh->totedge;
@@ -139,7 +140,8 @@ static void smoothModifier_do(
}
float *vco_new = accumulated_vecs[i];
- const float f_new = defvert_find_weight(dv, defgrp_index) * fac_new;
+ const float f_new = invert_vgroup ? (1.0f - defvert_find_weight(dv, defgrp_index)) * fac_new :
+ defvert_find_weight(dv, defgrp_index) * fac_new;
if (f_new <= 0.0f) {
continue;
}