From 49ec3cef69bf183b488b680b7ab98105ce8acdd0 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 14 Dec 2020 11:43:46 -0600 Subject: 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 --- source/blender/nodes/NOD_geometry_exec.hh | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/blender/nodes/NOD_geometry_exec.hh') 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 -- cgit v1.2.3