238 int compositor_domain_priority_ = -1;
242 bool compositor_expects_single_value_ =
false;
245 std::function<void(
bNode &)> make_available_fn_;
323 std::optional<std::string> value = std::nullopt);
457template<
typename SocketDecl>
460 using Self =
typename SocketDecl::Builder;
461 static_assert(std::is_base_of_v<SocketDeclaration, SocketDecl>);
476 std::function<DrawNodeLayoutFn>
draw;
500 friend NodeDeclarationBuilder;
532 template<
typename DeclType>
537 template<
typename DeclType>
539 template<
typename DeclType>
573 this->parent_panel_decl = &
decl;
626 MEM_CXX_CLASS_ALLOC_FUNCS(
"NodeDeclaration")
634 const bNode *node_ =
nullptr;
639 bool is_function_node_ =
false;
641 friend DeclarationListBuilder;
647 const bNode *node =
nullptr);
651 declaration_.is_context_dependent =
true;
657 declaration_.is_context_dependent =
true;
667 is_function_node_ =
true;
677 if (!declaration_.anonymous_attribute_relations_) {
678 declaration_.anonymous_attribute_relations_ = std::make_unique<aal::RelationsInNode>();
680 return *declaration_.anonymous_attribute_relations_;
689 void build_remaining_anonymous_attribute_relations();
709template<
typename DeclType>
716template<
typename DeclType>
723template<
typename DeclType>
728 static_assert(std::is_base_of_v<SocketDeclaration, DeclType>);
729 using SocketBuilder =
typename DeclType::Builder;
733 std::unique_ptr<SocketBuilder> socket_decl_builder_ptr = std::make_unique<SocketBuilder>();
734 SocketBuilder &socket_decl_builder = *socket_decl_builder_ptr;
735 this->node_decl_builder.socket_builders_.append(std::move(socket_decl_builder_ptr));
737 std::unique_ptr<DeclType> socket_decl_ptr = std::make_unique<DeclType>();
738 DeclType &socket_decl = *socket_decl_ptr;
739 this->node_decl_builder.declaration_.
all_items.
append(std::move(socket_decl_ptr));
740 this->items.
append(&socket_decl);
742 socket_decl.parent = this->parent_panel_decl;
743 socket_decl_builder.node_decl_builder_ = &this->node_decl_builder;
745 socket_decl_builder.decl_ = &socket_decl;
746 socket_decl_builder.decl_base_ = &socket_decl;
747 socket_decl.name = name;
748 socket_decl.identifier = identifier.
is_empty() ? name : identifier;
749 socket_decl.in_out = in_out;
750 socket_decl.socket_type = DeclType::static_socket_type;
752 if (this->node_decl_builder.is_function_node_) {
754 socket_decl_builder.supports_field();
757 socket_decl_builder.dependent_field();
762 this->node_decl_builder.input_socket_builders_.append(&socket_decl_builder);
763 socket_decl.index = this->node_decl_builder.declaration_.
inputs.append_and_get_index(
767 this->node_decl_builder.output_socket_builders_.append(&socket_decl_builder);
768 socket_decl.index = this->node_decl_builder.declaration_.
outputs.append_and_get_index(
771 return socket_decl_builder;
#define BLI_STRUCT_EQUALITY_OPERATORS_5(Type, m1, m2, m3, m4, m5)
#define BLI_STRUCT_EQUALITY_OPERATORS_2(Type, m1, m2)
BMesh const char void * data
void append(const T &value)
constexpr bool is_empty() const
void append(const T &value)
BaseSocketDeclarationBuilder & is_layer_name(bool value=true)
BaseSocketDeclarationBuilder & dependent_field()
BaseSocketDeclarationBuilder & align_with_previous(bool value=true)
BaseSocketDeclarationBuilder & make_available(std::function< void(bNode &)> fn)
NodeDeclarationBuilder * node_decl_builder_
BaseSocketDeclarationBuilder & field_source()
BaseSocketDeclarationBuilder & compositor_realization_mode(CompositorInputRealizationMode value)
friend class DeclarationListBuilder
BaseSocketDeclarationBuilder & propagate_all()
BaseSocketDeclarationBuilder & available(bool value=true)
BaseSocketDeclarationBuilder & implicit_field(NodeDefaultInputType default_input)
BaseSocketDeclarationBuilder & field_on_all()
BaseSocketDeclarationBuilder & is_attribute_name(bool value=true)
BaseSocketDeclarationBuilder & reference_pass(Span< int > input_indices)
BaseSocketDeclarationBuilder & compact(bool value=true)
BaseSocketDeclarationBuilder & structure_type(StructureType structure_type)
BaseSocketDeclarationBuilder & description(std::string value="")
BaseSocketDeclarationBuilder & socket_name_ptr(PointerRNA ptr, StringRef property_name)
BaseSocketDeclarationBuilder & compositor_expects_single_value(bool value=true)
BaseSocketDeclarationBuilder & short_label(std::string value="")
BaseSocketDeclarationBuilder & supports_field()
BaseSocketDeclarationBuilder & hide_label(bool value=true)
BaseSocketDeclarationBuilder & implicit_field_on_all(NodeDefaultInputType default_input)
BaseSocketDeclarationBuilder & translation_context(std::optional< std::string > value=std::nullopt)
BaseSocketDeclarationBuilder & multi_input(bool value=true)
BaseSocketDeclarationBuilder & custom_draw(CustomSocketDrawFn fn)
BaseSocketDeclarationBuilder & panel_toggle(bool value=true)
BaseSocketDeclarationBuilder & is_default_link_socket(bool value=true)
BaseSocketDeclarationBuilder & compositor_domain_priority(int priority)
friend class NodeDeclarationBuilder
BaseSocketDeclarationBuilder & field_source_reference_all()
virtual ~BaseSocketDeclarationBuilder()=default
BaseSocketDeclarationBuilder & field_on(Span< int > indices)
BaseSocketDeclarationBuilder & hide_value(bool value=true)
BaseSocketDeclarationBuilder & propagate_all_instance_attributes()
SocketDeclaration * decl_base_
BaseSocketDeclarationBuilder & implicit_field_on(NodeDefaultInputType default_input, Span< int > input_indices)
BaseSocketDeclarationBuilder & no_muted_links(bool value=true)
BaseSocketDeclarationBuilder & reference_pass_all()
BaseSocketDeclarationBuilder & default_input_type(NodeDefaultInputType value)
DeclType::Builder & add_output(StringRef name, StringRef identifier="")
DeclType::Builder & add_socket(StringRef name, StringRef identifier, eNodeSocketInOut in_out)
void add_default_layout()
void add_layout(std::function< void(uiLayout *, bContext *, PointerRNA *)> draw)
NodeDeclarationBuilder & node_decl_builder
PanelDeclaration * parent_panel_decl
Vector< ItemDeclaration * > & items
PanelDeclarationBuilder & add_panel(StringRef name, int identifier=-1)
DeclType::Builder & add_input(StringRef name, StringRef identifier="")
DeclarationListBuilder(NodeDeclarationBuilder &node_decl_builder, Vector< ItemDeclaration * > &items)
const PanelDeclaration * parent
virtual ~ItemDeclaration()=default
std::function< DrawNodeLayoutFn > draw
NodeDeclarationBuilder(const bke::bNodeType &typeinfo, NodeDeclaration &declaration, const bNodeTree *ntree=nullptr, const bNode *node=nullptr)
const bNodeTree * tree_or_null() const
void allow_any_socket_order(bool enable=true)
aal::RelationsInNode & get_anonymous_attribute_relations()
const bNode * node_or_null() const
NodeDeclaration & declaration()
void use_custom_socket_order(bool enable=true)
std::unique_ptr< aal::RelationsInNode > anonymous_attribute_relations_
Vector< ItemDeclaration * > root_items
bool skip_updating_sockets
bool allow_any_socket_order
Vector< SocketDeclaration * > inputs
void assert_valid() const
bool matches(const bNode &node) const
const aal::RelationsInNode * anonymous_attribute_relations() const
friend NodeDeclarationBuilder
bool is_context_dependent
Vector< SocketDeclaration * > outputs
bool use_custom_socket_order
Vector< PanelDeclaration * > panels
Vector< ItemDeclarationPtr > all_items
Span< SocketDeclaration * > sockets(eNodeSocketInOut in_out) const
static OutputFieldDependency ForPartiallyDependentField(Vector< int > indices)
static OutputFieldDependency ForDataSource()
static OutputFieldDependency ForDependentField()
Span< int > linked_input_indices() const
static OutputFieldDependency ForFieldSource()
OutputSocketFieldType field_type() const
Self & default_closed(bool closed)
Self & description(std::string value="")
Self & translation_context(std::optional< std::string > value=std::nullopt)
PanelDeclarationBuilder(NodeDeclarationBuilder &node_builder, PanelDeclaration &decl)
friend class NodeDeclarationBuilder
PanelDeclarationBuilder Self
std::optional< std::string > translation_context
friend class PanelDeclarationBuilder
Vector< ItemDeclaration * > items
~PanelDeclaration() override=default
void update_or_build(const bNodePanelState &old_panel, bNodePanelState &new_panel) const
bool matches(const bNodePanelState &panel) const
PanelDeclaration * parent_panel
const SocketDeclaration * panel_input_decl() const
void build(bNodePanelState &panel) const
friend class DeclarationListBuilder
friend class NodeDeclarationBuilder
typename SocketDecl::Builder Self
virtual bool matches(const bNodeSocket &socket) const =0
std::unique_ptr< SocketNameRNA > socket_name_rna
std::unique_ptr< CustomSocketDrawFn > custom_draw_fn
friend class BaseSocketDeclarationBuilder
bool align_with_previous_socket
bool matches_common_data(const bNodeSocket &socket) const
int compositor_domain_priority() const
StructureType structure_type
eNodeSocketDatatype socket_type
OutputFieldDependency output_field_dependency
const CompositorInputRealizationMode & compositor_realization_mode() const
void make_available(bNode &node) const
NodeDefaultInputType default_input_type
friend NodeDeclarationBuilder
~SocketDeclaration() override=default
bool is_default_link_socket
virtual bool can_connect(const bNodeSocket &socket) const =0
std::optional< std::string > translation_context
friend class SocketDeclarationBuilder
virtual bNodeSocket & update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const
bool compositor_expects_single_value() const
void set_common_flags(bNodeSocket &socket) const
virtual bNodeSocket & build(bNodeTree &ntree, bNode &node) const =0
InputSocketFieldType input_field_type
std::ostream & operator<<(std::ostream &stream, const RelationsInNode &relations)
CompositorInputRealizationMode
std::unique_ptr< SocketDeclaration > SocketDeclarationPtr
std::optional< ImplicitInputValueFn > get_implicit_input_value_fn(const NodeDefaultInputType type)
void(uiLayout *, bContext *, PointerRNA *) DrawNodeLayoutFn
void build_node_declaration(const bke::bNodeType &typeinfo, NodeDeclaration &r_declaration, const bNodeTree *ntree, const bNode *node)
std::unique_ptr< ItemDeclaration > ItemDeclarationPtr
bool socket_type_supports_default_input_type(const bke::bNodeSocketType &socket_type, const NodeDefaultInputType input_type)
std::function< void(CustomSocketDrawParams ¶ms)> CustomSocketDrawFn
std::unique_ptr< SocketDeclaration > make_declaration_for_socket_type(const eNodeSocketDatatype socket_type)
std::unique_ptr< PanelDeclaration > PanelDeclarationPtr
std::function< void(const bNode &node, void *r_value)> ImplicitInputValueFn
const PointerRNA PointerRNA_NULL
Array< InputSocketFieldType > inputs
Array< OutputFieldDependency > outputs
std::string property_name
Array< int > linked_inputs
Array< StructureType > inputs
Array< OutputDependency > outputs
Vector< AvailableRelation > available_relations
Vector< ReferenceRelation > reference_relations
Vector< int > available_on_none
Vector< EvalRelation > eval_relations
Vector< PropagateRelation > propagate_relations