21 .supported_type(GeometryComponent::Type::PointCloud)
22 .
description(
"Points that are converted to vertices in a mesh");
33 if (points ==
nullptr) {
34 geometry_set.
keep_only({GeometryComponent::Type::Edit});
38 geometry_set.
keep_only({GeometryComponent::Type::Edit});
44 selection_evaluator.
add(selection_field);
50 GeometryComponent::Type::Mesh,
69 for (
const int i : attributes.
names.index_range()) {
76 dst_attributes.
add(
id, AttrDomain::Point, data_type,
init);
80 id, AttrDomain::Point, data_type);
86 mesh->tag_loose_edges_none();
87 mesh->tag_overlapping_none();
90 geometry_set.
keep_only({GeometryComponent::Type::Mesh, GeometryComponent::Type::Edit});
100 geometry_set, selection_field,
params.get_attribute_filter(
"Mesh"));
103 params.set_output(
"Mesh", std::move(geometry_set));
111 ntype.
ui_name =
"Points to Vertices";
112 ntype.
ui_description =
"Generate a mesh vertex for each point cloud point";
CustomData interface, see also DNA_customdata_types.h.
bool CustomData_free_layer_named(CustomData *data, blender::StringRef name)
Mesh * BKE_mesh_new_nomain(int verts_num, int edges_num, int faces_num, int corners_num)
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_POINTS_TO_VERTICES
#define NOD_REGISTER_NODE(REGISTER_FUNC)
const void * data() const
GSpan get_internal_span() const
GAttributeReader lookup(const StringRef attribute_id) 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)
int add(GField field, GVArray *varray_ptr)
IndexMask get_evaluated_as_mask(int field_index)
void gather(const GVArray &src, const IndexMask &indices, GMutableSpan dst, int64_t grain_size=4096)
void node_register_type(bNodeType &ntype)
void foreach_real_geometry(bke::GeometrySet &geometry, FunctionRef< void(bke::GeometrySet &geometry_set)> fn)
static void node_geo_exec(GeoNodeExecParams params)
static void geometry_set_points_to_vertices(GeometrySet &geometry_set, Field< bool > &selection_field, const AttributeFilter &attribute_filter)
static void node_register()
static void node_declare(NodeDeclarationBuilder &b)
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 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
const PointCloud * get_pointcloud() const
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare