Composition

AnimationGroup

class manimlib.animation.composition.AnimationGroup(*animations, **kwargs)
build_animations_with_timings()

Creates a list of triplets of the form (anim, start_time, end_time)

get_all_mobjects()

Ordering must match the ording of arguments to interpolate_submobject

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.

AnimationGroupExample
class AnimationGroupExample(Scene):
    def construct(self):
        mobjects = VGroup(
            Circle(),
            Circle(fill_opacity=1),
            Text("Text").scale(2)
        )
        mobjects.scale(1.5)
        mobjects.arrange_submobjects(RIGHT,buff=2)

        self.wait()
        anims = AnimationGroup(
            *[GrowFromCenter(mob) for mob in mobjects]
        )
        self.play(anims)
        self.wait()

Succession

class manimlib.animation.composition.Succession(*animations, **kwargs)
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.

SuccessionExample
class SuccessionExample(Scene):
    def construct(self):
        mobjects = VGroup(
            Circle(),
            Circle(fill_opacity=1),
            Text("Text").scale(2)
        )
        mobjects.scale(1.5)
        mobjects.arrange_submobjects(RIGHT,buff=2)

        self.add(mobjects)
        self.wait()
        anims = Succession(
            *[ApplyMethod(mob.shift, DOWN) for mob in mobjects]
        )
        self.play(anims)
        self.wait()

LaggedStart

class manimlib.animation.composition.LaggedStart(*animations, **kwargs)
LaggedStartExample
class LaggedStartExample(Scene):
    def construct(self):
        mobjects = VGroup(
            Circle(),
            Circle(fill_opacity=1),
            Text("Text").scale(2)
        )
        mobjects.scale(1.5)
        mobjects.arrange_submobjects(RIGHT,buff=2)

        self.add(mobjects)
        self.wait()
        anims = LaggedStart(
            *[ApplyMethod(mob.shift, DOWN) for mob in mobjects]
        )
        self.play(anims)
        self.wait()

LaggedStartMap

class manimlib.animation.composition.LaggedStartMap(AnimationClass, mobject, arg_creator=None, **kwargs)
LaggedStartMapExample
class LaggedStartMapExample(Scene):
    def construct(self):
        mobjects = VGroup(
            Circle(),
            Circle(fill_opacity=1),
            Text("Text").scale(2)
        )
        mobjects.scale(1.5)
        mobjects.arrange_submobjects(RIGHT,buff=2)

        self.add(mobjects)
        self.wait()
        anims = LaggedStartMap(
            FadeOut, mobjects
        )
        self.play(anims)
        self.wait()