42 evaluator.
add(std::move(position_field));
43 evaluator.
add(std::move(radius_field));
65 GeometryComponent::Type::PointCloud,
68 attributes_to_propagate);
70 for (
const int i : attributes_to_propagate.
names.index_range()) {
72 if (
ELEM(attributes_to_propagate.
names[
i],
"position",
"radius")) {
83 dst_attributes.
add(
id, AttrDomain::Point, type,
init);
87 id, AttrDomain::Point, type);
103 params.get_attribute_filter(
"Points"));
104 geometry_set.
keep_only({GeometryComponent::Type::PointCloud, GeometryComponent::Type::Edit});
105 params.set_output(
"Points", std::move(geometry_set));
108 params.set_default_remaining_outputs();
117 ntype.
ui_name =
"Instances to Points";
119 "Generate points at the origins of instances.\nNote: Nested instances are not affected by "
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_INSTANCES_TO_POINTS
General operations for point clouds.
PointCloud * BKE_pointcloud_new_nomain(int totpoint)
@ NODE_DEFAULT_INPUT_POSITION_FIELD
#define NOD_REGISTER_NODE(REGISTER_FUNC)
const void * data() const
GSpan get_internal_span() const
GAttributeReader lookup(const StringRef attribute_id) const
bke::AttributeAccessor attributes() const
int instances_num() const
bool add(const StringRef attribute_id, const AttrDomain domain, const AttrType data_type, const AttributeInit &initializer)
GSpanAttributeWriter lookup_or_add_for_write_only_span(StringRef attribute_id, AttrDomain domain, AttrType data_type)
void set_selection(Field< bool > selection)
int add(GField field, GVArray *varray_ptr)
IndexMask get_evaluated_selection_as_mask() const
const GVArray & get_evaluated(const int field_index) const
void gather(const GVArray &src, const IndexMask &indices, GMutableSpan dst, int64_t grain_size=4096)
void node_register_type(bNodeType &ntype)
static void node_register()
static void node_geo_exec(GeoNodeExecParams params)
static void convert_instances_to_points(GeometrySet &geometry_set, Field< float3 > position_field, Field< float > radius_field, Field< bool > selection_field, const AttributeFilter &attribute_filter)
static void node_declare(NodeDeclarationBuilder &b)
VecBase< float, 3 > float3
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
static void init(bNodeTree *, bNode *node)
const ImplicitSharingInfo * sharing_info
Vector< AttributeDomainAndType, 16 > kinds
VectorSet< StringRef, 16 > names
void keep_only(Span< GeometryComponent::Type > component_types)
void replace_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const Instances * get_instances() const
bool has_instances() const
void gather_attributes_for_propagation(Span< GeometryComponent::Type > component_types, GeometryComponent::Type dst_component_type, bool include_instances, const AttributeFilter &attribute_filter, GatheredAttributes &r_attributes) const
MutableVArraySpan< T > span
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare