getCanvasPropValueAtFrame()v4.0.530
Reads the value a prop has at a composition frame according to the source code. Use it to show the value of an animated prop at the playhead in an inspector.
Experimental API: This package is not stable. Its public API may change without a major version bump.
OpacityField.tsxexport constOpacityField = () => { constvalue =getCanvasPropValueAtFrame ({track ,schema ,key : 'style.opacity',propStatus ,frame :playhead , }); return <input type ="number"value ={typeofvalue === 'number' ?value : ''}readOnly />; };
Parameters
An object with the following properties:
track
The TimelineTrackData of the sequence from controller.timeline. Only keyframeDisplayOffset and keyframePlaybackRate are read.
schema
The interactivity schema of the element, from track.sequence.controls. It provides the default of an unset prop.
key
The schema key of the prop in dot notation, for example 'style.opacity'.
propStatus
How the prop is written in the source, as the props of getNodeProps() report it.
frame
The composition frame at which to read the value.
Return value
The interpolated value of a 'keyframed' prop at the frame, the code value of a 'static' prop, or the schema default when the prop is not set. null for a 'computed' prop or when no value is known.
The value reflects the source, not an active override from controller.overrides.
Compatibility
| Browsers | Environments | |||||
|---|---|---|---|---|---|---|
Chrome | Firefox | Safari | ||||