Fix T103809: Using Preview Range Breaks Normalized FCurve Display
When using the "normalized" display of FCurves in the Graph Editor, and also turning on the preview range, the normalized display would break. The preview frame range was assumed to be bezt indices, which is only true when every frame has a key. Reviewed by: Colin Basnett Differential Revision: https://developer.blender.org/D16987 Ref: D16987
This commit is contained in:
@@ -343,8 +343,12 @@ static void fcurve_scene_coord_range_get(Scene *scene,
|
||||
int end = fcu->totvert;
|
||||
|
||||
if (use_preview_only) {
|
||||
start = scene->r.psfra;
|
||||
end = min_ii(scene->r.pefra + 1, fcu->totvert);
|
||||
/* 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);
|
||||
}
|
||||
|
||||
if (fcu->bezt) {
|
||||
|
||||
Reference in New Issue
Block a user