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) {
56 if (curves.points_num() == 0) {
62 evaluator.
add(start_size_);
63 evaluator.add(end_size_);
65 const VArray<int> start_size = evaluator.get_evaluated<
int>(0);
66 const VArray<int> end_size = evaluator.get_evaluated<
int>(1);
70 const OffsetIndices points_by_curve = curves.points_by_curve();
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);
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));
127 &ntype, GEO_NODE_CURVE_ENDPOINT_SELECTION,
"Endpoint Selection",
NODE_CLASS_INPUT);
Low-level operations for curves.
#define NOD_REGISTER_NODE(REGISTER_FUNC)
static VArray ForContainer(ContainerT container)
int add(GField field, GVArray *varray_ptr)
virtual void for_each_field_input_recursive(FunctionRef< void(const FieldInput &)> fn) const
const FieldNode & node() 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