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 6eb75647bb - Show all commits

View File

@ -22,6 +22,17 @@ static int node_shader_gpu_point_info(GPUMaterial *mat,
return GPU_stack_link(mat, node, "node_point_info", in, out);
}
NODE_SHADER_MATERIALX_BEGIN
{
/* TODO: This node doesn't have an implementation in MaterialX 1.38.6.*/
NodeItem res = val(MaterialX::Vector3(1.0f, 1.0f, 1.0f));
if (STREQ(socket_out_->name, "Radius") || STREQ(socket_out_->name, "Random")) {
res = res.extract(2);
}
return res;
BogdanNagirniak marked this conversation as resolved
Review

I think return get_output_default can be used here

I think `return get_output_default` can be used here
}
NODE_SHADER_MATERIALX_END
} // namespace blender::nodes::node_shader_point_info_cc
/* node type definition */
@ -34,6 +45,7 @@ void register_node_type_sh_point_info()
sh_node_type_base(&ntype, SH_NODE_POINT_INFO, "Point Info", NODE_CLASS_INPUT);
ntype.declare = file_ns::node_declare;
ntype.gpu_fn = file_ns::node_shader_gpu_point_info;
ntype.materialx_fn = file_ns::node_shader_materialx;
nodeRegisterType(&ntype);
}