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

Extending the functionality of the script editor: editing shaders and more. #2472

Open
AndyBarcia opened this issue Mar 16, 2021 · 0 comments

Comments

@AndyBarcia
Copy link

AndyBarcia commented Mar 16, 2021

Describe the project you are working on

Not important. I was just messing around with the Godot source code, specially with the script editor plugin.

Describe the problem or limitation you are having in your project

Right now the features of the script editor are greatly abstracted through the use of the ScriptEditorBase class (see this for reference). This, in practice, means that we can create any custom editor for any resource type, and it will be editable on the script editor (and I really mean any resource, not just a text based file).

But the possibilities of this implementation are barely used. As of now only TextEditor, ScriptTextEditor, and VisualScriptEditor extend the ScriptEditorBase class.

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

My idea is that, given that multiple windows are on the way in godot 4.0 (#28), we could extend this idea to the extreme, and let the “Script Editor” just be the “File Editor”. With this I mean that we could also edit shaders and visual shaders, edit scenes as text files (related), edit markdown files (related), or edit any text based file.

Note that you can do this to some extend right now. In the Script editor, you can click "File", "Open...", "Al Files", and you can finally open some text based files (not visual shader though). But this is a bit annoying, as it would be nice to open them from the FileSystem dock. And the files are opened as a raw text file; so no syntax highlighting either.

I think that this would make the experience of the editor a little bit better. Specially the editing of shaders on the script editor. Other users have already expressed their interest in the ability of opening shaders in the script editor in combination with the multiple windows feature (see this).

And yes, I guess that some people will still prefer the shader editor on the bottom panel (specially if this feature is implemented), but I think that maybe we could have both options, and let the user choose.

Edit: related

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

This should be relatively easy to do; with ScriptEditorBase we are already halfway there. But for now I don't have enough experience with the Godot source to give exact implementation details.

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

I wish.

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

Maybe this could be an add-on, I guess. But I think that the engine would benefit from having this in core, specially the editing of shaders and visual shaders in the script editor.

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

No branches or pull requests

2 participants