14 b.add_output<
decl::Int>(
"Point Count").field_source();
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);
65 return AttrDomain::Curve;
71 Field<float> spline_length_field{std::make_shared<bke::CurveLengthFieldInput>()};
72 Field<int> spline_count_field{std::make_shared<SplineCountFieldInput>()};
74 params.set_output(
"Length", std::move(spline_length_field));
75 params.set_output(
"Point Count", std::move(spline_count_field));
82 ntype.
ui_name =
"Spline Length";
84 "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)
unsigned long long int uint64_t
static VArray from_func(const int64_t size, GetFunc get_func)
OffsetIndices< int > points_by_curve() const
GVArray adapt_domain(const GVArray &varray, AttrDomain from, AttrDomain to) const
void node_register_type(bNodeType &ntype)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare