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:
@@ -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);
|
||||
|
||||
@@ -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]]) {
|
||||
|
||||
Reference in New Issue
Block a user