Manim: Add Manim Project Creating Subcommand

Created on 4 Aug 2020  Â·  13Comments  Â·  Source: ManimCommunity/manim

How about a sub command for example, manim new project, which will create a folder with some scripts assets folder and also a config file. This would be helpful for new users and we can make the users use uniform folder structure. This would surely be helpful while debugging and the users can keep the projects organised and not like I usually do.
PS. I got the idea from chocolatey.

good first issue help wanted new feature

Most helpful comment

I'd like to contribute to this if nobody is on it. So that it gives a first idea of what it could look like.

All 13 comments

I like this idea. I'd suggest the command be manim init. What do you think this command should do? What directories should it create? How will the config file be generated? Etc. Let's flesh this out a bit more :)

├───assets
│   ├───codes
│   ├───images
│   └───sounds
├───logs
└───media
    ├───Tex
    ├───texts
    └───videos

This command should create should project structure. The config file can be generated as a copy of default.cfg and later the users can edit it using the command introduced by #212 . This need to be discussed a lot.

Yes, we'd have to discuss if we want to force/suggest a particular folder structure for the input files (what you called assets/). The output files (media/) are already enforced.

Oh? Ok in that case we should document that somewhere in the mythical quickstart guide.

In that case, I'm leaning toward making a quick-and-dirty manim init command!

In that case, I'm leaning toward making a quick-and-dirty manim init command!

I just want to clarify that manim will search for assets from the current working directory, not from wherever the actual animation script is.

Before we implement manim init I think we should first ensure that manim also checks for the presence of assets folders next to the actual animation script and not just the cwd, like we are doing for the cfg file.

And like the cfg file, we could make the assets folder next to the file have the greatest priority, and the one in the cwd have the next greatest and so on.

I'd like to contribute to this if nobody is on it. So that it gives a first idea of what it could look like.

I'd like to contribute to this if nobody is on it. So that it gives a first idea of what it could look like.

@azarzadavila
From my side, I'd just like to inform you that I'll be working on making it easier to add subcommands (adding notes, clearing up confusing code etc) and fixing some bugs in how subcommands are selected. I should take a PR doing this by this Sunday (I hope).

Please don't feel as if I'm restricting you, I'd just like to say that there will be a few changes to the code that will make it just a tiny bit easier to do this sort of stuff . You can still work on this in the meantime should you wish to.

I'd like to contribute to this if nobody is on it. So that it gives a first idea of what it could look like.

@azarzadavila
From my side, I'd just like to inform you that I'll be working on making it easier to add subcommands (adding notes, clearing up confusing code etc) and fixing some bugs in how subcommands are selected. I should take a PR doing this by this Sunday (I hope).

Please don't feel as if I'm restricting you, I'd just like to say that there will be a few changes to the code that will make it just a tiny bit easier to do this sort of stuff . You can still work on this in the meantime should you wish to.

@Aathish04
Ah okey great. There really is no rush so I think I'll wait.

Ah okey great. There really is no rush so I think I'll wait.

@azarzadavila The PR I was talking about has been merged. You can implement manim init now!

@azarzadavila are you interested in implementing this? :)

Hi everyone,
I think this is a great idea.

A few thoughts:
You don't have to create the /media folder because
(a) manim will create it anyway when you compile the scene
(b) but the media directory will be created somewhere else entirely if the user supplies the --media-dir cli flag, or changes it in the .cfg file and the we'd be left with empty and unused directories here.

manim new project, which will create a folder with some scripts assets folder and also a config file

If we are going to generate a bunch of directories, then this is how we would do it.
If however we take a more lightweight approach and generate only a python file and a config file then we don't need to create an entire directory.
We could do something like: manim new name and generate a name.py file with scaffolding for a scene (also called name) and a name.cfg file, and nothing more.
It's quick. it's clean. We don't need to worry about assets subfolders or the order in which they are search.... and it is probably enough for almost all users almost all of the time. no?

I like the idea of keeping it short and to the point. Any more functionality sounds like we will hit a situation of diminishing returns. Especially because every new functionality will require new tests and more maintenance etc.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

huguesdevimeux picture huguesdevimeux  Â·  6Comments

XorUnison picture XorUnison  Â·  6Comments

dakyion picture dakyion  Â·  8Comments

qo4on picture qo4on  Â·  6Comments

nilaybhatia picture nilaybhatia  Â·  6Comments