Fix #119969: Crash rendering in sculpt mode with multires active

SubdvigCCG is null for the evaluated mesh in the render depsgraph
because of the `!for_render` check in `MOD_multires.cc`. But the PBVH
type is still `PBVH_GRIDS`. That's a weird inconsistency that ideally
wouldn't happen, but probably isn't simple to change. The simplest and
most obviously harmless fix is to just check whether the list of PBVH
nodes to update is empty.
This commit is contained in:
Hans Goudey 2024-03-28 15:10:54 -04:00
parent 0b80d5e755
commit 684dbba6a1
1 changed files with 3 additions and 0 deletions

View File

@ -1281,6 +1281,9 @@ void update_normals(PBVH &pbvh, SubdivCCG *subdiv_ccg)
{
Vector<PBVHNode *> nodes = search_gather(
&pbvh, [&](PBVHNode &node) { return update_search(&node, PBVH_UpdateNormals); });
if (nodes.is_empty()) {
return;
}
if (pbvh.header.type == PBVH_BMESH) {
bmesh_normals_update(nodes);