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

#include <NOD_node_declaration.hh>

Inherited by blender::nodes::SocketDeclarationBuilder< Bool >, blender::nodes::SocketDeclarationBuilder< Bundle >, blender::nodes::SocketDeclarationBuilder< Closure >, blender::nodes::SocketDeclarationBuilder< Color >, blender::nodes::SocketDeclarationBuilder< Custom >, blender::nodes::SocketDeclarationBuilder< Extend >, blender::nodes::SocketDeclarationBuilder< Float >, blender::nodes::SocketDeclarationBuilder< Geometry >, blender::nodes::SocketDeclarationBuilder< T >, blender::nodes::SocketDeclarationBuilder< Int >, blender::nodes::SocketDeclarationBuilder< IntVector >, 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
BaseSocketDeclarationBuilder & optional_label (bool value=true)
BaseSocketDeclarationBuilder & hide_value (bool value=true)
BaseSocketDeclarationBuilder & multi_input (bool value=true)
BaseSocketDeclarationBuilder & compact (bool value=true)
BaseSocketDeclarationBuilder & short_label (UString value)
BaseSocketDeclarationBuilder & description (std::string value="")
BaseSocketDeclarationBuilder & translation_context (std::optional< std::string > value=std::nullopt)
BaseSocketDeclarationBuilder & no_muted_links (bool value=true)
BaseSocketDeclarationBuilder & available (bool value=true)
BaseSocketDeclarationBuilder & is_attribute_name (bool value=true)
BaseSocketDeclarationBuilder & is_default_link_socket (bool value=true)
BaseSocketDeclarationBuilder & default_input_type (NodeDefaultInputType value)
BaseSocketDeclarationBuilder & evaluated_geometry_field ()
BaseSocketDeclarationBuilder & evaluated_geometry_field (Span< int > geometry_input_indices)
BaseSocketDeclarationBuilder & anonymous_attribute_output ()
BaseSocketDeclarationBuilder & anonymous_attribute_output (Span< int > geometry_output_indices)
BaseSocketDeclarationBuilder & references_other_outputs ()
BaseSocketDeclarationBuilder & references_other_outputs (Span< int > output_indices)
BaseSocketDeclarationBuilder & inferred_structure_type ()
BaseSocketDeclarationBuilder & inferred_structure_type (Span< int > input_indices)
BaseSocketDeclarationBuilder & propagate_references ()
BaseSocketDeclarationBuilder & propagate_references (Span< int > input_indices)
BaseSocketDeclarationBuilder & propagate_all ()
BaseSocketDeclarationBuilder & propagate_all (Span< int > input_indices)
BaseSocketDeclarationBuilder & propagate_all_geometry ()
BaseSocketDeclarationBuilder & compositor_realization_mode (CompositorInputRealizationMode value)
BaseSocketDeclarationBuilder & compositor_domain_priority (int priority)
BaseSocketDeclarationBuilder & make_available (std::function< void(bNode &)> fn)
BaseSocketDeclarationBuilder & custom_draw (CustomSocketDrawFn fn)
BaseSocketDeclarationBuilder & usage_inference (SocketUsageInferenceFn fn)
BaseSocketDeclarationBuilder & label_fn (CustomSocketLabelFn fn)
BaseSocketDeclarationBuilder & usage_by_single_menu (const int menu_value)
BaseSocketDeclarationBuilder & usage_by_menu (const UString menu_input_identifier, const int menu_value)
BaseSocketDeclarationBuilder & usage_by_menu (const UString menu_input_identifier, const Array< int > menu_values)
BaseSocketDeclarationBuilder & usage_by_bool (UString bool_input_identifier, bool value)
BaseSocketDeclarationBuilder & usage_by_panel_toggle ()
BaseSocketDeclarationBuilder & align_with_previous (bool value=true)
BaseSocketDeclarationBuilder & socket_name_ptr (PointerRNA ptr, StringRef property_name)
BaseSocketDeclarationBuilder & socket_name_ptr (const ID *id, const StructRNA *srna, const void *data, StringRef property_name)
BaseSocketDeclarationBuilder & panel_toggle (bool value=true)
BaseSocketDeclarationBuilder & structure_type (StructureType structure_type)
BaseSocketDeclarationBuilder & is_layer_name (bool value=true)
BaseSocketDeclarationBuilder & is_volume_grid_name (bool value=true)
virtual BaseSocketDeclarationBuilder & try_copy_ui_data (const SocketDeclaration &other_decl)
#BaseSocketDeclarationBuilder Inline Methods
int index () const
bool is_input () const
bool is_output () const

