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-10-22 12:56:05 +0300
committerJacques Lucke <jacques@blender.org>2021-10-22 12:56:19 +0300
commitd1fcf93f039b0546dfd01c33daf50bd135e34344 (patch)
treef51cc44167af77a2e56c53c3fc073082be431054 /source/blender/nodes/NOD_node_declaration.hh
parent675a22b3415919740d7adc01d823b9507e30a918 (diff)
Geometry Nodes: disable attribute search for non-attribute string sockets
This is a simplified version of D12730 by @erik85. I added attribute search only to one legacy node for testing purposes.
Diffstat (limited to 'source/blender/nodes/NOD_node_declaration.hh')
-rw-r--r--source/blender/nodes/NOD_node_declaration.hh14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/nodes/NOD_node_declaration.hh b/source/blender/nodes/NOD_node_declaration.hh
index da0ce6a3907..1481e69c00e 100644
--- a/source/blender/nodes/NOD_node_declaration.hh
+++ b/source/blender/nodes/NOD_node_declaration.hh
@@ -88,6 +88,7 @@ class SocketDeclaration {
bool hide_value_ = false;
bool is_multi_input_ = false;
bool no_mute_links_ = false;
+ bool is_attribute_name_ = false;
InputSocketFieldType input_field_type_ = InputSocketFieldType::None;
OutputFieldDependency output_field_dependency_;
@@ -105,6 +106,7 @@ class SocketDeclaration {
StringRefNull name() const;
StringRefNull description() const;
StringRefNull identifier() const;
+ bool is_attribute_name() const;
InputSocketFieldType input_field_type() const;
const OutputFieldDependency &output_field_dependency() const;
@@ -163,6 +165,12 @@ class SocketDeclarationBuilder : public BaseSocketDeclarationBuilder {
return *(Self *)this;
}
+ Self &is_attribute_name(bool value = true)
+ {
+ decl_->is_attribute_name_ = value;
+ return *(Self *)this;
+ }
+
/** The input socket allows passing in a field. */
Self &supports_field()
{
@@ -349,6 +357,12 @@ inline StringRefNull SocketDeclaration::description() const
{
return description_;
}
+
+inline bool SocketDeclaration::is_attribute_name() const
+{
+ return is_attribute_name_;
+}
+
inline InputSocketFieldType SocketDeclaration::input_field_type() const
{
return input_field_type_;