5#include <MaterialXFormat/XmlIo.h>
32 {{
"base_weight",
val(1.0f)},
33 {
"base_color",
val(MaterialX::Color3(material->
r, material->
g, material->
b))},
35 {
"specular_weight",
val(material->
spec)},
47 {{
"base_color",
val(MaterialX::Color3(1.0f, 0.0f, 1.0f))}});
60 MaterialX::DocumentPtr doc = MaterialX::createDocument();
72 local_tree->ensure_topology_cache();
74 if (output_node && output_node->
typeinfo->materialx_fn) {
76 output_node->
typeinfo->materialx_fn(&
data, output_node,
nullptr);
77 output_item =
data.result;
91 MaterialX::writeToXmlString(doc).c_str());
void BKE_id_free(Main *bmain, void *idv)
#define BLI_SCOPED_DEFER(function_to_defer)
#define CLOG_DEBUG(clg_ref,...)
struct bNode * ntreeShaderOutputNode(struct bNodeTree *ntree, int target)
BMesh const char void * data
BPy_StructRNA * depsgraph
NodeParser(NodeGraph &graph, const bNode *node, const bNodeSocket *socket_out, NodeItem::Type to_type, GroupNodeParser *group_parser)
NodeItem compute() override
NodeParser(NodeGraph &graph, const bNode *node, const bNodeSocket *socket_out, NodeItem::Type to_type, GroupNodeParser *group_parser)
NodeItem create_node(const std::string &category, NodeItem::Type type)
NodeItem val(const T &data) const
bNodeTree * node_tree_add_tree(Main *bmain, StringRef name, StringRef idname)
struct CLG_LogRef * LOG_IO_MATERIALX
MaterialX::DocumentPtr export_to_materialx(Depsgraph *depsgraph, Material *material, const ExportParams &export_params)
bool inline_shader_node_tree(const bNodeTree &src_tree, bNodeTree &dst_tree, InlineShaderNodeTreeParams ¶ms)
struct bNodeTree * nodetree
bNodeTypeHandle * typeinfo
void set_output_node_name(const NodeItem &item) const
NodeItem empty_node() const