diff --git a/source/blender/nodes/NOD_node_declaration.hh b/source/blender/nodes/NOD_node_declaration.hh index 9691de65a75..be9212b01de 100644 --- a/source/blender/nodes/NOD_node_declaration.hh +++ b/source/blender/nodes/NOD_node_declaration.hh @@ -569,6 +569,8 @@ class NodeDeclarationBuilder { /* Mark the most recent builder as 'complete' when changing builders * so no more items can be added. */ void set_active_panel_builder(const PanelDeclarationBuilder *panel_builder); + + void build_remaining_anonymous_attribute_relations(); }; namespace implicit_field_inputs { @@ -696,6 +698,15 @@ inline typename DeclType::Builder &NodeDeclarationBuilder::add_socket(StringRef output_socket_builders_.append(&*socket_decl_builder); } + if (is_function_node_) { + if (in_out == SOCK_IN) { + socket_decl_builder->supports_field(); + } + else { + socket_decl_builder->dependent_field(); + } + } + Builder &socket_decl_builder_ref = *socket_decl_builder; socket_builders_.append(std::move(socket_decl_builder)); diff --git a/source/blender/nodes/intern/node_declaration.cc b/source/blender/nodes/intern/node_declaration.cc index 819a6728029..9c1c1aa9019 100644 --- a/source/blender/nodes/intern/node_declaration.cc +++ b/source/blender/nodes/intern/node_declaration.cc @@ -33,21 +33,8 @@ void build_node_declaration(const bNodeType &typeinfo, node_decl_builder.finalize(); } -void NodeDeclarationBuilder::finalize() +void NodeDeclarationBuilder::build_remaining_anonymous_attribute_relations() { - if (is_function_node_) { - for (BaseSocketDeclarationBuilder *socket_builder : input_socket_builders_) { - if (socket_builder->decl_base_->input_field_type != InputSocketFieldType::Implicit) { - socket_builder->decl_base_->input_field_type = InputSocketFieldType::IsSupported; - } - } - for (BaseSocketDeclarationBuilder *socket_builder : output_socket_builders_) { - socket_builder->decl_base_->output_field_dependency = - OutputFieldDependency::ForDependentField(); - socket_builder->reference_pass_all_ = true; - } - } - Vector geometry_inputs; for (const int i : declaration_.inputs.index_range()) { if (dynamic_cast(declaration_.inputs[i])) { @@ -96,7 +83,11 @@ void NodeDeclarationBuilder::finalize() } } } +} +void NodeDeclarationBuilder::finalize() +{ + this->build_remaining_anonymous_attribute_relations(); BLI_assert(declaration_.is_valid()); }