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

Select the root node resulting from the drag-and-drop operation after drag-and-dropping a file to the editor viewport #8282

Closed
viksl opened this issue Oct 28, 2023 · 8 comments

Comments

@viksl
Copy link

viksl commented Oct 28, 2023

Describe the project you are working on

I'm adding gltf models into my scenes, every time I add one it doesn't get selected which makes it cumbersome to work with newly added meshes.

Describe the problem or limitation you are having in your project

When you drag and drop a model into your scene the newly added object should be selected so you can immediately work with it - move, rotate, scale, ...

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

Simply on drag and drop the object which was added should be selected to be ready to work with as an active object.
Dragging in multiple new items should have them all selected.

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

No idea how to code this.

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

No it's editor's basic feature.

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

It's just a very basic functionality which works everywhere and shouldn't need an addon.

@viksl viksl changed the title Change selected node on drag and drop in 3D. Change selected node on drag and drop in. Oct 28, 2023
@Calinou Calinou changed the title Change selected node on drag and drop in. Select the dropped scene's root node after drag-and-dropping a scene to the 3D editor viewport Oct 30, 2023
@Calinou Calinou changed the title Select the dropped scene's root node after drag-and-dropping a scene to the 3D editor viewport Select the root node resulting from the drag-and-drop operation after drag-and-dropping a file to the editor viewport Oct 30, 2023
@Calinou
Copy link
Member

Calinou commented Oct 30, 2023

This makes sense. From testing in 4.2.beta3, the current behavior appears to be the case with any file type (also in the 2D editor).

@KoBeWi
Copy link
Member

KoBeWi commented Feb 13, 2024

What if you want to drop multiple objects? Currently when you drag and drop, the new node is added as a child of the selected node. If the new node was selected, dropping multiple nodes would create a nested structure, which is rarely desirable (though it's the same behavior as copy paste).

@viksl
Copy link
Author

viksl commented Feb 13, 2024

@KoBeWi
Is it? Because in my test right now in 4.2.1 and in the artifacts from 4.3 PRs above when I add a new scene by drag&dropping it into the viewport the nodes are always added to the top level node (the owner) and the behaviour in the PRs as well as this proposal are not suggesting changing that. The only change here is to have the newly added scenes selected so user can immediately start working with them.
To add one or multiple nodes as children to a particular node you have to drop it into the node Tree docker under the node you want as a parent of them.

Or did I perhaps misunderstand what you meant, please?

@KoBeWi
Copy link
Member

KoBeWi commented Feb 13, 2024

There are modifier that change the parent where the node is added. In 4.2.1 nodes are added to root by default, Ctrl adds them as child of selected node, Shift as a sibling.
In 4.3 the behavior was changed to add as child by default, so you can select a node and add multiple children. Though using a modifier you could still add the new nodes as sibling of the newly selected one, so I guess it's still possible (just less obvious).

Personally I never needed to edit the newly dropped node, as most of my instances just use the defaults defined in the scene.

@viksl
Copy link
Author

viksl commented Feb 13, 2024

Would you please mind pointing me to the PR for 4.3 changes? I currently can't find it, or at least what was the name about? :)

The selecting currently added scene sure can be used to change properties if needed but the most value it has when building levels, you add something and you want to immediately move it, rotate it, currently you have to click on your node in the Scene tree or in the viewport before that happens. Especially in 3D this is impractical since clicking in viewport due to depth can easily select a different object, you ojbect might also not have an easily selectable AABB (imagine adding a marker or so scene, not saying it's common or why but it could happen), even more annoying is when you add multiple scenes and you want to quickly move them somewhere, currently you have to select them all and then work with them while with this PR you can start working with it straight. It doesn't sound like much but when filling the world in 3D it very quickly becomes a hindrance not having it. ^.^

EDIT: This one: godotengine/godot#87623 ?

@viksl
Copy link
Author

viksl commented Feb 13, 2024

@KoBeWi
Ok I rebased (only on my end, did not push it!) on the current master with the changed behaviour you mentioned and there don't seem to be any issues.
Maybe this is a misudnerstanding about what this proposal and my PRs are about?
The PR changing the behaviour where the nodes go in the tree is not in conflict with the PRs for this proposal, both work together just fine as far as I can tell. But it was worth a check so thank you for bringing it up for testing, everything seems to be fine.

Do you think there's anything else which would be blocking the PRs please?

@KoBeWi
Copy link
Member

KoBeWi commented Feb 13, 2024

the most value it has when building levels, you add something and you want to immediately move it, rotate it, currently you have to click on your node in the Scene tree or in the viewport before that happens.

That makes sense.
Yeah, on a second though this change is fine.

@akien-mga akien-mga added this to the 4.3 milestone Feb 15, 2024
@akien-mga
Copy link
Member

Implemented by godotengine/godot#84356 and godotengine/godot#84347.

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

4 participants