Blender V4.3
node_fn_input_special_characters.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
6
8
10{
11 b.add_output<decl::String>("Line Break");
12 b.add_output<decl::String>("Tab").translation_context(BLT_I18NCONTEXT_ID_TEXT);
13}
14
16 public:
18 {
19 static const mf::Signature signature = []() {
21 mf::SignatureBuilder builder{"Special Characters", signature};
22 builder.single_output<std::string>("Line Break");
23 builder.single_output<std::string>("Tab");
24 return signature;
25 }();
26 this->set_signature(&signature);
27 }
28
29 void call(const IndexMask &mask, mf::Params params, mf::Context /*context*/) const override
30 {
31 MutableSpan<std::string> lb = params.uninitialized_single_output<std::string>(0, "Line Break");
32 MutableSpan<std::string> tab = params.uninitialized_single_output<std::string>(1, "Tab");
33
34 mask.foreach_index([&](const int64_t i) {
35 new (&lb[i]) std::string("\n");
36 new (&tab[i]) std::string("\t");
37 });
38 }
39};
40
42{
43 static MF_SpecialCharacters special_characters_fn;
44 builder.set_matching_fn(special_characters_fn);
45}
46
47static void node_register()
48{
49 static blender::bke::bNodeType ntype;
50
52 &ntype, FN_NODE_INPUT_SPECIAL_CHARACTERS, "Special Characters", NODE_CLASS_INPUT);
53 ntype.declare = node_declare;
56}
58
59} // namespace blender::nodes::node_fn_input_special_characters_cc
#define NODE_CLASS_INPUT
Definition BKE_node.hh:404
#define BLT_I18NCONTEXT_ID_TEXT
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void set_signature(const Signature *signature)
void set_matching_fn(const mf::MultiFunction *fn)
void call(const IndexMask &mask, mf::Params params, mf::Context) const override
local_group_size(16, 16) .push_constant(Type b
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void node_register_type(bNodeType *ntype)
Definition node.cc:1708
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
void fn_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
__int64 int64_t
Definition stdint.h:89
Defines a node type.
Definition BKE_node.hh:218
NodeMultiFunctionBuildFunction build_multi_function
Definition BKE_node.hh:336
NodeDeclareFunction declare
Definition BKE_node.hh:347