From 19814ecf8774cd1d55da2e80fafef9da2cc53708 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Tue, 11 Feb 2020 19:52:41 -0800 Subject: [PATCH] Allow mobject to prepare and cleanup from animations --- manimlib/animation/animation.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manimlib/animation/animation.py b/manimlib/animation/animation.py index 17ea65fa..39ae30b4 100644 --- a/manimlib/animation/animation.py +++ b/manimlib/animation/animation.py @@ -42,6 +42,7 @@ class Animation(object): # played. As much initialization as possible, # especially any mobject copying, should live in # this method + self.mobject.prepare_for_animation() self.starting_mobject = self.create_starting_mobject() if self.suspend_mobject_updating: # All calls to self.mobject's internal updaters @@ -55,6 +56,7 @@ class Animation(object): def finish(self): self.interpolate(1) + self.mobject.cleanup_from_animation() if self.suspend_mobject_updating: self.mobject.resume_updating()