Updating node properties in multi-scene inheritance #61076
Draft
+4
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Opening as a draft to write down the different problems I'm finding about this issue.
This issue affects both opened and closed scenes. Making changes in a level 1 scene before opening a previously closed level 3 scene does not affect the same changes.
As far as I can tell this is happening in two places:
EditorData::_find_updated_instances
is only checking the immediate scene it inherits fromSceneState::_parse_node
is overwriting default values from the inherited scene with its own previous values, but only if the inheritance is more than one level.PropertyUtils::get_property_default_value
is unable to find the value from the scene it inherits from, possibly due to construction ofstates_stack
. This means one level inheritance is working fine because the following block tells it to not update the property when being instantiated (whether it's intended or not, I don't know).godot/scene/resources/packed_scene.cpp
Lines 554 to 560 in 396def9
Current commit has a fix for 1) but only works if all inherited scenes are open. I haven't found a way to traverse back the inheritance tree that works with checking modified time. This was the attempt at going back the inheritance tree. Since
SceneState
that the node scene saves is unique and the modified time value is pulled from the scene file when instantiating a node from theSceneState
, checking modified time didn't work.Working on a fix for #60846