[Bf-blender-cvs] [9f866a92dc4] master: Fix T104176: Smooth modifier with vergex group not work for negative factors.

Bastien Montagne noreply at git.blender.org
Tue Jan 31 09:55:50 CET 2023


Commit: 9f866a92dc4c9eb19532dddfabe43e2115eefe3f
Author: Bastien Montagne
Date:   Tue Jan 31 09:54:28 2023 +0100
Branches: master
https://developer.blender.org/rB9f866a92dc4c9eb19532dddfabe43e2115eefe3f

Fix T104176: Smooth modifier with vergex group not work for negative factors.

Regression from rBabc8d6b12ce9, over three years ago!

Should be backported to the active LTS releases too.

===================================================================

M	source/blender/modifiers/intern/MOD_smooth.c

===================================================================

diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c
index 32cb29bcf52..8b0516bb13e 100644
--- a/source/blender/modifiers/intern/MOD_smooth.c
+++ b/source/blender/modifiers/intern/MOD_smooth.c
@@ -134,12 +134,12 @@ static void smoothModifier_do(
         }
         float *vco_new = accumulated_vecs[i];
 
-        const float f_new = invert_vgroup ?
-                                (1.0f - BKE_defvert_find_weight(dv, defgrp_index)) * fac_new :
-                                BKE_defvert_find_weight(dv, defgrp_index) * fac_new;
-        if (f_new <= 0.0f) {
+        const float f_vgroup = invert_vgroup ? (1.0f - BKE_defvert_find_weight(dv, defgrp_index)) :
+                                               BKE_defvert_find_weight(dv, defgrp_index);
+        if (f_vgroup <= 0.0f) {
           continue;
         }
+        const float f_new = f_vgroup * fac_new;
         const float f_orig = 1.0f - f_new;
 
         if (flag & MOD_SMOOTH_X) {



More information about the Bf-blender-cvs mailing list