A newer version of the Gradio SDK is available: 6.20.0
AnimationGroup
Qualified name: manim.animation.composition.AnimationGroup
class AnimationGroup(mobject=None, *args, use_override=True, **kwargs)
Bases: Animation
Plays a group or series of Animation.
- Parameters:
animations (Animation | Iterable *[*Animation ]) – Sequence of
Animationobjects to be played.group (Group | VGroup | OpenGLGroup | OpenGLVGroup | None) – A group of multiple
Mobject.run_time (float | None) – The duration of the animation in seconds.
rate_func (Callable [ *[*float ] , float ]) – The function defining the animation progress based on the relative runtime (see
rate_functions) .lag_ratio (float) –
Defines the delay after which the animation is applied to submobjects. A lag_ratio of
n.nnmeans the next animation will play whennnn%of the current animation has played. 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.
kwargs (Any)
Methods
begin |
Begin the animation. |
|---|---|
build_animations_with_timings |
Creates a list of triplets of the form (anim, start_time, end_time). |
clean_up_from_scene |
Clean up the Scene after finishing the animation. |
finish |
Finish the animation. |
get_all_mobjects |
Get all mobjects involved in the animation. |
init_run_time |
Calculates the run time of the animation, if different from run_time. |
interpolate |
Set the animation progress. |
update_mobjects |
Updates things like starting_mobject, and (for Transforms) target_mobject. |
Attributes
run_time |
|---|
_original__init__(*animations, group=None, run_time=None, rate_func=, lag_ratio=0, **kwargs)
Initialize self. See help(type(self)) for accurate signature.
- Parameters:
_setup_scene(scene)
Setup up the Scene before starting the animation.
This includes to add() the Animation’s
Mobject if the animation is an introducer.
- Parameters: scene (Scene) – The scene the animation should be cleaned up from.
- Return type: None
begin()
Begin the animation.
This method is called right as an animation is being played. As much initialization as possible, especially any mobject copying, should live in this method.
- Return type: None
build_animations_with_timings()
Creates a list of triplets of the form (anim, start_time, end_time).
- Return type: None
clean_up_from_scene(scene)
Clean up the Scene after finishing the animation.
This includes to remove() the Animation’s
Mobject if the animation is a remover.
- Parameters: scene (Scene) – The scene the animation should be cleaned up from.
- Return type: None
finish()
Finish the animation.
This method gets called when the animation is over.
- Return type: None
get_all_mobjects()
Get all mobjects involved in the animation.
Ordering must match the ordering of arguments to interpolate_submobject
- Returns: The sequence of mobjects.
- Return type: Sequence[Mobject]
init_run_time(run_time)
Calculates the run time of the animation, if different from run_time.
- Parameters: run_time (float | None) – The duration of the animation in seconds.
- Returns: The duration of the animation in seconds.
- Return type: run_time
interpolate(alpha)
Set the animation progress.
This method gets called for every frame during an animation.
- Parameters: alpha (float) – The relative time to set the animation to, 0 meaning the start, 1 meaning the end.
- Return type: None
update_mobjects(dt)
Updates things like starting_mobject, and (for Transforms) target_mobject. Note, since typically (always?) self.mobject will have its updating suspended during the animation, this will do nothing to self.mobject.
- Parameters: dt (float)
- Return type: None