-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Auto-update properties when replacing a node #78300
Auto-update properties when replacing a node #78300
Conversation
fd53c83
to
ddd6b58
Compare
With this PR, changing the node type from Node2D to Node does nothing – the node remains a Node2D. Attempting to change from Node2D to Node3D prints:
While the latter case isn't expected to work, it should print an human-readable error message. PS: I removed the |
I can't reproduce locally. Did you check by removing the script because right now changing the type of a node that has a script feels like it is not working because icon does not change because the node still inherit the last type and the script now dictates the icon even without
I agree with you it should print a better error. I remember thinking about it but I didn't know what to do about it. I'm wondering maybe just removing the reference ? Edit : I was able to reproduce the error but then it disappeared. There is something strange on how it appears :(. |
ddd6b58
to
20efe03
Compare
20efe03
to
d0f1a62
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally (rebased on top of master
dcd187d), it works as expected. The node type changes correctly and the exported variable reference is kept.
Code looks good to me at a glance.
Update editor/scene_tree_dock.cpp Co-Authored-By: Hugo Locurcio <hugo.locurcio@hugo.pro>
9d4fda6
to
4da9927
Compare
Node
properties.
Thanks! |
Fixes #78299
The idea is to do something similar to what is done for auto updating
NodePath