forked from blender/blender
Parsing Improvements #14
@ -32,7 +32,7 @@ MaterialX::DocumentPtr export_to_materialx(Depsgraph *depsgraph, Material *mater
|
||||
}
|
||||
|
||||
CLOG_INFO(LOG_MATERIALX_SHADER,
|
||||
2,
|
||||
1,
|
||||
"Material: %s\n%s",
|
||||
material->id.name,
|
||||
MaterialX::writeToXmlString(doc).c_str());
|
||||
|
@ -617,6 +617,14 @@ NodeItem::Type NodeItem::type() const
|
||||
return Type::Empty;
|
||||
}
|
||||
|
||||
NodeItem NodeItem::create_node(const std::string &mx_category, NodeItem::Type type)
|
||||
{
|
||||
std::string mx_type = this->type(type);
|
||||
CLOG_INFO(LOG_MATERIALX_SHADER, 2, "%s, %s", mx_category.c_str(), mx_type.c_str());
|
||||
node = graph_->addNode(mx_category, MaterialX::EMPTY_STRING, mx_type);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void NodeItem::set_input(const std::string &in_name, const NodeItem &item)
|
||||
{
|
||||
if (item.value) {
|
||||
|
@ -97,6 +97,7 @@ class NodeItem {
|
||||
NodeItem empty() const;
|
||||
template<class T> NodeItem val(const T &data) const;
|
||||
Type type() const;
|
||||
NodeItem create_node(const std::string &mx_category, NodeItem::Type type);
|
||||
|
||||
/* Functions to set input and output */
|
||||
template<class T>
|
||||
|
@ -41,9 +41,7 @@ std::string NodeParser::node_name()
|
||||
|
||||
NodeItem NodeParser::create_node(const std::string &mx_category, NodeItem::Type type)
|
||||
{
|
||||
NodeItem res = empty();
|
||||
res.node = graph_->addNode(mx_category, MaterialX::EMPTY_STRING, NodeItem::type(type));
|
||||
return res;
|
||||
return empty().create_node(mx_category, type);
|
||||
}
|
||||
|
||||
NodeItem NodeParser::get_input_default(const std::string &name, NodeItem::Type to_type)
|
||||
|
Loading…
Reference in New Issue
Block a user