From 29dbe00719812925ab88030ce68509bf113520c5 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 13 Oct 2020 09:45:37 +0200 Subject: Fix T81484: Weight/Vertex paint with mirror and viewport clipping does not update stroke on initial side Issue introduced in rB4f616c93f7cb. Issue here is that the the `StrokeCache` `mirror_symmetry_pass` is still in its previous state when entering `wpaint_do_symmetrical_brush_actions`. For the initial stroke this means that the (wrong) cache `mirror_symmetry_pass` ends up in SculptBrushTest `mirror_symmetry_pass` as well and thus the clipping test in `sculpt_brush_test_clipping` will fail. [ This one flips the coords to test against clipping according to (now wrong) `mirror_symmetry_pass` ] Solution seems simple: just ensure we start of with a `mirror_symmetry_pass` of zero in `wpaint_do_symmetrical_brush_actions` for the initial stroke. Same thing is done for vertex paint as well. Maniphest Tasks: T81484 Differential Revision: https://developer.blender.org/D9268 --- source/blender/editors/sculpt_paint/paint_vertex.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/editors/sculpt_paint/paint_vertex.c') diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 6472da48f40..2876670a8d2 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -2296,6 +2296,7 @@ static void wpaint_do_symmetrical_brush_actions( int i = 0; /* initial stroke */ + cache->mirror_symmetry_pass = 0; wpaint_do_paint(C, ob, wp, sd, wpd, wpi, me, brush, 0, 'X', 0, 0); wpaint_do_radial_symmetry(C, ob, wp, sd, wpd, wpi, me, brush, 0, 'X'); wpaint_do_radial_symmetry(C, ob, wp, sd, wpd, wpi, me, brush, 0, 'Y'); @@ -3316,6 +3317,7 @@ static void vpaint_do_symmetrical_brush_actions( int i = 0; /* initial stroke */ + cache->mirror_symmetry_pass = 0; vpaint_do_paint(C, sd, vp, vpd, ob, me, brush, i, 'X', 0, 0); vpaint_do_radial_symmetry(C, sd, vp, vpd, ob, me, brush, i, 'X'); vpaint_do_radial_symmetry(C, sd, vp, vpd, ob, me, brush, i, 'Y'); -- cgit v1.2.3