Curves: Add support for proportional editing #104620

Closed
Falk David wants to merge 15 commits from filedescriptor:curves-proportional-editing into blender-v3.5-release

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 2 additions and 3 deletions
Showing only changes of commit 23529b64e0 - Show all commits

View File

@ -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
Review

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.

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.
Review

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 the InplacePriorityQueue on top of.

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 the `InplacePriorityQueue` on top of.
Review

Ah right! That's totally fine, it was just a thought.

Ah right! That's totally fine, it was just a thought.
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];