Skip to content

Mobject Ordering Regression in 0.15 #2585

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

Closed
sudgy opened this issue Feb 28, 2022 · 1 comment · Fixed by #2594
Closed

Mobject Ordering Regression in 0.15 #2585

sudgy opened this issue Feb 28, 2022 · 1 comment · Fixed by #2594
Labels
issue:bug Something isn't working... For use in issues
Milestone

Comments

@sudgy
Copy link

sudgy commented Feb 28, 2022

Consider the following scene:

class Test(Scene):
    def construct(self):
        a = Square(color = RED)
        b = Square(color = BLUE)
        b.shift(RIGHT)
        self.add(a)
        self.wait()
        self.bring_to_back(b)
        self.play(FadeIn(b))
        self.wait()

In 0.14, this is the output:

Test.mp4

In 0.15, this is the output:

Test.mp4

As you can see, the blue square is correctly drawn behind the red one in 0.14, but in 0.15, the blue square is drawn on top.

@sudgy sudgy added the issue:bug Something isn't working... For use in issues label Feb 28, 2022
@behackl
Copy link
Member

behackl commented Feb 28, 2022

Bisecting shows that this was introduced via #2396. This should be fixed by checking whether the mobject belonging to an animation with introducer=True set (like FadeIn) has already been added to the scene.

There is one workaround I can offer: in your example, either put

self.play(FadeIn(b), introducer=False)

or, more verbose,

anim = FadeIn(b)
anim.introducer = False
self.play(anim)

(the obvious FadeIn(b, introducer=False) unfortunately won't work due to the keyword argument not being propagated correctly.)

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
None yet
Development

Successfully merging a pull request may close this issue.

2 participants