15 b.add_input<
decl::Bool>(
N_(
"Selection")).default_value(
true).hide_value().supports_field();
37 evaluator.add(std::move(position_field));
38 evaluator.add(std::move(radius_field));
40 const IndexMask selection = evaluator.get_evaluated_selection_as_mask();
58 positions.materialize_compressed_to_uninitialized(selection, point_positions.
span);
59 radii.materialize_compressed_to_uninitialized(selection, point_radii.span);
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()) {
83 src.materialize_compressed_to_uninitialized(selection, dst.
span.
data());
98 params.set_output(
"Points", std::move(geometry_set));
101 params.set_default_remaining_outputs();
@ GEO_COMPONENT_TYPE_POINT_CLOUD
@ GEO_COMPONENT_TYPE_INSTANCES
@ GEO_COMPONENT_TYPE_EDIT
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_INSTANCES_TO_POINTS
void nodeRegisterType(struct bNodeType *ntype)
General operations for point clouds.
struct PointCloud * BKE_pointcloud_new_nomain(int totpoint)
std::optional< blender::bke::AttributeAccessor > attributes() const final
int instances_num() const
bool remove(const Key &key)
ItemIterator items() const
void set_selection(Field< bool > selection)
SyclQueue void void * src
MutableAttributeAccessor pointcloud_attributes_for_write(PointCloud &pointcloud)
static void convert_instances_to_points(GeometrySet &geometry_set, Field< float3 > position_field, Field< float > radius_field, const Field< bool > selection_field)
static void node_geo_exec(GeoNodeExecParams params)
static void node_declare(NodeDeclarationBuilder &b)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
MutableSpan< float3 > positions
Map< AttributeIDRef, GMutableSpan > point_attributes
MutableSpan< float > radii
void register_node_type_geo_instances_to_points()
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
const GeometryComponent * get_component_for_read(GeometryComponentType component_type) const
void gather_attributes_for_propagation(blender::Span< GeometryComponentType > component_types, GeometryComponentType dst_component_type, bool include_instances, blender::Map< blender::bke::AttributeIDRef, blender::bke::AttributeKind > &r_attributes) const
bool has_instances() const
void keep_only(const blender::Span< GeometryComponentType > component_types)
void replace_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare
eCustomDataType data_type
MutableVArraySpan< T > span