41 evaluator.add(std::move(position_field));
42 evaluator.add(std::move(radius_field));
44 const IndexMask selection = evaluator.get_evaluated_selection_as_mask();
45 if (selection.is_empty()) {
49 const VArray<float> radii = evaluator.get_evaluated<
float>(1);
67 attributes_to_propagate);
69 attributes_to_propagate.
remove(
"position");
70 attributes_to_propagate.
remove(
"radius");
72 for (
const auto item : attributes_to_propagate.
items()) {
81 dst_attributes.
add(
id, AttrDomain::Point, type,
init);
85 id, AttrDomain::Point, type);
101 params.get_attribute_filter(
"Points"));
103 params.set_output(
"Points", std::move(geometry_set));
106 params.set_default_remaining_outputs();
#define NODE_CLASS_GEOMETRY
General operations for point clouds.
PointCloud * BKE_pointcloud_new_nomain(int totpoint)
#define NOD_REGISTER_NODE(REGISTER_FUNC)
const void * data() const
GSpan get_internal_span() const
bool remove(const Key &key)
ItemIterator items() const
GAttributeReader lookup(const StringRef attribute_id) const
bool add(const StringRef attribute_id, const AttrDomain domain, const eCustomDataType data_type, const AttributeInit &initializer)
GSpanAttributeWriter lookup_or_add_for_write_only_span(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type)
void set_selection(Field< bool > selection)
local_group_size(16, 16) .push_constant(Type b
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)
void geo_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
const ImplicitSharingInfo * sharing_info
void keep_only(Span< GeometryComponent::Type > component_types)
void gather_attributes_for_propagation(Span< GeometryComponent::Type > component_types, GeometryComponent::Type dst_component_type, bool include_instances, const AttributeFilter &attribute_filter, Map< StringRef, AttributeKind > &r_attributes) const
void replace_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const Instances * get_instances() const
bool has_instances() const
MutableVArraySpan< T > span
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare