From ba820cf8f48bf2e79beaffc9cfd56640fdb4e9dc Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Thu, 28 Mar 2024 15:10:54 -0400 Subject: [PATCH] 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. --- source/blender/blenkernel/intern/pbvh.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/blenkernel/intern/pbvh.cc b/source/blender/blenkernel/intern/pbvh.cc index 21af091b062..4cebcdee912 100644 --- a/source/blender/blenkernel/intern/pbvh.cc +++ b/source/blender/blenkernel/intern/pbvh.cc @@ -1281,6 +1281,9 @@ void update_normals(PBVH &pbvh, SubdivCCG *subdiv_ccg) { Vector 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);