From 1730ba23ec7a2fa9a00e1928fa991b6172cffb07 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 3 Sep 2024 16:34:06 +0200 Subject: [PATCH] Fix: Crash when toggling dynamic topology off Before some recent refactors, normals were always calculated when creating the sculpt BVH tree. Switching from dyntopo BMesh back to base mesh sculpting, that didn't happen anymore. Nowadays it makes more sense to update the normals as necessary where they are used, so the intent of the code that uses normals is clearer. Pull Request: https://projects.blender.org/blender/blender/pulls/127111 --- source/blender/editors/sculpt_paint/sculpt.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/editors/sculpt_paint/sculpt.cc b/source/blender/editors/sculpt_paint/sculpt.cc index e9bcdebc63e..5d47cd3c07e 100644 --- a/source/blender/editors/sculpt_paint/sculpt.cc +++ b/source/blender/editors/sculpt_paint/sculpt.cc @@ -5036,6 +5036,8 @@ bool SCULPT_cursor_geometry_info_update(bContext *C, return true; } + bke::pbvh::update_normals(*depsgraph, ob, *ss.pbvh); + /* Calculate the sampled normal. */ if (const std::optional sampled_normal = calc_area_normal( *depsgraph, brush, ob, node_mask))