Blender V4.3
blender::nodes::BaseSocketDeclarationBuilder Class Reference

#include <NOD_node_declaration.hh>

Inherited by blender::nodes::SocketDeclarationBuilder< Bool >, blender::nodes::SocketDeclarationBuilder< Color >, blender::nodes::SocketDeclarationBuilder< Custom >, blender::nodes::SocketDeclarationBuilder< Extend >, blender::nodes::SocketDeclarationBuilder< Float >, blender::nodes::SocketDeclarationBuilder< Geometry >, blender::nodes::SocketDeclarationBuilder< Int >, blender::nodes::SocketDeclarationBuilder< Matrix >, blender::nodes::SocketDeclarationBuilder< Menu >, blender::nodes::SocketDeclarationBuilder< Rotation >, blender::nodes::SocketDeclarationBuilder< Shader >, blender::nodes::SocketDeclarationBuilder< String >, blender::nodes::SocketDeclarationBuilder< Vector >, and blender::nodes::SocketDeclarationBuilder< SocketDecl >.

Public Member Functions

virtual ~BaseSocketDeclarationBuilder ()=default
 
BaseSocketDeclarationBuilderhide_label (bool value=true)
 
BaseSocketDeclarationBuilderhide_value (bool value=true)
 
BaseSocketDeclarationBuildermulti_input (bool value=true)
 
BaseSocketDeclarationBuildershort_label (std::string value="")
 
BaseSocketDeclarationBuilderdescription (std::string value="")
 
BaseSocketDeclarationBuildertranslation_context (std::string value=BLT_I18NCONTEXT_DEFAULT)
 
BaseSocketDeclarationBuilderno_muted_links (bool value=true)
 
BaseSocketDeclarationBuilderavailable (bool value=true)
 
BaseSocketDeclarationBuilderis_attribute_name (bool value=true)
 
BaseSocketDeclarationBuilderis_default_link_socket (bool value=true)
 
BaseSocketDeclarationBuildersupports_field ()
 
BaseSocketDeclarationBuilderfield_on_all ()
 
BaseSocketDeclarationBuilderfield_source ()
 
BaseSocketDeclarationBuilderimplicit_field (ImplicitInputValueFn fn)
 
BaseSocketDeclarationBuilderimplicit_field_on_all (ImplicitInputValueFn fn)
 
BaseSocketDeclarationBuilderimplicit_field_on (ImplicitInputValueFn fn, Span< int > input_indices)
 
BaseSocketDeclarationBuilderfield_on (Span< int > indices)
 
BaseSocketDeclarationBuilderdependent_field ()
 
BaseSocketDeclarationBuilderdependent_field (Vector< int > input_dependencies)
 
BaseSocketDeclarationBuilderfield_source_reference_all ()
 
BaseSocketDeclarationBuilderreference_pass (Span< int > input_indices)
 
BaseSocketDeclarationBuilderreference_pass_all ()
 
BaseSocketDeclarationBuilderpropagate_all ()
 
BaseSocketDeclarationBuildercompositor_realization_options (CompositorInputRealizationOptions value)
 
BaseSocketDeclarationBuildercompositor_domain_priority (int priority)
 
BaseSocketDeclarationBuildercompositor_expects_single_value (bool value=true)
 
BaseSocketDeclarationBuildermake_available (std::function< void(bNode &)> fn)
 
BaseSocketDeclarationBuilderalign_with_previous (bool value=true)
 
BaseSocketDeclarationBuildersocket_name_ptr (PointerRNA ptr, StringRef property_name)
 
BaseSocketDeclarationBuildersocket_name_ptr (const ID *id, const StructRNA *srna, const void *data, StringRef property_name)
 
#BaseSocketDeclarationBuilder Inline Methods
int index () const
 
bool is_input () const
 
bool is_output () const
 

Protected Attributes

int index_ = -1
 
bool reference_pass_all_ = false
 
bool field_on_all_ = false
 
bool propagate_from_all_ = false
 
NodeDeclarationBuildernode_decl_builder_ = nullptr
 
SocketDeclarationdecl_base_ = nullptr
 

Friends

class NodeDeclarationBuilder
 

