index-of-nearest-104619 #2

Merged
Iliya Katushenock merged 62 commits from HooglyBoogly/blender:index-of-nearest-104619 into index_of_nearest 2023-04-20 21:19:53 +02:00
Showing only changes of commit 4054d76749 - Show all commits

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) {