diff options
author | Hans Goudey <h.goudey@me.com> | 2022-06-24 23:48:48 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-06-24 23:48:48 +0300 |
commit | fca94c5e0d6f8a98cb5fd3424141f5615f2445b2 (patch) | |
tree | 43a7c130eedc71051af6fb8b924257e1f976a614 /source/blender/blenkernel/intern/mesh_runtime.cc | |
parent | f6290cd2a448e0f632d3caf489e618077ce21a81 (diff) |
Fix: Incorrect dirty normal tag after mesh translation
Mistake in 54182e4925de4ee. The dirty flag was always cleared,
but we only want to clear it after translating a mesh if it normals
were already non-dirty.
Diffstat (limited to 'source/blender/blenkernel/intern/mesh_runtime.cc')
-rw-r--r-- | source/blender/blenkernel/intern/mesh_runtime.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/mesh_runtime.cc b/source/blender/blenkernel/intern/mesh_runtime.cc index d4bc47d5fd4..4521c519f45 100644 --- a/source/blender/blenkernel/intern/mesh_runtime.cc +++ b/source/blender/blenkernel/intern/mesh_runtime.cc @@ -268,10 +268,17 @@ 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 vertices moved by the same amount. */ - BKE_mesh_poly_normals_clear_dirty(mesh); - BKE_mesh_vertex_normals_clear_dirty(mesh); + if (!vert_normals_were_dirty) { + BKE_mesh_poly_normals_clear_dirty(mesh); + } + if (!poly_normals_were_dirty) { + BKE_mesh_vertex_normals_clear_dirty(mesh); + } } /** \} */ |