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.
This commit is contained in:

committed by
Campbell Barton

parent
2ca34e419e
commit
b147ecb991
@@ -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; \
|
||||
} \
|
||||
} \
|
||||
|
Reference in New Issue
Block a user