|
Blender V4.3
|
#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 |
| Node * | get_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 NodeOwner * | get_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 NodeType * | type |
| 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 T & | get_socket_value (const Node *node, const SocketType &socket) |
Protected Attributes | |
| const NodeOwner * | owner |
| int | ref_count {0} |
| SocketModifiedFlags | socket_modified |
Definition at line 90 of file graph/node.h.
|
explicit |
Definition at line 19 of file graph/node.cpp.
References owner, set_default_value(), and tag_modified().
|
pure virtual |
Definition at line 37 of file graph/node.cpp.
| void Node::clear_modified | ( | ) |
Definition at line 836 of file graph/node.cpp.
References socket_modified.
|
inline |
Definition at line 201 of file graph/node.h.
References ref_count.
| void Node::copy_value | ( | const SocketType & | input, |
| const Node & | other, | ||
| const SocketType & | other_input ) |
Definition at line 330 of file graph/node.cpp.
References SocketType::BOOLEAN_ARRAY, SocketType::COLOR_ARRAY, copy_array(), SocketType::FLOAT_ARRAY, get_socket_value(), SocketType::INT_ARRAY, SocketType::is_array(), SocketType::NODE, SocketType::NODE_ARRAY, SocketType::NORMAL_ARRAY, SocketType::POINT2_ARRAY, SocketType::POINT_ARRAY, SocketType::size(), SocketType::STRING_ARRAY, SocketType::struct_offset, SocketType::TRANSFORM_ARRAY, SocketType::type, and SocketType::VECTOR_ARRAY.
Referenced by ShaderGraph::remove_proxy_nodes().
|
inline |
Definition at line 193 of file graph/node.h.
References ref_count.
Referenced by set_if_different().
|
protected |
Definition at line 801 of file graph/node.cpp.
References get_socket_value(), SocketType::NODE, SocketType::NODE_ARRAY, and SocketType::type.
Referenced by Light::Light(), Background::~Background(), and Geometry::~Geometry().
| bool Node::equals | ( | const Node & | other | ) | const |
Definition at line 564 of file graph/node.cpp.
References equals_value().
Referenced by ImageSlotTextureNode::equals().
| bool Node::equals_value | ( | const Node & | other, |
| const SocketType & | input ) const |
Definition at line 497 of file graph/node.cpp.
References SocketType::BOOLEAN, SocketType::BOOLEAN_ARRAY, SocketType::CLOSURE, SocketType::COLOR, SocketType::COLOR_ARRAY, SocketType::ENUM, SocketType::FLOAT, SocketType::FLOAT_ARRAY, SocketType::INT, SocketType::INT_ARRAY, is_array_equal(), is_value_equal(), SocketType::NODE, SocketType::NODE_ARRAY, SocketType::NORMAL, SocketType::NORMAL_ARRAY, SocketType::NUM_TYPES, SocketType::POINT, SocketType::POINT2, SocketType::POINT2_ARRAY, SocketType::POINT_ARRAY, SocketType::STRING, SocketType::STRING_ARRAY, SocketType::TRANSFORM, SocketType::TRANSFORM_ARRAY, SocketType::type, SocketType::UINT, SocketType::UINT64, SocketType::UNDEFINED, SocketType::VECTOR, and SocketType::VECTOR_ARRAY.
Referenced by equals(), and ShaderNode::equals().
| bool Node::get_bool | ( | const SocketType & | input | ) | const |
Definition at line 182 of file graph/node.cpp.
References SocketType::BOOLEAN, and get_socket_value().
| 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().
| 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().
| float2 Node::get_float2 | ( | const SocketType & | input | ) | const |
Definition at line 212 of file graph/node.cpp.
References get_socket_value(), and SocketType::POINT2.
| 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.
| 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().
| 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().
| 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().
| 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.
| 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.
| 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().
| 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.
| const NodeOwner * Node::get_owner | ( | ) | const |
Definition at line 790 of file graph/node.cpp.
References owner.
|
inlinestaticprotected |
Definition at line 210 of file graph/node.h.
References SocketType::struct_offset.
Referenced by copy_value(), dereference_all_used_nodes(), get_bool(), get_bool_array(), get_float(), get_float2(), get_float2_array(), get_float3(), get_float3_array(), get_float_array(), get_int(), get_int_array(), get_node(), get_node_array(), get_string(), get_string_array(), get_transform(), get_transform_array(), get_uint(), get_uint64(), has_default_value(), set_if_different(), set_if_different(), set_if_different(), set_if_different(), and set_value().
| ustring Node::get_string | ( | const SocketType & | input | ) | const |
Definition at line 224 of file graph/node.cpp.
References SocketType::ENUM, NodeEnum::exists(), get_socket_value(), and SocketType::STRING.
| 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.
| size_t Node::get_total_size_in_bytes | ( | ) | const |
Definition at line 715 of file graph/node.cpp.
References SocketType::BOOLEAN, SocketType::BOOLEAN_ARRAY, SocketType::CLOSURE, SocketType::COLOR, SocketType::COLOR_ARRAY, SocketType::ENUM, SocketType::FLOAT, SocketType::FLOAT_ARRAY, SocketType::INT, SocketType::INT_ARRAY, SocketType::NODE, SocketType::NODE_ARRAY, SocketType::NORMAL, SocketType::NORMAL_ARRAY, SocketType::NUM_TYPES, SocketType::POINT, SocketType::POINT2, SocketType::POINT2_ARRAY, SocketType::POINT_ARRAY, SocketType::size(), SocketType::STRING, SocketType::STRING_ARRAY, SocketType::TRANSFORM, SocketType::TRANSFORM_ARRAY, SocketType::type, SocketType::UINT, SocketType::UINT64, SocketType::UNDEFINED, SocketType::VECTOR, and SocketType::VECTOR_ARRAY.
| Transform Node::get_transform | ( | const SocketType & | input | ) | const |
Definition at line 240 of file graph/node.cpp.
References get_socket_value(), and SocketType::TRANSFORM.
| 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.
| uint Node::get_uint | ( | const SocketType & | input | ) | const |
Definition at line 194 of file graph/node.cpp.
References get_socket_value(), and SocketType::UINT.
| 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.
| bool Node::has_default_value | ( | const SocketType & | input | ) | const |
Definition at line 303 of file graph/node.cpp.
References get_socket_value().
| void Node::hash | ( | MD5Hash & | md5 | ) |
Definition at line 611 of file graph/node.cpp.
References MD5Hash::append(), SocketType::BOOLEAN, SocketType::BOOLEAN_ARRAY, SocketType::CLOSURE, SocketType::COLOR, SocketType::COLOR_ARRAY, SocketType::ENUM, SocketType::FLOAT, SocketType::FLOAT_ARRAY, SocketType::INT, SocketType::INT_ARRAY, SocketType::name, SocketType::NODE, SocketType::NODE_ARRAY, SocketType::NORMAL, SocketType::NORMAL_ARRAY, SocketType::NUM_TYPES, SocketType::POINT, SocketType::POINT2, SocketType::POINT2_ARRAY, SocketType::POINT_ARRAY, SocketType::STRING, SocketType::STRING_ARRAY, SocketType::TRANSFORM, SocketType::TRANSFORM_ARRAY, SocketType::type, SocketType::UINT, SocketType::UINT64, SocketType::UNDEFINED, SocketType::VECTOR, and SocketType::VECTOR_ARRAY.
| bool Node::is_a | ( | const NodeType * | type | ) |
Definition at line 780 of file graph/node.cpp.
References NodeType::base.
Referenced by xml_read_node().
| bool Node::is_modified | ( | ) | const |
Definition at line 826 of file graph/node.cpp.
References socket_modified.
Referenced by Background::device_update(), Film::device_update(), GeometryManager::device_update(), Integrator::device_update(), GeometryManager::device_update_displacement_images(), GeometryManager::device_update_volume_images(), Scene::need_data_update(), Background::tag_update(), Light::tag_update(), Object::tag_update(), Camera::update(), and Film::update_passes().
| void Node::print_modified_sockets | ( | ) | const |
Definition at line 903 of file graph/node.cpp.
References SocketType::name, printf, and socket_is_modified().
|
inline |
Definition at line 188 of file graph/node.h.
References ref_count.
|
inline |
Definition at line 183 of file graph/node.h.
References ref_count.
Referenced by Shader::tag_used().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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.
| 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.
| 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().
| void Node::set | ( | const SocketType & | input, |
| const char * | value ) |
Definition at line 96 of file graph/node.cpp.
References set().
| 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.
|
inline |
Definition at line 110 of file graph/node.h.
References set().
| void Node::set | ( | const SocketType & | input, |
| float | value ) |
Definition at line 78 of file graph/node.cpp.
References SocketType::FLOAT, and set_if_different().
| void Node::set | ( | const SocketType & | input, |
| float2 | value ) |
Definition at line 84 of file graph/node.cpp.
References SocketType::POINT2, and set_if_different().
| 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().
| 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().
| void Node::set | ( | const SocketType & | input, |
| Node * | value ) |
Definition at line 126 of file graph/node.cpp.
References SocketType::NODE, and set_if_different().
| void Node::set | ( | const SocketType & | input, |
| uint | value ) |
Definition at line 66 of file graph/node.cpp.
References set_if_different(), and SocketType::UINT.
| 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.
| void Node::set | ( | const SocketType & | input, |
| ustring | value ) |
Definition at line 101 of file graph/node.cpp.
References SocketType::ENUM, NodeEnum::exists(), set_if_different(), and SocketType::STRING.
| 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().
|
protected |
Definition at line 882 of file graph/node.cpp.
References get_socket_value(), socket_is_modified(), and socket_modified.
|
protected |
Definition at line 870 of file graph/node.cpp.
References get_socket_value(), socket_is_modified(), and socket_modified.
|
protected |
Definition at line 851 of file graph/node.cpp.
References dereference(), get_socket_value(), and socket_modified.
|
protected |
| 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().
| void Node::set_value | ( | const SocketType & | input, |
| const Node & | other, | ||
| const SocketType & | other_input ) |
Definition at line 397 of file graph/node.cpp.
References SocketType::BOOLEAN, SocketType::BOOLEAN_ARRAY, SocketType::COLOR, SocketType::COLOR_ARRAY, SocketType::ENUM, SocketType::FLOAT, SocketType::FLOAT_ARRAY, get_socket_value(), SocketType::INT, SocketType::INT_ARRAY, SocketType::is_array(), SocketType::NODE, SocketType::NODE_ARRAY, SocketType::NORMAL, SocketType::NORMAL_ARRAY, SocketType::POINT, SocketType::POINT2, SocketType::POINT2_ARRAY, SocketType::POINT_ARRAY, set(), SocketType::STRING, SocketType::STRING_ARRAY, SocketType::TRANSFORM, SocketType::TRANSFORM_ARRAY, SocketType::type, SocketType::UINT, SocketType::UINT64, SocketType::VECTOR, and SocketType::VECTOR_ARRAY.
Referenced by add_node(), ShaderGraph::constant_fold(), and blender::io::grease_pencil::SVGExporter::export_grease_pencil_objects().
| 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().
| void Node::tag_modified | ( | ) |
Definition at line 831 of file graph/node.cpp.
References socket_modified.
Referenced by Geometry::clear(), Scene::device_update(), Node(), Scene::reset(), Camera::set_screen_size(), Geometry::tag_bvh_update(), Integrator::tag_update(), Shader::tag_update(), Shader::tag_used(), and Film::update_passes().
| InternalNode Node::internal |
Definition at line 165 of file octree.h.
Referenced by Octree::scanConvert().
| ustring Node::name |
Definition at line 177 of file graph/node.h.
Referenced by ShaderManager::add_default(), add_node(), BlenderSession::bake(), ConstantFolder::bypass(), copy_particle_systems_to_object(), ObjectManager::device_update_object_transform(), ED_mesh_join_objects_exec(), Pass::find(), blender::draw::point_cloud_sub_pass_setup_implementation(), ShaderNode::ShaderNode(), SVMCompiler::stack_find_offset(), template_id_liboverride_hierarchy_collections_tag_recursive(), update_depsgraph(), and blender::ed::object::vgroup_sort_bone_hierarchy().
|
protected |
Definition at line 207 of file graph/node.h.
Referenced by get_owner(), Node(), and set_owner().
|
protected |
Definition at line 208 of file graph/node.h.
Referenced by clear_reference_count(), dereference(), reference(), and reference_count().
|
protected |
Definition at line 215 of file graph/node.h.
Referenced by clear_modified(), is_modified(), set_if_different(), set_if_different(), set_if_different(), set_if_different(), socket_is_modified(), and tag_modified().
| const NodeType* Node::type |
Definition at line 178 of file graph/node.h.
Referenced by OSLNode::add_input(), OSLNode::add_output(), blender::deg::DepsgraphRelationBuilder::build_particle_systems(), compile_shader_program(), Pass::contains(), ShaderGraph::copy_nodes(), OSLNode::create(), LightManager::device_update_background(), Pass::get_info(), NODE_DEFINE(), NODE_DEFINE(), NODE_DEFINE(), Hair::pack_curves(), and OSLNode::~OSLNode().