-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Ensure object metadata is unique #32416
Ensure object metadata is unique #32416
Conversation
I'd like to clarify how the issue happens and how this fixes it... In the issue, the user sets an item within this dictionary on an instance of a scene. So I realize the issue is that during instancing of the scene, |
Yes.
Arrays have always been set uncopied, and when dictionaries came around, they have been set uncopied to mimic this behavior. Duplicating all dictionaries and arrays would increase memory usage and slightly decrease instancing performance, even in cases where it is not needed. Duplicating only metadata sounds like a workaround put in the wrong place.
Things inside metadata have always been copied by reference, without deep-copying them. |
Some comments from IRC:
So good to go for now, but we really need to rethink the way we handle metadata for 4.0. |
Thanks! |
Closes #32415.
Bugsquad edit: Fixes #20648, fixes #29189.
Not sure if this is the best fix. An alternative one would be to have a boolean which is true if the metadata might be shared, and having
set_meta
duplicate the dictionary when needed.