Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recursive parameter of suspend_udpating and resume_updating not working #1895

Open
leleogere opened this issue Aug 11, 2021 · 0 comments
Open
Labels
issue:bug Something isn't working... For use in issues

Comments

@leleogere
Copy link
Contributor

Description of bug / unexpected behavior

There is a recursive boolean parameter in the methods .suspend_updating() and .resume_updating() of mobjects. However, if I understand correctly what it is supposed to do, I think it is broken.

If I create a mobject with an updater, and I add to it a submobjects with other updaters, when I call main_object.suspend_updating(recursive=False) all updaters get stopped.

RecursiveTest_bug.mp4

Expected behavior

I expect main_object.suspend_updating(recursive=False) to only stop the updating of the main object, and not the ones of its submobjects.

RecursiveTest_expected.mp4

How to reproduce the issue

Code for reproducing the problem
class RecursiveTest(Scene):
    def construct(self):
        s = Square(3).add_updater(lambda a, dt: a.rotate(dt))
        sul = Square(1).add_updater(lambda c, dt: c.move_to(s.get_vertices()[0]).rotate(-2*dt))
        sur = Square(1).add_updater(lambda c, dt: c.move_to(s.get_vertices()[1]).rotate(-2*dt))
        sdl = Square(1).add_updater(lambda c, dt: c.move_to(s.get_vertices()[2]).rotate(-2*dt))
        sdr = Square(1).add_updater(lambda c, dt: c.move_to(s.get_vertices()[3]).rotate(-2*dt))
        corners = VGroup(sul, sur, sdl, sdr)
        s.add(corners)
        self.add(s)
        self.wait(3)
        s.suspend_updating(recursive=False)  # this should only stop the main square, not the small ones
        self.wait(5)

Additional comments

I'm working on a PR linked to updaters (#1873), so I can fix this issue too if it is indeed an bug (I asked in the discord if people agree that this is an unexpected behavior but I didn't get any answers).

@leleogere leleogere added the issue:bug Something isn't working... For use in issues label Aug 11, 2021
leleogere pushed a commit to leleogere/manim that referenced this issue Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue:bug Something isn't working... For use in issues
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant