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 1b8215f48e - Show all commits

View File

@ -67,6 +67,19 @@ static int node_shader_gpu_vertex_color(GPUMaterial *mat,
return GPU_stack_link(mat, node, "node_vertex_color", in, out, vertexColorLink);
}
NODE_SHADER_MATERIALX_BEGIN
{
/* TODO: some output expected be implemented within the next iteration (see nodedef
* <geomcolor>)*/
NodeItem res = val(MaterialX::Color4(1.0f, 0.0f, 1.0f, 1.0f));
BogdanNagirniak marked this conversation as resolved
Review

start from empty()

start from empty()
if (STREQ(socket_out_->name, "Alpha")) {
res = res.extract(3);
}
return res;
}
NODE_SHADER_MATERIALX_END
} // namespace blender::nodes::node_shader_vertex_color_cc
void register_node_type_sh_vertex_color()
@ -82,6 +95,7 @@ void register_node_type_sh_vertex_color()
node_type_storage(
&ntype, "NodeShaderVertexColor", node_free_standard_storage, node_copy_standard_storage);
ntype.gpu_fn = file_ns::node_shader_gpu_vertex_color;
ntype.materialx_fn = file_ns::node_shader_materialx;
nodeRegisterType(&ntype);
}