Skip to main content

Module animation

Module animation 

Source
Expand description

Animation (R17): timelines, tracks, keyframes, cels, the 2D camera and onion skin settings, how a frame is evaluated, and edits.

Tables (all optional; CSP adds them when a file first uses animation): AnimationCutBank (which timeline is current), TimeLine (one row per timeline, linked by NextTimeLine), Track (one row per animated layer and timeline, linked by TrackNextIndex from TimeLine.FirstTrack) and TimeLineLabel. A track’s keys are in two “cmt “ documents (crate::cmt) in external chunks: TrackActionMixer (version 0100, single precision) and TrackActionMixer2 (0110, double precision), with the same content. TrackValueMap holds the values at the current frame.

Time: a timeline frame f (0-based) is at t = f · 60 / FrameRate ticks. Each track has one clip mapping timeline ticks to motion ticks, m = MS + (t − TS) · (ME − MS) / (TE − TS) (TimeClip = TS..TE, MotionClip = MS..ME), and its curves are keyed in motion ticks.

Measured against CSP’s image-sequence export (docs/validation/V6c-animation.md): interpolation Constant holds a key until the next one, Linear moves at a constant speed, Default (CSP’s smooth interpolation, also used when a curve has no Interp list) eases with a cubic Hermite through the slopes (0 in every key seen so far), a keyframed layer is not shown before its clip starts, layer keyframes move TimeLineOriginalMipmap by q = Position + R(rotation) · Scale · (p − Center) (rotation in degrees, clockwise on screen), and opacity keys are percentages applied as round(v · 256 / 100) / 256. See docs/spec/08-animation.md.

Structs§

Affine
A 2D affine map p ↦ (a·x + b·y + c, d·x + e·y + f).
Animation
All animation data of a file.
Clip
The typed content of a track mixer.
Curve
One animated value (FCurve): Type and, for pairs, Axis X or Y.
Frame
The 基準フレーム (reference frame): the area an image-sequence export shows, in canvas pixels.
FrameState
What a frame changes in the layer tree: which layers are not drawn (cels not shown, light-table layers), keyframed layers’ transforms and cameras’ maps (frame position → canvas position of the folder’s content).
Key
One key of a curve.
Label
A TimeLineLabel: a timeline label (type 0), an in-between mark ○ on a cel track (type 1) or a named track label with a length (type 3).
LayerTransform
A keyframed layer at one frame.
MapEntry
One entry of Track.TrackValueMap (big endian: u32 size, UTF-16 name, UTF-16 tag, u32 type, value).
OnionSkin
オニオンスキン settings (Canvas.OnionSkin*).
Param
A Param node: the value a track shows without keys, and its name.
Timeline
A TimeLine row.
Track
A Track row with its mixers.

Enums§

Interp
How a key moves to the next one (FCurve/Interp).
MapValue
Value of a MapEntry, by type code.
TrackKind
What a track animates (Track.TrackKind).

Constants§

LAYER_TYPE_CAMERA
LayerType of a 2D camera folder.
LAYER_TYPE_LIGHT_TABLE
LayerType of light-table reference layers. They are hidden in the layer palette, only shown on the light table, and never rendered.
TICKS_PER_SECOND
Timeline ticks per second.

Functions§

parse_value_map
Decode Track.TrackValueMap.
value_map_bytes
Encode Track.TrackValueMap.