motion-canvas icon indicating copy to clipboard operation
motion-canvas copied to clipboard

Button for creating new projects in the project selector UI

Open TomatechGames opened this issue 2 years ago • 4 comments

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

TomatechGames avatar Feb 10 '23 20:02 TomatechGames

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.

ksassnowski avatar Feb 11 '23 06:02 ksassnowski

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 avatar Feb 11 '23 08:02 aarthificial

+1 for the latter idea.

GufNZ avatar Feb 15 '23 03:02 GufNZ

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?

fami-fish avatar Mar 14 '23 16:03 fami-fish