MaterialX: Implement export of Input nodes #20

Merged
Bogdan Nagirniak merged 26 commits from Vasyl-Pidhirskyi/blender:BLEN-530 into matx-export-material 2023-09-15 19:55:37 +02:00
Showing only changes of commit 6acf520cf1 - Show all commits

View File

@ -71,6 +71,27 @@ static int node_shader_gpu_tex_coord(GPUMaterial *mat,
return 1; return 1;
} }
NODE_SHADER_MATERIALX_BEGIN
{
/* TODO: Partially implemented, some nodes don't have an implementation in MaterialX 1.38.6.
* some outputs expected be implemented within the next iteration*/
BogdanNagirniak marked this conversation as resolved Outdated

This node I think has to be implemented in this PR

This node I think has to be implemented in this PR
CLG_LogRef *LOG_MATERIALX_SHADER = materialx::LOG_MATERIALX_SHADER;
NodeItem res = val(MaterialX::Vector2(1.0f, 1.0f));
const char *output_name = socket_out_->name;
if (STREQ(output_name, "UV")) {
res = texcoord_node();
}
else {
CLOG_WARN(LOG_MATERIALX_SHADER, "Unimplemented output %s", output_name);
}
return res;
}
NODE_SHADER_MATERIALX_END
} // namespace blender::nodes::node_shader_tex_coord_cc } // namespace blender::nodes::node_shader_tex_coord_cc
/* node type definition */ /* node type definition */
@ -84,6 +105,7 @@ void register_node_type_sh_tex_coord()
ntype.declare = file_ns::node_declare; ntype.declare = file_ns::node_declare;
ntype.draw_buttons = file_ns::node_shader_buts_tex_coord; ntype.draw_buttons = file_ns::node_shader_buts_tex_coord;
ntype.gpu_fn = file_ns::node_shader_gpu_tex_coord; ntype.gpu_fn = file_ns::node_shader_gpu_tex_coord;
ntype.materialx_fn = file_ns::node_shader_materialx;
nodeRegisterType(&ntype); nodeRegisterType(&ntype);
} }