Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/function/nodes/node_fn_input_string.cc
| Show All 13 Lines | |||||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
| */ | */ | ||||
| #include "node_function_util.hh" | #include "node_function_util.hh" | ||||
| #include "UI_interface.h" | #include "UI_interface.h" | ||||
| #include "UI_resources.h" | #include "UI_resources.h" | ||||
| namespace blender::nodes { | namespace blender::nodes::node_fn_input_string_cc { | ||||
| static void fn_node_input_string_declare(NodeDeclarationBuilder &b) | static void fn_node_input_string_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.is_function_node(); | b.is_function_node(); | ||||
| b.add_output<decl::String>(N_("String")); | b.add_output<decl::String>(N_("String")); | ||||
| }; | }; | ||||
| static void fn_node_input_string_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | static void fn_node_input_string_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) | ||||
| Show All 35 Lines | static void fn_node_string_copy(bNodeTree *UNUSED(dest_ntree), | ||||
| if (source_storage->string) { | if (source_storage->string) { | ||||
| destination_storage->string = (char *)MEM_dupallocN(source_storage->string); | destination_storage->string = (char *)MEM_dupallocN(source_storage->string); | ||||
| } | } | ||||
| dest_node->storage = destination_storage; | dest_node->storage = destination_storage; | ||||
| } | } | ||||
| } // namespace blender::nodes | } // namespace blender::nodes::node_fn_input_string_cc | ||||
| void register_node_type_fn_input_string() | void register_node_type_fn_input_string() | ||||
| { | { | ||||
| namespace file_ns = blender::nodes::node_fn_input_string_cc; | |||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| fn_node_type_base(&ntype, FN_NODE_INPUT_STRING, "String", NODE_CLASS_INPUT, 0); | fn_node_type_base(&ntype, FN_NODE_INPUT_STRING, "String", NODE_CLASS_INPUT); | ||||
| ntype.declare = blender::nodes::fn_node_input_string_declare; | ntype.declare = file_ns::fn_node_input_string_declare; | ||||
| node_type_init(&ntype, blender::nodes::fn_node_input_string_init); | node_type_init(&ntype, file_ns::fn_node_input_string_init); | ||||
| node_type_storage(&ntype, | node_type_storage( | ||||
| "NodeInputString", | &ntype, "NodeInputString", file_ns::fn_node_input_string_free, file_ns::fn_node_string_copy); | ||||
| blender::nodes::fn_node_input_string_free, | ntype.build_multi_function = file_ns::fn_node_input_string_build_multi_function; | ||||
| blender::nodes::fn_node_string_copy); | ntype.draw_buttons = file_ns::fn_node_input_string_layout; | ||||
| ntype.build_multi_function = blender::nodes::fn_node_input_string_build_multi_function; | |||||
| ntype.draw_buttons = blender::nodes::fn_node_input_string_layout; | |||||
| nodeRegisterType(&ntype); | nodeRegisterType(&ntype); | ||||
| } | } | ||||