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[~an.adapters.cutout.channel.Channel] = <factory>, loop_mode: ~an.adapters.cutout.clip.LoopMode = LoopMode.ONCE)[source]
Named animation: a duration + a bundle of channels.