From 2e36675decac452b99eb85292caf3d3ec41df30a Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Sat, 29 Jun 2024 18:44:15 -0400 Subject: [PATCH] Fix: Sculpt: Incorrect access of shared PBVH node vertices Tools should generally only process vertices owned by the current PBVH node rather than vertices owned by other nodes. --- source/blender/editors/sculpt_paint/paint_hide.cc | 2 +- source/blender/editors/sculpt_paint/sculpt_paint_color.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/sculpt_paint/paint_hide.cc b/source/blender/editors/sculpt_paint/paint_hide.cc index 088fecbfdf4..3a93ccc62b1 100644 --- a/source/blender/editors/sculpt_paint/paint_hide.cc +++ b/source/blender/editors/sculpt_paint/paint_hide.cc @@ -151,7 +151,7 @@ void mesh_show_all(Object &object, const Span nodes) const VArraySpan hide_vert(attribute); threading::parallel_for(nodes.index_range(), 1, [&](const IndexRange range) { for (PBVHNode *node : nodes.slice(range)) { - const Span verts = bke::pbvh::node_verts(*node); + const Span verts = bke::pbvh::node_unique_verts(*node); if (std::any_of(verts.begin(), verts.end(), [&](const int i) { return hide_vert[i]; })) { undo::push_node(object, node, undo::Type::HideVert); BKE_pbvh_node_mark_rebuild_draw(node); diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_color.cc b/source/blender/editors/sculpt_paint/sculpt_paint_color.cc index 27b4daadfe4..04c5779ff79 100644 --- a/source/blender/editors/sculpt_paint/sculpt_paint_color.cc +++ b/source/blender/editors/sculpt_paint/sculpt_paint_color.cc @@ -266,7 +266,7 @@ static void do_color_smooth_task(Object &ob, auto_mask::NodeData automask_data = auto_mask::node_begin( ob, ss.cache->automasking.get(), *node); - const Span verts = bke::pbvh::node_verts(*node); + const Span verts = bke::pbvh::node_unique_verts(*node); for (const int i : verts.index_range()) { const int vert = verts[i]; if (!hide_vert.is_empty() && hide_vert[verts[i]]) {