Blender V4.3
node_geo_input_id.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::Int>("ID").field_source().description(
12 "The values from the \"id\" attribute on points, or the index if that attribute does not "
13 "exist");
14}
15
17{
18 Field<int> position_field{std::make_shared<bke::IDAttributeFieldInput>()};
19 params.set_output("ID", std::move(position_field));
20}
21
22static void node_register()
23{
24 static blender::bke::bNodeType ntype;
25
26 geo_node_type_base(&ntype, GEO_NODE_INPUT_ID, "ID", NODE_CLASS_INPUT);
28 ntype.declare = node_declare;
30}
32
33} // namespace blender::nodes::node_geo_input_id_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
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
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