From 50f694c7def8bae73d33cb3c5e0fed3ad066820e Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Wed, 5 Jan 2022 15:09:55 -0500 Subject: Cleanup: Use new socket builder API Also enables translation of socket names --- .../shader/nodes/node_shader_particle_info.cc | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/source/blender/nodes/shader/nodes/node_shader_particle_info.cc b/source/blender/nodes/shader/nodes/node_shader_particle_info.cc index 40c5ff6db9b..163a5d6ebfe 100644 --- a/source/blender/nodes/shader/nodes/node_shader_particle_info.cc +++ b/source/blender/nodes/shader/nodes/node_shader_particle_info.cc @@ -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(N_("Index")); + b.add_output(N_("Random")); + b.add_output(N_("Age")); + b.add_output(N_("Lifetime")); + b.add_output(N_("Location")); #if 0 /* quaternion sockets not yet supported */ - {SOCK_QUATERNION, "Rotation"}, + b.add_output(N_("Rotation")); #endif - {SOCK_FLOAT, "Size"}, - {SOCK_VECTOR, "Velocity"}, - {SOCK_VECTOR, "Angular Velocity"}, - {-1, ""}, + b.add_output(N_("Size")); + b.add_output(N_("Velocity")); + b.add_output(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); -- cgit v1.2.3