Skip to main content

getCanvasKeyframeDisplayFrame()v4.0.530

Converts a frame of a prop's interpolate() expression to a composition frame. It is the inverse of getCanvasKeyframeSourceFrame().

warning

Experimental API: This package is not stable. Its public API may change without a major version bump.

seek-to-keyframe.ts
export const seekToKeyframe = (sourceFrame: number) => { seek(getCanvasKeyframeDisplayFrame({track, propStatus, sourceFrame})); };

Parameters​

An object with the following properties:

track​

The TimelineTrackData of the sequence from controller.timeline. Only keyframeDisplayOffset and keyframePlaybackRate are read.

propStatus​

How the prop is written in the source, as the props of getNodeProps() report it, or null.

sourceFrame​

A frame in the clock of the interpolation, for example the frame of a keyframe in a 'keyframed' prop status.

Return value​

The composition frame at which the keyframe applies. It may be fractional when the sequence has a playbackRate.

Compatibility​

BrowsersEnvironments
Chrome
Firefox
Safari

See also​