Cleanup: Remove useless PBVH update function

This `update_vertex_data` only found nodes with the color update
tag and also added redraw tags. But whenever nodes are marked
for a color update, those redraw tags are already set anyway.
It appears this was meant to solve problems switching active
color attributes during undo and redo, but it doesn't make a
difference when this function is removed.
This commit is contained in:
Hans Goudey
2023-12-14 15:01:16 -05:00
parent 262572a6a0
commit f15bca64f2
4 changed files with 0 additions and 21 deletions

View File

@@ -422,7 +422,6 @@ namespace blender::bke::pbvh {
void update_bounds(PBVH &pbvh, int flags);
void update_mask(PBVH &pbvh);
void update_visibility(PBVH &pbvh);
void update_vertex_data(PBVH &pbvh, int flags);
void update_normals(PBVH &pbvh, SubdivCCG *subdiv_ccg);
} // namespace blender::bke::pbvh

View File

@@ -1345,18 +1345,6 @@ void update_bounds(PBVH &pbvh, int flag)
}
}
void update_vertex_data(PBVH &pbvh, int flag)
{
Vector<PBVHNode *> nodes = search_gather(
&pbvh, [&](PBVHNode &node) { return update_search(&node, flag); });
if (flag & (PBVH_UpdateColor)) {
for (PBVHNode *node : nodes) {
node->flag |= PBVH_UpdateRedraw | PBVH_UpdateDrawBuffers | PBVH_UpdateColor;
}
}
}
void node_update_mask_mesh(const Span<float> mask, PBVHNode &node)
{
const bool fully_masked = std::all_of(node.vert_indices.begin(),

View File

@@ -5339,10 +5339,6 @@ void SCULPT_flush_update_done(const bContext *C, Object *ob, SculptUpdateType up
bke::pbvh::update_mask(*ss->pbvh);
}
if (update_flags & SCULPT_UPDATE_COLOR) {
bke::pbvh::update_vertex_data(*ss->pbvh, PBVH_UpdateColor);
}
BKE_sculpt_attributes_destroy_temporary_stroke(ob);
if (update_flags & SCULPT_UPDATE_COORDS) {

View File

@@ -1738,10 +1738,6 @@ static void set_active_layer(bContext *C, SculptAttrRef *attr)
if (ob->sculpt && ob->sculpt->pbvh) {
BKE_pbvh_update_active_vcol(ob->sculpt->pbvh, mesh);
if (!sculpt_attribute_ref_equals(&existing, attr)) {
bke::pbvh::update_vertex_data(*ob->sculpt->pbvh, PBVH_UpdateColor);
}
}
}
}