ManimCommunity / ManimCommunity/manim

Multiple scenes are saved to the same file.

Open
#2,076 1 comment 0 reactions 0 assignees View on GitHub
issue:bug
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Description of bug / unexpected behavior

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

### `main.py`

```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

Contributor guide

Open the contributing guide

Research direction

Start with the scene discovery flow in manim/cli/render/commands.py and the output-writing path referenced as scene_file_writer.py. Reproduce the issue with the provided main.py and manim.cfg, then compare the output path reported for scenes A and B. Done means separate scene files are produced and the relevant regression test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.