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
[BUG] Slides are shuffled when exporting mutliple files to revealjs format #428
Comments
Wait, now that I run my manim codes with the command line (manim-slides render file.py Scene), it works. I used to run my manim codes with tempconfig code snippet at the end of the file such as: which somehow seems to wreck havoc in the produced files. |
Hello @Judafa, do you have a minimal working examples that I could easily test locally? |
Yes, here are two files:
The first slide always has "Slide 1" written, for the second it's always "Slide 2". slide_1.py: from manim import *
from manim_slides import *
class Slide1(Slide):
def construct(self):
### Display title
title = Text("Slide 1").shift(3 * UP)
self.play(
Write(title),
)
### Next slide
self.next_slide()
self.play(
Write(Text(f"Some text {1}").shift(1.5 * UP))
)
# Create a rectangle
switch = Rectangle(height=2, width=3, color=BLUE, fill_color=BLACK, fill_opacity=1)
self.play(
Create(switch),
)
### Next slide
self.next_slide()
self.play(
Write(Text(f"Some text {2}").shift(1.5 * UP + 1 * DOWN))
)
### Next slide
self.next_slide()
self.play(
Write(Text(f"Some text {3}").shift(1.5 * UP + 2 * DOWN))
)
### Next slide
self.next_slide()
self.play(
*[FadeOut(mob) for mob in self.mobjects]
)
### Next slide
self.next_slide()
# To create the video at scrip run
with tempconfig(
{
"quality": "low_quality",
"preview": False,
"disable_caching": True,
"save_last_frame": False,
}):
scene = Slide1()
scene.render() and slide_2.py: from manim import *
from manim_slides import *
class Slide2(Slide):
def construct(self):
# Write the title 2
title = Text("Slide 2").shift(3 * UP)
self.play(
Write(title)
)
text1 = Tex("Some text 1").shift(1.5 * UP)
text2 = Tex("Some text 2").shift(0.5 * UP)
text3 = Tex("Some text 3").shift(-0.5 * UP)
self.next_slide()
self.play(
Write(text1)
)
self.next_slide()
self.play(
Write(text2)
)
self.next_slide()
self.play(
Write(text3)
)
# Remove all mobject
self.next_slide()
self.play(
*[FadeOut(mob) for mob in self.mobjects]
)
# To create the video at scrip run
with tempconfig(
{
"quality": "low_quality",
"preview": False,
"disable_caching": True,
"save_last_frame": False,
}):
scene = Slide2()
scene.render() |
Apparently, ManimCE can produce two different animations with the same name (i.e., the same hash). As documented, ManimGL would any produce files with the same name so this fix was needed. Closes #428
Ok so this is actually a very interesting bug you found! Apparently, Manim can produce different animations with the same hash... I'll report this issue to their repo, but I already created a PR that fixes your issue, see #429. Would you mind testing it? |
Ohhh Ok this is not really a bug from Manim, but, when |
* fix(lib): prevent filename collision Apparently, ManimCE can produce two different animations with the same name (i.e., the same hash). As documented, ManimGL would any produce files with the same name so this fix was needed. Closes #428 * chore(lib): update comment chore(lib): update comment * chore(tests): add test * chore(tests): remove redundant underscore * chore(docs): add changelog entry
Description
Hello everyone!
As the "default" gui is not working properly for me (black screen at the end of each slides, due to this bug of pyside #293 ), I'm planning on using revealjs instead.
Following the doc, I'm using the convert command and can thus successfully convert one slide.
The problem comes when I try to gather mutliple slides into one .html file. For that, as the doc suggests, I'm using:
manim-slides convert Scene1 Scene2 ... Scene 15
I would like the slides to be simply "concatenated": first show me Scene1, then Scene2, etc.
Unfortunately, the result is an unordered mixture of everything; in my case, exerpts of Scene2 appears in Scene3 and it's like that all along.
I strangely did not see this issue reported anywhere else; maybe I'm doing something wrong here.
Version
manim-slides, version 5.1.7
Platform
Linux, ArcoLinux
Screenshots
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: