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:
authorCampbell Barton <ideasman42@gmail.com>2016-03-07 03:28:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-03-07 03:28:21 +0300
commit42e86602721170c8fbb9d68a1a201a1d78052d72 (patch)
treedabffbe52a3fca5735d4435057fa8f53ff1142f5 /source/blender/modifiers
parentd086f6aa5c26d445aef1ebd04e6c8501f6189d91 (diff)
Simple Deform modifier: invert vgroup option
D1839 from @Orgold
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_simpledeform.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c
index f4fbfa74076..588b56d6aba 100644
--- a/source/blender/modifiers/intern/MOD_simpledeform.c
+++ b/source/blender/modifiers/intern/MOD_simpledeform.c
@@ -214,10 +214,15 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, struct Object
}
modifier_get_vgroup(ob, dm, smd->vgroup_name, &dvert, &vgroup);
+ const bool invert_vgroup = (smd->flag & MOD_SIMPLEDEFORM_FLAG_INVERT_VGROUP) != 0;
for (i = 0; i < numVerts; i++) {
float weight = defvert_array_find_weight_safe(dvert, i, vgroup);
+ if (invert_vgroup) {
+ weight = 1.0f - weight;
+ }
+
if (weight != 0.0f) {
float co[3], dcut[3] = {0.0f, 0.0f, 0.0f};