Animation¶
keyed.animation
¶
Animation related classes/functions.
AnimationType
¶
Bases: Enum
Specifies the mathematical operation used to combine the original and animated values.
Source code in src/keyed/animation.py
Animation
¶
Bases: Generic[T]
Define an animation.
Animations vary a parameter over time.
Generally, Animations become active at start_frame
and smoothly change
according to the easing
function until terminating to a final value at
end_frame
. The animation will remain active (i.e., the parameter will
not suddenly jump back to it's pre-animation state), but will cease varying.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start
|
int
|
Frame at which the animation will become active. |
required |
end
|
int
|
Frame at which the animation will stop varying. |
required |
start_value
|
HasValue[T]
|
Value at which the animation will start. |
required |
end_value
|
HasValue[T]
|
Value at which the animation will end. |
required |
ease
|
EasingFunctionT
|
The rate in which the value will change throughout the animation. |
linear_in_out
|
animation_type
|
AnimationType
|
How the animation value will affect the original value. |
ABSOLUTE
|
Raises:
Type | Description |
---|---|
ValueError
|
When |
Source code in src/keyed/animation.py
Loop
¶
Bases: Animation
Loop an animation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
animation
|
Animation
|
The animation to loop. |
required |
n
|
int
|
Number of times to loop the animation. |
1
|
Source code in src/keyed/animation.py
PingPong
¶
Bases: Animation
Play an animation forward, then backwards n times.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
animation
|
Animation
|
The animation to ping-pong. |
required |
n
|
int
|
Number of full back-and-forth cycles |
1
|
Source code in src/keyed/animation.py
end_frame
property
¶
Returns the frame at which the animation stops varying.
Notes
Each cycle consists of going forward and coming back.
stagger
¶
stagger(start_value=0, end_value=1, easing=linear_in_out, animation_type=ABSOLUTE)
Partially-initialize an animation for use with Group.write_on.
This will set the animations values, easing, and type without setting its start/end frames.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start_value
|
float
|
Value at which the animation will start. |
0
|
end_value
|
float
|
Value at which the animation will end. |
1
|
easing
|
EasingFunctionT
|
The rate in which the value will change throughout the animation. |
linear_in_out
|
animation_type
|
AnimationType
|
How the animation value will affect the original value. |
ABSOLUTE
|
Returns:
Type | Description |
---|---|
partial[Animation]
|
Partially initialized animation. |
Source code in src/keyed/animation.py
step
¶
Return an animation that applies a step function to the Variable at a particular frame.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value
|
HasValue[T]
|
The value to step to. |
required |
frame
|
int
|
The frame at which the step will be applied. |
ALWAYS
|
animation_type
|
AnimationType
|
See :class: |
ABSOLUTE
|
Returns:
Type | Description |
---|---|
Animation[T]
|
An animation that applies a step function to the Variable at a particular frame. |