Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Make sure scene doesn't re-add animated submobjects that are already part of the scene via some other mobject

Grant Sandersonbe52b795df69
diff --git a/scene/scene.py b/scene/scene.py
index 1f9f072f6..3210a6ead 100644
--- a/scene/scene.py
+++ b/scene/scene.py
@@ -216,6 +216,9 @@ class Scene(Container):
return num_families == 1
return list(filter(is_top_level, mobjects))
+ def get_mobject_family_members(self):
+ return self.camera.extract_mobject_family_members(self.mobjects)
+
def separate_mobjects_and_continual_animations(self, mobjects_or_continual_animations):
mobjects = []
continual_animations = []
@@ -461,7 +464,7 @@ class Scene(Container):
animation.update_config(**kwargs)
# Anything animated that's not already in the
# scene gets added to the scene
- if animation.mobject not in self.mobjects:
+ if animation.mobject not in self.get_mobject_family_members():
self.add(animation.mobject)
moving_mobjects = self.get_moving_mobjects(*animations)