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

Multiple render() only generate one #4186

Open
ecshoper opened this issue Mar 12, 2025 · 2 comments
Open

Multiple render() only generate one #4186

ecshoper opened this issue Mar 12, 2025 · 2 comments

Comments

@ecshoper
Copy link

ecshoper commented Mar 12, 2025

from manim import *

config.media_width = "1180px"
config.frame_rate = 60
config.pixel_height = 1920
config.pixel_width = 1080
config.frame_height = 32
config.frame_width = 18

class Test(Scene):
def construct(self):
text = Text(f'Test').scale(1.5)
self.add(text)

class Test1(Scene):
def construct(self):
text = Text(f'Test1').scale(1.5)
self.add(text)

if name == 'main':
Test().render()
Test1().render()

The above code only generated images rendered by Test

@uwezi
Copy link
Contributor

uwezi commented Mar 12, 2025

The template which appears when you file a new issue tells you how to correctly format code here on Github...

However, try the following way to render your scenes instead:

from manim import *

config.media_width = "1180px"
config.frame_rate = 60
config.pixel_height = 1920
config.pixel_width = 1080
config.frame_height = 32
config.frame_width = 18

class Test(Scene):
    def construct(self):
        text = Text(f'Test').scale(1.5)
        self.add(text)

class Test1(Scene):
    def construct(self):
        text = Text(f'Test1').scale(1.5)
        self.add(text)

if __name__ == '__main__':
    for scene in [Test,Test1]:
        with tempconfig(
            {"quality": "low_quality",
             "preview": False,
             "output_file": f"{scene.__name__}"}
        ):
            t = scene()
            t.render()

@ecshoper
Copy link
Author

@uwezi thanks!Now it can run normally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants