Creation

Draw

Show Partial

class manimlib.animation.creation.ShowPartial(mobject, **kwargs)

Abstract class of ShowCreation

Type: Animation

Show Creation

class manimlib.animation.creation.ShowCreation(mobject, **kwargs)

Type: ShowPartial

Parameters

Mobject (Mobject) -- TODO

CONFIG parameters

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

        self.play(
            *[ShowCreation(mob) for mob in mobjects]
        )

        self.wait()

Uncreate

class manimlib.animation.creation.Uncreate(mobject, **kwargs)

Type: ShowCreation

CONFIG parameters

"rate_func": lambda t: smooth(1 - t),
"remover": True
class UncreateExample(Scene):
    def construct(self):
        mobjects = VGroup(
                Circle(),
                Circle(fill_opacity=1),
                TextMobject("Text").scale(2)
            )
        mobjects.scale(1.5)
        mobjects.arrange_submobjects(RIGHT,buff=2)

        self.add(mobjects)

        self.wait(0.3)

        self.play(
            *[Uncreate(mob) for mob in mobjects]
        )

        self.wait()

Draw Border Then Fill

class manimlib.animation.creation.DrawBorderThenFill(vmobject, **kwargs)

Type: Animation

Parameters

vmobject (VMobject) -- Any VMobject

CONFIG parameters

"run_time": 2,
"stroke_width": 2,
"stroke_color": None,
"rate_func": double_smooth,
class DrawBorderThenFillExample(Scene):
    def construct(self):
        vmobjects = VGroup(
                Circle(),
                Circle(fill_opacity=1),
                TextMobject("Text").scale(2)
            )
        vmobjects.scale(1.5)
        vmobjects.arrange_submobjects(RIGHT,buff=2)

        self.play(
            *[DrawBorderThenFill(mob) for mob in vmobjects]
        )

        self.wait()

Write

class manimlib.animation.creation.Write(mob_or_text, **kwargs)

Type: DrawBorderThenFill

Parameters

mob_or_text (VMobject) -- Any VMobject

CONFIG parameters

"rate_func": None,
"submobject_mode": "lagged_start",
class WriteExample(Scene):
    def construct(self):
        mobjects = VGroup(
                Circle(),
                Circle(fill_opacity=1),
                TextMobject("Text").scale(2)
            )
        mobjects.scale(1.5)
        mobjects.arrange_submobjects(RIGHT,buff=2)

        self.play(
            *[Write(mob) for mob in mobjects]
        )

        self.wait()

Fade

Fade Out

class manimlib.animation.creation.FadeOut(mobject, **kwargs)

Type: Transform

Parameters

mobject (Mobject) -- TODO

CONFIG parameters

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

        self.add(mobjects)
        self.wait(0.3)

        self.play(
            *[FadeOut(mob) for mob in mobjects]
        )

        self.wait()

Fade In

class manimlib.animation.creation.FadeIn(mobject, **kwargs)

Type: Transform

Parameters

mobject (Mobject) -- Any Mobject

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

        self.play(
            *[FadeIn(mob) for mob in mobjects]
        )

        self.wait()

Fade In From

class manimlib.animation.creation.FadeInFrom(mobject, direction=None, **kwargs)

Type: Transform

Parameters
  • mobject (Mobject) -- TODO

  • direction (3D array) -- Point from come the mobject

CONFIG parameters

"direction": DOWN  # If direction = None
class FadeInFromExample(Scene):
    def construct(self):
        mobjects = VGroup(
                Circle(),
                Circle(fill_opacity=1),
                TextMobject("Text").scale(2)
            )
        mobjects.scale(1.5)
        mobjects.arrange_submobjects(RIGHT,buff=2)

        directions=[UP,LEFT,DOWN,RIGHT]

        for direction in directions:
            self.play(
                *[FadeInFrom(mob,direction) for mob in mobjects]
            )

        self.wait()

Fade In From Down

class manimlib.animation.creation.FadeInFromDown(mobject, direction=None, **kwargs)

Type: Transform

Parameters

mobject (Mobject) -- Any Mobject

CONFIG parameters

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

        self.play(
            *[FadeInFromDown(mob) for mob in mobjects]
        )

        self.wait()

Fade Out And Shift

class manimlib.animation.creation.FadeOutAndShift(mobject, direction=None, **kwargs)

Type: Transform

Parameters
  • mobject (Mobject) -- TODO

  • direction (3D array) -- Point from come the mobject

CONFIG parameters

"direction": DOWN  # If direction = None
class FadeOutAndShiftExample(Scene):
    def construct(self):
        mobjects = VGroup(
                Circle(),
                Circle(fill_opacity=1),
                TextMobject("Text").scale(2)
            )
        mobjects.scale(1.5)
        mobjects.arrange_submobjects(RIGHT,buff=2)

        directions=[UP,LEFT,DOWN,RIGHT]

        self.add(mobjects)
        self.wait(0.3)

        for direction in directions:
            self.play(
                *[FadeOutAndShift(mob,direction) for mob in mobjects]
            )

        self.wait()

