From 5403237123a9276da46b0640d57854e5d970f10d Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Sat, 9 Feb 2019 10:55:23 -0800 Subject: [PATCH] Added Animation.get_all_mobjects_to_update --- manimlib/animation/animation.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/manimlib/animation/animation.py b/manimlib/animation/animation.py index ecb728cf..ae4b2ad0 100644 --- a/manimlib/animation/animation.py +++ b/manimlib/animation/animation.py @@ -83,9 +83,18 @@ class Animation(object): suspended during the animation, this will do nothing to self.mobject. """ - for mob in self.get_all_mobjects(): + for mob in self.get_all_mobjects_to_update(): mob.update(dt) + def get_all_mobjects_to_update(self): + # The surrounding scene typically handles + # updating of self.mobject. Besides, in + # most cases its updating is suspended anyway + return list(filter( + lambda m: m is not self.mobject, + self.get_all_mobjects() + )) + def copy(self): return deepcopy(self)