-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Add DUPLICATE_NODE_REFERENCES flag to duplicate Nodes and change references to the newly duplicate Nodes #81866
base: master
Are you sure you want to change the base?
Add DUPLICATE_NODE_REFERENCES flag to duplicate Nodes and change references to the newly duplicate Nodes #81866
Conversation
6907fd0
to
247acfd
Compare
321918f
to
3886359
Compare
3886359
to
70843fc
Compare
The idea of it being the default behavior of |
Aside, I wonder why |
I agree wholeheartedly. I would fix it, myself.
I was waiting to personally test it. I... actually do not know. This actually works without it, I just realised. It's just that it's almost functionally useless without the DUPLICATE_USE_INSTANTIATION or DUPLICATE_SCRIPTS flags, because any scripts the developer may have set are not carried over in any way. |
I want to also note. This was not a possible situation in 3.x because exporting Node properties was not possible (only NodePaths). |
I think the revised behavior would be clearly the right one. An explanation in the release notes should be enough. |
Closes #78060.
This PR adds a new flag to be used in
Node.duplicate()
called DUPLICATE_NODE_REFERENCES .When added to the method, the newly duplicated Node and its children will "correct themselves". All exported Node properties will point to their respective nodes in the hierarchy, instead of the nodes of the original instance.
Alternatively. quoting the newly added description for it:
I apologise for the sheer amount of amends this PR has suffered from.
Stuff is still up the air. Perhaps this shouldn't even be a new flag, and just the default behavior of DUPLICATE_USE_INSTANTIATION? It can remain to be discussed.
Sidenote, the DUPLICATE_USE_INSTANTIATION description is completely screwed up and entirely incorrect. See #68560.