forked from blender/blender
index-of-nearest-104619 #2
@ -343,12 +343,20 @@ static void fcurve_scene_coord_range_get(Scene *scene,
|
|||||||
int end = fcu->totvert;
|
int end = fcu->totvert;
|
||||||
|
|
||||||
if (use_preview_only) {
|
if (use_preview_only) {
|
||||||
|
if (fcu->bezt) {
|
||||||
/* Preview frame ranges need to be converted to bezt array indices. */
|
/* Preview frame ranges need to be converted to bezt array indices. */
|
||||||
bool replace = false;
|
bool replace = false;
|
||||||
start = BKE_fcurve_bezt_binarysearch_index(
|
start = BKE_fcurve_bezt_binarysearch_index(
|
||||||
fcu->bezt, scene->r.psfra, fcu->totvert, &replace);
|
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) {
|
if (fcu->bezt) {
|
||||||
|
Loading…
Reference in New Issue
Block a user