Restore#

Qualified name: manim.animation.transform.Restore

class Restore(mobject=None, *args, use_override=True, **kwargs)[source]#

Bases: ApplyMethod

Transforms a mobject to its last saved state.

To save the state of a mobject, use the save_state() method.

Examples

Example: RestoreExample

from manim import *

class RestoreExample(Scene):
    def construct(self):
        s = Square()
        s.save_state()
        self.play(FadeIn(s))
        self.play(s.animate.set_color(PURPLE).set_opacity(0.5).shift(2*LEFT).scale(3))
        self.play(s.animate.shift(5*DOWN).rotate(PI/4))
        self.wait()
        self.play(Restore(s), run_time=2)
class RestoreExample(Scene):
    def construct(self):
        s = Square()
        s.save_state()
        self.play(FadeIn(s))
        self.play(s.animate.set_color(PURPLE).set_opacity(0.5).shift(2*LEFT).scale(3))
        self.play(s.animate.shift(5*DOWN).rotate(PI/4))
        self.wait()
        self.play(Restore(s), run_time=2)

Methods

Attributes

path_arc

path_func

Parameters:

mobject (Mobject) –