forked from blender/blender
MaterialX: Implement export of Input nodes #20
@ -77,6 +77,25 @@ static int node_shader_gpu_attribute(GPUMaterial *mat,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NODE_SHADER_MATERIALX_BEGIN
|
||||||
|
{
|
||||||
|
/* TODO: some outputs expected be implemented within the next iteration (see nodedef
|
||||||
|
* <geompropvalue>) */
|
||||||
|
NodeItem res = val(MaterialX::Color4(1.0f, 0.0f, 1.0f, 1.0f));
|
||||||
BogdanNagirniak marked this conversation as resolved
|
|||||||
|
if (STREQ(socket_out_->name, "Vector")) {
|
||||||
|
res = val(MaterialX::Vector3(1.0f, 1.0f, 1.0f));
|
||||||
|
}
|
||||||
|
if (STREQ(socket_out_->name, "Factor")) {
|
||||||
|
res = res.extract(3);
|
||||||
|
}
|
||||||
|
if (STREQ(socket_out_->name, "Alpha")) {
|
||||||
|
res = res.extract(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
NODE_SHADER_MATERIALX_END
|
||||||
|
|
||||||
} // namespace blender::nodes::node_shader_attribute_cc
|
} // namespace blender::nodes::node_shader_attribute_cc
|
||||||
|
|
||||||
/* node type definition */
|
/* node type definition */
|
||||||
@ -93,6 +112,7 @@ void register_node_type_sh_attribute()
|
|||||||
node_type_storage(
|
node_type_storage(
|
||||||
&ntype, "NodeShaderAttribute", node_free_standard_storage, node_copy_standard_storage);
|
&ntype, "NodeShaderAttribute", node_free_standard_storage, node_copy_standard_storage);
|
||||||
ntype.gpu_fn = file_ns::node_shader_gpu_attribute;
|
ntype.gpu_fn = file_ns::node_shader_gpu_attribute;
|
||||||
|
ntype.materialx_fn = file_ns::node_shader_materialx;
|
||||||
|
|
||||||
nodeRegisterType(&ntype);
|
nodeRegisterType(&ntype);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user
Start with
NodeItem res = empty();
add checkif (STREQ(socket_out_->name, "Color"))