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

Add a way to add "Create new..." entries #8254

Closed
KoBeWi opened this issue Oct 25, 2023 · 0 comments · Fixed by godotengine/godot#94582
Closed

Add a way to add "Create new..." entries #8254

KoBeWi opened this issue Oct 25, 2023 · 0 comments · Fixed by godotengine/godot#94582

Comments

@KoBeWi
Copy link
Member

KoBeWi commented Oct 25, 2023

Describe the project you are working on

Multiple projects made in Godot.

Describe the problem or limitation you are having in your project

While working on a project I quite often need to create a new image. My current workaround is copying an existing image, but it's problematic, because an image is not always easy to find among the many folders and when you find one, you need to copy it to the desired folder, which also isn't that easy (depending on source directory). Another thing is that an image may be huge and duplicating it causes an import of the new image, which just wastes time.

My another use-case is creating placeholders for sound effects. Sometimes I know something needs a SFX, but I don't feel like looking for it now, so I just drop an empty WAV file with the correct name and code it with the intention of replacing its content in the future. Finding an empty WAV file poses even more problems than images, because you can't just pick any file.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Having an option to create an empty image/sound file from filesystem dock's Create New menu would solve both my problems. It would be especially convenient when we have Open in External Program option now.

While creating images is common, empty WAV files are not. Instead of littering our Create New menu with arbitrary entries I think we could add an option to create new entries using plugins. This way users could add plugins for creating textures (including specific textures), sounds, models or even text file templates.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I can think of two ways to implement this.

The most straightforward one is adding EditorCreateNewPlugin class which handles adding entries and stuff.

The more flexible solution would be allowing to add new entries to various context menus (see this old issue godotengine/godot#6128). It could be a method that takes menu ID (e.g. MENU_CREATE_NEW), option name and a Callable. It would allow creating new files, but also executing any actions. (it could also allow superseding and deprecating the tool menu method)

If this enhancement will not be used often, can it be worked around with a few lines of script?

The workaround involves editor actions that just aren't convenient.
Although it can be implemented by using various workarounds, like hacking filesystem menu manually or using EditorScript.

Is there a reason why this should be core and not an add-on in the asset library?

It extends the editor's functionality to allow new kinds of addons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants