Mesh: Remove unnecessary wrapper_type_finalize logic
commit4bdf5bf2e289039b869ab91f1d25539e00a66b04
authorHans Goudey <hans@blender.org>
Wed, 3 Apr 2024 12:15:31 +0000 (3 14:15 +0200)
committerHans Goudey <hooglyboogly@noreply.localhost>
Wed, 3 Apr 2024 12:15:31 +0000 (3 14:15 +0200)
tree5772a776ab69c868d9e2c07c7168e1520800806a
parente7339bdd5fcc8f93be5a27ee183cb1c361e02b30
Mesh: Remove unnecessary wrapper_type_finalize logic

After some discussions and investigation over the last couple months,
it's not clear what the "wrapper type finalize" logic is necessary for.
For edit meshes and regular meshes, normals are calculated lazily when
building the draw cache.

Apart from the unnecessary complication for mesh GPU draw data
extraction, this code also causes normals to always be calculated
when turning an edit mesh wrapper into a regular mesh. However, those
normals are immediately discarded since the edit deform cache is deleted
in the next line.

Beyond the obvious simplification, the motivation for this change is to
avoid requesting write access on the evaluated mesh and cage mesh. This
works better with implicit sharing, allowing other improvements.

Pull Request: https://projects.blender.org/blender/blender/pulls/120066
source/blender/blenkernel/BKE_mesh.h
source/blender/blenkernel/BKE_mesh_types.hh
source/blender/blenkernel/intern/DerivedMesh.cc
source/blender/blenkernel/intern/mesh.cc
source/blender/blenkernel/intern/mesh_wrapper.cc