11 b.use_custom_socket_order();
12 b.allow_any_socket_order();
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) {
46 evaluator.
add(id_field);
52 result_ids.
materialize(selection, id_attribute.span);
53 id_attribute.finish();
64 GeometryComponent::Type::Mesh,
65 GeometryComponent::Type::PointCloud,
66 GeometryComponent::Type::Curve})
68 if (geometry_set.
has(type)) {
73 params.set_output(
"Geometry", std::move(geometry_set));
83 "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)
void materialize(MutableSpan< T > r_span) const
bool contains(StringRef attribute_id) const
int attribute_domain_size(AttrDomain domain) const
virtual std::optional< MutableAttributeAccessor > attributes_for_write()
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
GAttributeWriter lookup_or_add_for_write(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
void set_selection(Field< bool > selection)
int add(GField field, GVArray *varray_ptr)
IndexMask get_evaluated_selection_as_mask() const
int add_with_destination(GField field, GVMutableArray dst)
const GVArray & get_evaluated(const int field_index) const
void node_register_type(bNodeType &ntype)
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)
VMutableArray< T > varray
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