[Bf-blender-cvs] [0c5ccae79d6] master: Fix: Incorrect logic in mesh validation for removing layers

Hans Goudey noreply at git.blender.org
Thu Jan 13 23:36:56 CET 2022


Commit: 0c5ccae79d62127106af589f2d732cf40aa5213a
Author: Hans Goudey
Date:   Thu Jan 13 16:36:50 2022 -0600
Branches: master
https://developer.blender.org/rB0c5ccae79d62127106af589f2d732cf40aa5213a

Fix: Incorrect logic in mesh validation for removing layers

The mask is only used if it's not zero. Adding the normal mask made
it not zero, but it didn't include anything else, so all custom data
layers except normals were removed. The fix is to only add normals
to the mask when it should be used.

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

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 f11e8b3f93c..005c916b4e0 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -1008,13 +1008,12 @@ bool BKE_mesh_validate_all_customdata(CustomData *vdata,
   CustomData_MeshMasks mask = {0};
   if (check_meshmask) {
     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;
   }
 
-  /* 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(



More information about the Bf-blender-cvs mailing list