diff options
author | Hans Goudey <h.goudey@me.com> | 2022-04-20 01:08:02 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-04-20 01:08:02 +0300 |
commit | 6a3c3c77b3ebdbcd44559bf91ea7d5cf3c5e4953 (patch) | |
tree | 619854e36d34502c1f81f0fd1ec7b0454fecc5b3 /source/blender/geometry | |
parent | 9ec94c3882a414dc60dd17abfa12838f94f63c24 (diff) |
Mesh: Avoid unnecessary normal calculation and dirty tags
This is mostly a cleanup to avoid hardcoding the eager calculation of
normals it isn't necessary, by reducing calls to `BKE_mesh_calc_normals`
and by removing calls to `BKE_mesh_normals_tag_dirty` when the mesh
is newly created and already has dirty normals anyway. This reduces
boilerplate code and makes the "dirty by default" state more clear.
Any regressions from this commit should be easy to fix, though the
lazy calculation is solid enough that none are expected.
Diffstat (limited to 'source/blender/geometry')
-rw-r--r-- | source/blender/geometry/intern/mesh_merge_by_distance.cc | 4 | ||||
-rw-r--r-- | source/blender/geometry/intern/realize_instances.cc | 2 |
2 files changed, 0 insertions, 6 deletions
diff --git a/source/blender/geometry/intern/mesh_merge_by_distance.cc b/source/blender/geometry/intern/mesh_merge_by_distance.cc index 9bb1cbb324e..e45b84632ab 100644 --- a/source/blender/geometry/intern/mesh_merge_by_distance.cc +++ b/source/blender/geometry/intern/mesh_merge_by_distance.cc @@ -1580,10 +1580,6 @@ static Mesh *create_merged_mesh(const Mesh &mesh, BLI_assert((int)r_i == result_npolys); BLI_assert(loop_cur == result_nloops); - /* We could only update the normals of the elements in context, but the next modifier can make it - * dirty anyway which would make the work useless. */ - BKE_mesh_normals_tag_dirty(result); - return result; } diff --git a/source/blender/geometry/intern/realize_instances.cc b/source/blender/geometry/intern/realize_instances.cc index 0a0f01c1ff2..f3f0e5b1fce 100644 --- a/source/blender/geometry/intern/realize_instances.cc +++ b/source/blender/geometry/intern/realize_instances.cc @@ -1015,8 +1015,6 @@ static void execute_realize_mesh_tasks(const RealizeInstancesOptions &options, if (vertex_ids) { vertex_ids.save(); } - - BKE_mesh_normals_tag_dirty(dst_mesh); } /** \} */ |