diff options
author | Aaron Carlisle <carlisle.b3d@gmail.com> | 2022-01-05 23:09:55 +0300 |
---|---|---|
committer | Aaron Carlisle <carlisle.b3d@gmail.com> | 2022-01-05 23:47:15 +0300 |
commit | 50f694c7def8bae73d33cb3c5e0fed3ad066820e (patch) | |
tree | e799496d15aa5dd4a2200a3b80f455d2829cf77a | |
parent | a5b4373f9506322d6c149fe72ef262df017577bf (diff) |
Cleanup: Use new socket builder API
Also enables translation of socket names
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_particle_info.cc | 24 |
1 files 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<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); |