-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
Prevent some internal nodes being duplicated in Controls #88114
Conversation
I think #84824 fixes the same issue, no? |
It does not, I tried it with at least some cases, will confirm but that is for instanced nodes I believe Edit: It does not solve this issue |
#84824 solves the case when copying sub-scenes. The case here is the case of internal nodes in the same scene. Internal nodes are usually added when the parent node is initialized or under certain conditions. They can be treated as part of the parent node. Lines 2599 to 2607 in 94dbf69
- for (int i = 0; i < get_child_count(); i++) {
+ for (int i = 0; i < get_child_count(false); i++) { It may be better to directly exclude internal nodes when copying. |
Some internal nodes might not be automatically added though and might be data independent, unsure, but it'd also break compat to change it for internal nodes IMO as scripts may use it Note that if they're added in the constructor they are already automatically excluded |
Well, you are right, the script can manage the entire tree, possibly adding additional cases. |
2a82ef0
to
f0a8e3e
Compare
This is still relevant for 4.2 and would be best to get in first IMO, #89442 isn't necessarily cherry-pickable, but I can always retarget it for 4.2 |
f0a8e3e
to
48170ed
Compare
48b244a
to
a94151f
Compare
a94151f
to
d43896a
Compare
d43896a
to
9d4cf35
Compare
9d4cf35
to
6466cc5
Compare
Haven't looked for any new cases of this since this was opened, there might be some cases will try and search for them Edit: Seems at least all relevant cases of internal nodes being handled |
6466cc5
to
5dcab0e
Compare
Unsure about that case, there's no unhandled internal children there, and the |
Thanks! |
Thank you! |
Caused by duplication of on-demand created children, for example:
Will print:
This fixes these
There are probably some other potential cases but unsure how to apply each, but keeping these specific menu cases for now