Godot-proposals: Implement drag-and-drop for NodePaths

Created on 11 Jun 2020  路  6Comments  路  Source: godotengine/godot-proposals

Describe the project you are working on:
3D puzzle adventure

Describe the problem or limitation you are having in your project:
When you have a [Export] public NodeType myPath field in your script, then the editor brings up a popup dialog when you click on it, allowing you to pick a node.

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
It would be much more convenient if I could simply drag a node from the scene tree over to the inspector field and drop it there (the way it works in Unity).

This would require that the editor can be "locked", i.e. it must not immediately switch to the selected node, otherwise nodes cannot be dragged into inspector fields. Unity supports both locking the inspector to a certain scene element, and also only displays the editor for an element if you click on it, not if you click-and-drag it.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
image

If this enhancement will not be used often, can it be worked around with a few lines of script?:
No, because it concerns only the editor. The "workaround" is to use the popup dialog, which is distracting for the user due to the context switch. They may have their eyes on the node in the scene tree already, click on the "assign" button and get an entire new tree to browser through, just to find the same item again.

Is there a reason why this should be core and not an add-on in the asset library?:
Again, entirely editor-related and definitely a core feature.

editor

Most helpful comment

At one point I thought that brush icon was something like: "Click it, then click the node you want to generate a link." After a closer look I realized it just clears the assignment.

This is definitely a sore spot for us too, we try to avoid things with NodePath requirements as much as possible, because it could lead to a lot of time spent going through these windows, and it becomes very error prone when doing dozens or more of them.

I would add to this, that they're also very brittle in the sense that they don't update when the node they reference is moved or renamed. A simple edit, means going back through the process again.

If you have many, and a parent is changed, they can potentially all break and to be tediously relinked.

They're a nice idea, but it really needs some reworking to be practical to use in large projects.

All 6 comments

Unity supports both locking the inspector to a certain scene element, and also only displays the editor for an element if you click on it, not if you click-and-drag it.

Solving this would also fix https://github.com/godotengine/godot/issues/33704

For me, this issue is really highly critical - a term I don't use lightly. The reason is simple: productivity. If there's one feature I use literally all the time in the Unity editor, it's this one (granted: I mostly do coding, ymmv). Godots current solution unfortunately is very clunky and inefficient (in terms of time spent per action).

At one point I thought that brush icon was something like: "Click it, then click the node you want to generate a link." After a closer look I realized it just clears the assignment.

This is definitely a sore spot for us too, we try to avoid things with NodePath requirements as much as possible, because it could lead to a lot of time spent going through these windows, and it becomes very error prone when doing dozens or more of them.

I would add to this, that they're also very brittle in the sense that they don't update when the node they reference is moved or renamed. A simple edit, means going back through the process again.

If you have many, and a parent is changed, they can potentially all break and to be tediously relinked.

They're a nice idea, but it really needs some reworking to be practical to use in large projects.

+1 to this. Would really save a lot of time.

@barefists Please don't bump issues without contributing significant new information. Use the :+1: reaction button on the first post instead.

I've got a love-hate relationship with locking the editor in unity, it's easy to forget that it's locked. I'm not sure whether that would be the best solution, I haven't missed that specific feature in Godot. Just not changing the inspector until a mouse up event (so only trigger it after a full click) is much better in my opinion.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

WizzardMaker picture WizzardMaker  路  3Comments

aaronfranke picture aaronfranke  路  3Comments

PLyczkowski picture PLyczkowski  路  3Comments

lupoDharkael picture lupoDharkael  路  3Comments

davthedev picture davthedev  路  3Comments