Blender V4.3
node_geo_input_named_layer_selection.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
12
14{
15 b.add_input<decl::String>("Name").hide_label();
16 b.add_output<decl::Bool>("Selection").field_source_reference_all();
17}
18
20{
21 std::string name = params.extract_input<std::string>("Name");
22 if (name.empty()) {
23 params.set_default_remaining_outputs();
24 return;
25 }
26
27 Field<bool> selection_field{
28 std::make_shared<bke::NamedLayerSelectionFieldInput>(std::move(name))};
29 params.set_output("Selection", std::move(selection_field));
30}
31
32static void node_register()
33{
34 static blender::bke::bNodeType ntype;
35
37 &ntype, GEO_NODE_INPUT_NAMED_LAYER_SELECTION, "Named Layer Selection", NODE_CLASS_INPUT);
38 ntype.declare = node_declare;
41}
43
44} // namespace blender::nodes::node_geo_input_named_layer_selection__cc
#define NODE_CLASS_INPUT
Definition BKE_node.hh:404
#define NOD_REGISTER_NODE(REGISTER_FUNC)
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
void geo_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
Defines a node type.
Definition BKE_node.hh:218
NodeGeometryExecFunction geometry_node_execute
Definition BKE_node.hh:339
NodeDeclareFunction declare
Definition BKE_node.hh:347