Blender V5.3
node_geo_set_geometry_name.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.use_custom_socket_order();
12 b.allow_any_socket_order();
13 b.add_input<decl::Geometry>("Geometry"_ustr).description("Geometry to override the name of");
14 b.add_output<decl::Geometry>("Geometry"_ustr).propagate_all().align_with_previous();
15 b.add_input<decl::String>("Name"_ustr).optional_label();
16}
17
19{
20 GeometrySet geometry_set = params.extract_input<GeometrySet>("Geometry"_ustr);
21 std::string name = params.extract_input<std::string>("Name"_ustr);
22 geometry_set.set_name(std::move(name));
23 params.set_output("Geometry"_ustr, std::move(geometry_set));
24}
25
26static void node_register()
27{
28 static bke::bNodeType ntype;
29
30 geo_node_type_base(&ntype, "GeometryNodeSetGeometryName"_ustr, GEO_NODE_SET_GEOMETRY_NAME);
31 ntype.ui_name = "Set Geometry Name";
32 ntype.ui_description = "Set the name of a geometry for easier debugging";
33 ntype.enum_name_legacy = "SET_GEOMETRY_NAME";
36 ntype.declare = node_declare;
38}
40
41} // namespace blender::nodes::node_geo_set_geometry_name
#define NODE_CLASS_GEOMETRY
Definition BKE_node.hh:492
#define GEO_NODE_SET_GEOMETRY_NAME
#define NOD_REGISTER_NODE(REGISTER_FUNC)
T extract_input(const UString identifier)
void set_output(const UString identifier, T &&value)
void node_register_type(bNodeType &ntype)
Definition node.cc:2920
static void node_geo_exec(GeoNodeExecParams params)
static void node_declare(NodeDeclarationBuilder &b)
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
void set_name(std::string name)
Defines a node type.
Definition BKE_node.hh:265
std::string ui_description
Definition BKE_node.hh:271
NodeGeometryExecFunction geometry_node_execute
Definition BKE_node.hh:385
const char * enum_name_legacy
Definition BKE_node.hh:274
NodeDeclareFunction declare
Definition BKE_node.hh:393