An almost full rewrite, because the reviews took a different turn than the community task I started with ([#113248: GPv3: Copy/Paste Strokes](blender/blender#113…
The layers (threads) are keeping their own record of points under the brush, so just for the points on that layer. That way the threads can operate independently, no shared memory, no need for…
For the outer loop that's not an option right now, unfortunately. We need the frame_group
index inside the loop; with parallel_for_each
we don't have that index.
I'll improve the comment above…
I can't see how we can gain much from an index mask. The gradient is an interactive tool, so at the operator's invoke
we can't build a mask yet. And at the execute
we already have to loop over…
For the case we have more than 1024 layers? ;-)
It's just like the threading::parallel_for_each(drawings, [&](const MutableDrawingInfo &info) {
we do in many other operators, only now at a…
Ha, when the mutex was used all the time, I would fully agree, of course. But adding stroke points to the brush buffer runs perfectly parallel, no mutex used there. The only rare moment the mutex…
Th comment was probably a bit confusing, I changed it. And I changed the for loop into threading::parallel_for_each(drawing_weights, [&](DrawingWeightData &drawing_weight) {
, reflecting the…
In general, a lot of stroke points are affected by the gradient tool. I wouldn't recommend using an index mask for that; it would be less performant.