Skip to content

Fix nodes being deselected upon reparenting #84135

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

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

aXu-AP
Copy link
Contributor

@aXu-AP aXu-AP commented Oct 29, 2023

Fixes inconsistency when moving nodes in hierarchy, as reparenting caused nodes to be deselected (vs reordering children of same node).
This especially improves flow when building a skeleton by duplicating and reparenting bones:
reparent

There isn't existing issue about this, just a short conversation at rocket chat.

@aXu-AP aXu-AP requested a review from a team as a code owner October 29, 2023 08:35
@KoBeWi KoBeWi added this to the 4.3 milestone Oct 29, 2023
@KoBeWi
Copy link
Member

KoBeWi commented Oct 29, 2023

Reparenting resets the inspector, unlike normal moving:

godot.windows.editor.dev.x86_64_riQ3FfGvqP.mp4

Though not sure if it can be reasonably solved.

@aXu-AP aXu-AP force-pushed the reparent-select-fix branch from 75e10ee to b88e3c0 Compare October 29, 2023 11:10
@aXu-AP
Copy link
Contributor Author

aXu-AP commented Oct 29, 2023

Thanks for noticing. I made it so that nodes get reselected so that inspector opens as well. This has the caveat that if something else was opened in the inspector then changing the object wouldn't be desired, but it's much rarer case than having selected nodes opened.

@KoBeWi
Copy link
Member

KoBeWi commented Oct 31, 2023

Your last change did not address my comment.
Notice how I had everything unfolded in the inspector and it was scrolled, but after moving, everything is folded again, with scroll reset to 0. It does not happen with single node though.

If you can't solve it then it's fine too I guess, still better than how it was before. But then you should probably revert your last change, as it doesn't really serve purpose.

@aXu-AP aXu-AP force-pushed the reparent-select-fix branch from b88e3c0 to 414d84b Compare October 31, 2023 19:15
@aXu-AP
Copy link
Contributor Author

aXu-AP commented Oct 31, 2023

Oh, you're right. To be exact, the problem occurs only when reparenting multiple nodes. Single node retains its unfolded sections. I must have tested it on a single node and thought that the problem got solved.
Tbh the logic for remembering unfolded sections could be better overall.

@akien-mga akien-mga merged commit 1312a73 into godotengine:master Jan 4, 2024
@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.

3 participants