Blender V4.5
OSLNode Class Referencefinal

#include <shader_nodes.h>

Inherits ShaderNode.

Public Member Functions

 ~OSLNode () override
 
ShaderNodeclone (ShaderGraph *graph) const override
 
void attributes (Shader *shader, AttributeRequestSet *attributes) override
 
char * input_default_value ()
 
void add_input (ustring name, SocketType::Type type, const int flags=0)
 
void add_output (ustring name, SocketType::Type type)
 
bool has_surface_emission () override
 
bool has_spatial_varying () override
 
bool has_volume_support () override
 
int get_feature () override
 
bool equals (const ShaderNode &) override
 
- Public Member Functions inherited from ShaderNode
 ShaderNode (const NodeType *type)
 
 ShaderNode (const ShaderNode &other)
 
void create_inputs_outputs (const NodeType *type)
 
void remove_input (ShaderInput *input)
 
ShaderInputinput (const char *name)
 
ShaderOutputoutput (const char *name)
 
ShaderInputinput (ustring name)
 
ShaderOutputoutput (ustring name)
 
virtual void compile (SVMCompiler &compiler)=0
 
virtual void compile (OSLCompiler &compiler)=0
 
virtual void expand (ShaderGraph *)
 
virtual void constant_fold (const ConstantFolder &)
 
virtual void simplify_settings (Scene *)
 
virtual bool has_surface_transparent ()
 
virtual bool has_surface_bssrdf ()
 
virtual bool has_bump ()
 
virtual bool has_bssrdf_bump ()
 
virtual bool has_attribute_dependency ()
 
virtual ClosureType get_closure_type ()
 
- Public Member Functions inherited from Node
 Node (const NodeType *type, ustring name=ustring())
 
virtual ~Node ()=0
 
void set (const SocketType &input, bool value)
 
void set (const SocketType &input, const int value)
 
void set (const SocketType &input, const uint value)
 
void set (const SocketType &input, const uint64_t value)
 
void set (const SocketType &input, const float value)
 
void set (const SocketType &input, const float2 value)
 
void set (const SocketType &input, const 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 &socket) const
 
void copy_value (const SocketType &socket, const Node &other, const SocketType &other_socket)
 
void set_value (const SocketType &socket, const Node &other, const SocketType &other_socket)
 
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 ()
 

Static Public Member Functions

static OSLNodecreate (ShaderGraph *graph, const size_t num_inputs, const OSLNode *from=nullptr)
 
static void operator delete (void *ptr)
 
static void operator delete (void *, void *)
 

Public Attributes

string filepath
 
string bytecode_hash
 
bool has_emission
 
- Public Attributes inherited from ShaderNode
unique_ptr_vector< ShaderInputinputs
 
unique_ptr_vector< ShaderOutputoutputs
 
int id = -1
 
ShaderBump bump = SHADER_BUMP_NONE
 
float bump_filter_width = 0.0f
 
ShaderNodeSpecialType special_type = SHADER_SPECIAL_TYPE_NONE
 
- Public Attributes inherited from Node
ustring name
 
const NodeTypetype
 
InternalNode internal
 
LeafNode leaf
 

Additional Inherited Members

- Protected Member Functions inherited from Node
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 inherited from Node
template<typename T >
static Tget_socket_value (const Node *node, const SocketType &socket)
 
- Protected Attributes inherited from Node
const NodeOwnerowner
 
int ref_count {0}
 
SocketModifiedFlags socket_modified
 

Detailed Description

Definition at line 1567 of file shader_nodes.h.

Constructor & Destructor Documentation

◆ ~OSLNode()

OSLNode::~OSLNode ( )
override

Definition at line 7591 of file shader_nodes.cpp.

References Node::type.

Member Function Documentation

◆ add_input()

void OSLNode::add_input ( ustring name,
SocketType::Type type,
const int flags = 0 )

Definition at line 7650 of file shader_nodes.cpp.

References input_default_value(), SocketType::LINKABLE, Node::name, and Node::type.

◆ add_output()

void OSLNode::add_output ( ustring name,
SocketType::Type type )

Definition at line 7658 of file shader_nodes.cpp.

References Node::name, and Node::type.

◆ attributes()

void OSLNode::attributes ( Shader * shader,
AttributeRequestSet * attributes )
overridevirtual

◆ clone()

ShaderNode * OSLNode::clone ( ShaderGraph * graph) const
overridevirtual

Implements ShaderNode.

Definition at line 7596 of file shader_nodes.cpp.

References create(), graph, ShaderNode::inputs, and unique_ptr_vector< T >::size().

◆ create()

OSLNode * OSLNode::create ( ShaderGraph * graph,
const size_t num_inputs,
const OSLNode * from = nullptr )
static

Definition at line 7621 of file shader_nodes.cpp.

References align_up(), from, graph, SocketType::max_size(), node, and Node::type.

Referenced by clone().

◆ equals()

bool OSLNode::equals ( const ShaderNode & )
inlineoverridevirtual

Reimplemented from ShaderNode.

Definition at line 1615 of file shader_nodes.h.

◆ get_feature()

int OSLNode::get_feature ( )
inlineoverridevirtual

Reimplemented from ShaderNode.

Definition at line 1610 of file shader_nodes.h.

References ShaderNode::get_feature(), and KERNEL_FEATURE_NODE_RAYTRACE.

◆ has_spatial_varying()

bool OSLNode::has_spatial_varying ( )
inlineoverridevirtual

Reimplemented from ShaderNode.

Definition at line 1602 of file shader_nodes.h.

◆ has_surface_emission()

bool OSLNode::has_surface_emission ( )
inlineoverridevirtual

Reimplemented from ShaderNode.

Definition at line 1596 of file shader_nodes.h.

◆ has_volume_support()

bool OSLNode::has_volume_support ( )
inlineoverridevirtual

Reimplemented from ShaderNode.

Definition at line 1606 of file shader_nodes.h.

◆ input_default_value()

char * OSLNode::input_default_value ( )

Definition at line 7642 of file shader_nodes.cpp.

References align_up(), NodeType::inputs, SocketType::max_size(), and Node::type.

Referenced by add_input().

◆ operator delete() [1/2]

static void OSLNode::operator delete ( void * ,
void *  )
inlinestatic

Definition at line 1581 of file shader_nodes.h.

◆ operator delete() [2/2]

static void OSLNode::operator delete ( void * ptr)
inlinestatic

Definition at line 1574 of file shader_nodes.h.

References ptr.

Member Data Documentation

◆ bytecode_hash

string OSLNode::bytecode_hash

Definition at line 1621 of file shader_nodes.h.

Referenced by ShaderGraph::compute_displacement_hash().

◆ filepath

string OSLNode::filepath

Definition at line 1620 of file shader_nodes.h.

◆ has_emission

bool OSLNode::has_emission

Definition at line 1622 of file shader_nodes.h.


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