18 .structure_type(StructureType::Field)
19 .description(
"The amount of points to select from the start of each spline");
23 .structure_type(StructureType::Field)
24 .description(
"The amount of points to select from the end of each spline");
26 .structure_type(StructureType::Field)
27 .propagate_references()
28 .
description(
"The selection from the start and end of the splines based on the input sizes");
38 start_size_(start_size),
46 if (context.domain() != AttrDomain::Point) {
60 evaluator.
add(start_size_);
61 evaluator.
add(end_size_);
71 for (const int i : curves_range) {
72 const IndexRange points = points_by_curve[i];
73 const int start = std::max(start_size[i], 0);
74 const int end = std::max(end_size[i], 0);
76 selection_span.slice(points.take_front(start)).fill(true);
77 selection_span.slice(points.take_back(end)).fill(true);
93 static constexpr int8_t id = 0;
95 hash.add(deep_hash_cache.ensure(start_size_));
96 hash.add(deep_hash_cache.ensure(end_size_));
101 return AttrDomain::Point;
110 params.
set_output(
"Selection"_ustr, std::move(selection_field));
118 ntype.
ui_name =
"Endpoint Selection";
119 ntype.
ui_description =
"Provide a selection for an arbitrary number of endpoints in each spline";
Low-level operations for curves.
#define GEO_NODE_CURVE_ENDPOINT_SELECTION
#define NOD_REGISTER_NODE(REGISTER_FUNC)
static VArray from_container(ContainerT container)
int add(GField field, GVArray *varray_ptr)
const GVArray & get_evaluated(const int field_index) const
static Field from_input(Args &&...args)
T extract_input(const UString identifier)
void set_output(const UString identifier, T &&value)
void node_register_type(bNodeType &ntype)
static void node_geo_exec(GeoNodeExecParams params)
static void node_register()
static void node_declare(NodeDeclarationBuilder &b)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
void devirtualize_varray2(const VArray< T1 > &varray1, const VArray< T2 > &varray2, const Func &func, bool enable=true)
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