Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Added Animation.get_all_mobjects_to_update

Grant Sanderson5403237123a9
diff --git a/manimlib/animation/animation.py b/manimlib/animation/animation.py
index ecb728cf6..ae4b2ad0c 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)