Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/function/nodes/node_fn_string_length.cc
| Show All 18 Lines | |||||
| #include <iomanip> | #include <iomanip> | ||||
| #include "node_function_util.hh" | #include "node_function_util.hh" | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void fn_node_string_length_declare(NodeDeclarationBuilder &b) | static void fn_node_string_length_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::String>("String"); | b.add_input<decl::String>(N_("String")); | ||||
| b.add_output<decl::Int>("Length"); | b.add_output<decl::Int>(N_("Length")); | ||||
| }; | }; | ||||
| static void fn_node_string_length_build_multi_function(NodeMultiFunctionBuilder &builder) | static void fn_node_string_length_build_multi_function(NodeMultiFunctionBuilder &builder) | ||||
| { | { | ||||
| static fn::CustomMF_SI_SO<std::string, int> str_len_fn{ | static fn::CustomMF_SI_SO<std::string, int> str_len_fn{ | ||||
| "String Length", [](const std::string &a) { return BLI_strlen_utf8(a.c_str()); }}; | "String Length", [](const std::string &a) { return BLI_strlen_utf8(a.c_str()); }}; | ||||
| builder.set_matching_fn(&str_len_fn); | builder.set_matching_fn(&str_len_fn); | ||||
| } | } | ||||
| Show All 12 Lines | |||||