Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 45 additions & 28 deletions manim/animation/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,18 @@ class AnimationGroup(Animation):
The function defining the animation progress based on the relative
runtime (see :mod:`~.rate_functions`) .
lag_ratio
Defines the delay after which the animation is applied to submobjects. A lag_ratio of
``n.nn`` means the next animation will play when ``nnn%`` of the current animation has played.
Defaults to 0.0, meaning that all animations will be played together.
Defines the delay after which each subsequent animation begins, relative to the previous animation's duration.

This does not influence the total runtime of the animation. Instead the runtime
of individual animations is adjusted so that the complete animation has the defined
run time.
Example: With `lag_ratio=0.5`, animation 2 starts when animation 1 is 50% complete,
animation 3 starts when animation 2 is 50% complete, and so on.

This is analogous to how `lag_ratio` works for submobjects in other Manim animations.
(e.g., `self.play(animation, lag_ratio=x)`):
- `lag_ratio=0.0` (default): All animations play together (parallel)
- `lag_ratio=1.0`: Animations play sequentially (current submobject's animation finishes before next starts)

Note: The total runtime (`run_time`) is preserved. Each individual animation's run_time is scaled
to fit the user-provided `run_time` duration, with overlaps determined by the `lag_ratio`.
"""

def __init__(
Expand Down Expand Up @@ -203,14 +208,18 @@ class Succession(AnimationGroup):
animations
Sequence of :class:`~.Animation` objects to be played.
lag_ratio
Defines the delay after which the animation is applied to submobjects. A lag_ratio of
``n.nn`` means the next animation will play when ``nnn%`` of the current animation has played.
Defaults to 1.0, meaning that the next animation will begin when 100% of the current
animation has played.
Defines the delay after which each subsequent animation begins, relative to the previous animation's duration.

Example: With `lag_ratio=0.5`, animation 2 starts when animation 1 is 50% complete,
animation 3 starts when animation 2 is 50% complete, and so on.

This does not influence the total runtime of the animation. Instead the runtime
of individual animations is adjusted so that the complete animation has the defined
run time.
This is analogous to how `lag_ratio` works for submobjects in other Manim animations.
(e.g., `self.play(animation, lag_ratio=x)`):
- `lag_ratio=0.0` (default): All animations play together (parallel)
- `lag_ratio=1.0`: Animations play sequentially (current submobject's animation finishes before next starts)

Note: The total runtime (`run_time`) is preserved. Each individual animation's run_time is scaled
to fit the user-provided `run_time` duration, with overlaps determined by the `lag_ratio`.

Examples
--------
Expand Down Expand Up @@ -302,14 +311,18 @@ class LaggedStart(AnimationGroup):
animations
Sequence of :class:`~.Animation` objects to be played.
lag_ratio
Defines the delay after which the animation is applied to submobjects. A lag_ratio of
``n.nn`` means the next animation will play when ``nnn%`` of the current animation has played.
Defaults to 0.05, meaning that the next animation will begin when 5% of the current
animation has played.
Defines the delay after which each subsequent animation begins, relative to the previous animation's duration.

Example: With `lag_ratio=0.5`, animation 2 starts when animation 1 is 50% complete,
animation 3 starts when animation 2 is 50% complete, and so on.

This does not influence the total runtime of the animation. Instead the runtime
of individual animations is adjusted so that the complete animation has the defined
run time.
This is analogous to how `lag_ratio` works for submobjects in other Manim animations.
(e.g., `self.play(animation, lag_ratio=x)`):
- `lag_ratio=0.0` (default): All animations play together (parallel)
- `lag_ratio=1.0`: Animations play sequentially (current submobject's animation finishes before next starts)

Note: The total runtime (`run_time`) is preserved. Each individual animation's run_time is scaled
to fit the user-provided `run_time` duration, with overlaps determined by the `lag_ratio`.

Examples
--------
Expand Down Expand Up @@ -363,14 +376,18 @@ class LaggedStartMap(LaggedStart):
run_time
The duration of the animation in seconds.
lag_ratio
Defines the delay after which the animation is applied to submobjects. A lag_ratio of
``n.nn`` means the next animation will play when ``nnn%`` of the current animation has played.
Defaults to 0.05, meaning that the next animation will begin when 5% of the current
animation has played.

This does not influence the total runtime of the animation. Instead the runtime
of individual animations is adjusted so that the complete animation has the defined
run time.
Defines the delay after which each subsequent animation begins, relative to the previous animation's duration.

Example: With `lag_ratio=0.5`, animation 2 starts when animation 1 is 50% complete,
animation 3 starts when animation 2 is 50% complete, and so on.

This is analogous to how `lag_ratio` works for submobjects in other Manim animations.
(e.g., `self.play(animation, lag_ratio=x)`):
- `lag_ratio=0.0` (default): All animations play together (parallel)
- `lag_ratio=1.0`: Animations play sequentially (current submobject's animation finishes before next starts)

Note: The total runtime (`run_time`) is preserved. Each individual animation's run_time is scaled
to fit the user-provided `run_time` duration, with overlaps determined by the `lag_ratio`.
kwargs
Further keyword arguments that are passed to `animation_class`.

Expand Down
Loading
Loading