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>2020-12-10 19:50:37 +0300
committerHans Goudey <h.goudey@me.com>2020-12-10 19:50:37 +0300
commit8bdd996cd0de794f21d5f201a3af0a9cca9e8e5e (patch)
tree20031b69a7fdc185097d7d087c8e177fe6d25dd5 /source/blender/blenkernel/intern
parent3d25312617019178455dc6f68166c65c687a7041 (diff)
Geometry Nodes: Add helper function to check if attribute exists
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/attribute_access.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc
index d79168d5443..282e9bc2962 100644
--- a/source/blender/blenkernel/intern/attribute_access.cc
+++ b/source/blender/blenkernel/intern/attribute_access.cc
@@ -590,6 +590,15 @@ Set<std::string> GeometryComponent::attribute_names() const
return {};
}
+bool GeometryComponent::attribute_exists(const blender::StringRef attribute_name) const
+{
+ ReadAttributePtr attribute = this->attribute_try_get_for_read(attribute_name);
+ if (attribute) {
+ return true;
+ }
+ return false;
+}
+
static ReadAttributePtr try_adapt_data_type(ReadAttributePtr attribute,
const blender::fn::CPPType &to_type)
{