Protected Attributes

NodeDeclarationBuilder * node_decl_builder_ = nullptr
SocketDeclaration * decl_base_ = nullptr
bool propagate_all_input_references_ = false
bool propagate_all_input_data_ = false
bool propagate_all_input_data_from_geometry_ = false
bool input_reference_used_on_all_data_ = false
bool output_reference_available_on_all_data_ = false

Friends

class NodeDeclarationBuilder
class DeclarationListBuilder
class FlatBundleTypeBuilder

Detailed Description

Definition at line 288 of file NOD_node_declaration.hh.

Constructor & Destructor Documentation

◆ ~BaseSocketDeclarationBuilder()

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

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

Referenced by ~BaseSocketDeclarationBuilder().

◆ anonymous_attribute_output() [1/2]

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::anonymous_attribute_output ( )

Declares that this socket outputs an attribute field referencing an anonymous attribute that exists on an output geometry of the node.

Definition at line 734 of file node_declaration.cc.

References blender::BLI_assert(), decl_base_, blender::nodes::SocketDeclaration::is_anonymous_attribute_output, is_output(), references_other_outputs(), and blender::nodes::SocketDeclaration::structure_type.

Referenced by ~BaseSocketDeclarationBuilder().

◆ anonymous_attribute_output() [2/2]

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::anonymous_attribute_output ( Span< int > geometry_output_indices)

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

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

Referenced by blender::nodes::node_composite_image_cc::declare_old_linked_outputs(), blender::nodes::node_composite_render_layer_cc::declare_old_linked_outputs(), and ~BaseSocketDeclarationBuilder().

◆ compact()

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

◆ compositor_domain_priority()

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

The priority of the input for determining the domain of the node. Needs to be positive. See compositor::InputDescriptor for more information.

Definition at line 782 of file node_declaration.cc.

References blender::BLI_assert(), and decl_base_.

Referenced by ~BaseSocketDeclarationBuilder().

◆ compositor_realization_mode()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::compositor_realization_mode ( CompositorInputRealizationMode value)

◆ custom_draw()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::custom_draw ( CustomSocketDrawFn fn)

Provide a fully custom draw function for the socket that overrides any default behavior.

Definition at line 797 of file node_declaration.cc.

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

Referenced by ~BaseSocketDeclarationBuilder().

◆ default_input_type()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::default_input_type ( NodeDefaultInputType value)

◆ description()

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

◆ evaluated_geometry_field() [1/2]

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::evaluated_geometry_field ( )

Declares that this input is or contains a field that is evaluated on some geometry in this node.

Definition at line 710 of file node_declaration.cc.

References blender::BLI_assert(), decl_base_, input_reference_used_on_all_data_, is_input(), and blender::nodes::SocketDeclaration::structure_type.

Referenced by ~BaseSocketDeclarationBuilder().

◆ evaluated_geometry_field() [2/2]

◆ hide_value()

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

◆ index()

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

◆ inferred_structure_type() [1/2]

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::inferred_structure_type ( )

◆ inferred_structure_type() [2/2]

◆ 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_layer_name()

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

◆ is_output()

◆ is_volume_grid_name()

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

◆ label_fn()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::label_fn ( CustomSocketLabelFn fn)

Provide a function that determines the UI label of this socket.

Definition at line 651 of file node_declaration.cc.

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

Referenced by ~BaseSocketDeclarationBuilder().

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

References decl_base_.

Referenced by usage_by_bool(), usage_by_menu(), usage_by_single_menu(), and ~BaseSocketDeclarationBuilder().

◆ multi_input()

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

◆ no_muted_links()

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

◆ optional_label()

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

◆ panel_toggle()

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

Use the socket as a toggle in its panel.

Definition at line 1016 of file node_declaration.cc.

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

Referenced by ~BaseSocketDeclarationBuilder().

◆ propagate_all() [1/2]

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

The node passes data and references from inputs this output. Since data like a geometry can also indirectly contain fields, those are simply implied here.

Definition at line 588 of file node_declaration.cc.

References blender::BLI_assert(), is_output(), propagate_all_input_data_, and propagate_all_input_references_.

Referenced by ~BaseSocketDeclarationBuilder().

◆ propagate_all() [2/2]

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::propagate_all ( Span< int > input_indices)

◆ propagate_all_geometry()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::propagate_all_geometry ( )

Filters the set of inputs that is propagated from to only geometry sockets.

Definition at line 598 of file node_declaration.cc.

References propagate_all_input_data_from_geometry_.

Referenced by ~BaseSocketDeclarationBuilder().

◆ propagate_references() [1/2]

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::propagate_references ( )

The node passes references to data (anonymous attributes) from inputs to this output.

Definition at line 566 of file node_declaration.cc.

References blender::BLI_assert(), is_output(), and propagate_all_input_references_.

Referenced by ~BaseSocketDeclarationBuilder().

◆ propagate_references() [2/2]

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::propagate_references ( Span< int > input_indices)

◆ references_other_outputs() [1/2]

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::references_other_outputs ( )

The output might reference data (anonymous attributes) on other outputs that does not exist on the inputs already. Use the more specific anonymous_attribute_output() if applicable.

Definition at line 753 of file node_declaration.cc.

References blender::BLI_assert(), is_output(), and output_reference_available_on_all_data_.

Referenced by anonymous_attribute_output(), anonymous_attribute_output(), and ~BaseSocketDeclarationBuilder().

◆ references_other_outputs() [2/2]

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::references_other_outputs ( Span< int > output_indices)

◆ short_label()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::short_label ( UString 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 )

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

References decl_base_.

Referenced by blender::nodes::group_input_declare(), blender::nodes::group_output_declare(), blender::nodes::node_composite_file_output_cc::node_declare(), socket_name_ptr(), and ~BaseSocketDeclarationBuilder().

◆ structure_type()

◆ translation_context()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::translation_context ( std::optional< std::string > value = std::nullopt)

◆ try_copy_ui_data()

◆ usage_by_bool()

◆ usage_by_menu() [1/2]

◆ usage_by_menu() [2/2]

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::usage_by_menu ( const UString menu_input_identifier,
const int menu_value )

Utility method for the case when this socket is only used when the menu input of the given identifier has a specific value.

Definition at line 866 of file node_declaration.cc.

References usage_by_menu().

Referenced by usage_by_menu(), and ~BaseSocketDeclarationBuilder().

◆ usage_by_panel_toggle()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::usage_by_panel_toggle ( )

The socket is only used if the parent panel toggle is checked.

Definition at line 973 of file node_declaration.cc.

References decl_base_, blender::nodes::PanelDeclaration::panel_input_decl(), blender::nodes::ItemDeclaration::parent, and usage_by_bool().

Referenced by ~BaseSocketDeclarationBuilder().

◆ usage_by_single_menu()

◆ usage_inference()

BaseSocketDeclarationBuilder & blender::nodes::BaseSocketDeclarationBuilder::usage_inference ( SocketUsageInferenceFn fn)

Provide a function that determines whether this socket is used based on other input values and based on which outputs are used.

Definition at line 803 of file node_declaration.cc.

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

Referenced by usage_by_bool(), usage_by_menu(), usage_by_single_menu(), and ~BaseSocketDeclarationBuilder().

◆ DeclarationListBuilder

friend class DeclarationListBuilder
friend

Definition at line 302 of file NOD_node_declaration.hh.

References DeclarationListBuilder.

Referenced by DeclarationListBuilder.

◆ FlatBundleTypeBuilder

friend class FlatBundleTypeBuilder
friend

Definition at line 303 of file NOD_node_declaration.hh.

References FlatBundleTypeBuilder.

Referenced by FlatBundleTypeBuilder.

◆ NodeDeclarationBuilder

friend class NodeDeclarationBuilder
friend

Definition at line 301 of file NOD_node_declaration.hh.

References NodeDeclarationBuilder.

Referenced by NodeDeclarationBuilder.

Member Data Documentation

◆ decl_base_

◆ input_reference_used_on_all_data_

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

Definition at line 298 of file NOD_node_declaration.hh.

Referenced by evaluated_geometry_field().

◆ node_decl_builder_

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

◆ output_reference_available_on_all_data_

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

Definition at line 299 of file NOD_node_declaration.hh.

Referenced by references_other_outputs().

◆ propagate_all_input_data_

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

Definition at line 296 of file NOD_node_declaration.hh.

Referenced by propagate_all().

◆ propagate_all_input_data_from_geometry_

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

Definition at line 297 of file NOD_node_declaration.hh.

Referenced by propagate_all_geometry().

◆ propagate_all_input_references_

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

Definition at line 295 of file NOD_node_declaration.hh.

Referenced by propagate_all(), and propagate_references().


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