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.
This commit is contained in:
Hans Goudey
2024-06-29 18:44:15 -04:00
parent 7c17339749
commit 2e36675dec
2 changed files with 2 additions and 2 deletions

View File

@@ -151,7 +151,7 @@ void mesh_show_all(Object &object, const Span<PBVHNode *> nodes)
const VArraySpan hide_vert(attribute);
threading::parallel_for(nodes.index_range(), 1, [&](const IndexRange range) {
for (PBVHNode *node : nodes.slice(range)) {
const Span<int> verts = bke::pbvh::node_verts(*node);
const Span<int> 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);

View File

@@ -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<int> verts = bke::pbvh::node_verts(*node);
const Span<int> 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]]) {