Cleanup: Use new socket builder API
Also enables translation of socket names
This commit is contained in:
parent
a5b4373f95
commit
50f694c7de
|
@ -23,19 +23,19 @@
|
|||
|
||||
namespace blender::nodes::node_shader_particle_info_cc {
|
||||
|
||||
static bNodeSocketTemplate outputs[] = {
|
||||
{SOCK_FLOAT, "Index"},
|
||||
{SOCK_FLOAT, "Random"},
|
||||
{SOCK_FLOAT, "Age"},
|
||||
{SOCK_FLOAT, "Lifetime"},
|
||||
{SOCK_VECTOR, "Location"},
|
||||
static void node_declare(NodeDeclarationBuilder &b)
|
||||
{
|
||||
b.add_output<decl::Float>(N_("Index"));
|
||||
b.add_output<decl::Float>(N_("Random"));
|
||||
b.add_output<decl::Float>(N_("Age"));
|
||||
b.add_output<decl::Float>(N_("Lifetime"));
|
||||
b.add_output<decl::Vector>(N_("Location"));
|
||||
#if 0 /* quaternion sockets not yet supported */
|
||||
{SOCK_QUATERNION, "Rotation"},
|
||||
b.add_output<decl::Quaternion>(N_("Rotation"));
|
||||
#endif
|
||||
{SOCK_FLOAT, "Size"},
|
||||
{SOCK_VECTOR, "Velocity"},
|
||||
{SOCK_VECTOR, "Angular Velocity"},
|
||||
{-1, ""},
|
||||
b.add_output<decl::Float>(N_("Size"));
|
||||
b.add_output<decl::Vector>(N_("Velocity"));
|
||||
b.add_output<decl::Vector>(N_("Angular Velocity"));
|
||||
};
|
||||
|
||||
static int gpu_shader_particle_info(GPUMaterial *mat,
|
||||
|
@ -66,7 +66,7 @@ void register_node_type_sh_particle_info()
|
|||
static bNodeType ntype;
|
||||
|
||||
sh_node_type_base(&ntype, SH_NODE_PARTICLE_INFO, "Particle Info", NODE_CLASS_INPUT);
|
||||
node_type_socket_templates(&ntype, nullptr, file_ns::outputs);
|
||||
ntype.declare = file_ns::node_declare;
|
||||
node_type_gpu(&ntype, file_ns::gpu_shader_particle_info);
|
||||
|
||||
nodeRegisterType(&ntype);
|
||||
|
|
Loading…
Reference in New Issue