-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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 loading packed scene with editable children at runtime #49664
Fix loading packed scene with editable children at runtime #49664
Conversation
2475c8f
to
f35b52b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good, although it would make me happy if someone more recently involved in this code can give it a check.
@pouleyKetchoupp This needs a rebase :) |
f35b52b
to
9e8fdb4
Compare
At runtime, packed scenes with nodes marked as editable instance where saved with node type tags, which prevented the scene to be then loaded as an instance, causing duplicated nodes in the tree. This change ensures nodes marked as editable instances and their owned children are properly set as instances. That doesn't make a difference in the editor, since such nodes where already set as instances based on their instance state, but it helps at runtime where instance states are disabled. Co-authored-by: latorril <latorril@gmail.com>
9e8fdb4
to
fab88a8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Built & tested locally, tests run fine, works in my tests projects, and I could verify that it fixes the issue. I couldn't find anything that this breaks, and the code looks fine too.
Looking at the history of the file, it doesn't seem like anyone besides @pouleyKetchoupp has touched this code (outside of small style changes or as side effect or changes elsewhere) much for at least the last year.
Thanks for this! |
Cherry-picked for 3.4. |
Fixes #49660
At runtime, packed scenes with nodes marked as editable instance where saved with node type tags, which prevented the scene to be then loaded as an instance, causing duplicated nodes in the tree.
This change ensures nodes marked as editable instances and their owned children are properly set as instances.
That doesn't make a difference in the editor, since such nodes where already set as instances based on their instance state, but it helps at runtime where instance states are disabled.
Credits to @latorril for finding the issue and investigating the cause.