Detailed Description

Definition at line 256 of file NOD_node_declaration.hh.

Constructor & Destructor Documentation

◆ ~BaseSocketDeclarationBuilder()

virtual blender::nodes::BaseSocketDeclarationBuilder::~BaseSocketDeclarationBuilder ( )
virtualdefault

Member Function Documentation

◆ align_with_previous()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::align_with_previous ( bool value = true)

Puts this socket on the same row as the previous socket. This only works when one of them is an input and the other is an output.

Definition at line 781 of file node_declaration.cc.

References blender::nodes::SocketDeclaration::align_with_previous_socket, and decl_base_.

◆ available()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::available ( bool value = true)

Can be used to make a socket unavailable. It's still stored in DNA, but it's not shown in the UI and also can't be unhidden.

Definition at line 664 of file node_declaration.cc.

References decl_base_, and blender::nodes::SocketDeclaration::is_available.

◆ compositor_domain_priority()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::compositor_domain_priority ( int priority)

The priority of the input for determining the domain of the node. See realtime_compositor::InputDescriptor for more information.

Definition at line 760 of file node_declaration.cc.

References decl_base_.

◆ compositor_expects_single_value()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::compositor_expects_single_value ( bool value = true)

This input expects a single value and can't operate on non-single values. See realtime_compositor::InputDescriptor for more information.

Definition at line 767 of file node_declaration.cc.

References decl_base_.

◆ compositor_realization_options()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::compositor_realization_options ( CompositorInputRealizationOptions value)

Definition at line 753 of file node_declaration.cc.

References decl_base_.

◆ dependent_field() [1/2]

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::dependent_field ( )

The output is a field if any of the inputs are a field.

Definition at line 726 of file node_declaration.cc.

References BLI_assert, decl_base_, is_output(), blender::nodes::SocketDeclaration::output_field_dependency, and reference_pass_all().

◆ dependent_field() [2/2]

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::dependent_field ( Vector< int > input_dependencies)

The output is a field if any of the inputs with indices in the given list is a field.

Definition at line 573 of file node_declaration.cc.

References BLI_assert, decl_base_, is_output(), blender::nodes::SocketDeclaration::output_field_dependency, and reference_pass().

◆ description()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::description ( std::string value = "")

◆ field_on()

◆ field_on_all()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::field_on_all ( )

For inputs this means that the input field is evaluated on all geometry inputs. For outputs it means that this contains an anonymous attribute reference that is available on all geometry outputs. This sockets value does not have to be output manually in the node. It's done automatically by #LazyFunctionForGeometryNode. This allows outputting this field even if the geometry output does not have to be computed.

Definition at line 682 of file node_declaration.cc.

References field_on_all_, field_source(), is_input(), is_output(), and supports_field().

◆ field_source()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::field_source ( )

The output is always a field, regardless of any inputs.

Definition at line 694 of file node_declaration.cc.

References BLI_assert, decl_base_, is_output(), and blender::nodes::SocketDeclaration::output_field_dependency.

Referenced by field_on(), field_on_all(), and field_source_reference_all().

◆ field_source_reference_all()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::field_source_reference_all ( )

For outputs that combine all input fields into a new field. The output is a field even if none of the inputs is a field.

Definition at line 734 of file node_declaration.cc.

References field_source(), and reference_pass_all().

◆ hide_label()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::hide_label ( bool value = true)

◆ hide_value()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::hide_value ( bool value = true)

Definition at line 589 of file node_declaration.cc.

References decl_base_, and blender::nodes::SocketDeclaration::hide_value.

Referenced by implicit_field().

◆ implicit_field()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::implicit_field ( ImplicitInputValueFn fn)

The input supports a field and is a field by default when nothing is connected.

Definition at line 701 of file node_declaration.cc.

References BLI_assert, decl_base_, hide_value(), blender::nodes::Implicit, blender::nodes::SocketDeclaration::implicit_input_fn, blender::nodes::SocketDeclaration::input_field_type, and is_input().

Referenced by implicit_field_on(), and implicit_field_on_all().

◆ implicit_field_on()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::implicit_field_on ( ImplicitInputValueFn fn,
Span< int > input_indices )

