an.adapters.cutout.clip#

Clips, loop modes and poses — moved to an.timing.clip (the timing kernel).

This path keeps working for every existing caller; new code imports from an.timing.

>>> 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, 1.25)[("a", "x")]  # loop wraps
2.5

Functions

evaluate(clip, t, *[, kind_of])

Evaluate clip at time t, returning a Pose.

merge_poses(*poses)

Merge multiple poses with override semantics (later wins per key).

Classes

Clip(name, duration[, channels, loop_mode])

Named animation: a duration + a bundle of channels.

LoopMode(*values)

How a clip behaves past its natural duration.

class an.adapters.cutout.clip.Clip(name, duration, channels=<factory>, loop_mode=LoopMode.ONCE)[source]#

Bases: object

Named animation: a duration + a bundle of channels.

class an.adapters.cutout.clip.LoopMode(*values)[source]#

Bases: str, Enum

How a clip behaves past its natural duration.

an.adapters.cutout.clip.evaluate(clip, t, *, kind_of=None)[source]#

Evaluate clip at time t, returning a Pose.

kind_of declares each channel’s field kind; None interpolates by value type, as runtime.js does (see an.timing.channel).

Return type:

dict[tuple[str, str], Any]

an.adapters.cutout.clip.merge_poses(*poses)[source]#

Merge multiple poses with override semantics (later wins per key).

Used by the timeline to combine concurrent clips on the same target.

Return type:

dict[tuple[str, str], Any]

>>> merge_poses({("a", "x"): 1.0}, {("a", "x"): 2.0, ("a", "y"): 3.0})
{('a', 'x'): 2.0, ('a', 'y'): 3.0}