Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-06-24 23:48:48 +0300
committerHans Goudey <h.goudey@me.com>2022-06-24 23:48:48 +0300
commitfca94c5e0d6f8a98cb5fd3424141f5615f2445b2 (patch)
tree43a7c130eedc71051af6fb8b924257e1f976a614 /source/blender/blenkernel
parentf6290cd2a448e0f632d3caf489e618077ce21a81 (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')
-rw-r--r--source/blender/blenkernel/intern/mesh_runtime.cc11
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);
+ }
}
/** \} */