Anim: run bezier handle calculation in parallel #119388

Merged
Christoph Lendenfeld merged 21 commits from ChrisLend/blender:thread_recalc_handles into main 2024-05-07 10:43:03 +02:00
1 changed files with 1 additions and 1 deletions
Showing only changes of commit 97097c0653 - Show all commits

View File

@ -1239,7 +1239,7 @@ void BKE_fcurve_handles_recalc_ex(FCurve *fcu, eBezTriple_Flag handle_sel_flag)
const bool cycle = BKE_fcurve_is_cyclic(fcu) && BEZT_IS_AUTOH(first) && BEZT_IS_AUTOH(last);
blender::IndexRange bezt_range(0, fcu->totvert);
blender::threading::parallel_for(bezt_range, 128, [&](const blender::IndexRange range) {
blender::threading::parallel_for(bezt_range, 512, [&](const blender::IndexRange range) {
for (const int i : range) {
BezTriple *bezt = &fcu->bezt[i];

How about pulling the special handling for the first and last keyframes out of the parallel loop, and skipping those two indices? bezt_range.drop_front(1).drop_back(1)

How about pulling the special handling for the first and last keyframes out of the parallel loop, and skipping those two indices? `bezt_range.drop_front(1).drop_back(1)`

To do that without duplicating the code within the loop I'd need to extract the logic into a function. Should I do this within this PR?

To do that without duplicating the code within the loop I'd need to extract the logic into a function. Should I do this within this PR?

Definitely not a big deal either way, it could wait if you preferred!

Definitely not a big deal either way, it could wait if you preferred!
BezTriple *prev = nullptr;