Hans Goudey 5fdf7deb57 Sculpt: Remove duplicate BVH tree positions storage
When there is a deform modifier or shape keys, currently the evaluated
position array is copied to a duplicate array on the sculpt PBVH tree.
Historically most code has used this array directly, so the code has
been a bit confusing, but conceptually this is just supposed to be
the evaluated positions.

Instead of editing the BVH tree position array while sculpting, we
can edit the arrays on the evaluated mesh directly-- or the original
mesh when there are no deform modifiers.

Removing this array reduces memory usage and plays better with implicit
sharing since we don't need to unshare the attribute just to store a
mutable copy.

The remaining non-ideal part is sculpt mode's use of a specialized
crazy-space function `BKE_crazyspace_build_sculpt` for building the
evaluated position array rather than using the general system for
retrieving deformed mesh data, `BKE_object_get_mesh_deform_eval`.
This should be replaced at some point.

This change makes clear a few simplifications for sculpt normals
recomputation, because we can store the normals for all cases as
a shared cache, unifying the code paths for original and deformed
normals.

Part of #118145.

Pull Request: https://projects.blender.org/blender/blender/pulls/126382
2024-08-22 21:00:25 +02:00
2023-12-08 13:28:13 +11:00

Blender

Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.

Blender screenshot

Project Pages

Development

License

Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.

See blender.org/about/license for details.

Description
No description provided
Readme 841 MiB
Languages
C++ 78%
Python 14.9%
C 2.9%
GLSL 1.9%
CMake 1.2%
Other 0.9%