X Tutup
Skip to content

Supplement the case of scene instantiation for "Editable Children"#81530

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
Rindbee:supplement-scene-instantiation-for-editable-children
Dec 2, 2025
Merged

Supplement the case of scene instantiation for "Editable Children"#81530
Repiteo merged 1 commit intogodotengine:masterfrom
Rindbee:supplement-scene-instantiation-for-editable-children

Conversation

@Rindbee
Copy link
Contributor

@Rindbee Rindbee commented Sep 11, 2023

This is a follow-up to #65011.

For scenes with Editable Children enabled, the main scene will record more information and resource mapping will be valid for multiple nodes. See #64487 (comment).

@akien-mga akien-mga added this to the 4.2 milestone Sep 11, 2023
@akien-mga akien-mga requested a review from KoBeWi September 11, 2023 07:26
@Rindbee Rindbee force-pushed the supplement-scene-instantiation-for-editable-children branch from e5d0d2e to cea3ff6 Compare September 11, 2023 07:54
@KoBeWi
Copy link
Member

KoBeWi commented Oct 22, 2023

What does it fix exactly?

@Rindbee Rindbee force-pushed the supplement-scene-instantiation-for-editable-children branch from cea3ff6 to 216ec91 Compare October 23, 2023 00:59
@Rindbee
Copy link
Contributor Author

Rindbee commented Oct 23, 2023

When Editable Children is enabled, due to copying nodes or specifying the same resource instance for different nodes in batches, the same resource entries will be recorded when saving. When opened again, resources with local_to_scene enabled should be loaded as different instances for different sub-scenes. See #64487 (comment).

demo.zip

A test project is provided here. Before opening the scene, please check the text of test*.tscn. Nodes in different scenes may have the same resource records. These same resource records should be loaded as different instances for different sub-scenes.

0.mp4

@Rindbee Rindbee force-pushed the supplement-scene-instantiation-for-editable-children branch from 216ec91 to f7d0c23 Compare October 23, 2023 05:23
@Rindbee
Copy link
Contributor Author

Rindbee commented Oct 23, 2023

In the case in #81530 (comment), there may be multiple resource instances with the same scene_unique_id, I'm not sure if they need to be deduplicated like in resource_format_binary and resource_format_text.

@Rindbee Rindbee force-pushed the supplement-scene-instantiation-for-editable-children branch from f7d0c23 to 439317f Compare October 23, 2023 06:30
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't say I fully understand the code changes, but it does fix a bug. I'm not familiar enough with using editable children/local to scene to tell if there are any obvious regressions.

@akien-mga
Copy link
Member

PackedScene changes at this stage seem risky (4.2 RC imminent), so moving to the next milestone.

@akien-mga akien-mga modified the milestones: 4.2, 4.3 Nov 12, 2023
@KoBeWi KoBeWi modified the milestones: 4.3, 4.4 Aug 3, 2024
@Repiteo Repiteo modified the milestones: 4.4, 4.5 Feb 24, 2025
@Repiteo Repiteo modified the milestones: 4.5, 4.6 Sep 8, 2025
@Repiteo Repiteo modified the milestones: 4.6, 4.x Nov 19, 2025
@Rindbee Rindbee force-pushed the supplement-scene-instantiation-for-editable-children branch 3 times, most recently from 6692acc to a037a67 Compare November 24, 2025 06:37
This is a follow-up to godotengine#65011.

For scenes with **Editable Children** enabled, the main scene will record
more information and resource mapping will be valid for multiple nodes.
@Rindbee Rindbee force-pushed the supplement-scene-instantiation-for-editable-children branch from a037a67 to 1b4f116 Compare November 29, 2025 00:25
@Repiteo Repiteo merged commit 1b4f116 into godotengine:master Dec 2, 2025
20 checks passed
@Rindbee Rindbee deleted the supplement-scene-instantiation-for-editable-children branch December 2, 2025 23:25
@akien-mga akien-mga modified the milestones: 4.x, 4.6 Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

X Tutup