an.timing.clip#
Clip: a named bundle of channels with a duration and loop mode.
A clip is what you’d call an “animation” in Spine / Rive terminology — a
reusable unit (e.g. "walk_cycle", "wave"). Evaluating a clip at time
t produces a Pose by evaluating each of its channels at t.
Loop modes:
LoopMode.ONCE— pastduration, the last frame holds.LoopMode.LOOP—twraps moduloduration.LoopMode.PING_PONG—tping-pongs over[0, duration].
>>> from an.timing.channel import Channel, Keyframe
>>> ch = Channel("a", "x", [Keyframe(0.0, 0.0), Keyframe(1.0, 10.0)])
>>> clip = Clip("walk", duration=1.0, channels=[ch], loop_mode=LoopMode.LOOP)
>>> evaluate(clip, 0.5)[("a", "x")]
5.0
>>> evaluate(clip, 1.25)[("a", "x")] # loop wraps
2.5
Module Attributes
Mapping of (target_path, property_name) -> value — the universal output of animation evaluation. |
|
the declared kind of each channel. |
|
|
The public name of the loop rule (the contract's; |
Functions
|
Evaluate |
|
Merge multiple poses with override semantics (later wins per key). |
|
The public name of the loop rule (the contract's; |
Classes
|
Named animation: a duration + a bundle of channels. |
|
How a clip behaves past its natural duration. |
- class an.timing.clip.Clip(name, duration, channels=<factory>, loop_mode=LoopMode.ONCE)[source]#
Bases:
objectNamed animation: a duration + a bundle of channels.
- an.timing.clip.KindOf#
the declared kind of each channel.
- Type:
(target, property) -> FieldKind
- an.timing.clip.Pose#
Mapping of (target_path, property_name) -> value — the universal output of animation evaluation. Application happens in
runtime.js(applyPose); the Python side only ever produces poses (an#86 deleted the Python applier, which structurally could not apply swap or alpha values).
- an.timing.clip.evaluate(clip, t, *, kind_of=None)[source]#
Evaluate
clipat timet, returning aPose.kind_ofdeclares each channel’s field kind;Noneinterpolates by value type, asruntime.jsdoes (seean.timing.channel).