animation_contexts¶
Animation contexts – the with blocks that decide when things happen.
Recording an animation says what changes; the surrounding context says how the changes are laid out in time. There are four:
SeqOne after another. The default outside any context.
SyncAll at once.
LagOverlapping – each change starts when the previous is
ratioof the way through.Lag(0)isSync,Lag(1)isSeq.OffInstantly, in a single frame, recording no animation.
Contexts nest, and a nested context counts as a single animation to its parent,
which is what makes complex multi-Mob choreography readable. Unset parameters are
inherited from the enclosing context. runtime sets a context’s total
runtime and is applied retroactively on __exit__, by rescaling every
child timestamp – which is why an event recorded outside any entered-and-exited
context evaluates to time zero.
Audio and
Speech are the same
mechanism with their runtime taken from a sound clip instead of a number.
AnimationManager is the per-Scene owner of the context stack.
See Combining Animations.
Classes
Base class for the |
|
Per-Scene owner of the active animation-context stack. |
|
Play a sound, and fit the block's animations to its length. |
|
Bend the timing of the block's animations through an extra rate function. |
|
Overlap the block's animations, each starting partway into the last. |
|
Suppress enclosing contexts' spawn/despawn extras inside this block. |
|
Apply changes instantly, with no animation and no video time. |
|
Run a function over every Mob constructed inside the block. |
|
Play the block's animations one after another. |
|
Present Mobs one at a time, pausing on each, and clear up at the end. |
|
Narrate a line, and fit the block's animations to how long it takes to say. |
|
Play the block's animations all at the same time. |
Functions
- animation_manager_bound(function)[source]¶
Run an initialized Animatable method with its Scene manager bound.
- animation_manager_context(animation_manager)[source]¶
Temporarily bind implicit AnimationContexts to one scene manager.
- animation_manager_for(*owners)[source]¶
Resolve the one animation manager associated with
owners.Owners may be scenes, mobs, or nested Python collections containing them. A context cannot coherently combine mobs from different scenes, so mixed managers are rejected instead of silently recording into whichever scene happens to be globally active.