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
This commit is contained in:
Hans Goudey
2024-09-03 16:34:06 +02:00
committed by Hans Goudey
parent 8cf4d47fe2
commit 1730ba23ec

View File

@@ -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<float3> sampled_normal = calc_area_normal(
*depsgraph, brush, ob, node_mask))