19 .description(
"The amount of points to select from the start of each spline");
24 .description(
"The amount of points to select from the end of each spline");
26 .field_source_reference_all()
27 .
description(
"The selection from the start and end of the splines based on the input sizes");
36 :
bke::GeometryFieldInput(
CPPType::get<bool>(),
"Endpoint Selection node"),
37 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);
87 start_size_.node().for_each_field_input_recursive(
fn);
88 end_size_.node().for_each_field_input_recursive(
fn);
101 return start_size_ == other_endpoint->start_size_ && end_size_ == other_endpoint->end_size_;
108 return AttrDomain::Point;
116 Field<bool> selection_field{std::make_shared<EndpointFieldInput>(start_size, end_size)};
117 params.set_output(
"Selection", std::move(selection_field));
125 ntype.
ui_name =
"Endpoint Selection";
126 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)
unsigned long long int uint64_t
static VArray from_container(ContainerT container)
OffsetIndices< int > points_by_curve() const
IndexRange curves_range() const
int add(GField field, GVArray *varray_ptr)
const GVArray & get_evaluated(const int field_index) const
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)
uint64_t get_default_hash(const T &v, const Args &...args)
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