-
-
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
Enforce custom nodes to keep their original type #91341
Conversation
0811a61
to
76f2ce2
Compare
You could try using |
f6fd549
to
ddabc7d
Compare
I haven't found a nice way around the PackedScene changes yet. As I see it, |
In Object. Although they are part of GDClass, so not sure if it's possible. In worst case you can put some duplicate code in Node and Resource. |
I was trying to avoid changes to
|
Thanks for rebasing! @KoBeWi @AThousandShips Does this still look good to merge to you after a few months? |
So I decided to give it a last try by testing with my project and there is a critical bug 💀 If you instantiate a scene, the value of |
Hi @KoBeWi, let me look into it. Can you give me minimal steps to reproduce this issue? |
|
03a84f3
to
52e12e3
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.
Now it works correctly.
I still think it's a nice feature. It improves usability of custom Nodes, though the drawback is that every newly created custom node has an additional metadata property for the base script.
It's safe to merge, because it can be reverted at any time without breaking compatibility. It's only relevant to editor.
Enforce that custom nodes and resources created via the "Create New Node" dialog, should permanently retain their original type (script). This means: - Type continuity: It should be impossible for the user to (accidentally) clear the original script of a custom node that was created via the "Create New Node" dialog. - Extensibility: The user should be able to extend custom types as usual (create a script that inherits the original type and replace the original script of that node with his own). However, if he then clears his extension-script from that node later on, the custom type should revert to its original script instead of becoming a non-scripted type.
Thanks, and congratulations on your first contribution! 🎉 |
Replaces PR #82684 with a move away from Core/Object in favor of
Scene/Main/Nodemetadata usage.Closes godotengine/godot-proposals#7905
Closes #37479