5#include <MaterialXFormat/XmlIo.h>
32 {{
"base_weight",
val(1.0f)},
33 {
"base_color",
val(MaterialX::Color3(material->r, material->g, material->b))},
34 {
"base_diffuse_roughness",
val(material->roughness)},
35 {
"specular_weight",
val(material->spec)},
36 {
"base_metalness",
val(material->metallic)}});
47 {{
"base_color",
val(MaterialX::Color3(1.0f, 0.0f, 1.0f))}});
60 MaterialX::DocumentPtr doc = MaterialX::createDocument();
63 NodeGraph graph(depsgraph, material, export_params, doc);
66 nullptr,
"Inlined Tree", material->nodetree->idname);
72 local_tree->ensure_topology_cache();
77 output_item =
data.result;
91 MaterialX::writeToXmlString(doc).c_str());
#define BLI_SCOPED_DEFER(function_to_defer)
#define CLOG_DEBUG(clg_ref,...)
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)
CLG_LogRef * LOG_IO_MATERIALX
MaterialX::DocumentPtr export_to_materialx(const Depsgraph *depsgraph, const Material *material, const ExportParams &export_params)
bool inline_shader_node_tree(const bNodeTree &src_tree, bNodeTree &dst_tree, InlineShaderNodeTreeParams ¶ms)
struct bNode * ntreeShaderOutputNode(struct bNodeTree *ntree, int target)
BMesh const char void * data
void BKE_id_free(Main *bmain, void *idv)
bke::bNodeType * typeinfo
NodeMaterialXFunction materialx_fn
void set_output_node_name(const NodeItem &item) const
const Material * material
NodeItem empty_node() const