-
-
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
fix: editor reset button share same reference between objects #36656
Conversation
You need to use |
I've fixed formatting issue and still it fails building. What am I doing wrong? |
CI failure seems not related to your PR. |
You can click failing builds to see the build logs and the errors: https://travis-ci.org/godotengine/godot/builds/656630454?utm_source=github_status&utm_medium=notification |
It is related to that PR, otherwise it would happen in the master branch too. The errors are likely due to the invalid addition to |
oh. I need to keep in mind. |
Hi, Thank you so much!! |
@kimjiy9607 the scenario here is if the reset button pressed for 2 (or more) path curves, they all will reset to the same resource (all have the same reference), which leads editing one curve reflect on the other, and here the "property" is a |
Needs a rebase to squash commits into one, and make the commit log a bit more explicit. |
a671455
to
c6f25f6
Compare
@akien-mga done rebase. ( btw it was my very first pr to godot ) |
To do so, Object gets a new virtual `object_duplicate` (`duplicate` already taken by incompatible implementations in derived classes) which is implemented in `Node` and `Resource`. This allows fixing godotengine#36372 properly in `ClassDB` by duplicating Objects that need it to avoid using the same one as default value. (So far it seems only Path2D/Path3D's `curve` property uses this.) Fixes godotengine#36372. Fixes godotengine#36650. Supersedes godotengine#36644 and godotengine#36656.
Superseded by #39479. I added you as co-author as in the end I mostly reused the same fix as you found, just higher up the call stack. |
Fixes godotengine#36372 as Path2D/Path3D's `curve` property no longer uses a Curve instance as default value, but instead it gets a (unique) default Curve instance when created through the editor (CreateDialog). ClassDB gets a sanity check to ensure that we don't do the same mistake for other properties in the future, but instead use the dedicated property usage hint. Fixes godotengine#36372. Fixes godotengine#36650. Supersedes godotengine#36644 and godotengine#36656. Co-authored-by: Thakee Nathees <thakeenathees@gmail.com> Co-authored-by: simpuid <utkarsh.email@yahoo.com>
when reset button at the Inspector dock pressed and if the default_value (at ClassDB::default_value) Type is OBJECT, not null -> the resource is Referenced by the property. It leads multiple nodes which have been resetted have the same reference, also After the reset button pressed first time ever the property has the reference of resetting resource -> so no more resets
Fix: #36372
Fix: #36650