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 70324222ab - Show all commits

View File

@ -26,6 +26,14 @@ static int gpu_shader_rgb(GPUMaterial *mat,
return GPU_link(mat, "set_rgba", GPU_uniform(value), &out->link); return GPU_link(mat, "set_rgba", GPU_uniform(value), &out->link);
} }
NODE_SHADER_MATERIALX_BEGIN
{
NodeItem res = create_node("constant", NodeItem::Type::Color4);
res.set_input("value", get_output_default("Color"));
return res;
}
NODE_SHADER_MATERIALX_END
} // namespace blender::nodes::node_shader_rgb_cc } // namespace blender::nodes::node_shader_rgb_cc
void register_node_type_sh_rgb() void register_node_type_sh_rgb()
@ -37,6 +45,7 @@ void register_node_type_sh_rgb()
sh_node_type_base(&ntype, SH_NODE_RGB, "RGB", NODE_CLASS_INPUT); sh_node_type_base(&ntype, SH_NODE_RGB, "RGB", NODE_CLASS_INPUT);
ntype.declare = file_ns::node_declare; ntype.declare = file_ns::node_declare;
ntype.gpu_fn = file_ns::gpu_shader_rgb; ntype.gpu_fn = file_ns::gpu_shader_rgb;
ntype.materialx_fn = file_ns::node_shader_materialx;
nodeRegisterType(&ntype); nodeRegisterType(&ntype);
} }