Curves: Add support for proportional editing #104620
|
@ -127,8 +127,7 @@ static void createTransCurvesVerts(bContext * /*C*/, TransInfo *t)
|
|||
}
|
||||
}
|
||||
|
||||
const Span<float3> positions_curve = positions.slice(points);
|
||||
Array<float> closest_distances(positions_curve.size(), FLT_MAX);
|
||||
Array<float> closest_distances(points.size(), FLT_MAX);
|
||||
|
||||
filedescriptor marked this conversation as resolved
|
||||
for (const int i : IndexRange(points.size())) {
|
||||
const int point_i = points[i];
|
||||
|
@ -153,7 +152,7 @@ static void createTransCurvesVerts(bContext * /*C*/, TransInfo *t)
|
|||
|
||||
if (use_connected_only) {
|
||||
calculate_curve_point_distances_for_proportional_editing(
|
||||
positions_curve, closest_distances.as_mutable_span());
|
||||
positions.slice(points), closest_distances.as_mutable_span());
|
||||
for (const int i : IndexRange(points.size())) {
|
||||
TransData &td = tc.data[points[i]];
|
||||
td.dist = closest_distances[i];
|
||||
|
|
Loading…
Reference in New Issue
This array makes things a bit more readable, but it isn't really necessary considering all the data will go into
TransData.dist
right after. It might be worth skipping the array, since this will be an allocation and free for every single curve.I am not sure how I would rewrite the code to not use an array in this case. The
td->dist
values are not sequential, so I can't write to them directly. But the implementation needs some container that I can build theInplacePriorityQueue
on top of.Ah right! That's totally fine, it was just a thought.