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

Button for creating new projects in the project selector UI #301

Open
TomatechGames opened this issue Feb 10, 2023 · 4 comments · May be fixed by #530
Open

Button for creating new projects in the project selector UI #301

TomatechGames opened this issue Feb 10, 2023 · 4 comments · May be fixed by #530
Labels
b-enhancement New feature or request c-discussion The issue is being discussed

Comments

@TomatechGames
Copy link

Description
Multi-project support is nice, but the only way to create a second project is to either duplicate the folder of an existing project, or manually create the files with the basic makeProject and makeScene implementations, and both ways need you to manually add the project to vite.config.ts.

Proposed solution
Add a new button to the Projects screen, which builds the motion canvas standard project in a new folder and automatically adds it to the vite config. The Projects screen would also appear even if there is only one project in the config. For consistency, perhaps also a button on each project in the list to remove it from the vite config

@ksassnowski
Copy link
Contributor

Doing this would also implicitly define a "canonical" structure for having a multi-project repository. That's just a general observation, not really a criticism about this idea.

@aarthificial
Copy link
Contributor

For now, it's a hard pass from me.
Two main reasons:

  1. This would require Vite to modify its own config file at runtime, which sounds like a hack.
  2. I'd like to avoid any sort of code generation on the editor side. The core idea behind MC is that it is code-driven. I've already received comments on YouTube asking for a WYSIWYG functionality which I think is pure insanity. Metafiles should be the only way for the editor to influence the animation - no modifying/generating actual source code.

That being said, I think that having a way to quickly bootstrap new projects is useful.
I have my own templates configured in WebStorm for this reason:
image

Maybe a CLI would be a better solution? More aligned with the spirit of programming:

mc add project | scene | component

@aarthificial aarthificial removed their assignment Feb 11, 2023
@aarthificial aarthificial added b-enhancement New feature or request c-discussion The issue is being discussed labels Feb 11, 2023
@GufNZ
Copy link

GufNZ commented Feb 15, 2023

+1 for the latter idea.

@fami-fish
Copy link
Contributor

i'd make a cli but what if people structure things weirdly?
say they just dont have a src/scenes folder but instead just throw all of their scenes into src. How do you generate a scene then? or better yet: how do you find and update project.ts?

@Thomsr Thomsr linked a pull request Mar 15, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
b-enhancement New feature or request c-discussion The issue is being discussed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants