13 b.add_output<
decl::Float>(
"Length"_ustr).structure_type(StructureType::Field);
14 b.add_output<
decl::Int>(
"Point Count"_ustr).structure_type(StructureType::Field);
25 auto count_fn = [points_by_curve](
int64_t i) {
return points_by_curve[i].
size(); };
27 if (domain == AttrDomain::Curve) {
30 if (domain == AttrDomain::Point) {
32 return curves.adapt_domain<
int>(std::move(count), AttrDomain::Curve, AttrDomain::Point);
51 static constexpr int8_t id = 0;
57 return AttrDomain::Curve;
71 ntype.
ui_name =
"Spline Length";
73 "Retrieve the total length of each spline, as a distance or as a number of points";
Low-level operations for curves.
#define GEO_NODE_INPUT_SPLINE_LENGTH
#define NOD_REGISTER_NODE(REGISTER_FUNC)
static VArray from_func(const int64_t size, GetFunc get_func)
static Field from_input(Args &&...args)
void set_output(const UString identifier, T &&value)
void node_register_type(bNodeType &ntype)
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare