Blender V4.3
Node Union Referenceabstract

#include <node.h>

Inherited by Background, BufferParams, BufferPass, Camera, DenoiseParams, Film, Geometry, Integrator, Light, Object, ParticleSystem, Pass, Procedural, Shader, and ShaderNode.

Public Member Functions

 Node (const NodeType *type, ustring name=ustring())
 
virtual ~Node ()=0
 
void set (const SocketType &input, bool value)
 
void set (const SocketType &input, int value)
 
void set (const SocketType &input, uint value)
 
void set (const SocketType &input, uint64_t value)
 
void set (const SocketType &input, float value)
 
void set (const SocketType &input, float2 value)
 
void set (const SocketType &input, float3 value)
 
void set (const SocketType &input, const char *value)
 
void set (const SocketType &input, ustring value)
 
void set (const SocketType &input, const Transform &value)
 
void set (const SocketType &input, Node *value)
 
template<class ValueType , std::enable_if_t< std::is_enum_v< ValueType >, bool > = true>
void set (const SocketType &input, const ValueType &value)
 
void set (const SocketType &input, array< bool > &value)
 
void set (const SocketType &input, array< int > &value)
 
void set (const SocketType &input, array< float > &value)
 
void set (const SocketType &input, array< float2 > &value)
 
void set (const SocketType &input, array< float3 > &value)
 
void set (const SocketType &input, array< ustring > &value)
 
void set (const SocketType &input, array< Transform > &value)
 
void set (const SocketType &input, array< Node * > &value)
 
bool get_bool (const SocketType &input) const
 
int get_int (const SocketType &input) const
 
uint get_uint (const SocketType &input) const
 
uint64_t get_uint64 (const SocketType &input) const
 
float get_float (const SocketType &input) const
 
float2 get_float2 (const SocketType &input) const
 
float3 get_float3 (const SocketType &input) const
 
ustring get_string (const SocketType &input) const
 
Transform get_transform (const SocketType &input) const
 
Nodeget_node (const SocketType &input) const
 
const array< bool > & get_bool_array (const SocketType &input) const
 
const array< int > & get_int_array (const SocketType &input) const
 
const array< float > & get_float_array (const SocketType &input) const
 
const array< float2 > & get_float2_array (const SocketType &input) const
 
const array< float3 > & get_float3_array (const SocketType &input) const
 
const array< ustring > & get_string_array (const SocketType &input) const
 
const array< Transform > & get_transform_array (const SocketType &input) const
 
const array< Node * > & get_node_array (const SocketType &input) const
 
bool has_default_value (const SocketType &input) const
 
void set_default_value (const SocketType &input)
 
bool equals_value (const Node &other, const SocketType &input) const
 
void copy_value (const SocketType &input, const Node &other, const SocketType &other_input)
 
void set_value (const SocketType &input, const Node &other, const SocketType &other_input)
 
bool equals (const Node &other) const
 
void hash (MD5Hash &md5)
 
size_t get_total_size_in_bytes () const
 
bool is_a (const NodeType *type)
 
bool socket_is_modified (const SocketType &input) const
 
bool is_modified () const
 
void tag_modified ()
 
void clear_modified ()
 
void print_modified_sockets () const
 
const NodeOwnerget_owner () const
 
void set_owner (const NodeOwner *owner_)
 
int reference_count () const
 
void reference ()
 
void dereference ()
 
void clear_reference_count ()
 

Public Attributes

ustring name
 
const NodeTypetype
 
InternalNode internal
 
LeafNode leaf
 

Protected Member Functions

template<typename T >
void set_if_different (const SocketType &input, T value)
 
void set_if_different (const SocketType &input, Node *value)
 
template<typename T >
void set_if_different (const SocketType &input, array< T > &value)
 
void set_if_different (const SocketType &input, array< Node * > &value)
 
void dereference_all_used_nodes ()
 

Static Protected Member Functions

template<typename T >
static Tget_socket_value (const Node *node, const SocketType &socket)
 

Protected Attributes

const NodeOwnerowner
 
int ref_count {0}
 
SocketModifiedFlags socket_modified
 

Detailed Description

Definition at line 90 of file graph/node.h.

Constructor & Destructor Documentation

◆ Node()

Node::Node ( const NodeType * type,
ustring name = ustring() )
explicit

Definition at line 19 of file graph/node.cpp.

References owner, set_default_value(), and tag_modified().

◆ ~Node()

Node::~Node ( )
pure virtual

Definition at line 37 of file graph/node.cpp.

Member Function Documentation

◆ clear_modified()

void Node::clear_modified ( )

Definition at line 836 of file graph/node.cpp.

References socket_modified.

◆ clear_reference_count()

void Node::clear_reference_count ( )
inline

Definition at line 201 of file graph/node.h.

References ref_count.

◆ copy_value()

◆ dereference()

void Node::dereference ( )
inline

Definition at line 193 of file graph/node.h.

References ref_count.

Referenced by set_if_different().

◆ dereference_all_used_nodes()

void Node::dereference_all_used_nodes ( )
protected

◆ equals()

bool Node::equals ( const Node & other) const

Definition at line 564 of file graph/node.cpp.

References equals_value().

Referenced by ImageSlotTextureNode::equals().

◆ equals_value()

◆ get_bool()

bool Node::get_bool ( const SocketType & input) const

Definition at line 182 of file graph/node.cpp.

References SocketType::BOOLEAN, and get_socket_value().

◆ get_bool_array()

const array< bool > & Node::get_bool_array ( const SocketType & input) const

Definition at line 253 of file graph/node.cpp.

References SocketType::BOOLEAN_ARRAY, and get_socket_value().

◆ get_float()

float Node::get_float ( const SocketType & input) const

Definition at line 206 of file graph/node.cpp.

References SocketType::FLOAT, and get_socket_value().

Referenced by BsdfNode::compile(), and VolumeNode::compile().

◆ get_float2()

float2 Node::get_float2 ( const SocketType & input) const

Definition at line 212 of file graph/node.cpp.

References get_socket_value(), and SocketType::POINT2.

◆ get_float2_array()

const array< float2 > & Node::get_float2_array ( const SocketType & input) const

Definition at line 271 of file graph/node.cpp.

References get_socket_value(), and SocketType::POINT2_ARRAY.

◆ get_float3()

float3 Node::get_float3 ( const SocketType & input) const

Definition at line 218 of file graph/node.cpp.

References get_socket_value(), and is_socket_float3().

◆ get_float3_array()

const array< float3 > & Node::get_float3_array ( const SocketType & input) const

Definition at line 277 of file graph/node.cpp.

References get_socket_value(), and is_socket_array_float3().

◆ get_float_array()

const array< float > & Node::get_float_array ( const SocketType & input) const

Definition at line 265 of file graph/node.cpp.

References SocketType::FLOAT_ARRAY, and get_socket_value().

◆ get_int()

int Node::get_int ( const SocketType & input) const

Definition at line 188 of file graph/node.cpp.

References SocketType::ENUM, get_socket_value(), and SocketType::INT.

◆ get_int_array()

const array< int > & Node::get_int_array ( const SocketType & input) const

Definition at line 259 of file graph/node.cpp.

References get_socket_value(), and SocketType::INT_ARRAY.

◆ get_node()

Node * Node::get_node ( const SocketType & input) const

Definition at line 246 of file graph/node.cpp.

References get_socket_value(), and SocketType::NODE.

Referenced by xml_write_node().

◆ get_node_array()

const array< Node * > & Node::get_node_array ( const SocketType & input) const

Definition at line 295 of file graph/node.cpp.

References get_socket_value(), and SocketType::NODE_ARRAY.

◆ get_owner()

const NodeOwner * Node::get_owner ( ) const

Definition at line 790 of file graph/node.cpp.

References owner.

◆ get_socket_value()

◆ get_string()

ustring Node::get_string ( const SocketType & input) const

◆ get_string_array()

const array< ustring > & Node::get_string_array ( const SocketType & input) const

Definition at line 283 of file graph/node.cpp.

References get_socket_value(), and SocketType::STRING_ARRAY.

◆ get_total_size_in_bytes()

◆ get_transform()

Transform Node::get_transform ( const SocketType & input) const

Definition at line 240 of file graph/node.cpp.

References get_socket_value(), and SocketType::TRANSFORM.

◆ get_transform_array()

const array< Transform > & Node::get_transform_array ( const SocketType & input) const

Definition at line 289 of file graph/node.cpp.

References get_socket_value(), and SocketType::TRANSFORM_ARRAY.

◆ get_uint()

uint Node::get_uint ( const SocketType & input) const

Definition at line 194 of file graph/node.cpp.

References get_socket_value(), and SocketType::UINT.

◆ get_uint64()

uint64_t Node::get_uint64 ( const SocketType & input) const

Definition at line 200 of file graph/node.cpp.

References get_socket_value(), and SocketType::UINT64.

◆ has_default_value()

bool Node::has_default_value ( const SocketType & input) const

Definition at line 303 of file graph/node.cpp.

References get_socket_value().

◆ hash()

◆ is_a()

bool Node::is_a ( const NodeType * type)

Definition at line 780 of file graph/node.cpp.

References NodeType::base.

Referenced by xml_read_node().

◆ is_modified()

◆ print_modified_sockets()

void Node::print_modified_sockets ( ) const

Definition at line 903 of file graph/node.cpp.

References SocketType::name, printf, and socket_is_modified().

◆ reference()

void Node::reference ( )
inline

Definition at line 188 of file graph/node.h.

References ref_count.

◆ reference_count()

int Node::reference_count ( ) const
inline

Definition at line 183 of file graph/node.h.

References ref_count.

Referenced by Shader::tag_used().

◆ set() [1/20]

void Node::set ( const SocketType & input,
array< bool > & value )

Definition at line 133 of file graph/node.cpp.

References SocketType::BOOLEAN_ARRAY, and set_if_different().

◆ set() [2/20]

void Node::set ( const SocketType & input,
array< float > & value )

Definition at line 145 of file graph/node.cpp.

References SocketType::FLOAT_ARRAY, and set_if_different().

◆ set() [3/20]

void Node::set ( const SocketType & input,
array< float2 > & value )

Definition at line 151 of file graph/node.cpp.

References SocketType::POINT2_ARRAY, and set_if_different().

◆ set() [4/20]

void Node::set ( const SocketType & input,
array< float3 > & value )

Definition at line 157 of file graph/node.cpp.

References is_socket_array_float3(), and set_if_different().

◆ set() [5/20]

void Node::set ( const SocketType & input,
array< int > & value )

Definition at line 139 of file graph/node.cpp.

References SocketType::INT_ARRAY, and set_if_different().

◆ set() [6/20]

void Node::set ( const SocketType & input,
array< Node * > & value )

Definition at line 175 of file graph/node.cpp.

References SocketType::NODE_ARRAY, and set_if_different().

◆ set() [7/20]

void Node::set ( const SocketType & input,
array< Transform > & value )

Definition at line 169 of file graph/node.cpp.

References set_if_different(), and SocketType::TRANSFORM_ARRAY.

◆ set() [8/20]

void Node::set ( const SocketType & input,
array< ustring > & value )

Definition at line 163 of file graph/node.cpp.

References set_if_different(), and SocketType::STRING_ARRAY.

◆ set() [9/20]

void Node::set ( const SocketType & input,
bool value )

Definition at line 54 of file graph/node.cpp.

References SocketType::BOOLEAN, and set_if_different().

Referenced by BKE_scene_base_iter_next(), set(), set(), set_value(), and xml_read_node().

◆ set() [10/20]

void Node::set ( const SocketType & input,
const char * value )

Definition at line 96 of file graph/node.cpp.

References set().

◆ set() [11/20]

void Node::set ( const SocketType & input,
const Transform & value )

Definition at line 120 of file graph/node.cpp.

References set_if_different(), and SocketType::TRANSFORM.

◆ set() [12/20]

template<class ValueType , std::enable_if_t< std::is_enum_v< ValueType >, bool > = true>
void Node::set ( const SocketType & input,
const ValueType & value )
inline

Definition at line 110 of file graph/node.h.

References set().

◆ set() [13/20]

void Node::set ( const SocketType & input,
float value )

Definition at line 78 of file graph/node.cpp.

References SocketType::FLOAT, and set_if_different().

◆ set() [14/20]

void Node::set ( const SocketType & input,
float2 value )

Definition at line 84 of file graph/node.cpp.

References SocketType::POINT2, and set_if_different().

◆ set() [15/20]

void Node::set ( const SocketType & input,
float3 value )

Definition at line 90 of file graph/node.cpp.

References is_socket_float3(), and set_if_different().

◆ set() [16/20]

void Node::set ( const SocketType & input,
int value )

Definition at line 60 of file graph/node.cpp.

References SocketType::ENUM, SocketType::INT, and set_if_different().

◆ set() [17/20]

void Node::set ( const SocketType & input,
Node * value )

Definition at line 126 of file graph/node.cpp.

References SocketType::NODE, and set_if_different().

◆ set() [18/20]

void Node::set ( const SocketType & input,
uint value )

Definition at line 66 of file graph/node.cpp.

References set_if_different(), and SocketType::UINT.

◆ set() [19/20]

void Node::set ( const SocketType & input,
uint64_t value )

Definition at line 72 of file graph/node.cpp.

References set_if_different(), and SocketType::UINT64.

◆ set() [20/20]

void Node::set ( const SocketType & input,
ustring value )

◆ set_default_value()

void Node::set_default_value ( const SocketType & input)

Definition at line 310 of file graph/node.cpp.

References SocketType::default_value, SocketType::size(), and SocketType::struct_offset.

Referenced by Node().

◆ set_if_different() [1/4]

void Node::set_if_different ( const SocketType & input,
array< Node * > & value )
protected

Definition at line 882 of file graph/node.cpp.

References get_socket_value(), socket_is_modified(), and socket_modified.

◆ set_if_different() [2/4]

template<typename T >
void Node::set_if_different ( const SocketType & input,
array< T > & value )
protected

Definition at line 870 of file graph/node.cpp.

References get_socket_value(), socket_is_modified(), and socket_modified.

◆ set_if_different() [3/4]

void Node::set_if_different ( const SocketType & input,
Node * value )
protected

Definition at line 851 of file graph/node.cpp.

References dereference(), get_socket_value(), and socket_modified.

◆ set_if_different() [4/4]

template<typename T >
void Node::set_if_different ( const SocketType & input,
T value )
protected

Definition at line 841 of file graph/node.cpp.

References get_socket_value(), and socket_modified.

Referenced by set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), set(), and set().

◆ set_owner()

void Node::set_owner ( const NodeOwner * owner_)

Definition at line 795 of file graph/node.cpp.

References owner.

Referenced by OSLNode::create(), and xml_read_shader_graph().

◆ set_value()

◆ socket_is_modified()

bool Node::socket_is_modified ( const SocketType & input) const

Definition at line 821 of file graph/node.cpp.

References socket_modified.

Referenced by print_modified_sockets(), set_if_different(), and set_if_different().

◆ tag_modified()

Member Data Documentation

◆ internal

InternalNode Node::internal

Definition at line 165 of file octree.h.

Referenced by Octree::scanConvert().

◆ leaf

LeafNode Node::leaf

Definition at line 166 of file octree.h.

◆ name

◆ owner

const NodeOwner* Node::owner
protected

Definition at line 207 of file graph/node.h.

Referenced by get_owner(), Node(), and set_owner().

◆ ref_count

int Node::ref_count {0}
protected

Definition at line 208 of file graph/node.h.

Referenced by clear_reference_count(), dereference(), reference(), and reference_count().

◆ socket_modified

◆ type


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