matx-code-improvements #8

Merged
Bogdan Nagirniak merged 6 commits from BogdanNagirniak/blender:matx-code-improvements into matx-export-material 2023-09-04 10:10:09 +02:00
2 changed files with 10 additions and 1 deletions
Showing only changes of commit a52af50029 - Show all commits

View File

@ -143,7 +143,7 @@ NodeItem NodeParser::get_input_value(const bNodeSocket &socket)
NodeItem NodeParser::compute_full()
{
CLOG_INFO(LOG_MATERIALX_SHADER, 1, "Node: %s [%d]", node->name, node->typeinfo->type);
CLOG_INFO(LOG_MATERIALX_SHADER, 1, "%s [%d]", node->name, node->typeinfo->type);
NodeItem res = compute();
if (res.node) {
res.set_name(node->output_sockets().size() == 1 ?

View File

@ -38,6 +38,15 @@ NodeItem OutputMaterialNodeParser::compute_default()
{
NodeItem surface = create_node("standard_surface", "surfaceshader");
surface.set_input("base_color", value(MaterialX::Color3(material->r, material->g, material->b)));
surface.set_input("diffuse_roughness", value(material->roughness));
if (material->metallic > 0.0f) {
surface.set_input("metalness", value(material->metallic));
}
if (material->spec) {
surface.set_input("specular", value(material->spec));
surface.set_input("specular_color", value(material->spec));
surface.set_input("specular_roughness", value(material->roughness));
}
NodeItem res = create_node("surfacematerial", "material");
res.set_name("Material");