-
-
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 script properties being lost and prevent node reference corruption upon scene reimport #92279
Fix script properties being lost and prevent node reference corruption upon scene reimport #92279
Conversation
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.
I tested https://github.com/godotengine/godot/files/15415243/reimport_test.zip.
On 4.3 and this pr it keeps the last value
Screen.Recording.2024-05-23.at.7.23.22.PM.mov
On 4.2 it resets on reimport
Screen.Recording.2024-05-23.at.7.20.01.PM.mov
Will do more testing.
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.
I tested the broken cases. See video. It seems to resolve property reload bugs.
Didn't see anything obviously problematic.
The last attempt to introduce this fix created a signal. In this bugfix pull request we use _nodes_scene_reimported
as the callback as a replacement.
@lyuma I expect this to solve your common case of "click on the skeleton" and click reimport to see Godot Engine crash bug. |
f049cbe
to
f83bdeb
Compare
f83bdeb
to
686a167
Compare
* The reimported instance attempt to preserve ownerless nodes. * A recursive function call to '_nodes_scene_reimported' so these can be recreated if required. * Clears instance scene_state on new instantiated replacement nodes.
686a167
to
97d2730
Compare
|
Preserves exported script variables Prevents corruption of direct node references.
892786c
to
e57312d
Compare
Thanks @fire, I was a bit confused how the CoreStringNames API was meant to be used. |
Thanks! |
Expands and depends upon the previous PR (#92182) to fix further bugs in the hot scene reloader. It now prevents script properties on reimported nodes from getting lost, and prevents node reference properties referencing nodes which get replaced by the reimport system from being retained, preventing several cases which can cause editor crashes.