Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/function/nodes/node_fn_float_to_int.cc
| Show All 19 Lines | |||||
| #include "RNA_enum_types.h" | #include "RNA_enum_types.h" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| #include "node_function_util.hh" | #include "node_function_util.hh" | ||||
| namespace blender::nodes { | namespace blender::nodes::node_fn_float_to_int_cc { | ||||
| static void fn_node_float_to_int_declare(NodeDeclarationBuilder &b) | static void fn_node_float_to_int_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.is_function_node(); | b.is_function_node(); | ||||
| b.add_input<decl::Float>(N_("Float")); | b.add_input<decl::Float>(N_("Float")); | ||||
| b.add_output<decl::Int>(N_("Integer")); | b.add_output<decl::Int>(N_("Integer")); | ||||
| }; | }; | ||||
| Show All 39 Lines | |||||
| } | } | ||||
| static void fn_node_float_to_int_build_multi_function(NodeMultiFunctionBuilder &builder) | static void fn_node_float_to_int_build_multi_function(NodeMultiFunctionBuilder &builder) | ||||
| { | { | ||||
| const fn::MultiFunction *fn = get_multi_function(builder.node()); | const fn::MultiFunction *fn = get_multi_function(builder.node()); | ||||
| builder.set_matching_fn(fn); | builder.set_matching_fn(fn); | ||||
| } | } | ||||
| } // namespace blender::nodes | } // namespace blender::nodes::node_fn_float_to_int_cc | ||||
| void register_node_type_fn_float_to_int() | void register_node_type_fn_float_to_int() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_fn_float_to_int_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| fn_node_type_base(&ntype, FN_NODE_FLOAT_TO_INT, "Float to Integer", NODE_CLASS_CONVERTER, 0); | fn_node_type_base(&ntype, FN_NODE_FLOAT_TO_INT, "Float to Integer", NODE_CLASS_CONVERTER); | ||||
| ntype.declare = blender::nodes::fn_node_float_to_int_declare; | ntype.declare = file_ns::fn_node_float_to_int_declare; | ||||
| ntype.labelfunc = blender::nodes::node_float_to_int_label; | ntype.labelfunc = file_ns::node_float_to_int_label; | ||||
| ntype.build_multi_function = blender::nodes::fn_node_float_to_int_build_multi_function; | ntype.build_multi_function = file_ns::fn_node_float_to_int_build_multi_function; | ||||
| ntype.draw_buttons = blender::nodes::fn_node_float_to_int_layout; | ntype.draw_buttons = file_ns::fn_node_float_to_int_layout; | ||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||