ManimCommunity / ManimCommunity/manim

Support for passing CLI arguments to the scene constructor

Open
#3,359 2 comments 0 reactions 0 assignees View on GitHub
new feature
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Description of proposed feature
So I'm trying to create some videos with some simple animations and do it with different variable data from a file and for that, I am thinking about running manim from another program(cli call) that will provide the extra data to the manim cli as as params and i can read that data in the scene and use it for rendering/calculations.

I tried to find something similar in the [config documentation](https://docs.manim.community/en/stable/guides/configuration.html), but i couldn't find anything for that, may be I missed something

## How can the new feature be used?
A cli arg, that can pass in the params in whichever way, one that comes to my mind:
```
manim -p -ql main.py --args "key=value"
```
and this will be repeatable arg, so
```
manim -p -ql main.py --args "key=value" --args "key2=value2"
```
and then this can be passed into the constructor as a list, or be present in a global scope

## Additional comments
Right now, as a work around, I'm having to write my params to a file and then read that file in the constructor, but this will simplify it, and also make it concurrent, now i just have to wait for one to render and the trigger next one because my file name is constant.
May be what I'm trying to achieve can be done with whats already available, so let me know if i missed something, it'll be much appreciated!

Contributor guide

Open the contributing guide

Research direction

Start with the manim CLI and the configuration documentation referenced in the issue, then trace how scene constructors receive rendering inputs. Define how repeatable key=value arguments should be parsed and exposed to scenes, and verify that multiple concurrent CLI invocations can use different values without temporary files.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.