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

Support for passing CLI arguments to the scene constructor #3359

Open
SscSPs opened this issue Sep 5, 2023 · 2 comments
Open

Support for passing CLI arguments to the scene constructor #3359

SscSPs opened this issue Sep 5, 2023 · 2 comments
Labels
new feature Enhancement specifically adding a new feature (feature request should be used for issues instead)

Comments

@SscSPs
Copy link

SscSPs commented Sep 5, 2023

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, 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!

@SscSPs SscSPs added the new feature Enhancement specifically adding a new feature (feature request should be used for issues instead) label Sep 5, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in Dev Board Sep 5, 2023
@SscSPs SscSPs changed the title Support for passing CLI to the scene constructor Support for passing CLI arguments to the scene constructor Sep 5, 2023
@AR4152
Copy link

AR4152 commented Oct 21, 2023

Can I be assigned to work on this please?

@MrDiver
Copy link
Collaborator

MrDiver commented Dec 1, 2023

You can just do this manually by using tempconfig and manually calling the render method on an instantiation of thr Scene.

So if your scene is called Test

Just do

with tempconfig({}):
    Test(args).render()

And then instead of calling manim you just execute the python file as usual

Hope that helps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Enhancement specifically adding a new feature (feature request should be used for issues instead)
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants