Commit: 46097744adc00db38d41b46c55497fc14f64f64f
Author: Hans Goudey
Date:   Thu Jan 13 12:29:09 2022 -0600
Branches: temp-vert-normals-cleanup
https://developer.blender.org/rB46097744adc00db38d41b46c55497fc14f64f64f

Fix: Mesh validation removes normal layers but doesn't tag dirty

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

M       source/blender/blenkernel/intern/mesh_validate.c

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

diff --git a/source/blender/blenkernel/intern/mesh_validate.c 
b/source/blender/blenkernel/intern/mesh_validate.c
index fb2a92b5797..f11e8b3f93c 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -304,6 +304,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
   }
 
   const float(*vert_normals)[3] = NULL;
+  BKE_mesh_assert_normals_dirty_or_calculated(mesh);
   if (!BKE_mesh_vertex_normals_are_dirty(mesh)) {
     vert_normals = BKE_mesh_vertex_normals_ensure(mesh);
   }
@@ -1009,6 +1010,11 @@ bool BKE_mesh_validate_all_customdata(CustomData *vdata,
     mask = CD_MASK_MESH;
   }
 
+  /* Normal data isn't in the mask since it is derived data,
+   * but it is valid and should not be removed. */
+  mask.vmask |= CD_MASK_NORMAL;
+  mask.pmask |= CD_MASK_NORMAL;
+
   is_valid &= mesh_validate_customdata(
       vdata, mask.vmask, totvert, do_verbose, do_fixes, &is_change_v);
   is_valid &= mesh_validate_customdata(

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to