an.adapters.cutout.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.adapters.cutout.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
- class an.adapters.cutout.clip.Clip(name: str, duration: float, channels: list[Channel] = <factory>, loop_mode: LoopMode = LoopMode.ONCE)[source]
Named animation: a duration + a bundle of channels.
- class an.adapters.cutout.clip.LoopMode(value)[source]
How a clip behaves past its natural duration.
- an.adapters.cutout.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).alias of
dict[tuple[str,str],Any]
- an.adapters.cutout.clip.evaluate(clip: Clip, t: float) dict[tuple[str, str], Any][source]
Evaluate
clipat timet, returning a Pose.
- an.adapters.cutout.clip.merge_poses(*poses: dict[tuple[str, str], Any]) dict[tuple[str, str], Any][source]
Merge multiple poses with override semantics (later wins per key).
Used by the timeline to combine concurrent clips on the same target.
>>> merge_poses({("a", "x"): 1.0}, {("a", "x"): 2.0, ("a", "y"): 3.0}) {('a', 'x'): 2.0, ('a', 'y'): 3.0}