Blender V5.0
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::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 bNodeSocketbuild (bNodeTree &ntree, bNode &node) const=0
virtual bool matches (const bNodeSocket &socket) const=0
virtual bNodeSocketupdate_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

std::string name
std::string short_label
std::string 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
int index = -1
InputSocketFieldType input_field_type = InputSocketFieldType::None
OutputFieldDependency output_field_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< InputSocketUsageInferenceFn > usage_inference_fn
friend NodeDeclarationBuilder
Public Attributes inherited from blender::nodes::ItemDeclaration
const PanelDeclarationparent = nullptr

Protected Member Functions

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

Friends

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 206 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()

const CompositorInputRealizationMode & blender::nodes::SocketDeclaration::compositor_realization_mode ( ) const

◆ 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 1003 of file node_declaration.cc.

◆ matches()

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

◆ matches_common_data()

Definition at line 291 of file node_declaration.cc.

◆ set_common_flags()

Definition at line 284 of file node_declaration.cc.

◆ update_or_build()

Definition at line 274 of file node_declaration.cc.

◆ BaseSocketDeclarationBuilder

friend class BaseSocketDeclarationBuilder
friend

Definition at line 276 of file NOD_node_declaration.hh.

◆ SocketDeclarationBuilder

template<typename SocketDecl>
friend class SocketDeclarationBuilder
friend

Definition at line 277 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 231 of file NOD_node_declaration.hh.

◆ compact

◆ custom_draw_fn

std::unique_ptr<CustomSocketDrawFn> blender::nodes::SocketDeclaration::custom_draw_fn

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

Definition at line 268 of file NOD_node_declaration.hh.

◆ default_input_type

NodeDefaultInputType blender::nodes::SocketDeclaration::default_input_type = NodeDefaultInputType::NODE_DEFAULT_INPUT_VALUE

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

Definition at line 259 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 215 of file NOD_node_declaration.hh.

◆ index

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

Definition at line 238 of file NOD_node_declaration.hh.

◆ input_field_type

◆ 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 233 of file NOD_node_declaration.hh.

◆ is_volume_grid_name

◆ 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 222 of file NOD_node_declaration.hh.

◆ output_field_dependency

◆ 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 264 of file NOD_node_declaration.hh.

◆ socket_type

Socket type that corresponds to this socket declaration.

Definition at line 217 of file NOD_node_declaration.hh.

Referenced by blender::ed::space_node::ui_node_link_items().

◆ structure_type

◆ translation_context

Definition at line 212 of file NOD_node_declaration.hh.

◆ usage_inference_fn

std::unique_ptr<InputSocketUsageInferenceFn> blender::nodes::SocketDeclaration::usage_inference_fn

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

Definition at line 273 of file NOD_node_declaration.hh.


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