[Bf-blender-cvs] [b147ecb] master: Fix Smooth Weight expand logic
Alexander Gavrilov
noreply at git.blender.org
Sun Jan 24 06:34:26 CET 2016
Commit: b147ecb991e04a5b37bae96166c8f9eb554030cc
Author: Alexander Gavrilov
Date: Thu Jan 21 23:03:14 2016 +0300
Branches: master
https://developer.blender.org/rBb147ecb991e04a5b37bae96166c8f9eb554030cc
Fix Smooth Weight expand logic
Since weight_other is equal to weight_accum_prev[i_other], the original
lines actually are no-op. The visible effect is that when smoothing just
two vertices with weights 1 and 0, the expand value has no effect until
it reaches exactly 1. This change makes it gradual.
===================================================================
M source/blender/editors/object/object_vgroup.c
===================================================================
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index c0b0303..265ef22 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -1828,13 +1828,13 @@ static void vgroup_smooth_subset(
float tot_factor = 1.0f; \
if (expand_sign == 1) { /* expand */ \
if (weight_other < weight_accum_prev[i]) { \
- weight_other = (weight_accum_prev[i_other] * iexpand) + (weight_other * expand); \
+ weight_other = (weight_accum_prev[i] * expand) + (weight_other * iexpand); \
tot_factor = iexpand; \
} \
} \
else if (expand_sign == -1) { /* contract */ \
if (weight_other > weight_accum_prev[i]) { \
- weight_other = (weight_accum_prev[i_other] * iexpand) + (weight_other * expand); \
+ weight_other = (weight_accum_prev[i] * expand) + (weight_other * iexpand); \
tot_factor = iexpand; \
} \
} \
More information about the Bf-blender-cvs
mailing list