-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Clear the previously set state when configuring for a new scene root node #79201
Clear the previously set state when configuring for a new scene root node #79201
Conversation
The fix is much appreciated, but these changes only sporadically resolve #79176 for me - sometimes the scene with the Subviewport and ViewportTexture will open correctly, but other times they will not. |
c3efb35
to
ec39551
Compare
Comparing addresses seems to be unreliable. Because the node pointed to by |
This version does appear to fix #79176, thanks! |
I think the method name should be more descriptive, like |
…node Saving a subscene causes the main scene to be re-instantiated. And the resource instance in the main scene will be reused when the main scene is re-instantiated. So for resources with `resource_local_to_scene` enabled, resetting state may be necessary (at least for `ViewportTexture`).
ec39551
to
4795c3c
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.
This adds a new method to Resource, so needs core review.
Other than that works correctly.
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.
@reduz said on chat that this one seems fine to him.
Thanks! |
Cherry-picked for 4.1.3. |
Saving a subscene (or other reasons) causes the main scene to be re-instantiated. And the resource instance in the main scene will be reused when the main scene is re-instantiated. So for resources with
resource_local_to_scene
enabled, resetting state may be necessary (at least forViewportTexture
).Fix #69469, fix #79176, fix #77981, fix #74080, fix #80417.