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

Dragging an object does not respect selection. #80795

Closed
SkanerSoft opened this issue Aug 19, 2023 · 9 comments · Fixed by #87623
Closed

Dragging an object does not respect selection. #80795

SkanerSoft opened this issue Aug 19, 2023 · 9 comments · Fixed by #87623

Comments

@SkanerSoft
Copy link

Godot version

3.6 Beta 3

System information

Ubuntu 22

Issue description

When I drag an object from the file system of the engine, the selected object is ignored, it is added to the scene end.

In Godot 3.5.2, everything works correctly, when you drag an object, it becomes a child of the selected object.

This is how it worked before (3.5.2)

Peek.2023-08-19.23-47.mp4

This is how it works now (3.6)

Peek.2023-08-19.23-49.mp4

Steps to reproduce

Drag an object (in 3D, *.mesh) into the workspace from the engine's file system.

Minimal reproduction project

Does not trumpet, because works in any project.

@SkanerSoft
Copy link
Author

Small addition: The problem is observed in all versions 3.6 (beta 1, 2, 3).

@matheusmdx
Copy link
Contributor

Bisecting the issue leads to #55626, but after check the code is possible to see that is not a regression, but a behavior change, now you need to hold ctrl before drop the 3d object to have the same behavior, so this is most a documentation issue.

bool is_ctrl = Input::get_singleton()->is_key_pressed(KEY_CONTROL);
selected_files.clear();
Dictionary d = p_data;
if (d.has("type") && String(d["type"]) == "files") {
selected_files = d["files"];
}
List<Node *> selected_nodes = editor->get_editor_selection()->get_selected_node_list();
Node *root_node = editor->get_edited_scene();
if (selected_nodes.size() == 1) {
Node *selected_node = selected_nodes[0];
target_node = root_node;
if (is_ctrl) {
target_node = selected_node;
} else if (is_shift && selected_node != root_node) {
target_node = selected_node->get_parent();
}

@SkanerSoft
Copy link
Author

I tried this method and it solves this problem but creates another one. The snapping is completely lost and I can't position the new object in the right place.

test.mp4

@SkanerSoft
Copy link
Author

I don’t quite understand the reasons to change long-standing functionality, instead of expanding it with use cases without changing basic things.

@Calinou
Copy link
Member

Calinou commented Sep 20, 2023

Bisecting the issue leads to #55626, but after check the code is possible to see that is not a regression, but a behavior change, now you need to hold ctrl before drop the 3d object to have the same behavior, so this is most a documentation issue.

I think this is a regression, as the behavior is only supposed to change if there is no root node present in the current scene. There's no reason to change the behavior when there is already a root node present in the scene.

@SkanerSoft
Copy link
Author

So, I tried using CTRL and dragging, but the convenience was greatly reduced because... CTRL enables snapping to the grid, you have to make a lot of movements to adjust positions. It is also very inconvenient that this differs in behavior from 3.5. Temporarily returning to 3.5.

@SkanerSoft
Copy link
Author

We kindly ask you to return the previous behavior of dragging objects, or make it customizable. This behavior is unintuitive and differs from all versions of the engine. It became bad to use it. Also, CTRL does not allow you to position the object due to snapping to the grid.

@Calinou
Copy link
Member

Calinou commented Oct 6, 2023

Bisecting the issue leads to #55626, but after check the code is possible to see that is not a regression, but a behavior change, now you need to hold ctrl before drop the 3d object to have the same behavior, so this is most a documentation issue.

That PR shouldn't be affecting non-root nodes in the scene. In other words, if you already have an existing node in the scene at the time of drag-and-dropping, the behavior should be the same as 3.5.

Therefore, it's a bug 🙂

@akien-mga akien-mga changed the title Dragging an object does not respect selection. 3.6 b3 Dragging an object does not respect selection. Oct 30, 2023
@SkanerSoft
Copy link
Author

3.6 B4, problem persists.

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.

4 participants