Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_set_id.cc
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | /* SPDX-License-Identifier: GPL-2.0-or-later */ | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes::node_geo_set_id_cc { | namespace blender::nodes::node_geo_set_id_cc { | ||||
| static void node_declare(NodeDeclarationBuilder &b) | static void node_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>(N_("Geometry")); | b.add_input<decl::Geometry>(N_("Geometry")); | ||||
| b.add_input<decl::Bool>(N_("Selection")).default_value(true).hide_value().supports_field(); | b.add_input<decl::Bool>(N_("Selection")).default_value(true).hide_value().field_on_all(); | ||||
| b.add_input<decl::Int>(N_("ID")).implicit_field(implicit_field_inputs::index); | b.add_input<decl::Int>(N_("ID")).implicit_field_on_all(implicit_field_inputs::index); | ||||
| b.add_output<decl::Geometry>(N_("Geometry")); | b.add_output<decl::Geometry>(N_("Geometry")).propagate_all(); | ||||
| } | } | ||||
| static void set_id_in_component(GeometryComponent &component, | static void set_id_in_component(GeometryComponent &component, | ||||
| const Field<bool> &selection_field, | const Field<bool> &selection_field, | ||||
| const Field<int> &id_field) | const Field<int> &id_field) | ||||
| { | { | ||||
| const eAttrDomain domain = (component.type() == GEO_COMPONENT_TYPE_INSTANCES) ? | const eAttrDomain domain = (component.type() == GEO_COMPONENT_TYPE_INSTANCES) ? | ||||
| ATTR_DOMAIN_INSTANCE : | ATTR_DOMAIN_INSTANCE : | ||||
| ▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines | |||||