forked from blender/blender
MaterialX: Implement export of Input nodes #20
@ -34,6 +34,20 @@ static int gpu_shader_particle_info(GPUMaterial *mat,
|
|||||||
return GPU_stack_link(mat, node, "particle_info", in, out);
|
return GPU_stack_link(mat, node, "particle_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, "Index") || STREQ(socket_out_->name, "Random") ||
|
||||||
BogdanNagirniak marked this conversation as resolved
Outdated
|
|||||||
|
STREQ(socket_out_->name, "Age") || STREQ(socket_out_->name, "Lifetime") ||
|
||||||
|
STREQ(socket_out_->name, "Size"))
|
||||||
|
{
|
||||||
|
res = res.extract(2);
|
||||||
|
}
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
NODE_SHADER_MATERIALX_END
|
||||||
|
|
||||||
} // namespace blender::nodes::node_shader_particle_info_cc
|
} // namespace blender::nodes::node_shader_particle_info_cc
|
||||||
|
|
||||||
/* node type definition */
|
/* node type definition */
|
||||||
@ -46,6 +60,7 @@ void register_node_type_sh_particle_info()
|
|||||||
sh_node_type_base(&ntype, SH_NODE_PARTICLE_INFO, "Particle Info", NODE_CLASS_INPUT);
|
sh_node_type_base(&ntype, SH_NODE_PARTICLE_INFO, "Particle Info", NODE_CLASS_INPUT);
|
||||||
ntype.declare = file_ns::node_declare;
|
ntype.declare = file_ns::node_declare;
|
||||||
ntype.gpu_fn = file_ns::gpu_shader_particle_info;
|
ntype.gpu_fn = file_ns::gpu_shader_particle_info;
|
||||||
|
ntype.materialx_fn = file_ns::node_shader_materialx;
|
||||||
|
|
||||||
nodeRegisterType(&ntype);
|
nodeRegisterType(&ntype);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user
use
std::string name = socket_out_->name
andELEM(name, ....)