[Bf-blender-cvs] [ae6c063b338] temp-geometry-nodes-fields-prototype: don't show anonymous attributes in spreadsheet

Jacques Lucke noreply at git.blender.org
Thu Jul 29 21:41:14 CEST 2021


Commit: ae6c063b3380638b86bcd0f16129eb299e87659b
Author: Jacques Lucke
Date:   Thu Jul 29 21:03:52 2021 +0200
Branches: temp-geometry-nodes-fields-prototype
https://developer.blender.org/rBae6c063b3380638b86bcd0f16129eb299e87659b

don't show anonymous attributes in spreadsheet

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

M	source/blender/blenkernel/BKE_attribute_access.hh
M	source/blender/blenkernel/intern/attribute_access.cc
M	source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc

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

diff --git a/source/blender/blenkernel/BKE_attribute_access.hh b/source/blender/blenkernel/BKE_attribute_access.hh
index c3f7dbd4bd9..4c9af9f8a5a 100644
--- a/source/blender/blenkernel/BKE_attribute_access.hh
+++ b/source/blender/blenkernel/BKE_attribute_access.hh
@@ -37,10 +37,12 @@
 struct AttributeMetaData {
   AttributeDomain domain;
   CustomDataType data_type;
+  const AnonymousCustomDataLayerID *anonymous_layer_id = nullptr;
 
   constexpr friend bool operator==(AttributeMetaData a, AttributeMetaData b)
   {
-    return (a.domain == b.domain) && (a.data_type == b.data_type);
+    return (a.domain == b.domain) && (a.data_type == b.data_type) &&
+           (a.anonymous_layer_id == b.anonymous_layer_id);
   }
 };
 
diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc
index b1ed72bf258..051a257dc00 100644
--- a/source/blender/blenkernel/intern/attribute_access.cc
+++ b/source/blender/blenkernel/intern/attribute_access.cc
@@ -587,7 +587,7 @@ bool CustomDataAttributeProvider::foreach_attribute(const GeometryComponent &com
   for (const CustomDataLayer &layer : Span(custom_data->layers, custom_data->totlayer)) {
     const CustomDataType data_type = (CustomDataType)layer.type;
     if (this->type_is_supported(data_type)) {
-      AttributeMetaData meta_data{domain_, data_type};
+      AttributeMetaData meta_data{domain_, data_type, layer.anonymous_id};
       if (!callback(layer.name, meta_data)) {
         return false;
       }
@@ -811,7 +811,7 @@ bool CustomDataAttributes::foreach_attribute(const AttributeForeachCallback call
                                              const AttributeDomain domain) const
 {
   for (const CustomDataLayer &layer : Span(data.layers, data.totlayer)) {
-    AttributeMetaData meta_data{domain, (CustomDataType)layer.type};
+    AttributeMetaData meta_data{domain, (CustomDataType)layer.type, layer.anonymous_id};
     if (!callback(layer.name, meta_data)) {
       return false;
     }
diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
index e38c70afd0f..eaec43f0208 100644
--- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
+++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc
@@ -49,6 +49,9 @@ void GeometryDataSource::foreach_default_column_ids(
     if (meta_data.domain != domain_) {
       return true;
     }
+    if (meta_data.anonymous_layer_id != nullptr) {
+      return true;
+    }
     SpreadsheetColumnID column_id;
     column_id.name = (char *)name.c_str();
     fn(column_id);



More information about the Bf-blender-cvs mailing list