jeertmans / manim-slides

Tool for live presentations using manim
https://manim-slides.eertmans.be
MIT License
419 stars 46 forks source link

[BUG] Manim Slides Showing Black Screen Only #402

Closed NikoMolecule closed 3 months ago

NikoMolecule commented 3 months ago

Please explain the issue you're experiencing (with as much detail as possible):

Hello, so i downloaded qt bindings and everything and manim_slides finnaly started running but i ran into the problem, where manim_slides only show black slides and nothing more. can anyone help me out to fix this problem?

this is code:

from manim import *
from manim_slides import Slide
import numpy as np

class rectangle(Slide):
    def construct(self):
        box1 = Rectangle(stroke_color = RED_C, stroke_opacity = 0.7, fill_color = RED_B, fill_opacity=0.5, height = 1, width = 2).shift(3 * RIGHT)
        name1 = Tex("Discriminator D(z)", font_size = 18).move_to(box1.get_center())

        box2 = Rectangle(stroke_color = GREEN_C, stroke_opacity = 0.7, fill_color = GREEN_B, fill_opacity=0.5, height = 1, width = 2).shift(2.5 * DOWN + 3.75 * LEFT)
        name2 = Tex("Generator G(z)", font_size = 18).move_to(box2.get_center())

        box3 = Rectangle(stroke_color = GREY_A, stroke_opacity = 0.7, fill_color = BLACK, fill_opacity=0, height = 2, width = 2).shift(2.5 * UP + 1 * LEFT)
        name3 = Tex("Real Images", font_size = 18).move_to(box3.get_top())

        image1r = ImageMobject("../manim/logo/10.jpg").scale(0.25).move_to(box3.get_center()).shift(0.5 * UP + 0.5 * LEFT)
        image2r = ImageMobject("../manim/logo/1012.jpg").scale(0.25).move_to(box3.get_center()).shift(0.5 * UP + 0.5 * RIGHT)
        image3r = ImageMobject("../manim/logo/1022.jpg").scale(0.25).move_to(box3.get_center()).shift(0.5 * DOWN + 0.5 * LEFT)
        image4r = ImageMobject("../manim/logo/1032.jpg").scale(0.25).move_to(box3.get_center()).shift(0.5 * DOWN + 0.5 * RIGHT)

        box4 = Rectangle(stroke_color = GREY_A, stroke_opacity = 0.7, fill_color = BLACK, fill_opacity=0.5, height = 2, width = 1).shift(2.5 * DOWN + 5.6 * LEFT)
        name4 = Text("\n 0.000 \n -0.234 \n -3.456 \n 1.293 \n 0.015 \n ... \n -1.102 \n 0.998 \n -0.122", font_size = 18).move_to(box4.get_center())

        brace1 = Brace(box4, LEFT)
        name5 = Tex("100", font_size = 18).next_to(brace1, LEFT)
        name6 = Tex("Random Noise", font_size = 18).next_to(box4, 0.25 * UP)

        box7 = Rectangle(stroke_color = GREY_A, stroke_opacity = 0.7, fill_color = BLACK, fill_opacity=0, height = 2, width = 2).shift(2.5 * DOWN + 1 * LEFT)
        name7 = Tex("Fake Images", font_size = 18).move_to(box7.get_bottom())

        image1f = ImageMobject("../manim/logo/generated_plot_epoch-960.png").move_to(box7.get_center()).shift(0.5 * UP + 0.5 * LEFT)
        image2f = ImageMobject("../manim/logo/generated_plot_epoch-961.png").move_to(box7.get_center()).shift(0.5 * UP + 0.5 * RIGHT)
        image3f = ImageMobject("../manim/logo/generated_plot_epoch-962.png").move_to(box7.get_center()).shift(0.5 * DOWN + 0.5 * LEFT)
        image4f = ImageMobject("../manim/logo/generated_plot_epoch-963.png").move_to(box7.get_center()).shift(0.5 * DOWN + 0.5 * RIGHT)

        arrow_1 = Arrow(start = box3.get_right(), end = box1.get_left(), color = WHITE)
        arrow_2 = Arrow(start = box7.get_right(), end = box1.get_left(), color = WHITE)
        arrow_3 = Arrow(start = box2.get_right(), end = box7.get_left(), color = WHITE)
        arrow_4 = Arrow(start = box4.get_right(), end = box2.get_left(), color = WHITE)

        self.play(Create(box4), Create(name4), Create(brace1), Create(name5), Create(name6))
        self.next_slide()

        self.play(Create(arrow_4), Create(box2), Create(name2))
        self.next_slide()

        self.play(Create(arrow_3), Create(box7), Create(name7), FadeIn(image1f), FadeIn(image2f),FadeIn(image3f), FadeIn(image4f))
        self.play(Create(box3), Create(name3), FadeIn(image1r), FadeIn(image2r), FadeIn(image3r), FadeIn(image4r))
        self.next_slide()

        self.play(Create(arrow_1), Create(arrow_2), Create(box1), Create(name1))
        self.wait()

and this is the message before running manim_slides

[04/05/24 22:18:52] WARNING  You are using API = 'pyqt6', QTVERSION = '6.6.1', but we recommend installing 'PySide6==6.5.2', mainly to avoid flashing        __init.py:23
                             screens between slides, see issue https://github.com/jeertmans/manim-slides/issues/293. You can do so with pip install
                             'manim-slides[pyside6]'.
qt.qpa.window: QtWindows::DpiAwareness::PerMonitorVersion2 is not supported by current system.
QWindowsVistaStylePrivate: Load OpenThemeDataForDpi in uxtheme.dll failed
No QtMultimedia backends found. Only QMediaDevices, QAudioDevice, QSoundEffect, QAudioSink, and QAudioSource are available.
Failed to create QVideoSink "Not available"
Failed to initialize QMediaPlayer "Not available"
Failed to create QVideoSink "Not available"
Failed to create QVideoSink "Not available"
Failed to initialize QMediaPlayer "Not available"
jeertmans commented 3 months ago

Hello @NikoMolecule, can you check with a smaller code, like this one from example.py:

from manim import *
from manim_slides import Slide, ThreeDSlide

class BasicExample(Slide):
    def construct(self):
        circle = Circle(radius=3, color=BLUE)
        dot = Dot()

        self.play(GrowFromCenter(circle))

        self.next_slide(loop=True)
        self.play(MoveAlongPath(dot, circle), run_time=2, rate_func=linear)
        self.next_slide()

        self.play(dot.animate.move_to(ORIGIN))

Then:

manim-slides render yourfile.py BasicExample

And:

manim-slides -v DEBUG BasicExample
NikoMolecule commented 3 months ago

@jeertmans it outputed this: "python -m manim_slides, version 5.1.3"

jeertmans commented 3 months ago

Oops, sorry, this was manim-slides BasicExample -v DEBUG.

NikoMolecule commented 3 months ago

@jeertmans image

jeertmans commented 3 months ago

This is likely similar to #315 (or even #377). Can you try manim-slides BasicExample --hide-info-window?

NikoMolecule commented 3 months ago

@jeertmans thx so much <33

jeertmans commented 3 months ago

Happy it solved your problem, and I am sorry for all the troubles with Windows!