Fix 3D overlap when animating by checking Mobject family members recursively instead of self.mobjects (#2254)

* Add Animation.setup_scene method to make Animation more customizable

* Remove Animation.setup_scene method and let scene check all mobject family members
This commit is contained in:
Benjamín Ubilla 2024-12-07 12:13:35 -03:00 committed by GitHub
parent 6196daa5ec
commit df1e067480
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -623,7 +623,7 @@ class Scene(object):
# animated mobjects that are in the family of
# those on screen, this can result in a restructuring
# of the scene.mobjects list, which is usually desired.
if animation.mobject not in self.mobjects:
if animation.mobject not in self.get_mobject_family_members():
self.add(animation.mobject)
def progress_through_animations(self, animations: Iterable[Animation]) -> None: