-
-
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
[4.3dev] Exported node path in child scene are reflected in the parent scene file #91591
Comments
If I understand correctly, what you've reported is about properties of the instance being copied to properties of the base scene. |
That's it! That's the issue I wanted to describe. This wasn't the case in Godot 4.2. |
Indeed, can't reproduce in v4.2.2.stable.official [15073af] and earlier. Can reproduce since v4.3.dev1.official [9d1cbab]. That's a regression, hence marking it as such (should be addressed before 4.3.stable).
[gd_scene load_steps=2 format=3 uid="uid://bdp4gvtih2bec"]
[ext_resource type="Script" path="res://menu.gd" id="1_vb7hi"]
[node name="Menu" type="Node2D" node_paths=PackedStringArray("nodes")]
script = ExtResource("1_vb7hi")
nodes = [NodePath("VBoxContainer/Label"), NodePath("VBoxContainer/Label2"), NodePath("VBoxContainer/Label3")]
[node name="VBoxContainer" type="VBoxContainer" parent="."]
offset_right = 40.0
offset_bottom = 40.0
[node name="Label" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Label 1"
[node name="Label2" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Label 2"
[node name="Label3" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Label 3"
[gd_scene load_steps=2 format=3 uid="uid://dakw7h8ta0aa4"]
[ext_resource type="PackedScene" uid="uid://bdp4gvtih2bec" path="res://menu.tscn" id="1_tkt5r"]
[node name="MyLevel" type="Node2D"]
[node name="Menu" parent="." instance=ExtResource("1_tkt5r")]
[gd_scene load_steps=2 format=3 uid="uid://dakw7h8ta0aa4"]
[ext_resource type="PackedScene" uid="uid://bdp4gvtih2bec" path="res://menu.tscn" id="1_tkt5r"]
[node name="MyLevel" type="Node2D"]
[node name="Menu" parent="." node_paths=PackedStringArray("nodes") instance=ExtResource("1_tkt5r")]
nodes = [NodePath("VBoxContainer/Label"), NodePath("VBoxContainer/Label2"), NodePath("VBoxContainer/Label3")] This leads to potential desyncing of the properties, e.g. after adding a new entry to
"BUT only if the parent scene is opened in the editor"
@Sauermann Unlabelling |
Thank you for digging into it! I wasn't able to reproduce this when the scenes are closed, but maybe I missed something. That's good to know. |
If someone has time to bisect, this should be done between |
Bisecting points to #83343 as the culprit |
Minor note from my own run-in and experimentation with this issue: It does not seem to affect |
I've run into this as well and my interpretation of the issue is that when instancing a scene (child.tscn in parent.tscn) with exported nodepaths on child.tscn it now always saves the nodepaths in parent.tscn as well, as if they had set overrides in parent.tscn. For example, even without overriding the
This is problematic since if I then change the If instead I edit parent.tscn in a text editor and just remove the I think this could also be the root issue behind the node duplication issues #83343 above was originally meant to fix. Since if the nodepaths are seen as overridden in instances when they are not this could I think cause exactly these types of issues when duplicating these instances. |
I'm experiencing the same issue with the |
If you have scenes that were previously bugged you need to remove the non-default values. |
That's what I did. Here is a screencast; maybe I did something wrong. CleanShot.2024-06-20.at.23.16.54.mp4Thank you for the fast answer 🙏 |
Your scenes still show revert icon though. Revert them before saving. |
Ok looks like the only fixed case is when a Node is exported, but not Array of nodes. |
Many many thanks for the quick investigation and MR @KoBeWi 🙏 |
I confirm the issue has been solved for good with beta 3! Again, many thanks to everyone for this fix! |
Tested versions
System information
macOS Monterey 12.6.5
Issue description
Exported nodes in a child scene will be reflected in the parent scene file when saving a scene, BUT only if the parent scene is opened in the editor.
Steps to reproduce
@export var nodes: Array[Label]
)Minimal reproduction project (MRP)
exported-node-issue.zip
The text was updated successfully, but these errors were encountered: