[Bf-blender-cvs] [17770192fb0] master: Tests: exclude anonymous attributes from mesh comparison

Jacques Lucke noreply at git.blender.org
Wed Nov 24 10:38:51 CET 2021


Commit: 17770192fb0c5fddda709a37986c98b4cfcfb99b
Author: Jacques Lucke
Date:   Wed Nov 24 10:37:06 2021 +0100
Branches: master
https://developer.blender.org/rB17770192fb0c5fddda709a37986c98b4cfcfb99b

Tests: exclude anonymous attributes from mesh comparison

The set of anonymous attributes on a geometry is not visible to the user.

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

M	source/blender/blenkernel/intern/mesh.cc

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

diff --git a/source/blender/blenkernel/intern/mesh.cc b/source/blender/blenkernel/intern/mesh.cc
index 56e5435c68c..3f115d98891 100644
--- a/source/blender/blenkernel/intern/mesh.cc
+++ b/source/blender/blenkernel/intern/mesh.cc
@@ -442,13 +442,15 @@ static int customdata_compare(
   const uint64_t cd_mask_all_attr = CD_MASK_PROP_ALL | cd_mask_non_generic;
 
   for (int i = 0; i < c1->totlayer; i++) {
-    if (CD_TYPE_AS_MASK(c1->layers[i].type) & cd_mask_all_attr) {
+    l1 = &c1->layers[i];
+    if (CD_TYPE_AS_MASK(l1->type) & cd_mask_all_attr && l1->anonymous_id != nullptr) {
       layer_count1++;
     }
   }
 
   for (int i = 0; i < c2->totlayer; i++) {
-    if (CD_TYPE_AS_MASK(c2->layers[i].type) & cd_mask_all_attr) {
+    l2 = &c2->layers[i];
+    if (CD_TYPE_AS_MASK(l1->type) & cd_mask_all_attr && l2->anonymous_id != nullptr) {
       layer_count2++;
     }
   }
@@ -464,7 +466,8 @@ static int customdata_compare(
     l1 = c1->layers + i1;
     for (int i2 = 0; i2 < c2->totlayer; i2++) {
       l2 = c2->layers + i2;
-      if (l1->type != l2->type || !STREQ(l1->name, l2->name)) {
+      if (l1->type != l2->type || !STREQ(l1->name, l2->name) || l1->anonymous_id != nullptr ||
+          l2->anonymous_id != nullptr) {
         continue;
       }
       /* At this point `l1` and `l2` have the same name and type, so they should be compared. */



More information about the Bf-blender-cvs mailing list