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

Fix selecting root when opening scene. #91435

Merged

Conversation

ajreckof
Copy link
Contributor

@ajreckof ajreckof commented May 2, 2024

Fixes #91411
This part was literaly pushing the root to be edited whenever loaded. This made a lot of issues and my modifications to edit_current and selection made it more visible.
This was removed in #80517 during restoration of scenes because those problems became too apparent there but kept it for normal loading. The fact is some of those bugs can be reproduced with simple loading like the theme one

output.mp4

Here I removed it untirely but I'm wondering if it is a feature that if nothing is selected when opening the scene it automatically selects the root if so then I can update the PR to make it so in a non problematic way.

@YeldhamDev
Copy link
Member

There's another PR that also says that will fix the issue: #91430

@ajreckof
Copy link
Contributor Author

ajreckof commented May 2, 2024

Even if the other one is merged I think this should still me merged because of the issue I showed

@Hilderin
Copy link
Contributor

Hilderin commented May 6, 2024

I tested this PR and everything seems to work fine except when tabbing between scenes without changing the selection. I think it's maybe another side effect of calling SceneTreeDock::get_singleton()->set_selection in EditorNode::_edit_current ?

After the first load of a scene, the selection is restored correctly, but if I switch to another scene (another tab) and go back to the first scene, only one node is selected.

Exemple:
https://github.com/godotengine/godot/assets/81109165/f0b58ba0-1a83-4cce-8b40-76bdb946c7a3

Before (version 4.2.1):
https://github.com/godotengine/godot/assets/81109165/4839a66b-a8c9-4a8f-a163-89cc69f736c6

@ajreckof ajreckof force-pushed the Fix-selecting-root-when-opening-scene- branch from 587ee0b to 0ab5d37 Compare May 12, 2024 19:46
@ajreckof ajreckof requested a review from a team as a code owner May 12, 2024 19:46
@akien-mga akien-mga merged commit 0ebba30 into godotengine:master May 13, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Opening a scene always selects the root node
5 participants