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.
This commit is contained in:
Hans Goudey 2022-11-15 23:58:34 -06:00
parent c8c14d1681
commit 1aa851e939
1 changed files with 3 additions and 11 deletions

View File

@ -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)