Godot-proposals: Allow opening sprites and other files in external editor/default program

Created on 22 Dec 2019  路  9Comments  路  Source: godotengine/godot-proposals

Describe the project you are working on:
Project with many sprites
Describe the problem or limitation you are having in your project:
To edit sprites, I have to leave Godot and locate them on my computer
Describe how this feature / enhancement will help you overcome this problem or limitation:
It will basically make me stay close to the 'Godot environment'
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
See below
Describe implementation detail for your proposal (in code), if possible:
Basically, it will be an option in editor settings. User has to point the application.
All textures resources will have an Edit in Image Editor button in inspector
If this enhancement will not be used often, can it be worked around with a few lines of script?:
Plugins are per project. It will be tedious to set image editor in each project
Is there a reason why this should be core and not an add-on in the asset library?:
Same as above

editor

Most helpful comment

To make it generic, it could just be an "Open file in default program" button.

All 9 comments

As you said, I think we'll need to make users define editor settings for this. If we want the option to always open an image in an editor (rather than just a viewer), relying on the OS file associations would be a bad idea.

What about other kinds of files, such as sounds? Should we have a "sound editor" property so users can point to Audacity or similar?

Plugins are per project. It will be tedious to set image editor in each project

Making plugins easier to set up and having this proposal as a plugin sounds like an option too.

I think I'd almost prefer to have both an EditorSetting and ProjectSetting for it (a "default" and an "override") since I imagine it would be annoying to have to set it for every project, as OP says. But, I can also see the argument that different projects, with different art styles, might use different image editors (Krita, Asesprite, Inkscape, etc.), and so being able to override the default setting on a per-project basis would be useful, that way you don't have to update the shared EditorSetting if you happen to be flipping between contrasting projects.

As for plugins, I just don't really see the need for them here. It's not like you're doing any sort of user-defined integration with the editor beyond just linking to the app. And there is no need for any runtime evaluation of the configuration data for linking, so no scripting is necessary.

The user could be able to define custom resource edit overrides specifying file extensions for each type of file he wants to open in an external editor, so, not limited to images only.

To make it generic, it could just be an "Open file in default program" button.

@aaronfranke Implementing this on Linux is very easy, it's a matter of calling xdg-open with the absolute path to the file. I think macOS has an equivalent open command for this. Windows might be a bit more difficult, but it should still be quite easy.

That is, unless we decide to go the "custom program paths" route, which just involves using OS.execute() with the program path and absolute path to the file.

Will this issue be fixed by this pr?
godotengine/godot#35432

I think if the said pr is merged, Godot could itself provide a lot of plugins like this Image Editor one.
A dedicated list of official/recommended plugins could also be made.

@nikhilCad No, that's entirely separate. The feature you proposed here might be able to be provided by a plugin, but I think it makes sense to have it in core. (Not a dedicated image editor of course, but a way to define an image editor program in the Editor Settings and provide a context menu option in the FileSystem dock.)

Was this page helpful?
0 / 5 - 0 ratings