A community-maintained Python framework for creating mathematical animations.
Updaters fix (#838)
Devin Nealf42bd0579d35
diff --git a/manim/scene/scene.py b/manim/scene/scene.pyindex dd6307d98..3a0217448 100644--- a/manim/scene/scene.py+++ b/manim/scene/scene.py@@ -319,6 +319,11 @@ class Scene(Container):mobjects = [*mobjects, *self.foreground_mobjects]self.restructure_mobjects(to_remove=mobjects)self.mobjects += mobjects+ if self.moving_mobjects:+ self.restructure_mobjects(+ to_remove=mobjects, mobject_list_name="moving_mobjects"+ )+ self.moving_mobjects += mobjectsreturn selfdef add_mobjects_from_animations(self, animations):diff --git a/tests/control_data/graphical_units_data/updaters/UpdateSceneDuringAnimationTest.npz b/tests/control_data/graphical_units_data/updaters/UpdateSceneDuringAnimationTest.npznew file mode 100644index 000000000..59e78df02Binary files /dev/null and b/tests/control_data/graphical_units_data/updaters/UpdateSceneDuringAnimationTest.npz differdiff --git a/tests/test_graphical_units/test_updaters.py b/tests/test_graphical_units/test_updaters.pyindex dd166c306..addb95046 100644--- a/tests/test_graphical_units/test_updaters.py+++ b/tests/test_graphical_units/test_updaters.py@@ -24,6 +24,15 @@ class ValueTrackerTest(Scene):line_2.rotate(theta.get_value(), about_point=ORIGIN)+class UpdateSceneDuringAnimationTest(Scene):+ def construct(self):+ def f(mob):+ self.add(Square())++ s = Circle().add_updater(f)+ self.play(ShowCreation(s))++MODULE_NAME = "updaters"