Is there a way to save/apply the instance changes of a packed scene instance to the original packed scene?
For example in my hierarchy the white nodes under “Hud” are changes I made after selecting “Editable children” (i think). Now I want to save those changes back the Hud.tscn file in case I create another instance elsewhere.
If I uncheck “Editable children” I get the warning:
Disabling “editable_instance” will cause all properties of the node to be reverted to their default.
Hmm this is something I want to do often to keep my packed scenes updated. Also I think this code would break the instance references I mentioned in the comment above
For something that keeps the instances like they are in the reference scene, you have to instance them with code, there’s probably no other way.
Note: if you need keep instances up to date, As you said, the code above is not appropriate, but the above method doesn’t break the dependencies, it just creates a new PackedScene file that has no effect on the original and its instances. (It doesn’t matter right now)
In general, the best way to update instanes with reference is to in-instance them with code in _ready(), i.e. the instance is not in the tree before the scene is executed, and becomes an instance each time the scene is loaded.
Example:
func _ready():
var an_instance = preload("res://path/to/scnen.tcsn").instantate() #i am not sure about function name
# instance configurations
add_child(an_instance)
#... and/or setup other instance(s)