Fade Out And Shift Down

class manimlib.animation.creation.FadeOutAndShiftDown(mobject, direction=None, **kwargs)

Type: Transform

Parameters

mobject (Mobject) -- TODO

CONFIG parameters

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

        self.play(
            *[FadeOutAndShiftDown(mob) for mob in mobjects]
        )

        self.wait()

Fade In From Large

class manimlib.animation.creation.FadeInFromLarge(mobject, scale_factor=2, **kwargs)

Type: Transform

Parameters
  • mobject (Mobject) -- TODO

  • scale_factor (float) -- TODO

CONFIG parameters

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

        scale_factors=[0.3,0.8,1,1.3,1.8]

        for scale_factor in scale_factors:
            t_scale_factor = TextMobject(f"\\tt scale\\_factor = {scale_factor}")
            t_scale_factor.to_edge(UP)

            self.add(t_scale_factor)

            self.play(
                *[FadeInFromLarge(mob,scale_factor) for mob in mobjects]
            )

            self.remove(t_scale_factor)

        self.wait(0.3)

VFade In

class manimlib.animation.creation.VFadeIn(mobject, **kwargs)

VFadeIn and VFadeOut only work for VMobjects, but they can be applied to mobjects while they are being animated in some other way (e.g. shifting then) in a way that does not work with FadeIn and FadeOut

Type: Animation

VFade Out

class manimlib.animation.creation.VFadeOut(mobject, **kwargs)

Same of FadeOut but with VMobjects

Type: VFadeOut

CONFIG parameters

"remover": True

Grow

Grow From Point

class manimlib.animation.creation.GrowFromPoint(mobject, point, **kwargs)

Type: Transform

Parameters
  • mobject (Mobject) -- TODO

  • point (3D array) -- TODO

CONFIG parameters

"point_color": None,
class GrowFromPointExample(Scene):
    def construct(self):
        mobjects = VGroup(
                Circle(),
                Circle(fill_opacity=1),
                TextMobject("Text").scale(2)
            )
        mobjects.arrange_submobjects(RIGHT,buff=2)

        directions=[UP,LEFT,DOWN,RIGHT]

        for direction in directions:
            self.play(
                *[GrowFromPoint(mob,mob.get_center()+direction*3) for mob in mobjects]
            )

        self.wait()

Grow From Center

class manimlib.animation.creation.GrowFromCenter(mobject, **kwargs)

Type: GrowFromPoint

Parameters

mobject (Mobject) -- TODO

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

        self.play(
            *[GrowFromCenter(mob) for mob in mobjects]
        )

        self.wait()

Grow From Edge

class manimlib.animation.creation.GrowFromEdge(mobject, edge, **kwargs)

Type: GrowFromPoint

Parameters
  • mobject (Mobject) -- TODO

  • edge (Edge) -- TODO

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

        directions=[UP,LEFT,DOWN,RIGHT]

        for direction in directions:
            self.play(
                *[GrowFromEdge(mob,direction) for mob in mobjects]
            )

        self.wait()

Grow Arrow

class manimlib.animation.creation.GrowArrow(arrow, **kwargs)

Type: GrowFromPoint

Parameters

arrow (Arrow) -- See manimlib.mobject.geometry.Arrow()

class GrowArrowExample(Scene):
    def construct(self):
        mobjects = VGroup(
                Arrow(LEFT,RIGHT),
                Vector(RIGHT*2)
            )
        mobjects.scale(3)
        mobjects.arrange_submobjects(DOWN,buff=2)

        self.play(
            *[GrowArrow(mob)for mob in mobjects]
        )

        self.wait()

Spin In From Nothing

class manimlib.animation.creation.SpinInFromNothing(mobject, **kwargs)

Type: GrowFromCenter

Parameters

mobject (Mobject) -- TODO

CONFIG parameters

"point_color": counterclockwise_path(),
class SpinInFromNothingExample(Scene):
    def construct(self):
        mobjects = VGroup(
                Square(),
                RegularPolygon(fill_opacity=1),
                TextMobject("Text").scale(2)
            )
        mobjects.scale(1.5)
        mobjects.arrange_submobjects(RIGHT,buff=2)

        self.play(
            *[SpinInFromNothing(mob) for mob in mobjects]
        )

        self.wait()

Shrink To Center

class manimlib.animation.creation.ShrinkToCenter(mobject, **kwargs)

Type: Transform

Parameters

mobject (Mobject) -- TODO

class ShrinkToCenterExample(Scene):
    def construct(self):
        mobjects = VGroup(
                Square(),
                RegularPolygon(fill_opacity=1),
                TextMobject("Text").scale(2)
            )
        mobjects.scale(1.5)
        mobjects.arrange_submobjects(RIGHT,buff=2)

        self.play(
            *[ShrinkToCenter(mob) for mob in mobjects]
        )

        self.wait()