Blender V5.3
blender::SocketDeclaration Class Referenceabstract

#include <NOD_node_declaration.hh>

Inherits blender::nodes::ItemDeclaration.

Inherited by blender::nodes::decl::Bool, blender::nodes::decl::Bundle, blender::nodes::decl::Closure, blender::nodes::decl::Color, blender::nodes::decl::Custom, blender::nodes::decl::Extend, blender::nodes::decl::Float, blender::nodes::decl::Geometry, blender::nodes::decl::IDSocketDeclaration, blender::nodes::decl::Int, blender::nodes::decl::IntVector, blender::nodes::decl::Matrix, blender::nodes::decl::Menu, blender::nodes::decl::Rotation, blender::nodes::decl::Shader, blender::nodes::decl::String, and blender::nodes::decl::Vector.

Public Member Functions

 ~SocketDeclaration () override=default
virtual bNodeSocket & build (bNodeTree &ntree, bNode &node) const=0
virtual bool matches (const bNodeSocket &socket) const=0
virtual bNodeSocket & update_or_build (bNodeTree &ntree, bNode &node, bNodeSocket &socket) const
virtual bool can_connect (const bNodeSocket &socket) const=0
void make_available (bNode &node) const
const CompositorInputRealizationMode & compositor_realization_mode () const
int compositor_domain_priority () const
Public Member Functions inherited from blender::nodes::ItemDeclaration
virtual ~ItemDeclaration ()=default

Public Attributes

UString name
UString short_label
UString identifier
std::string description
std::optional< std::string > translation_context
eNodeSocketInOut in_out
eNodeSocketDatatype socket_type
bool optional_label = false
bool hide_value = false
bool compact = false
bool is_multi_input = false
bool no_mute_links = false
bool is_available = true
bool is_attribute_name = false
bool is_default_link_socket = false
bool align_with_previous_socket = false
bool is_panel_toggle = false
bool is_layer_name = false
bool is_volume_grid_name = false
bool is_anonymous_attribute_output = false
int index = -1
OutputStructureTypeDependency structure_type_output_dependency
StructureType structure_type = StructureType::Single
NodeDefaultInputType default_input_type = NodeDefaultInputType::NODE_DEFAULT_INPUT_VALUE
std::unique_ptr< SocketNameRNA > socket_name_rna
std::unique_ptr< CustomSocketDrawFn > custom_draw_fn
std::unique_ptr< CustomSocketLabelFn > label_fn
std::unique_ptr< SocketUsageInferenceFn > usage_inference_fn
friend NodeDeclarationBuilder
Public Attributes inherited from blender::nodes::ItemDeclaration
const PanelDeclaration * parent = nullptr

Protected Member Functions

void set_common_flags (bNodeSocket &socket) const
bool matches_common_data (const bNodeSocket &socket) const

Friends

class FlatBundleTypeBuilder
class BaseSocketDeclarationBuilder
template<typename SocketDecl>
class SocketDeclarationBuilder

Detailed Description

Describes a single input or output socket. This is subclassed for different socket types.

Definition at line 175 of file NOD_node_declaration.hh.

Constructor & Destructor Documentation

◆ ~SocketDeclaration()

Member Function Documentation

◆ build()

virtual bNodeSocket & blender::nodes::SocketDeclaration::build ( bNodeTree & ntree,
bNode & node ) const
pure virtual

◆ can_connect()

virtual bool blender::nodes::SocketDeclaration::can_connect ( const bNodeSocket & socket) const
pure virtual

Determine if a new socket described by this declaration could have a valid connection the other socket.

◆ compositor_domain_priority()

◆ compositor_realization_mode()

◆ make_available()

Change the node such that the socket will become visible. The node type's update method should be called afterwards.

Note
this is not necessarily implemented for all node types.

Definition at line 1051 of file node_declaration.cc.

◆ matches()

virtual bool blender::nodes::SocketDeclaration::matches ( const bNodeSocket & socket) const
pure virtual

◆ matches_common_data()

Definition at line 300 of file node_declaration.cc.

◆ set_common_flags()

Definition at line 293 of file node_declaration.cc.

◆ update_or_build()

Definition at line 283 of file node_declaration.cc.

◆ BaseSocketDeclarationBuilder

friend class BaseSocketDeclarationBuilder
friend

Definition at line 254 of file NOD_node_declaration.hh.

◆ FlatBundleTypeBuilder

friend class FlatBundleTypeBuilder
friend

Definition at line 253 of file NOD_node_declaration.hh.

◆ SocketDeclarationBuilder

template<typename SocketDecl>
friend class SocketDeclarationBuilder
friend

Definition at line 255 of file NOD_node_declaration.hh.

Member Data Documentation

◆ align_with_previous_socket

Puts this socket on the same line as the previous one in the UI.

Definition at line 202 of file NOD_node_declaration.hh.

◆ compact

◆ custom_draw_fn

Draw function that overrides how the socket is drawn for a specific node.

Definition at line 241 of file NOD_node_declaration.hh.

◆ default_input_type

Some input sockets can have non-trivial values in the case when they are unlinked.

Definition at line 232 of file NOD_node_declaration.hh.

◆ description

◆ hide_value

◆ identifier

◆ in_out

Defined by whether the socket is part of the node's input or output socket declaration list. Included here for convenience.

Definition at line 186 of file NOD_node_declaration.hh.

◆ index

Index in the list of inputs or outputs of the node.

Definition at line 210 of file NOD_node_declaration.hh.

◆ is_anonymous_attribute_output

◆ is_attribute_name

◆ is_available

◆ is_default_link_socket

◆ is_layer_name

◆ is_multi_input

◆ is_panel_toggle

This socket is used as a toggle for the parent panel.

Definition at line 204 of file NOD_node_declaration.hh.

◆ is_volume_grid_name

◆ label_fn

Custom label function so a socket can display a different text depending on what it does.

Definition at line 245 of file NOD_node_declaration.hh.

◆ name

◆ no_mute_links

◆ NodeDeclarationBuilder

◆ optional_label

Indicates that the meaning of the socket values is clear even if the label is not shown. This can result in cleaner UIs in some cases. The drawing code will still draw the label sometimes.

Definition at line 193 of file NOD_node_declaration.hh.

◆ short_label

◆ socket_name_rna

Property that stores the name of the socket so that it can be modified directly from the node without going to the side-bar.

Definition at line 237 of file NOD_node_declaration.hh.

◆ socket_type

Socket type that corresponds to this socket declaration.

Definition at line 188 of file NOD_node_declaration.hh.

◆ structure_type

StructureType blender::nodes::SocketDeclaration::structure_type = StructureType::Single

Definition at line 214 of file NOD_node_declaration.hh.

◆ structure_type_output_dependency

◆ translation_context

Definition at line 181 of file NOD_node_declaration.hh.

◆ usage_inference_fn

Determines whether this socket is used based on other input values and based on which outputs are used.

Definition at line 250 of file NOD_node_declaration.hh.


The documentation for this class was generated from the following files: