i don't know, it would be nice, wouldn't it ? :)
@vichug just in case if you don't know, you can use "export (NodePath)var path2SomeNode" to get path without typing it manually.
Something like netbeans would do in terms of php/web dev... :)
@kubecz3k but still, you don't get a drag/drop interface with this workaround... If you could drag it into the script property in the inspector :smile:
I wanted to modernize the UI eventually with Drag an Drop and contextual
menus. But for now this will wait, the editor has changed a lot and needs
to be well tested and stabilized first.
On Wed, Sep 23, 2015 at 9:46 AM, Bojidar Marinov [email protected]
wrote:
@kubecz3k https://github.com/kubecz3k but still, you don't get a
drag/drop interface with this workaround... If you could drag it into the
script property in the inspector [image: :smile:]—
Reply to this email directly or view it on GitHub
https://github.com/okamstudio/godot/issues/2505#issuecomment-142587116.
_OkamStudio_
@kubecz3k you mean from inside a script attached to a node ? i'm not sure of the syntax here : is (NodePath) a typecasting ?
@okamstudio fair enough. But after writing this here request, i realized it would already be good enough if node path coompletion would support node paths with ../ (so relative to current node) or full node path from /root/MainSceneNode ; because right now when i go from /root/ it only autocompletes with global project nodes (in the AutoLoad tab of project settings) and not the nodes in the scene.
@vichug Well it's not drag and drop, but it works and it's available now :)
Just try to add to your script that line (ensure you are not inside function):
"export (NodePath)var path2SomeNode"
Go out to editor and click on a node that has this line, there will be new property "Path 2 Some Node", when you click on it you will be able to choose target node from a nice interface.
When it comes to syntax "(NodePath)" it's saying to the editor what type of property you want to export, take a look here: https://github.com/okamstudio/godot/wiki/gdscript#exports
@kubecz3k uh, i'm not sure i understand... what is the "target node" you speak of ?
@vichug just take a look at the video I recorded for you, I hope it will be clear then :)
https://youtu.be/JoR3hytxF_I
@kubecz3k wow thanks a lot for your efforts ^^ got it now. Effectively, it's not as simple as drag and drop :) but still could come in useful indeed.
@vichug I'm happy it was helpful :)
This could now be implemented since the editor supports drag and drop and contextual menus.
@reduz already pointed out that clicking in a node switches the view to CanvasItemEditor/SpatialEditor so he could not find a way to solve this
There could be a contextual menu "Copy NodePath to clipboard" that copies the Nodepath in the OS's clipboard, so that you can paste it where you want.
Path from where? I belive this is not too straight forward to use...
Edit: ./ Is game root, if you add another key like $/ to refer the scene owner then this could be possible
I'd say absolute path to game root, as you wouldn't know in what script the copied NodePath would be pasted. But all in all I don't think this a very meaningful feature, autocompletion works great for getting node paths.
@akien-mga We don't know where in the game tree the scene would be instanced, so absolute paths won't work. :smile:
Yeah.. So I don't see this being implemented then.
I would rather repurpose this issue for drag'n'drop into NodePath fields in the Inspector dock from the Scene dock (and maybe 2D/3D viewport).
For this to work, first we need to prevent inspector from showing dragged node.
Currently both clicking and dragging a node affects the inspector. We need to change it to click only.
Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.
The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.
If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!
Most helpful comment
I would rather repurpose this issue for drag'n'drop into NodePath fields in the Inspector dock from the Scene dock (and maybe 2D/3D viewport).