Skip to content

Restore

Animation Parameters#

Paremeters - as mentioned in Azarzadvillas Documentation - are:

  • Constructor : - self.play() - self.add()

  • Parameters :

  • run_time : The duration of the animation

    • float (ex: 3)
    • Optional
    • Default: DEFAULT_ANIMATION_RUN_TIME

Restore Parameters#

  • Constructor : - Mobject.save_state()

Transform then Restore#

from manimlib import *

class AnimationRestore(Scene):
    def construct(self):

        square = Square()
        square.save_state()
        circle = Circle()
        self.play(Transform(square, circle))
        square.generate_target()
        square.target.shift(2 * LEFT)
        self.play(MoveToTarget(square))
        self.play(Restore(square))
from manim import *

class AnimationRestore(Scene):
    def construct(self):

        square = Square()
        square.save_state()
        circle = Circle()
        self.play(Transform(square, circle))
        square.generate_target()
        square.target.shift(2 * LEFT)
        self.play(MoveToTarget(square))
        self.play(Restore(square))
Back to top