diff options
author | Hans Goudey <h.goudey@me.com> | 2022-04-19 07:48:43 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-04-19 07:48:43 +0300 |
commit | 8c25889bb67db4c1d2f94bf85ca6d1c2a050fcfe (patch) | |
tree | 772697b82ecd172e577ef11779543c523b4e86f8 /source/blender/blenkernel/intern/mesh_runtime.cc | |
parent | 775f0d76d55b2977c30dcd0f9306437ae520d63f (diff) |
Refactor: Move mesh face dot tag out of MVert
Continuing the refactors described in T93602, this commit moves
the face dot tag set by the subdivision surface modifier out of
`MVert` to `MeshRuntime`. This clarifies its status as runtime data
and allows further refactoring of mesh positions in the future.
Before, `BKE_modifiers_uses_subsurf_facedots` was used to check
whether subsurf face dots should be drawn, but now we can just check
if the tags exist on the mesh. Modifiers that create new new geometry
or modify topology will already remove the array by clearing mesh
runtime data.
Differential Revision: https://developer.blender.org/D14680
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_runtime.cc')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_runtime.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/mesh_runtime.cc b/source/blender/blenkernel/intern/mesh_runtime.cc index b06e867cf37..90e9a2a2ff6 100644 --- a/source/blender/blenkernel/intern/mesh_runtime.cc +++ b/source/blender/blenkernel/intern/mesh_runtime.cc @@ -86,6 +86,7 @@ void BKE_mesh_runtime_reset_on_copy(Mesh *mesh, const int UNUSED(flag)) runtime->looptris = blender::dna::shallow_zero_initialize(); runtime->bvh_cache = nullptr; runtime->shrinkwrap_data = nullptr; + runtime->subsurf_face_dot_tags = nullptr; runtime->vert_normals_dirty = true; runtime->poly_normals_dirty = true; @@ -254,6 +255,8 @@ void BKE_mesh_runtime_clear_geometry(Mesh *mesh) mesh->runtime.subdiv_ccg = nullptr; } BKE_shrinkwrap_discard_boundary_data(mesh); + + MEM_SAFE_FREE(mesh->runtime.subsurf_face_dot_tags); } /** \} */ |