[Bf-blender-cvs] [1aa851e9395] master: Mesh: Don't tag normals and triangluation dirty when translating

Hans Goudey noreply at git.blender.org
Wed Nov 16 06:58:42 CET 2022


Commit: 1aa851e9395ec0fa31c8bb150a686276e0e91591
Author: Hans Goudey
Date:   Tue Nov 15 23:58:34 2022 -0600
Branches: master
https://developer.blender.org/rB1aa851e9395ec0fa31c8bb150a686276e0e91591

Mesh: Don't tag normals and triangluation dirty when translating

This only applies to procedural operations rather than edit mode
operations, but it might save some recalculations of these caches
for the transform geometry node in some cases.

===================================================================

M	source/blender/blenkernel/intern/mesh_runtime.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/mesh_runtime.cc b/source/blender/blenkernel/intern/mesh_runtime.cc
index 19e5cdd291d..3f434ede774 100644
--- a/source/blender/blenkernel/intern/mesh_runtime.cc
+++ b/source/blender/blenkernel/intern/mesh_runtime.cc
@@ -269,17 +269,9 @@ void BKE_mesh_tag_coords_changed(Mesh *mesh)
 
 void BKE_mesh_tag_coords_changed_uniformly(Mesh *mesh)
 {
-  const bool vert_normals_were_dirty = BKE_mesh_vertex_normals_are_dirty(mesh);
-  const bool poly_normals_were_dirty = BKE_mesh_poly_normals_are_dirty(mesh);
-
-  BKE_mesh_tag_coords_changed(mesh);
-  /* The normals didn't change, since all verts moved by the same amount. */
-  if (!vert_normals_were_dirty) {
-    BKE_mesh_vertex_normals_clear_dirty(mesh);
-  }
-  if (!poly_normals_were_dirty) {
-    BKE_mesh_poly_normals_clear_dirty(mesh);
-  }
+  /* The normals and triangulation didn't change, since all verts moved by the same amount. */
+  free_bvh_cache(*mesh->runtime);
+  mesh->runtime->bounds_cache.tag_dirty();
 }
 
 bool BKE_mesh_is_deformed_only(const Mesh *mesh)



More information about the Bf-blender-cvs mailing list