The input is evaluated on a subset of the geometry inputs.

Definition at line 718 of file node_declaration.cc.

References field_on(), and implicit_field().

◆ implicit_field_on_all()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::implicit_field_on_all ( ImplicitInputValueFn fn)

The input is an implicit field that is evaluated on all geometry inputs.

Definition at line 710 of file node_declaration.cc.

References field_on_all_, and implicit_field().

◆ index()

int blender::nodes::BaseSocketDeclarationBuilder::index ( ) const
inline

Index in the list of inputs or outputs.

Definition at line 670 of file NOD_node_declaration.hh.

References index_.

◆ is_attribute_name()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::is_attribute_name ( bool value = true)

◆ is_default_link_socket()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::is_default_link_socket ( bool value = true)

◆ is_input()

bool blender::nodes::BaseSocketDeclarationBuilder::is_input ( ) const
inline

◆ is_output()

bool blender::nodes::BaseSocketDeclarationBuilder::is_output ( ) const
inline

◆ make_available()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::make_available ( std::function< void(bNode &)> fn)

Pass a function that sets properties on the node required to make the corresponding socket available, if it is not available on the default state of the node. The function is allowed to make other sockets unavailable, since it is meant to be called when the node is first added. The node type's update function is called afterwards.

Definition at line 774 of file node_declaration.cc.

References decl_base_.

◆ multi_input()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::multi_input ( bool value = true)

◆ no_muted_links()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::no_muted_links ( bool value = true)

◆ propagate_all()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::propagate_all ( )

Attributes from the all geometry inputs can be propagated.

Definition at line 747 of file node_declaration.cc.

References propagate_from_all_.

◆ reference_pass()

◆ reference_pass_all()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::reference_pass_all ( )

For outputs that combine all input fields into a new field.

Definition at line 741 of file node_declaration.cc.

References reference_pass_all_.

Referenced by dependent_field(), and field_source_reference_all().

◆ short_label()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::short_label ( std::string value = "")

◆ socket_name_ptr() [1/2]

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::socket_name_ptr ( const ID * id,
const StructRNA * srna,
const void * data,
StringRef property_name )

Definition at line 796 of file node_declaration.cc.

References RNA_pointer_create(), and socket_name_ptr().

◆ socket_name_ptr() [2/2]

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::socket_name_ptr ( PointerRNA ptr,
StringRef property_name )

Set a function that retrieves an RNA pointer to the name of the socket. This can be used to be able to rename the socket within the node.

Definition at line 787 of file node_declaration.cc.

References ptr.

Referenced by socket_name_ptr().

◆ supports_field()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::supports_field ( )

◆ translation_context()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::translation_context ( std::string value = BLT_I18NCONTEXT_DEFAULT)

Friends And Related Symbol Documentation

◆ NodeDeclarationBuilder

friend class NodeDeclarationBuilder
friend

Definition at line 266 of file NOD_node_declaration.hh.

Member Data Documentation

◆ decl_base_

◆ field_on_all_

bool blender::nodes::BaseSocketDeclarationBuilder::field_on_all_ = false
protected

Definition at line 261 of file NOD_node_declaration.hh.

Referenced by field_on_all(), and implicit_field_on_all().

◆ index_

int blender::nodes::BaseSocketDeclarationBuilder::index_ = -1
protected

Definition at line 259 of file NOD_node_declaration.hh.

Referenced by field_on(), index(), and reference_pass().

◆ node_decl_builder_

NodeDeclarationBuilder* blender::nodes::BaseSocketDeclarationBuilder::node_decl_builder_ = nullptr
protected

Definition at line 263 of file NOD_node_declaration.hh.

Referenced by field_on(), and reference_pass().

◆ propagate_from_all_

bool blender::nodes::BaseSocketDeclarationBuilder::propagate_from_all_ = false
protected

Definition at line 262 of file NOD_node_declaration.hh.

Referenced by propagate_all().

◆ reference_pass_all_

bool blender::nodes::BaseSocketDeclarationBuilder::reference_pass_all_ = false
protected

Definition at line 260 of file NOD_node_declaration.hh.

Referenced by reference_pass_all().


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