From cc6ec71b1934b5489caa538c13d290b45d2b1aa5 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Tue, 17 Nov 2020 22:33:09 +0100 Subject: Sculpt: Wet paint area radius This adds a new property to the sculpt vertex color paint brush to limit the area of the brush that is going to be used to sample the wet paint color. This is exactly the same concept as normal radius and area radius that exist for sculpting brushes for sampling the surface depth and orientation. When working near color hard edges, this allows to prevent the color from the other side of the edge to blend into the wet paint. With 1.0 (the previous default) wet paint radius, as soon as the brush touches one vertex of the other color, the wet paint mix color changes, making it impossible to maintain the border between the two colors. Reviewed By: sergey, dbystedt, JulienKaspar Differential Revision: https://developer.blender.org/D9587 --- source/blender/editors/sculpt_paint/sculpt_paint_color.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/editors/sculpt_paint/sculpt_paint_color.c') diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_color.c b/source/blender/editors/sculpt_paint/sculpt_paint_color.c index f0047448a8d..39320f3f558 100644 --- a/source/blender/editors/sculpt_paint/sculpt_paint_color.c +++ b/source/blender/editors/sculpt_paint/sculpt_paint_color.c @@ -220,6 +220,9 @@ static void do_sample_wet_paint_task_cb(void *__restrict userdata, SculptBrushTestFn sculpt_brush_test_sq_fn = SCULPT_brush_test_init_with_falloff_shape( ss, &test, data->brush->falloff_shape); + test.radius *= data->brush->wet_paint_radius_factor; + test.radius_squared = test.radius * test.radius; + BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) { if (sculpt_brush_test_sq_fn(&test, vd.co)) { -- cgit v1.2.3