21 .description(
"The amount of points to select from the start of each spline");
26 .description(
"The amount of points to select from the end of each spline");
28 .field_source_reference_all()
29 .
description(
"The selection from the start and end of the splines based on the input sizes");
38 :
bke::GeometryFieldInput(
CPPType::get<bool>(),
"Endpoint Selection node"),
39 start_size_(start_size),
48 if (context.domain() != AttrDomain::Point) {
62 evaluator.
add(start_size_);
63 evaluator.
add(end_size_);
73 for (const int i : curves_range) {
74 const IndexRange points = points_by_curve[i];
75 const int start = std::max(start_size[i], 0);
76 const int end = std::max(end_size[i], 0);
78 selection_span.slice(points.take_front(start)).fill(true);
79 selection_span.slice(points.take_back(end)).fill(true);
89 start_size_.node().for_each_field_input_recursive(
fn);
90 end_size_.node().for_each_field_input_recursive(
fn);
103 return start_size_ == other_endpoint->start_size_ && end_size_ == other_endpoint->end_size_;
110 return AttrDomain::Point;
118 Field<bool> selection_field{std::make_shared<EndpointFieldInput>(start_size, end_size)};
119 params.set_output(
"Selection", std::move(selection_field));
Low-level operations for curves.
#define GEO_NODE_CURVE_ENDPOINT_SELECTION
#define NOD_REGISTER_NODE(REGISTER_FUNC)
static VArray ForContainer(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
local_group_size(16, 16) .push_constant(Type b
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)
void geo_node_type_base(blender::bke::bNodeType *ntype, int type, const char *name, short nclass)
GPU_SHADER_INTERFACE_INFO(overlay_edit_curve_handle_iface, "vert").flat(Type pos vertex_in(1, Type::UINT, "data") .vertex_out(overlay_edit_curve_handle_iface) .geometry_layout(PrimitiveIn Frequency::GEOMETRY storage_buf(1, Qualifier::READ, "uint", "data[]", Frequency::GEOMETRY) .push_constant(Type Frequency::GEOMETRY selection[]
unsigned __int64 uint64_t
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare