Fix: Normalization with baked curves and preview range #106890

Merged
Christoph Lendenfeld merged 1 commits from ChrisLend/blender:fix_baked_curve_normalization_prev_range into main 2023-04-20 10:08:03 +02:00
1 changed files with 13 additions and 5 deletions

View File

@ -343,12 +343,20 @@ static void fcurve_scene_coord_range_get(Scene *scene,
int end = fcu->totvert;
if (use_preview_only) {
/* Preview frame ranges need to be converted to bezt array indices. */
bool replace = false;
start = BKE_fcurve_bezt_binarysearch_index(
fcu->bezt, scene->r.psfra, fcu->totvert, &replace);
if (fcu->bezt) {
/* Preview frame ranges need to be converted to bezt array indices. */
bool replace = false;
start = BKE_fcurve_bezt_binarysearch_index(
fcu->bezt, scene->r.psfra, fcu->totvert, &replace);
end = BKE_fcurve_bezt_binarysearch_index(fcu->bezt, scene->r.pefra, fcu->totvert, &replace);
end = BKE_fcurve_bezt_binarysearch_index(
fcu->bezt, scene->r.pefra + 1, fcu->totvert, &replace);
}
else if (fcu->fpt) {
const int unclamped_start = (int)(scene->r.psfra - fcu->fpt[0].vec[0]);
start = max_ii(unclamped_start, 0);
end = min_ii(unclamped_start + (scene->r.pefra - scene->r.psfra) + 1, fcu->totvert);
}
}
if (fcu->bezt) {