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

Implement drag-and-drop for NodePaths #1042

Closed
MartinHaeusler opened this issue Jun 11, 2020 · 8 comments · Fixed by godotengine/godot#55761
Closed

Implement drag-and-drop for NodePaths #1042

MartinHaeusler opened this issue Jun 11, 2020 · 8 comments · Fixed by godotengine/godot#55761
Milestone

Comments

@MartinHaeusler
Copy link

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.

@KoBeWi
Copy link
Member

KoBeWi commented Jun 12, 2020

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 godotengine/godot#33704

@MartinHaeusler
Copy link
Author

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).

@ghost
Copy link

ghost commented Jun 16, 2020

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.

@barefists

This comment has been minimized.

@Calinou

This comment has been minimized.

@Calinou Calinou changed the title Drag-and-Drop for NodePaths Implement drag-and-drop for NodePaths Sep 27, 2020
@robbertzzz
Copy link

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.

@idchlife
Copy link

idchlife commented Nov 9, 2021

I'm making custom waypoint system and I need to link multiple waypoints to multiple waypoints (e.g. like in cs 1.6 PodBot waypoints).

It's not possible to keep system flexible if I have to manually assign nodes from the hierarchy and not drag-dropping them, unfortunately. Maybe I'm missing different approach?

Right now I'm basically forced to check before assignment - which nodes I should use and I don't write custom names for them (e.g. Path1 Path2 Path3) since there can be like TONS of nodes.

image

image

@Domigome
Copy link

w I'm basically forced to check before assignment - which nodes I should use and I don't write custom

I think would be better solution that the inspector only changes after mouse is released. Thus, no need to lock the inspector.

If I just click on a object that I'm willing to drag, as far as I keep the mouse pressed, the inspector keeps the same.

Even Unity does not have this feature, but I really think this way is really simple and useful.

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.

8 participants