26 .description(
"Base curves that new curves are interpolated between");
28 .evaluated_geometry_field({0})
30 .
description(
"Optional up vector that is typically a surface normal");
32 .evaluated_geometry_field({0})
35 "Splits guides into separate groups. New curves interpolate existing curves "
36 "from a single group");
38 .description(
"First control point positions for new interpolated curves");
40 .evaluated_geometry_field({3})
42 .
description(
"Optional up vector that is typically a surface normal");
44 .evaluated_geometry_field({3})
51 "Maximum amount of close guide curves that are taken into account for interpolation");
54 .anonymous_attribute_output()
55 .
description(
"Index of the closest guide curve for each generated curve");
57 .anonymous_attribute_output()
58 .
description(
"Weight of the closest guide curve for each generated curve");
71 for (
const int group : guides_by_group.
index_range()) {
72 const Span<int> guide_curve_indices = guides_by_group[group];
73 int group_control_points = points_by_curve[guide_curve_indices[0]].
size();
74 for (
const int guide_curve_i : guide_curve_indices.
drop_front(1)) {
75 const int control_points = points_by_curve[guide_curve_i].
size();
76 if (group_control_points != control_points) {
77 group_control_points = -1;
81 points_per_curve_by_group[group] = group_control_points;
83 return points_per_curve_by_group;
97 for (const int group : range) {
98 kdtrees[group] = std::make_unique<KDTreeNew<float3>>(root_positions,
99 guides_by_group[group]);
103 [&](
const IndexRange range) {
return guides_by_group.offsets[range].size(); }));
116 const int max_neighbor_count,
122 for (const int child_curve_i : range) {
123 const float3 &position = positions[child_curve_i];
124 const int group = point_group_indices[child_curve_i];
126 r_all_neighbor_counts[child_curve_i] = 0;
129 const KDTreeNew<float3> &kdtree = *kdtrees[group];
131 const int num_guides_in_group = guides_by_group[group].size();
135 const bool use_extra_neighbor = num_guides_in_group > max_neighbor_count;
136 const int neighbors_to_find = max_neighbor_count + use_extra_neighbor;
138 Vector<KDTreeNew<float3>::Nearest, 16> nearest_n(neighbors_to_find);
139 const int num_neighbors = kdtree.find_nearest_n(position, nearest_n);
140 if (num_neighbors == 0) {
141 r_all_neighbor_counts[child_curve_i] = 0;
145 const IndexRange neighbors_range{child_curve_i * max_neighbor_count, max_neighbor_count};
146 MutableSpan<int> neighbor_indices = r_all_neighbor_indices.slice(neighbors_range);
147 MutableSpan<float> neighbor_weights = r_all_neighbor_weights.slice(neighbors_range);
149 float tot_weight = 0.0f;
151 if (use_extra_neighbor) {
154 const float max_distance = math::sqrt(
157 nearest_n.begin() + num_neighbors,
158 [](const KDTreeNew<float3>::Nearest &a, const KDTreeNew<float3>::Nearest &b) {
159 return a.distance_sq < b.distance_sq;
162 if (max_distance == 0.0f) {
163 r_all_neighbor_counts[child_curve_i] = 1;
164 neighbor_indices[0] = nearest_n[0].index;
165 neighbor_weights[0] = 1.0f;
169 int neighbor_counter = 0;
170 for (const int neighbor_i : IndexRange(num_neighbors)) {
171 const KDTreeNew<float3>::Nearest &nearest = nearest_n[neighbor_i];
172 const float dist = math::sqrt(nearest.distance_sq);
176 const float weight = (max_distance - dist) / std::max(dist, 0.000001f);
178 tot_weight += weight;
179 neighbor_indices[neighbor_counter] = nearest.index;
180 neighbor_weights[neighbor_counter] = weight;
184 r_all_neighbor_counts[child_curve_i] = neighbor_counter;
187 int neighbor_counter = 0;
188 for (const int neighbor_i : IndexRange(num_neighbors)) {
189 const KDTreeNew<float3>::Nearest &nearest = nearest_n[neighbor_i];
190 const float dist = math::sqrt(nearest.distance_sq);
194 const float weight = 1.0f / std::max(dist, 0.000001f);
196 tot_weight += weight;
197 neighbor_indices[neighbor_counter] = nearest.index;
198 neighbor_weights[neighbor_counter] = weight;
202 r_all_neighbor_counts[child_curve_i] = neighbor_counter;
204 if (tot_weight > 0.0f) {
206 const float weight_factor = 1.0f / tot_weight;
207 for (float &weight : neighbor_weights.take_front(r_all_neighbor_counts[child_curve_i])) {
208 weight *= weight_factor;
221 const Span<int> points_per_curve_by_group,
225 const int max_neighbors,
231 for (const int child_curve_i : range) {
232 const int neighbor_count = all_neighbor_counts[child_curve_i];
233 if (neighbor_count == 0) {
234 r_points_per_child[child_curve_i] = 1;
235 r_use_direct_interpolation[child_curve_i] = false;
238 const int group = point_group_indices[child_curve_i];
239 const int points_per_curve_in_group = points_per_curve_by_group[group];
240 if (points_per_curve_in_group != -1) {
241 r_points_per_child[child_curve_i] = points_per_curve_in_group;
242 r_use_direct_interpolation[child_curve_i] = true;
245 const IndexRange neighbors_range{child_curve_i * max_neighbors, neighbor_count};
246 const Span<float> neighbor_weights = all_neighbor_weights.slice(neighbors_range);
247 const Span<int> neighbor_indices = all_neighbor_indices.slice(neighbors_range);
249 float neighbor_points_weighted_sum = 0.0f;
250 for (const int neighbor_i : IndexRange(neighbor_count)) {
251 const int neighbor_index = neighbor_indices[neighbor_i];
252 const float neighbor_weight = neighbor_weights[neighbor_i];
253 const int neighbor_points = guide_points_by_curve[neighbor_index].size();
254 neighbor_points_weighted_sum += neighbor_weight * float(neighbor_points);
256 const int points_in_child = std::max<int>(1, roundf(neighbor_points_weighted_sum));
257 r_points_per_child[child_curve_i] = points_in_child;
258 r_use_direct_interpolation[child_curve_i] = false;
273 for (const int guide_curve_i : range) {
274 r_parameterized_guide_offsets[guide_curve_i] = length_parameterize::segments_num(
275 guide_points_by_curve[guide_curve_i].size(), false);
281 r_parameterized_guide_lengths.reinitialize(r_parameterized_guide_offsets.last());
282 const Span<float3> guide_positions = guide_curves.positions();
284 for (const int guide_curve_i : range) {
285 const IndexRange points = guide_points_by_curve[guide_curve_i];
286 const IndexRange lengths_range = parameterize_offsets[guide_curve_i];
287 length_parameterize::accumulate_lengths<float3>(
288 guide_positions.slice(points),
290 r_parameterized_guide_lengths.as_mutable_span().slice(lengths_range));
300 const int max_neighbors,
309 const Span<bool> use_direct_interpolation_per_child)
317 Vector<float, 16> sample_lengths;
318 Vector<int, 16> sample_segments;
319 Vector<float, 16> sample_factors;
321 for (const int child_curve_i : range) {
322 const IndexRange points = child_points_by_curve[child_curve_i];
323 const int neighbor_count = all_neighbor_counts[child_curve_i];
324 const float3 child_up = points_up[child_curve_i];
325 BLI_assert(math::is_unit_scale(child_up));
326 const float3 &child_root_position = point_positions[child_curve_i];
327 MutableSpan<float3> child_positions = children_positions.slice(points);
329 child_positions.fill(child_root_position);
330 if (neighbor_count == 0) {
335 const IndexRange neighbors_range{child_curve_i * max_neighbors, neighbor_count};
336 const Span<float> neighbor_weights = all_neighbor_weights.slice(neighbors_range);
337 const Span<int> neighbor_indices = all_neighbor_indices.slice(neighbors_range);
339 const bool use_direct_interpolation = use_direct_interpolation_per_child[child_curve_i];
341 for (const int neighbor_i : IndexRange(neighbor_count)) {
342 const int neighbor_index = neighbor_indices[neighbor_i];
343 const float neighbor_weight = neighbor_weights[neighbor_i];
344 const IndexRange guide_points = guide_points_by_curve[neighbor_index];
345 const Span<float3> neighbor_positions = guide_positions.slice(guide_points);
346 const float3 &neighbor_root = neighbor_positions.first();
347 const float3 neighbor_up = guides_up[neighbor_index];
348 BLI_assert(math::is_unit_scale(neighbor_up));
350 const bool is_same_up_vector = neighbor_up == child_up;
352 float3x3 normal_rotation;
353 if (!is_same_up_vector) {
354 rotation_between_vecs_to_mat3(normal_rotation.ptr(), neighbor_up, child_up);
357 if (use_direct_interpolation) {
361 for (const int i : IndexRange(points.size())) {
362 const float3 &neighbor_pos = neighbor_positions[i];
363 const float3 relative_to_root = neighbor_pos - neighbor_root;
364 float3 rotated_relative = relative_to_root;
365 if (!is_same_up_vector) {
366 rotated_relative = normal_rotation * rotated_relative;
368 child_positions[i] += neighbor_weight * rotated_relative;
375 const IndexRange guide_offsets = parameterized_guide_offsets[neighbor_index];
377 if (guide_offsets.is_empty()) {
379 float3 rotated_relative = neighbor_root;
380 if (!is_same_up_vector) {
381 rotated_relative = normal_rotation * rotated_relative;
383 const float3 global_pos = rotated_relative * neighbor_weight;
384 for (float3 &position : child_positions) {
385 position += global_pos;
390 const Span<float> lengths = parameterized_guide_lengths.slice(guide_offsets);
391 const float neighbor_length = lengths.last();
393 sample_lengths.reinitialize(points.size());
394 const float sample_length_factor = math::safe_divide(neighbor_length,
395 float(points.size() - 1));
396 for (const int i : sample_lengths.index_range()) {
397 sample_lengths[i] = i * sample_length_factor;
400 sample_segments.reinitialize(points.size());
401 sample_factors.reinitialize(points.size());
402 length_parameterize::sample_at_lengths(
403 lengths, sample_lengths, sample_segments, sample_factors);
405 for (const int i : IndexRange(points.size())) {
406 const int segment = sample_segments[i];
407 const float factor = sample_factors[i];
408 const float3 sample_pos = math::interpolate(
409 neighbor_positions[segment], neighbor_positions[segment + 1], factor);
410 const float3 relative_to_root = sample_pos - neighbor_root;
411 float3 rotated_relative = relative_to_root;
412 if (!is_same_up_vector) {
413 rotated_relative = normal_rotation * rotated_relative;
415 child_positions[i] += neighbor_weight * rotated_relative;
433 const int max_neighbors,
439 const Span<bool> use_direct_interpolation_per_child)
472 if (iter.
domain == AttrDomain::Curve) {
474 iter.
name, AttrDomain::Curve, type);
479 if constexpr (!std::is_void_v<bke::attribute_math::DefaultMixer<T>>) {
484 for (const int child_curve_i : range) {
485 const int neighbor_count = all_neighbor_counts[child_curve_i];
486 const IndexRange neighbors_range{child_curve_i * max_neighbors, neighbor_count};
487 dst[child_curve_i] = bke::attribute_math::mix_indices(
489 all_neighbor_indices.slice(neighbors_range),
490 all_neighbor_weights.slice(neighbors_range));
496 dst_generic.finish();
501 iter.
name, AttrDomain::Point, type);
507 if constexpr (!std::is_void_v<bke::attribute_math::DefaultMixer<T>>) {
508 const Span<T> src = src_generic.typed<
T>();
513 Vector<float, 16> sample_lengths;
514 Vector<int, 16> sample_segments;
515 Vector<float, 16> sample_factors;
516 for (const int child_curve_i : range) {
517 const IndexRange points = child_points_by_curve[child_curve_i];
518 const int neighbor_count = all_neighbor_counts[child_curve_i];
519 const IndexRange neighbors_range{child_curve_i * max_neighbors, neighbor_count};
520 const Span<float> neighbor_weights = all_neighbor_weights.slice(neighbors_range);
521 const Span<int> neighbor_indices = all_neighbor_indices.slice(neighbors_range);
522 const bool use_direct_interpolation =
523 use_direct_interpolation_per_child[child_curve_i];
525 for (const int neighbor_i : IndexRange(neighbor_count)) {
526 const int neighbor_index = neighbor_indices[neighbor_i];
527 const float neighbor_weight = neighbor_weights[neighbor_i];
528 const IndexRange guide_points = guide_points_by_curve[neighbor_index];
530 if (use_direct_interpolation) {
531 for (const int i : IndexRange(points.size())) {
532 mixer.mix_in(points[i], src[guide_points[i]], neighbor_weight);
536 const IndexRange guide_offsets = parameterized_guide_offsets[neighbor_index];
537 if (guide_offsets.is_empty()) {
539 const T &curve_value = src[guide_points.first()];
540 for (const int i : points) {
541 mixer.mix_in(i, curve_value, neighbor_weight);
546 const Span<float> lengths = parameterized_guide_lengths.slice(guide_offsets);
547 const float neighbor_length = lengths.last();
549 sample_lengths.reinitialize(points.size());
550 const float sample_length_factor = math::safe_divide(neighbor_length,
551 float(points.size() - 1));
552 for (const int i : sample_lengths.index_range()) {
553 sample_lengths[i] = i * sample_length_factor;
556 sample_segments.reinitialize(points.size());
557 sample_factors.reinitialize(points.size());
558 length_parameterize::sample_at_lengths(
559 lengths, sample_lengths, sample_segments, sample_factors);
561 for (const int i : IndexRange(points.size())) {
562 const int segment = sample_segments[i];
563 const float factor = sample_factors[i];
564 const T value = math::interpolate(
565 src[guide_points[segment]], src[guide_points[segment + 1]], factor);
566 mixer.mix_in(points[i], value, neighbor_weight);
571 mixer.finalize(child_points_by_curve[range]);
576 dst_generic.finish();
583 if (iter.
is_builtin && !children_attributes.is_builtin(iter.
name)) {
586 if (guide_curve_attributes.contains(iter.
name)) {
589 if (attribute_filter.allow_skip(iter.
name)) {
592 if (iter.
data_type == bke::AttrType::String) {
596 const GAttributeReader src = iter.
get();
597 if (src.sharing_info && src.varray.is_span()) {
598 const bke::AttributeInitShared
init(src.varray.get_internal_span().data(),
603 children_attributes.add(
604 iter.
name, AttrDomain::Curve, iter.
data_type, bke::AttributeInitVArray(src.varray));
610 const std::optional<StringRef> &weight_attribute_id,
611 const std::optional<StringRef> &index_attribute_id,
612 const int max_neighbors,
617 if (!weight_attribute_id && !index_attribute_id) {
621 if (weight_attribute_id) {
624 *weight_attribute_id, AttrDomain::Curve);
627 if (index_attribute_id) {
629 *index_attribute_id, AttrDomain::Curve);
632 for (const int child_curve_i : range) {
633 const int neighbor_count = all_neighbor_counts[child_curve_i];
636 float closest_weight;
637 if (neighbor_count == 0) {
639 closest_weight = 0.0f;
642 const IndexRange neighbors_range{child_curve_i * max_neighbors, neighbor_count};
643 const Span<float> neighbor_weights = all_neighbor_weights.slice(neighbors_range);
644 const Span<int> neighbor_indices = all_neighbor_indices.slice(neighbors_range);
645 const int max_index = std::max_element(neighbor_weights.begin(), neighbor_weights.end()) -
646 neighbor_weights.begin();
647 closest_index = neighbor_indices[max_index];
648 closest_weight = neighbor_weights[max_index];
650 if (index_attribute) {
651 index_attribute.span[child_curve_i] = closest_index;
653 if (weight_attribute) {
654 weight_attribute.span[child_curve_i] = closest_weight;
658 if (index_attribute) {
659 index_attribute.finish();
661 if (weight_attribute) {
662 weight_attribute.finish();
667 const Curves &guide_curves_id,
673 const int max_neighbors,
675 const std::optional<StringRef> &index_attribute_id,
676 const std::optional<StringRef> &weight_attribute_id)
687 for (const int i : range) {
688 guide_group_indices[i] = guide_group_indexing.index_of(guide_group_ids[i]);
695 guide_group_indices, guide_group_indexing.size(), group_offset_data, group_index_data);
697 const Array<int> points_per_curve_by_group = compute_points_per_curve_by_group(guides_by_group,
702 guide_curves.offsets().take_front(guide_curves.curves_num()),
703 root_positions.as_mutable_span());
706 guides_by_group, root_positions);
708 const VArraySpan point_positions = *point_attributes.lookup<
float3>(
"position");
709 const int num_child_curves = point_attributes.domain_size(AttrDomain::Point);
713 Array<int> point_group_indices(num_child_curves);
715 for (
const int i : range) {
716 point_group_indices[i] = int(guide_group_indexing.index_of_try(point_group_ids[i]));
722 Array<int> all_neighbor_indices(num_child_curves * max_neighbors);
723 Array<float> all_neighbor_weights(num_child_curves * max_neighbors);
724 Array<int> all_neighbor_counts(num_child_curves);
726 find_neighbor_guides(point_positions,
731 all_neighbor_indices,
732 all_neighbor_weights,
733 all_neighbor_counts);
735 Curves *child_curves_id = bke::curves_new_nomain(0, num_child_curves);
736 bke::CurvesGeometry &child_curves = child_curves_id->geometry.wrap();
737 MutableSpan<int> children_curve_offsets = child_curves.offsets_for_write();
739 Array<bool> use_direct_interpolation_per_child(num_child_curves);
740 compute_point_counts_per_child(guide_curves,
742 points_per_curve_by_group,
743 all_neighbor_indices,
744 all_neighbor_weights,
747 children_curve_offsets.drop_back(1),
748 use_direct_interpolation_per_child);
749 offset_indices::accumulate_counts_to_offsets(children_curve_offsets);
750 const int num_child_points = children_curve_offsets.last();
751 child_curves.resize(num_child_points, num_child_curves);
754 Array<int> parameterized_guide_offsets;
755 Array<float> parameterized_guide_lengths;
756 parameterize_guide_curves(
757 guide_curves, parameterized_guide_offsets, parameterized_guide_lengths);
759 interpolate_curve_shapes(child_curves,
762 all_neighbor_indices,
763 all_neighbor_weights,
768 OffsetIndices<int>(parameterized_guide_offsets),
769 parameterized_guide_lengths,
770 use_direct_interpolation_per_child);
771 interpolate_curve_attributes(child_curves,
776 all_neighbor_indices,
777 all_neighbor_weights,
779 OffsetIndices<int>(parameterized_guide_offsets),
780 parameterized_guide_lengths,
781 use_direct_interpolation_per_child);
783 store_output_attributes(child_curves,
788 all_neighbor_indices,
789 all_neighbor_weights);
791 if (guide_curves_id.mat !=
nullptr) {
792 child_curves_id->mat = MEM_dupalloc(guide_curves_id.mat);
793 child_curves_id->totcol = guide_curves_id.totcol;
796 geometry::debug_randomize_curve_order(&child_curves);
798 return GeometrySet::from_curves(child_curves_id);
807 guide_curves_geometry.
get_curves()->geometry.curve_num == 0)
813 if (points_component ==
nullptr) {
814 points_component = points_geometry.get_component<
MeshComponent>();
816 if (points_component ==
nullptr || points_geometry.
is_empty()) {
821 const int max_neighbors = std::max<int>(1, params.
extract_input<
int>(
"Max Neighbors"_ustr));
824 "normalize(float3)"_ustr);
838 fn::FieldEvaluator curves_evaluator{curves_context, guide_curves_id.geometry.curve_num};
839 curves_evaluator.
add(guides_up_field);
840 curves_evaluator.
add(guide_group_field);
848 points_evaluator.
add(points_up_field);
849 points_evaluator.
add(point_group_field);
856 std::optional<std::string> index_attribute_id =
858 std::optional<std::string> weight_attribute_id =
870 weight_attribute_id);
873 if (
const auto *curve_edit_data =
876 new_curves.
add(*curve_edit_data);
881 params.
set_output(
"Curves"_ustr, std::move(new_curves));
889 ntype.
ui_name =
"Interpolate Curves";
890 ntype.
ui_description =
"Generate new curves on points by interpolating between existing curves";
Low-level operations for curves.
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_INTERPOLATE_CURVES
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void reinitialize(const int64_t new_size)
MutableSpan< T > typed() const
CommonVArrayInfo common_info() const
const CPPType & type() const
constexpr IndexRange index_range() const
constexpr Span drop_front(int64_t n) const
constexpr int64_t size() const
constexpr IndexRange index_range() const
void foreach_attribute(const FunctionRef< void(const AttributeIter &)> fn) const
GAttributeReader get() const
MutableSpan< float3 > positions_for_write()
AttributeAccessor attributes() const
Span< float3 > positions() const
IndexRange curves_range() const
OffsetIndices< int > points_by_curve() const
MutableAttributeAccessor attributes_for_write()
int attribute_domain_size(AttrDomain domain) const
virtual std::optional< AttributeAccessor > attributes() const
virtual bool is_empty() const
bool add(const StringRef name, const AttrDomain domain, const AttrType data_type, const AttributeInit &initializer)
GSpanAttributeWriter lookup_or_add_for_write_only_span(StringRef name, AttrDomain domain, AttrType data_type)
int add(GField field, GVArray *varray_ptr)
const GVArray & get_evaluated(const int field_index) const
static FieldOperationPtr from(std::shared_ptr< const mf::MultiFunction > fn, Vector< GField > inputs)
NodeAttributeFilter get_attribute_filter(const UString output_identifier) const
std::optional< std::string > get_output_anonymous_attribute_id_if_needed(const UString output_identifier, const bool force_create=false)
T extract_input(const UString identifier)
void set_default_remaining_outputs()
void set_output(const UString identifier, T &&value)
static void remember_deformed_positions_if_necessary(GeometrySet &geometry)
void gather(const GVArray &src, const IndexMask &indices, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel)
typename DefaultMixerStruct< T >::type DefaultMixer
void to_static_type(const CPPType &cpp_type, Fn &&fn)
void node_register_type(bNodeType &ntype)
const MultiFunction & lookup(UString id)
static void find_neighbor_guides(const Span< float3 > positions, const Span< int > point_group_indices, const Span< std::unique_ptr< KDTreeNew< float3 > > > kdtrees, const GroupedSpan< int > guides_by_group, const int max_neighbor_count, MutableSpan< int > r_all_neighbor_indices, MutableSpan< float > r_all_neighbor_weights, MutableSpan< int > r_all_neighbor_counts)
static void parameterize_guide_curves(const bke::CurvesGeometry &guide_curves, Array< int > &r_parameterized_guide_offsets, Array< float > &r_parameterized_guide_lengths)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
static void compute_point_counts_per_child(const bke::CurvesGeometry &guide_curves, const Span< int > point_group_indices, const Span< int > points_per_curve_by_group, const Span< int > all_neighbor_indices, const Span< float > all_neighbor_weights, const Span< int > all_neighbor_counts, const int max_neighbors, MutableSpan< int > r_points_per_child, MutableSpan< bool > r_use_direct_interpolation)
static Array< std::unique_ptr< KDTreeNew< float3 > > > build_kdtrees_for_root_positions(const GroupedSpan< int > guides_by_group, const Span< float3 > root_positions)
static void interpolate_curve_attributes(bke::CurvesGeometry &child_curves, const bke::CurvesGeometry &guide_curves, const AttributeAccessor &point_attributes, const AttributeFilter &attribute_filter, const int max_neighbors, const Span< int > all_neighbor_indices, const Span< float > all_neighbor_weights, const Span< int > all_neighbor_counts, const OffsetIndices< int > parameterized_guide_offsets, const Span< float > parameterized_guide_lengths, const Span< bool > use_direct_interpolation_per_child)
static void interpolate_curve_shapes(bke::CurvesGeometry &child_curves, const bke::CurvesGeometry &guide_curves, const int max_neighbors, const Span< int > all_neighbor_indices, const Span< float > all_neighbor_weights, const Span< int > all_neighbor_counts, const VArray< float3 > &guides_up, const VArray< float3 > &points_up, const Span< float3 > point_positions, const OffsetIndices< int > parameterized_guide_offsets, const Span< float > parameterized_guide_lengths, const Span< bool > use_direct_interpolation_per_child)
static Array< int > compute_points_per_curve_by_group(const GroupedSpan< int > guides_by_group, const bke::CurvesGeometry &guide_curves)
static void node_geo_exec(GeoNodeExecParams params)
static void store_output_attributes(bke::CurvesGeometry &child_curves, const std::optional< StringRef > &weight_attribute_id, const std::optional< StringRef > &index_attribute_id, const int max_neighbors, const Span< int > all_neighbor_counts, const Span< int > all_neighbor_indices, const Span< float > all_neighbor_weights)
static GeometrySet generate_interpolated_curves(const Curves &guide_curves_id, const AttributeAccessor &point_attributes, const VArray< float3 > &guides_up, const VArray< float3 > &points_up, const Span< int > guide_group_ids, const VArray< int > &point_group_ids, const int max_neighbors, const AttributeFilter &attribute_filter, const std::optional< StringRef > &index_attribute_id, const std::optional< StringRef > &weight_attribute_id)
OffsetIndices< int > accumulate_counts_to_offsets(MutableSpan< int > counts_to_offsets, int start_offset=0)
GroupedSpan< int > build_groups_from_indices(Span< int > indices, int groups_num, Array< int > &offset_data, Array< int > &index_data)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
auto accumulated_task_sizes(Fn &&fn)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
VecBase< float, 3 > float3
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
bool allow_skip(const StringRef name) const
StringRefNull name() const
void set_name(std::string name)
const GeometryComponent * get_component(GeometryComponent::Type component_type) const
const Curves * get_curves() const
void copy_bundle_from(const GeometrySet &other)
void add(const GeometryComponent &component)
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare
IndexRange index_range() const