Blender V5.0
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 (NodeGraph &graph, const bNode *node, const bNodeSocket *socket_out, NodeItem::Type to_type, GroupNodeParser *group_parser)
virtual ~NodeParser ()=default
virtual NodeItem compute ()=0
virtual NodeItem compute_full ()

Protected Member Functions

std::string node_name (const char *override_output_name=nullptr) 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

NodeGraphgraph_
const bNodenode_
const bNodeSocketsocket_out_
NodeItem::Type to_type_
GroupNodeParsergroup_parser_

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 25 of file node_parser.h.

Constructor & Destructor Documentation

◆ NodeParser()

blender::nodes::materialx::NodeParser::NodeParser ( NodeGraph & graph,
const bNode * node,
const bNodeSocket * socket_out,
NodeItem::Type to_type,
GroupNodeParser * group_parser )

◆ ~NodeParser()

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

Member Function Documentation

◆ compute()

◆ compute_full()

NodeItem blender::nodes::materialx::NodeParser::compute_full ( )
virtual

◆ create_input()

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

Definition at line 80 of file node_parser.cc.

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

◆ 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

◆ 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 90 of file node_parser.cc.

References name, 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 95 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 100 of file node_parser.cc.

References get_input_link(), name, 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 105 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 115 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 120 of file node_parser.cc.

References name, 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 125 of file node_parser.cc.

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

◆ node_name()

std::string blender::nodes::materialx::NodeParser::node_name ( const char * override_output_name = nullptr) const
protected

◆ texcoord_node()

◆ val()

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

Member Data Documentation

◆ graph_

◆ group_parser_

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

◆ node_

◆ socket_out_

◆ to_type_


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