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:
authorCampbell Barton <ideasman42@gmail.com>2016-01-14 06:05:15 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-01-14 06:05:15 +0300
commit10ac7c0f15cbf82ee4dca2e10fd2a313f896d8e6 (patch)
tree28dc997d58c11ba90867e9ae663a71802d119061 /source/blender/editors/sculpt_paint
parent3a51a90e56471f22bb3e78ce5475614fc31eeb0d (diff)
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.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c18
1 files changed, 8 insertions, 10 deletions
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);