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:
authorJacques Lucke <jacques@blender.org>2021-04-21 18:07:00 +0300
committerJacques Lucke <jacques@blender.org>2021-04-21 18:07:00 +0300
commit3da74c1c18dca19af9e2745ff9ea5ad587f3b47e (patch)
tree4251da06ea442046ad485c5b9490513a47f34e15 /source/blender/blenkernel/BKE_geometry_set.hh
parent1dd17726f2a17483b62e762da26a236d6440f8a9 (diff)
Geometry Nodes: add method to get attribute by name and type
This is needed by the upcoming Attribute Transfer node. It changes its behavior based on what domain the attribute is on.
Diffstat (limited to 'source/blender/blenkernel/BKE_geometry_set.hh')
-rw-r--r--source/blender/blenkernel/BKE_geometry_set.hh6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh
index bfb4afe085c..38f692fee0e 100644
--- a/source/blender/blenkernel/BKE_geometry_set.hh
+++ b/source/blender/blenkernel/BKE_geometry_set.hh
@@ -158,6 +158,12 @@ class GeometryComponent {
std::unique_ptr<blender::fn::GVArray> attribute_try_get_for_read(
const blender::StringRef attribute_name, const AttributeDomain domain) const;
+ /* Get a virtual array to read data of an attribute with the given data type. The domain is
+ * left unchanged. Returns null when the attribute does not exist or cannot be converted to the
+ * requested data type. */
+ blender::bke::ReadAttributeLookup attribute_try_get_for_read(
+ const blender::StringRef attribute_name, const CustomDataType data_type) const;
+
/* Get a virtual array to read the data of an attribute. If that is not possible, the returned
* virtual array will contain a default value. This never returns null. */
std::unique_ptr<blender::fn::GVArray> attribute_get_for_read(