From 684dbba6a124b248c457c41b45f72487fed3639c 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 2a10f434558..6536336cb21 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);