manim icon indicating copy to clipboard operation
manim copied to clipboard

write_to_movie option failed in manim.cfg

Open LingrenKong opened this issue 2 years ago • 6 comments

Description of bug / unexpected behavior

write_to_movie option in manim.cfg cannot be detected. but the command line --write_to_movie works

Expected behavior

if we write write_to_movie = True in manim.cfg and use it as config file, then we don't need to use --write_to_movie

How to reproduce the issue

run these two comman line:

 manim main.py -c manim.cfg
 manim main.py -c manim.cfg --write_to_movie
main.py
from manim import *
class DefaultTemplate(Scene):
    def construct(self):
        circle = Circle()  # create a circle
        circle.set_fill(PINK, opacity=0.5)  # set color and transparency

        square = Square()  # create a square
        square.flip(RIGHT)  # flip horizontally
        square.rotate(-3 * TAU / 8)  # rotate a certain amount

        self.play(Create(square))  # animate the creation of the square
        self.play(Transform(square, circle))  # interpolate the square into the circle
        self.play(FadeOut(square))  # fade out animation
manim.cfg
renderer = opengl
write_to_movie = True
preview = True

Additional media files

Logs

System specifications

System Details
  • OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)): Windows 11
  • RAM:
  • Python version (python/py/python3 --version):Python 3.8.12
  • Installed modules (provide output from pip list):
Package                        Version   Location
------------------------------ --------- ----------------------------------------
azure-cognitiveservices-speech 1.22.0
backcall                       0.2.0
certifi                        2021.10.8
cffi                           1.15.0
charset-normalizer             2.0.7
click                          8.0.3
click-default-group            1.2.2
cloup                          0.13.1
colorama                       0.4.4
colour                         0.1.5
commonmark                     0.9.1
comtypes                       1.1.11
debugpy                        1.5.1
decorator                      5.1.0
entrypoints                    0.3
glcontext                      2.3.4
gTTS                           2.2.4
idna                           3.3
ipdb                           0.13.9
ipykernel                      6.4.2
ipython                        7.29.0
ipython-genutils               0.2.0
isosurfaces                    0.1.0
jedi                           0.18.0
jupyter-client                 7.0.6
jupyter-core                   4.9.1
manim                          0.15.2
manim-fontawesome              6.0.0
manim-physics                  0.2.4
manim-speech                   0.0.1     e:\manim视频\测试-speech插件\manim-speech-main
ManimPango                     0.4.1
mapbox-earcut                  0.12.10
matplotlib-inline              0.1.3
moderngl                       5.6.4
moderngl-window                2.4.0
multipledispatch               0.6.0
mutagen                        1.45.1
nest-asyncio                   1.5.1
networkx                       2.6.3
numpy                          1.21.3
parso                          0.8.2
pickleshare                    0.7.5
Pillow                         8.4.0
pip                            21.0.1
prompt-toolkit                 3.0.21
pycairo                        1.20.1
pycparser                      2.21
pydub                          0.25.1
pyglet                         1.5.21
Pygments                       2.10.0
pymunk                         6.2.1
PyOpenGL                       3.1.6
pypiwin32                      223
pyrr                           0.10.3
python-dateutil                2.8.2
python-dotenv                  0.20.0
pyttsx3                        2.90
pywin32                        302
pyzmq                          22.3.0
requests                       2.26.0
rich                           10.12.0
scipy                          1.8.1
screeninfo                     0.8
setuptools                     58.0.4
Shapely                        1.8.2
six                            1.16.0
skia-pathops                   0.7.1
sox                            1.4.1
srt                            3.5.2
toml                           0.10.2
tornado                        6.1
tqdm                           4.62.3
traitlets                      5.1.1
typing-extensions              4.2.0
urllib3                        1.26.7
watchdog                       2.1.6
wcwidth                        0.2.5
wheel                          0.37.0
wincertstore                   0.2

Additional comments

LingrenKong avatar Jun 12 '22 10:06 LingrenKong

update config in python also works fine, but default write_to_movie option cannot write in opengl mode

config['write_to_movie'] = True

LingrenKong avatar Jun 12 '22 11:06 LingrenKong

The same thing also happens for me with format.

SolidTux avatar Jun 14 '22 23:06 SolidTux

Yeah, not all cli options are accessible via manim.cfg, I am afraid it will stay that way because I do not see any easy way to add that within the current config system.

ad-chaos avatar Jun 19 '22 07:06 ad-chaos

Is there a place in the documentation with a list of options that can or cannot be changed?

SolidTux avatar Jun 19 '22 22:06 SolidTux

You can take a look at the _OPTS set here https://github.com/ManimCommunity/manim/blob/a20f8aeb6ccd30d6b9d5c34285c3a718b0f5a59b/manim/_config/utils.py#L245

Also, it looks like write to movie is always overridden. https://github.com/ManimCommunity/manim/blob/a20f8aeb6ccd30d6b9d5c34285c3a718b0f5a59b/manim/_config/utils.py#L794-L796

ad-chaos avatar Jun 20 '22 05:06 ad-chaos

You can take a look at the _OPTS set here

https://github.com/ManimCommunity/manim/blob/a20f8aeb6ccd30d6b9d5c34285c3a718b0f5a59b/manim/_config/utils.py#L245

Also, it looks like write to movie is always overridden.

https://github.com/ManimCommunity/manim/blob/a20f8aeb6ccd30d6b9d5c34285c3a718b0f5a59b/manim/_config/utils.py#L794-L796

So the reason for this bug is: some command line args use default value, and command has highest level in the cascading config system. Okay, now I understand.

Thanks.

LingrenKong avatar Jun 30 '22 07:06 LingrenKong