From c07f37287c005058e63556b2e61d3e17cca11c4c Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Tue, 18 Feb 2025 22:21:02 +0100 Subject: [PATCH] Fix #134706: Vertex & Weight Paint do not respect clipping This commit adds the `filter_region_clip_factors` call to each of the brush types in vertex and weight paint modes to ensure that the region clip state is accurately handled. Pull Request: https://projects.blender.org/blender/blender/pulls/134717 --- source/blender/editors/sculpt_paint/paint_vertex.cc | 5 +++++ source/blender/editors/sculpt_paint/paint_weight.cc | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/source/blender/editors/sculpt_paint/paint_vertex.cc b/source/blender/editors/sculpt_paint/paint_vertex.cc index 3f759a86273..eaeb4121fe9 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.cc +++ b/source/blender/editors/sculpt_paint/paint_vertex.cc @@ -1080,6 +1080,7 @@ static void do_vpaint_brush_blur_loops(const bContext *C, tls.factors.resize(verts.size()); const MutableSpan factors = tls.factors; fill_factor_from_hide(hide_vert, verts, factors); + filter_region_clip_factors(ss, vert_positions, verts, factors); if (!select_vert.is_empty()) { filter_factors_with_selection(select_vert, verts, factors); } @@ -1235,6 +1236,7 @@ static void do_vpaint_brush_blur_verts(const bContext *C, tls.factors.resize(verts.size()); const MutableSpan factors = tls.factors; fill_factor_from_hide(hide_vert, verts, factors); + filter_region_clip_factors(ss, vert_positions, verts, factors); if (!select_vert.is_empty()) { filter_factors_with_selection(select_vert, verts, factors); } @@ -1393,6 +1395,7 @@ static void do_vpaint_brush_smear(const bContext *C, tls.factors.resize(verts.size()); const MutableSpan factors = tls.factors; fill_factor_from_hide(hide_vert, verts, factors); + filter_region_clip_factors(ss, vert_positions, verts, factors); if (!select_vert.is_empty()) { filter_factors_with_selection(select_vert, verts, factors); } @@ -1575,6 +1578,7 @@ static void calculate_average_color(VPaintData &vpd, tls.factors.resize(verts.size()); const MutableSpan factors = tls.factors; fill_factor_from_hide(hide_vert, verts, factors); + filter_region_clip_factors(ss, vert_positions, verts, factors); if (!select_vert.is_empty()) { filter_factors_with_selection(select_vert, verts, factors); } @@ -1704,6 +1708,7 @@ static void vpaint_do_draw(const bContext *C, tls.factors.resize(verts.size()); const MutableSpan factors = tls.factors; fill_factor_from_hide(hide_vert, verts, factors); + filter_region_clip_factors(ss, vert_positions, verts, factors); if (!select_vert.is_empty()) { filter_factors_with_selection(select_vert, verts, factors); } diff --git a/source/blender/editors/sculpt_paint/paint_weight.cc b/source/blender/editors/sculpt_paint/paint_weight.cc index 7bf59c64487..423fb790afe 100644 --- a/source/blender/editors/sculpt_paint/paint_weight.cc +++ b/source/blender/editors/sculpt_paint/paint_weight.cc @@ -1137,6 +1137,7 @@ static void do_wpaint_brush_blur(const Depsgraph &depsgraph, tls.factors.resize(verts.size()); const MutableSpan factors = tls.factors; fill_factor_from_hide(hide_vert, verts, factors); + filter_region_clip_factors(ss, vert_positions, verts, factors); if (!select_vert.is_empty()) { filter_factors_with_selection(select_vert, verts, factors); } @@ -1255,6 +1256,7 @@ static void do_wpaint_brush_smear(const Depsgraph &depsgraph, tls.factors.resize(verts.size()); const MutableSpan factors = tls.factors; fill_factor_from_hide(hide_vert, verts, factors); + filter_region_clip_factors(ss, vert_positions, verts, factors); if (!select_vert.is_empty()) { filter_factors_with_selection(select_vert, verts, factors); } @@ -1372,6 +1374,7 @@ static void do_wpaint_brush_draw(const Depsgraph &depsgraph, tls.factors.resize(verts.size()); const MutableSpan factors = tls.factors; fill_factor_from_hide(hide_vert, verts, factors); + filter_region_clip_factors(ss, vert_positions, verts, factors); if (!select_vert.is_empty()) { filter_factors_with_selection(select_vert, verts, factors); } @@ -1459,6 +1462,7 @@ static float calculate_average_weight(const Depsgraph &depsgraph, tls.factors.resize(verts.size()); const MutableSpan factors = tls.factors; fill_factor_from_hide(hide_vert, verts, factors); + filter_region_clip_factors(ss, vert_positions, verts, factors); if (!select_vert.is_empty()) { filter_factors_with_selection(select_vert, verts, factors); }