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-09-19 07:08:38 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-09-20 05:54:38 +0300
commite0f13f41c68172ca61f76b85fdf281fabb48c8b5 (patch)
treed26ee20251002058893d1593f5c3fbfdad24b149 /source/blender/modifiers/intern/MOD_warp.c
parent94a63f75055024dbf0c9f9236b3cda5438fa2162 (diff)
Fix invert vertex group weight miscalculation for modifiers
Warp & weight vertex-group editing modifiers miscalculated vertex weight inversion, the weights were multiplied before being subtracted from 1. Ref D8241
Diffstat (limited to 'source/blender/modifiers/intern/MOD_warp.c')
-rw-r--r--source/blender/modifiers/intern/MOD_warp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c
index bb0896994b1..2e4e4da6803 100644
--- a/source/blender/modifiers/intern/MOD_warp.c
+++ b/source/blender/modifiers/intern/MOD_warp.c
@@ -279,8 +279,9 @@ static void warpModifier_do(WarpModifierData *wmd,
/* skip if no vert group found */
if (defgrp_index != -1) {
dv = &dvert[i];
- weight = invert_vgroup ? 1.0f - BKE_defvert_find_weight(dv, defgrp_index) * strength :
- BKE_defvert_find_weight(dv, defgrp_index) * strength;
+ weight = (invert_vgroup ? (1.0f - BKE_defvert_find_weight(dv, defgrp_index)) :
+ BKE_defvert_find_weight(dv, defgrp_index)) *
+ strength;
if (weight <= 0.0f) {
continue;
}