Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajesh Advani <rajeshja>2021-09-03 11:45:48 +0300
committerJacques Lucke <jacques@blender.org>2021-09-03 11:45:48 +0300
commit684500837d2994a2da840456cbff8c04b4371e00 (patch)
tree45bb303f05e733d4920762b7fe2abb5e8d383911 /source/blender/nodes/function/nodes/node_fn_input_string.cc
parent4a3243f311c75d8b15fc39ec07dd57ecb40bd32f (diff)
Cleanup: convert function nodes socket list to use new API
The new API was introduced in rB1e69a25043120cc8dddc3f58622eb50e1443def1. Differential Revision: https://developer.blender.org/D12380
Diffstat (limited to 'source/blender/nodes/function/nodes/node_fn_input_string.cc')
-rw-r--r--source/blender/nodes/function/nodes/node_fn_input_string.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/nodes/function/nodes/node_fn_input_string.cc b/source/blender/nodes/function/nodes/node_fn_input_string.cc
index 560ace57aba..4a8e898fb9b 100644
--- a/source/blender/nodes/function/nodes/node_fn_input_string.cc
+++ b/source/blender/nodes/function/nodes/node_fn_input_string.cc
@@ -19,11 +19,15 @@
#include "UI_interface.h"
#include "UI_resources.h"
-static bNodeSocketTemplate fn_node_input_string_out[] = {
- {SOCK_STRING, N_("String")},
- {-1, ""},
+namespace blender::nodes {
+
+static void fn_node_input_string_declare(NodeDeclarationBuilder &b)
+{
+ b.add_output<decl::String>("String");
};
+} // namespace blender::nodes
+
static void fn_node_input_string_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "string", 0, "", ICON_NONE);
@@ -75,7 +79,7 @@ void register_node_type_fn_input_string()
static bNodeType ntype;
fn_node_type_base(&ntype, FN_NODE_INPUT_STRING, "String", NODE_CLASS_INPUT, 0);
- node_type_socket_templates(&ntype, nullptr, fn_node_input_string_out);
+ ntype.declare = blender::nodes::fn_node_input_string_declare;
node_type_init(&ntype, fn_node_input_string_init);
node_type_storage(&ntype, "NodeInputString", fn_node_input_string_free, fn_node_string_copy);
ntype.build_multi_function = fn_node_input_string_build_multi_function;