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-14 20:43:46 +0300
committerHans Goudey <h.goudey@me.com>2020-12-14 20:43:54 +0300
commit49ec3cef69bf183b488b680b7ab98105ce8acdd0 (patch)
treec67027a2750b27ab5a86401fa9197b07f55d6650 /source/blender/nodes/NOD_geometry_exec.hh
parent010f44b855cab664126975543e0e760576202d85 (diff)
Geometry Nodes: Input data type utility function
This commit adds a simple utility function for getting the data type of an attribute or its "constant" socket counterparts. No functional changes. Differential Revision: https://developer.blender.org/D9819
Diffstat (limited to 'source/blender/nodes/NOD_geometry_exec.hh')
-rw-r--r--source/blender/nodes/NOD_geometry_exec.hh11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/nodes/NOD_geometry_exec.hh b/source/blender/nodes/NOD_geometry_exec.hh
index a7df4bc3e1b..5fe554e0478 100644
--- a/source/blender/nodes/NOD_geometry_exec.hh
+++ b/source/blender/nodes/NOD_geometry_exec.hh
@@ -168,10 +168,21 @@ class GeoNodeExecParams {
return this->get_input_attribute(name, component, domain, type, &default_value);
}
+ /**
+ * Get the type of an input property or the associated constant socket types with the
+ * same names. Fall back to the default value if no attribute exists with the name.
+ */
+ CustomDataType get_input_attribute_data_type(const StringRef name,
+ const GeometryComponent &component,
+ const CustomDataType default_type) const;
+
private:
/* Utilities for detecting common errors at when using this class. */
void check_extract_input(StringRef identifier, const CPPType *requested_type = nullptr) const;
void check_set_output(StringRef identifier, const CPPType &value_type) const;
+
+ /* Find the active socket socket with the input name (not the identifier). */
+ const bNodeSocket *find_available_socket(const StringRef name) const;
};
} // namespace blender::nodes