Blender V4.3
blender::nodes::materialx::NodeParser Class Referenceabstract

#include <node_parser.h>

Inherited by blender::nodes::materialx::DefaultMaterialNodeParser, and blender::nodes::materialx::GroupNodeParser.

Public Member Functions

 NodeParser (MaterialX::GraphElement *graph, const Depsgraph *depsgraph, const Material *material, const bNode *node, const bNodeSocket *socket_out, NodeItem::Type to_type, GroupNodeParser *group_parser, const ExportParams &export_params)
 
virtual ~NodeParser ()=default
 
virtual NodeItem compute ()=0
 
virtual NodeItem compute_full ()
 

Protected Member Functions

std::string node_name (bool with_out_socket=true) const
 
NodeItem create_node (const std::string &category, NodeItem::Type type)
 
NodeItem create_node (const std::string &category, NodeItem::Type type, const NodeItem::Inputs &inputs)
 
NodeItem create_input (const std::string &name, const NodeItem &item)
 
NodeItem create_output (const std::string &name, const NodeItem &item)
 
NodeItem get_input_default (const std::string &name, NodeItem::Type to_type)
 
NodeItem get_input_default (int index, NodeItem::Type to_type)
 
NodeItem get_output_default (const std::string &name, NodeItem::Type to_type)
 
NodeItem get_output_default (int index, NodeItem::Type to_type)
 
NodeItem get_input_link (const std::string &name, NodeItem::Type to_type)
 
NodeItem get_input_link (int index, NodeItem::Type to_type)
 
NodeItem get_input_value (const std::string &name, NodeItem::Type to_type)
 
NodeItem get_input_value (int index, NodeItem::Type to_type)
 
NodeItem empty () const
 
template<class T >
NodeItem val (const T &data) const
 
NodeItem texcoord_node (NodeItem::Type type=NodeItem::Type::Vector2, const std::string &attribute_name="")
 

Protected Attributes

MaterialX::GraphElement * graph_
 
const Depsgraph * depsgraph_
 
const Materialmaterial_
 
const bNodenode_
 
const bNodeSocketsocket_out_
 
NodeItem::Type to_type_
 
GroupNodeParsergroup_parser_
 
ExportParams export_params_
 

Detailed Description

This is base abstraction class for parsing Blender nodes into MaterialX nodes. NodeParser::compute() should be overridden in child classes.

Definition at line 26 of file node_parser.h.

Constructor & Destructor Documentation

◆ NodeParser()

blender::nodes::materialx::NodeParser::NodeParser ( MaterialX::GraphElement * graph,
const Depsgraph * depsgraph,
const Material * material,
const bNode * node,
const bNodeSocket * socket_out,
NodeItem::Type to_type,
GroupNodeParser * group_parser,
const ExportParams & export_params )

Definition at line 21 of file node_parser.cc.

◆ ~NodeParser()

virtual blender::nodes::materialx::NodeParser::~NodeParser ( )
virtualdefault

Member Function Documentation

◆ compute()

◆ compute_full()

◆ create_input()

NodeItem blender::nodes::materialx::NodeParser::create_input ( const std::string & name,
const NodeItem & item )
protected

Definition at line 118 of file node_parser.cc.

References blender::nodes::materialx::NodeItem::create_input(), and empty().

◆ create_node() [1/2]

◆ create_node() [2/2]

NodeItem blender::nodes::materialx::NodeParser::create_node ( const std::string & category,
NodeItem::Type type,
const NodeItem::Inputs & inputs )
protected

Definition at line 111 of file node_parser.cc.

References blender::nodes::materialx::NodeItem::create_node(), and empty().

◆ create_output()

NodeItem blender::nodes::materialx::NodeParser::create_output ( const std::string & name,
const NodeItem & item )
protected

◆ empty()

NodeItem blender::nodes::materialx::NodeParser::empty ( ) const
protected

◆ get_input_default() [1/2]

NodeItem blender::nodes::materialx::NodeParser::get_input_default ( const std::string & name,
NodeItem::Type to_type )
protected

Definition at line 128 of file node_parser.cc.

References node_, and blender::gpu::shader::to_type().

◆ get_input_default() [2/2]

NodeItem blender::nodes::materialx::NodeParser::get_input_default ( int index,
NodeItem::Type to_type )
protected

Definition at line 133 of file node_parser.cc.

References node_, and blender::gpu::shader::to_type().

◆ get_input_link() [1/2]

NodeItem blender::nodes::materialx::NodeParser::get_input_link ( const std::string & name,
NodeItem::Type to_type )
protected

Definition at line 138 of file node_parser.cc.

References get_input_link(), node_, and blender::gpu::shader::to_type().

Referenced by get_input_link(), and get_input_link().

◆ get_input_link() [2/2]

NodeItem blender::nodes::materialx::NodeParser::get_input_link ( int index,
NodeItem::Type to_type )
protected

Definition at line 143 of file node_parser.cc.

References get_input_link(), node_, and blender::gpu::shader::to_type().

◆ get_input_value() [1/2]

NodeItem blender::nodes::materialx::NodeParser::get_input_value ( const std::string & name,
NodeItem::Type to_type )
protected

◆ get_input_value() [2/2]

NodeItem blender::nodes::materialx::NodeParser::get_input_value ( int index,
NodeItem::Type to_type )
protected

Definition at line 153 of file node_parser.cc.

References get_input_value(), node_, and blender::gpu::shader::to_type().

◆ get_output_default() [1/2]

NodeItem blender::nodes::materialx::NodeParser::get_output_default ( const std::string & name,
NodeItem::Type to_type )
protected

Definition at line 158 of file node_parser.cc.

References node_, and blender::gpu::shader::to_type().

◆ get_output_default() [2/2]

NodeItem blender::nodes::materialx::NodeParser::get_output_default ( int index,
NodeItem::Type to_type )
protected

Definition at line 163 of file node_parser.cc.

References node_, and blender::gpu::shader::to_type().

◆ node_name()

◆ texcoord_node()

◆ val()

template<class T >
NodeItem blender::nodes::materialx::NodeParser::val ( const T & data) const
protected

Member Data Documentation

◆ depsgraph_

const Depsgraph* blender::nodes::materialx::NodeParser::depsgraph_
protected

Definition at line 29 of file node_parser.h.

Referenced by blender::nodes::materialx::GroupNodeParser::compute().

◆ export_params_

ExportParams blender::nodes::materialx::NodeParser::export_params_
protected

◆ graph_

MaterialX::GraphElement* blender::nodes::materialx::NodeParser::graph_
protected

◆ group_parser_

GroupNodeParser* blender::nodes::materialx::NodeParser::group_parser_
protected

Definition at line 34 of file node_parser.h.

Referenced by node_name().

◆ material_

const Material* blender::nodes::materialx::NodeParser::material_
protected

◆ node_

◆ socket_out_

const bNodeSocket* blender::nodes::materialx::NodeParser::socket_out_
protected

Definition at line 32 of file node_parser.h.

Referenced by blender::nodes::materialx::GroupNodeParser::compute(), and node_name().

◆ to_type_


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