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
19 changes: 12 additions & 7 deletions manim/animation/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AnimationGroup(Animation):
Parameters
----------
animations
Sequence of :class:`~.Animation` objects to be played.
The animations to be played. Should be passed as individual arguments.
group
A group of multiple :class:`~.Mobject`.
run_time
Expand All @@ -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
4 changes: 2 additions & 2 deletions manim/animation/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ def __init__(

def interpolate_submobject(
self,
submobject: Mobject,
starting_submobject: Mobject,
submobject: VMobject | OpenGLVMobject | OpenGLSurface,
starting_submobject: VMobject | OpenGLVMobject | OpenGLSurface,
alpha: float,
) -> None:
submobject.pointwise_become_partial(
Expand Down
11 changes: 6 additions & 5 deletions manim/animation/indication.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ class Indicate(Transform):
scale_factor
The factor by which the mobject will be temporally scaled
color
The color the mobject temporally takes.
The color the mobject temporarily takes.
rate_func
The function defining the animation progress at every point in time.
kwargs
Additional arguments to be passed to the :class:`~.Succession` constructor
Additional arguments to be passed to the :class:`~.Transform` initializer.

Examples
--------
Expand Down Expand Up @@ -190,7 +190,7 @@ class Flash(AnimationGroup):
run_time
The duration of the animation.
kwargs
Additional arguments to be passed to the :class:`~.Succession` constructor
Additional arguments to be passed to the :class:`~.ShowPassingFlash` initializer.

Examples
--------
Expand Down Expand Up @@ -232,7 +232,7 @@ def __init__(
**kwargs: Any,
):
if isinstance(point, Mobject):
self.point: Point3D = point.get_center()
self.point = point.get_center()
else:
self.point = np.asarray(point)
self.color = color
Expand Down Expand Up @@ -279,7 +279,8 @@ class ShowPassingFlash(ShowPartial):
mobject
The mobject whose stroke is animated.
time_width
The length of the sliver relative to the length of the stroke.
The fraction of the stroke length that is visible at any given moment.
For example, a value of ``0.1`` means only 10% of the stroke is visible at any moment of time.

Examples
--------
Expand Down
Loading