From 10ac7c0f15cbf82ee4dca2e10fd2a313f896d8e6 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Jan 2016 14:05:15 +1100 Subject: Fix weight paint normalizing w/ locked groups Reported as part of T47123 Checks for locked groups assumed auto-normalize and would distribute wight between groups even with auto-normalize disabled. --- source/blender/editors/sculpt_paint/paint_vertex.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'source/blender/editors/sculpt_paint') diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index d632138f3f9..76326f42dd4 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1700,8 +1700,6 @@ static void do_weight_paint_vertex( MDeformVert *dv_mirr; MDeformWeight *dw_mirr; - const short do_multipaint_totsel = (wpi->do_multipaint && wpi->defbase_tot_sel > 1); - if (wp->flag & VP_ONLYVGROUP) { dw = defvert_find_index(dv, wpi->vgroup_active); dw_prev = defvert_find_index(wp->wpaint_prev + index, wpi->vgroup_active); @@ -1765,15 +1763,15 @@ static void do_weight_paint_vertex( dw_mirr = NULL; } - - /* TODO: De-duplicate the simple weight paint - jason */ - /* ... or not, since its <10 SLOC - campbell */ - - /* If there are no locks or multipaint, + /* If there are no normalize-locks or multipaint, * then there is no need to run the more complicated checks */ - if ((do_multipaint_totsel == false) && - (wpi->lock_flags == NULL || has_locked_group(dv, wpi->defbase_tot, wpi->vgroup_validmap, wpi->lock_flags) == false)) - { + const bool do_multipaint_totsel = + (wpi->do_multipaint && wpi->defbase_tot_sel > 1); + const bool do_locked_normalize = + (wpi->do_auto_normalize && wpi->lock_flags && + has_locked_group(dv, wpi->defbase_tot, wpi->vgroup_validmap, wpi->lock_flags)); + + if ((do_multipaint_totsel || do_locked_normalize) == false) { dw->weight = wpaint_blend(wp, dw->weight, dw_prev->weight, alpha, paintweight, wpi->brush_alpha_value, wpi->do_flip, false); -- cgit v1.2.3