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.
This commit is contained in:
@@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user