From edc0fe7589af157f075ab37eb2438f381c9f50bc Mon Sep 17 00:00:00 2001 From: mirefek Date: Sun, 28 Jan 2018 16:56:38 +0100 Subject: [PATCH] clean_up for AnimationGroup --- animation/simple_animations.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/animation/simple_animations.py b/animation/simple_animations.py index 566cd9f7..411520c5 100644 --- a/animation/simple_animations.py +++ b/animation/simple_animations.py @@ -460,3 +460,9 @@ class AnimationGroup(Animation): def update_mobject(self, alpha): for anim in self.sub_anims: anim.update(alpha) + + def clean_up(self, surrounding_scene = None): + if surrounding_scene is not None: + surrounding_scene.mobjects.remove(self.everything) + for anim in self.sub_anims: + anim.clean_up(surrounding_scene = surrounding_scene)