Fix: Assert in resample curve node with single point curve
This commit is contained in:
parent
f26aa186b2
commit
739136caca
Notes:
blender-bot
2023-10-13 01:54:23 +02:00
Referenced by issue #99533, Geometry Nodes: Hit assert in Resample Curve node
|
@ -233,10 +233,18 @@ static Curves *resample_to_uniform(const CurveComponent &src_component,
|
|||
for (const int i_curve : sliced_selection) {
|
||||
const bool cyclic = curves_cyclic[i_curve];
|
||||
const IndexRange dst_points = dst_curves.points_for_curve(i_curve);
|
||||
length_parameterize::sample_uniform(src_curves.evaluated_lengths_for_curve(i_curve, cyclic),
|
||||
!curves_cyclic[i_curve],
|
||||
sample_indices.as_mutable_span().slice(dst_points),
|
||||
sample_factors.as_mutable_span().slice(dst_points));
|
||||
const Span<float> lengths = src_curves.evaluated_lengths_for_curve(i_curve, cyclic);
|
||||
if (lengths.is_empty()) {
|
||||
/* Handle curves with only one evaluated point. */
|
||||
sample_indices.as_mutable_span().slice(dst_points).fill(0);
|
||||
sample_factors.as_mutable_span().slice(dst_points).fill(0.0f);
|
||||
}
|
||||
else {
|
||||
length_parameterize::sample_uniform(lengths,
|
||||
!curves_cyclic[i_curve],
|
||||
sample_indices.as_mutable_span().slice(dst_points),
|
||||
sample_factors.as_mutable_span().slice(dst_points));
|
||||
}
|
||||
}
|
||||
|
||||
/* For every attribute, evaluate attributes from every curve in the range in the original
|
||||
|
|
Loading…
Reference in New Issue