ManimCommunity / manim

A community-maintained Python framework for creating mathematical animations.
https://www.manim.community
MIT License
25.64k stars 1.77k forks source link

Multiple scenes are saved to the same file. #2076

Open Timmmm opened 3 years ago

Timmmm commented 3 years ago

Description of bug / unexpected behavior

If you have multiple scenes they all get saved to the same file. Very similar to #1578.

main.py

from manim import *

config.background_color = "#333388"
config.frame_width = 40
config.scene_names = ["A", "B"]

class A(Scene):
    def construct(self):
        a = Circle(5)
        self.play(Create(a))

class B(Scene):
    def construct(self):
        a = Circle(5)
        self.play(Create(a))

manim.cfg

[CLI]
frame_rate = 30
pixel_height = 1080
pixel_width = 1920

Logs

Terminal output Uhm... `-v DEBUG` does not work: ``` manim -v DEBUG render main.py Manim Community v0.10.0 Traceback (most recent call last): File "/usr/local/bin/manim", line 8, in sys.exit(main()) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 829, in __call__ return self.main(*args, **kwargs) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python3.9/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/usr/local/lib/python3.9/site-packages/manim/cli/render/commands.py", line 132, in render for SceneClass in scene_classes_from_file(file): File "/usr/local/lib/python3.9/site-packages/manim/utils/module_ops.py", line 124, in scene_classes_from_file module = get_module(file_path) File "/usr/local/lib/python3.9/site-packages/manim/utils/module_ops.py", line 51, in get_module raise FileNotFoundError(f"{file_name} not found") FileNotFoundError: render not found ``` Here's the output without that: ``` manim render main.py Manim Community v0.10.0 [09/24/21 20:12:03] INFO Animation 0 : Using cached data (hash : 2103384290_1959254436_1145583325) cairo_renderer.py:107 INFO scene_file_writer.py:606 File ready at '/.../project/media/videos/main/1080p60/A.mp4' INFO Rendered A scene.py:233 Played 1 animations INFO Animation 0 : Using cached data (hash : 2103384290_950503052_1145583325) cairo_renderer.py:107 INFO scene_file_writer.py:606 File ready at '/.../project/media/videos/main/1080p60/A.mp4' INFO Rendered B scene.py:233 Played 1 animations ```

System specifications

System Details - OS: Mac - Python version: 3.9.7
k4pran commented 3 years ago

Seems that it is failing to write multiple files when using config.scene_names = ["A", "B"]. Until it is fixed you can omit this line and when it prompts you to select scenes it will write to multiple files