From 3d7cc72378a5f6b58faacb067123cef6e2da8ecf Mon Sep 17 00:00:00 2001 From: GoThrones Date: Tue, 5 May 2026 21:26:55 +0530 Subject: [PATCH 1/4] minor changes in indication.py, composition.py and creation.py --- manim/animation/composition.py | 7 ++++--- manim/animation/creation.py | 4 ++-- manim/animation/indication.py | 11 ++++++----- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/manim/animation/composition.py b/manim/animation/composition.py index 82488425f8..6e6269cef2 100644 --- a/manim/animation/composition.py +++ b/manim/animation/composition.py @@ -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 @@ -42,8 +42,9 @@ 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. + Defines the delay after which the animation is applied to submobjects. + Example: A lag_ratio of ``0.1`` means the animation for the next submobject + will play when ``10%`` of the current submobject's animation is complete. Defaults to 0.0, meaning that all animations will be played together. This does not influence the total runtime of the animation. Instead the runtime diff --git a/manim/animation/creation.py b/manim/animation/creation.py index f79b6ec197..5781a20236 100644 --- a/manim/animation/creation.py +++ b/manim/animation/creation.py @@ -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( diff --git a/manim/animation/indication.py b/manim/animation/indication.py index 98694af726..123bf13811 100644 --- a/manim/animation/indication.py +++ b/manim/animation/indication.py @@ -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 -------- @@ -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 -------- @@ -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 @@ -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 -------- From 4b153980ae9925daf8456949be9e062a24c350fa Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 5 May 2026 16:03:58 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- manim/animation/composition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manim/animation/composition.py b/manim/animation/composition.py index 6e6269cef2..2cf50773c7 100644 --- a/manim/animation/composition.py +++ b/manim/animation/composition.py @@ -42,7 +42,7 @@ 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. + Defines the delay after which the animation is applied to submobjects. Example: A lag_ratio of ``0.1`` means the animation for the next submobject will play when ``10%`` of the current submobject's animation is complete. Defaults to 0.0, meaning that all animations will be played together. From 665a4a63fa2e44d761197845b6606a8d7d34c1c7 Mon Sep 17 00:00:00 2001 From: GoThrones Date: Tue, 5 May 2026 23:50:49 +0530 Subject: [PATCH 3/4] docstring for lag_ratio improved --- manim/animation/composition.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/manim/animation/composition.py b/manim/animation/composition.py index 6e6269cef2..7e980cda5b 100644 --- a/manim/animation/composition.py +++ b/manim/animation/composition.py @@ -42,14 +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. - Example: A lag_ratio of ``0.1`` means the animation for the next submobject - will play when ``10%`` of the current submobject's animation is complete. - Defaults to 0.0, meaning that all animations will be played together. - - 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`. """ def __init__( From bcc48db58941d801dbe533869b8d5146c76d011e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 5 May 2026 19:29:44 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- manim/animation/composition.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/manim/animation/composition.py b/manim/animation/composition.py index 7e980cda5b..9af4be48c2 100644 --- a/manim/animation/composition.py +++ b/manim/animation/composition.py @@ -43,16 +43,16 @@ class AnimationGroup(Animation): runtime (see :mod:`~.rate_functions`) . lag_ratio 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, + + 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 + + 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`. """