-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
LaggedStart animation bugs when z-index of animated mobject is non-positive #3914
Comments
not a fix, but a work-around: class MainScene(Scene):
def construct(self):
self.wait()
text = MathTex("amogus", font_size=30)
line = Line([-2, 0, 0], [2, 0, 0], color=RED_D, z_index=-1).set_opacity(0)
self.add(line)
self.play(LaggedStart( FadeIn(text), line.animate.set_opacity(1), lag_ratio=1/2 ))
self.wait() |
@uwezi Actually FadeIn animation was an example. Your solution works for that specific animation, but there are still plenty of them that are affected by this bug. I mean there is even simpler way of avoiding this bug - just use positive z-indices and everything works fine. But I will keep this issue opened, because z-index is supposedly an integer which can be non-positive. |
If you already have isolated the z-index as the culprit, then perhaps the title of your posting here is a bit misleading... |
Yeah you're right |
Description of bug / unexpected behavior
I wanted to animate MathTex and Line class instances together using LaggedStart animation.
I set the line's z-index value (using optional parameter in constructor) to -1 so it will appear under the text (which has no z-index value set).
When I render this, text animation is fine, unlike line's. It appears that line animation does not work, until LaggedStart finishes it's duty - then line transforms to the state in which it should be after successful animation.
Expected behavior
LaggedStart animation playing text's and line's animation together with lag ratio of 1/2. Finally line appearing under the text.
How to reproduce the issue
Code for reproducing the problem
Additional media files
Images/GIFs
MainScene.mp4
Logs
Terminal output
System specifications
System Details
python/py/python3 --version
): 3.10.12pip list
):LaTeX details
https://pastebin.ai/tuqw9trapp
Additional comments
I think checking out what does setting various z-indices for both mobjects actually result in, maybe we can learn something from the output behavior.
The text was updated successfully, but these errors were encountered: