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

Automatically select an object after it was drag-and-dropped in the 3D view #9613

Closed
Nodragem opened this issue Apr 27, 2024 · 13 comments
Closed

Comments

@Nodragem
Copy link

Describe the project you are working on

Making a 3d level for a Top Down shooter.

Describe the problem or limitation you are having in your project

When I drag-and-drop an asset from the FileSystem to the 3D View, the newly created object is not selected.

This can be really cumbersome when the object is spawned behind or too close another object.
But even if the object is spawned in a visible spot, I still need to click on it so I can rotate/scale/move it.

Note : other people have found this to be an issue.

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

Automatically select the latest object created after that the user drag-and-drop an asset in the 3D View.

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

I am hopeful that there is an easy way to know what object was newly created in the tree (after the drag and drop operation) and set this object as the currently selected object.

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

It will be used thousands time 🚀

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

it is a core behaviour.

@AThousandShips
Copy link
Member

This might be undesirable, the new node is parented to the selection, so you'd have to manually change back if you want to drop another child node, this should be a modifier IMO, not by default, so holding down some key makes it select it

@Nodragem
Copy link
Author

So actually, they are not parented to the current selection ! They are added to the root node. So the feature would not be interfering with that behavior (I just tested in Godot 4.2.2).

@AThousandShips
Copy link
Member

AThousandShips commented Apr 27, 2024

I just tested, they are parented to the currently selected node, at least in 4.3, don't have a 4.2 version around right now, but this would break behavior in 4.3

@Calinou
Copy link
Member

Calinou commented Apr 27, 2024

For reference, drag-and-drop tree insertion order is determined by the modifiers outlined in godotengine/godot#87623 since 4.3.

Automatically selecting a node after drag-and-dropping it is sometimes beneficial, but it can be counterproductive in cases where you drag-and-drop another node and don't want it be the child of the other node you just drag-and-dropped.

@timothyqiu
Copy link
Member

The dropped object is already selected since 4.3.dev4 :P

@AThousandShips
Copy link
Member

The dropped object is already selected since 4.3.dev4

Not in latest on a standard build

@Nodragem
Copy link
Author

I just downloaded 4.3dev5 and here the behaviours I've got:

  • default: add new node as child of selected node and select automatically the new node;
  • ALT modifier: add new node as child of root and select automatically the new node;
  • SHIFT modifier: add new node as sibbling of currently selected node and select automatically the new node.

The first (default) behaviour seems a bit counterproductive as mentionned by Calinou and AThousandShips.
The 2 last behaviours are really useful when building a level (that is exactly what I needed).

@AThousandShips are you using a more recent build than dev5?

@AThousandShips
Copy link
Member

AThousandShips commented Apr 28, 2024

I'm using the latest build, as I said above

Edit: My bad, it does select it automatically on the standard build, but not my main working build, must be something that was changed in some of the bug fixes I've added there

But that's a bug, as it was never introduced intentionally I'd say, it was clearly not the fact after the other features were introduced in godotengine/godot#87623

Edit 2: Now occuring on my working build as well, unsure what changed between now and when I tested it yesterday and before

@Nodragem
Copy link
Author

Thank you, I wasn't sure what you meant by latest.

I am a bit confused on what's happening on your working build and what is a bug. The default behaviour I experienced in 4.3dev5 (see my last message) is indeed surprising, I am not sure of its use case. But the SHIFT and ALT modifier behaviours are super useful for level editing; so please keep them 😃 !

People doing level editing will be super happy and be pressing SHIFT all the time 😄 Maybe the cherry on the cake would be to add an option in the Editor Setting so we can configure what is the default/shift/alt behaviours.

@AThousandShips
Copy link
Member

AThousandShips commented Apr 28, 2024

It appears that this was intentionally introduced in:

So this can be closed as implemented, though I missed this and would have been against it being introduced as it's messy

Closing and would be good to discuss improving this in the future

Must have been some temporary bug with this behavior recently that was solved and therefore didn't show up in my recent build

@AThousandShips AThousandShips added this to the 4.3 milestone Apr 28, 2024
@Nodragem
Copy link
Author

would have been against it being introduced as it's messy

Please try the SHIFT behaviour, it is not messy. IMO, it should be the default behaviour.
Thank you for investigating. Happy for the issue to be closed and really excited to save on clicks !

@AThousandShips
Copy link
Member

Having to hold down a button to do what I'd call the default behavior isn't very ergonomic, but fair enough

@Nodragem
Copy link
Author

Nodragem commented May 5, 2024

I opened a feature proposal for it, but now, I am thinking maybe I should have reported it as a bug as those behaviours are accidental!

Let me know if I should close the proposal and open an issue instead.

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