Blender V4.3
blender::nodes::node_geo_interpolate_curves_cc Namespace Reference

Functions

static void node_declare (NodeDeclarationBuilder &b)
 
static MultiValueMap< int, intseparate_guides_by_group (const VArray< int > &guide_group_ids)
 
static Map< int, intcompute_points_per_curve_by_group (const MultiValueMap< int, int > &guides_by_group, const bke::CurvesGeometry &guide_curves)
 
static Map< int, KDTree_3d * > build_kdtrees_for_root_positions (const MultiValueMap< int, int > &guides_by_group, const bke::CurvesGeometry &guide_curves)
 
static void find_neighbor_guides (const Span< float3 > positions, const VArray< int > point_group_ids, const Map< int, KDTree_3d * > kdtrees, const MultiValueMap< int, 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 compute_point_counts_per_child (const bke::CurvesGeometry &guide_curves, const VArray< int > &point_group_ids, const Map< int, 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 void parameterize_guide_curves (const bke::CurvesGeometry &guide_curves, Array< int > &r_parameterized_guide_offsets, Array< float > &r_parameterized_guide_lengths)
 
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 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 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 VArray< 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)
 
static void node_geo_exec (GeoNodeExecParams params)
 
static void node_register ()
 

Function Documentation

◆ build_kdtrees_for_root_positions()

◆ compute_point_counts_per_child()

static void blender::nodes::node_geo_interpolate_curves_cc::compute_point_counts_per_child ( const bke::CurvesGeometry & guide_curves,
const VArray< int > & point_group_ids,
const Map< int, 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

Compute how many points each generated curve will have. This is determined by looking at neighboring points.

Definition at line 234 of file node_geo_interpolate_curves.cc.

References compute_point_counts_per_child(), blender::MutableSpan< T >::index_range(), and blender::bke::CurvesGeometry::points_by_curve().

Referenced by compute_point_counts_per_child(), and generate_interpolated_curves().

◆ compute_points_per_curve_by_group()

static Map< int, int > blender::nodes::node_geo_interpolate_curves_cc::compute_points_per_curve_by_group ( const MultiValueMap< int, int > & guides_by_group,
const bke::CurvesGeometry & guide_curves )
static

Checks if all curves within a group have the same number of points. If yes, a better interpolation algorithm can be used, that does not require resampling curves.

Definition at line 76 of file node_geo_interpolate_curves.cc.

References blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::add(), blender::MultiValueMap< Key, Value >::items(), blender::bke::CurvesGeometry::points_by_curve(), and blender::offset_indices::OffsetIndices< T >::size().

Referenced by generate_interpolated_curves().

◆ find_neighbor_guides()

static void blender::nodes::node_geo_interpolate_curves_cc::find_neighbor_guides ( const Span< float3 > positions,
const VArray< int > point_group_ids,
const Map< int, KDTree_3d * > kdtrees,
const MultiValueMap< int, 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

For every start point of newly generated curves, find the closest guide curves within the same group and compute a weight for each of them.

Definition at line 129 of file node_geo_interpolate_curves.cc.

References blender::threading::parallel_for().

Referenced by generate_interpolated_curves().

◆ generate_interpolated_curves()

◆ interpolate_curve_attributes()

static void blender::nodes::node_geo_interpolate_curves_cc::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

◆ interpolate_curve_shapes()

static void blender::nodes::node_geo_interpolate_curves_cc::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

◆ node_declare()

static void blender::nodes::node_geo_interpolate_curves_cc::node_declare ( NodeDeclarationBuilder & b)
static

Definition at line 20 of file node_geo_interpolate_curves.cc.

References b, and blender::nodes::SocketDeclaration::description.

Referenced by node_register().

◆ node_geo_exec()

◆ node_register()

static void blender::nodes::node_geo_interpolate_curves_cc::node_register ( )
static

◆ parameterize_guide_curves()

static void blender::nodes::node_geo_interpolate_curves_cc::parameterize_guide_curves ( const bke::CurvesGeometry & guide_curves,
Array< int > & r_parameterized_guide_offsets,
Array< float > & r_parameterized_guide_lengths )
static

◆ separate_guides_by_group()

static MultiValueMap< int, int > blender::nodes::node_geo_interpolate_curves_cc::separate_guides_by_group ( const VArray< int > & guide_group_ids)
static

Guides are split into groups. Every point will only interpolate between guides within the group with the same id.

Definition at line 62 of file node_geo_interpolate_curves.cc.

References blender::MultiValueMap< Key, Value >::add(), and blender::VArrayCommon< T >::index_range().

Referenced by generate_interpolated_curves().

◆ store_output_attributes()

static void blender::nodes::node_geo_interpolate_curves_cc::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