11 b.use_custom_socket_order();
12 b.allow_any_socket_order();
13 b.add_input<
decl::Geometry>(
"Geometry").description(
"Geometry to update the ID attribute on");
14 b.add_output<
decl::Geometry>(
"Geometry").propagate_all().align_with_previous();
23 const AttrDomain domain = (component.
type() == GeometryComponent::Type::Instance) ?
24 AttrDomain::Instance :
27 if (domain_size == 0) {
34 attributes, field_context,
"id", domain, selection_field, id_field);
44 GeometryComponent::Type::Mesh,
45 GeometryComponent::Type::PointCloud,
46 GeometryComponent::Type::Curve})
48 if (geometry_set.
has(type)) {
53 params.set_output(
"Geometry", std::move(geometry_set));
63 "Set the id attribute on the input geometry, mainly used internally for randomizing";
#define NODE_CLASS_GEOMETRY
@ NODE_DEFAULT_INPUT_INDEX_FIELD
#define NOD_REGISTER_NODE(REGISTER_FUNC)
int attribute_domain_size(AttrDomain domain) const
virtual std::optional< MutableAttributeAccessor > attributes_for_write()
void node_register_type(bNodeType &ntype)
bool try_capture_field_on_geometry(MutableAttributeAccessor attributes, const fn::FieldContext &field_context, const StringRef attribute_id, AttrDomain domain, const fn::Field< bool > &selection, const fn::GField &field)
static void node_geo_exec(GeoNodeExecParams params)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
static void set_id_in_component(GeometryComponent &component, const Field< bool > &selection_field, const Field< int > &id_field)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
GeometryComponent & get_component_for_write(GeometryComponent::Type component_type)
bool has(const GeometryComponent::Type component_type) const
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare