diff options
Diffstat (limited to 'source/blender/nodes/function/nodes/node_fn_float_to_int.cc')
-rw-r--r-- | source/blender/nodes/function/nodes/node_fn_float_to_int.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/nodes/function/nodes/node_fn_float_to_int.cc b/source/blender/nodes/function/nodes/node_fn_float_to_int.cc index 40b8f27f895..e59c78d2c04 100644 --- a/source/blender/nodes/function/nodes/node_fn_float_to_int.cc +++ b/source/blender/nodes/function/nodes/node_fn_float_to_int.cc @@ -25,16 +25,16 @@ #include "node_function_util.hh" -static bNodeSocketTemplate fn_node_float_to_int_in[] = { - {SOCK_FLOAT, N_("Float"), 0.0, 0.0, 0.0, 0.0, -FLT_MAX, FLT_MAX}, - {-1, ""}, -}; +namespace blender::nodes { -static bNodeSocketTemplate fn_node_float_to_int_out[] = { - {SOCK_INT, N_("Integer")}, - {-1, ""}, +static void fn_node_float_to_int_declare(NodeDeclarationBuilder &b) +{ + b.add_input<decl::Float>("Float"); + b.add_output<decl::Int>("Integer"); }; +} // namespace blender::nodes + static void fn_node_float_to_int_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "rounding_mode", 0, "", ICON_NONE); @@ -88,7 +88,7 @@ void register_node_type_fn_float_to_int() static bNodeType ntype; fn_node_type_base(&ntype, FN_NODE_FLOAT_TO_INT, "Float to Integer", NODE_CLASS_CONVERTER, 0); - node_type_socket_templates(&ntype, fn_node_float_to_int_in, fn_node_float_to_int_out); + ntype.declare = blender::nodes::fn_node_float_to_int_declare; node_type_label(&ntype, node_float_to_int_label); ntype.build_multi_function = fn_node_float_to_int_build_multi_function; ntype.draw_buttons = fn_node_float_to_int_layout; |