godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.14k stars 93 forks source link

Add drag-and-drop support between Godot instances #2400

Open me2beats opened 3 years ago

me2beats commented 3 years ago

Describe the project you are working on

plugins

Describe the problem or limitation you are having in your project

I often have several open Godot editor instances. I do this mainly to compare projects, as well as find resources (scripts, scenes, fonts, assets, etc.) in one project and then copy them to another project.

Sometimes I have to do this really often and then I am convinced again and again that it would be convenient to be able to drag-drop resources, nodes and other things from one project to another, without having to use the OS's file explorer or other tools.

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

Ability to drag-and-drop between Godot instances would solve the problem. This would make copying resources and other stuff easier and more convenient, for example copying of files from project A to project B, like this:

https://user-images.githubusercontent.com/16458555/110035493-929b1680-7d5d-11eb-87c9-19cca7489bba.mp4

this would allow drag-n-drop:

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

Godot Editor at least should detect that something is dropped on it from another Godot instance. SceneTree has files_dropped signal, so a similar signal could be added like EditorPlugin.resources_dropped (a clearer signal name could be chosen). A more advanced way would be to be able to define the details of drag-and-drop, something similar to Control.can_drop_data(), drop_data(), get_drag_data(), etc.

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

It can't. A work-round would be to open the selected files in your OS file explorer and copy the files there, which is less convenient.

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

It seems there is no a reliable and relatively easy way to implement drag-n-drop between editors with an addon.

On the other hand, the problem of conveniently copying files between projects can be solved with plugins using other approaches (but drag-and-drop looks so UX friendly :))

Calinou commented 3 years ago

I'm not sure if this can be done without implementing complex IPC mechanisms…

If https://github.com/godotengine/godot-proposals/issues/50 is implemented first, it might become a little easier, but it'll still require a lot of OS-specific wrangling.

fire commented 2 years ago

For these cases I think it's possible to use the cut and paste technology to encode a tres.

  1. between different open scenes
  2. filesystem items