godot
godot copied to clipboard
Non-editable status is not preserved on custom types inheriting from other custom types
Godot version
4.0 beta 15
System information
Windows 10
Issue description
When you have a plugin with multiple custom types, and one of them inherits another, the second-level custom type's non-editable status is not preserved.
In this case we would expect both A and B to have protected types, but in this case B's type is not protected.
Steps to reproduce
Create a plugin. Create two scripts, one A is the base level script, and B to inherit from A. Create a new plugin, add both as custom types, making sure that B inherits from A. After enabling plugin and restarting the editor, instances of A will show as protected, whereas instances of B are free to be modified.
Minimal reproduction project
I think this is not a correct usage of add_custom_type(). As per documentation, the base you provide is the base node that will be instantiated and then it will get the script attached. Custom class is not a valid base type, because it's a script. The nodes will appear correctly if you use Node as base for both.
It seems like you are correct, it is supposed to be the base built-in node/resource. Perhaps documentation should to be changed to indicate this.
Fixed by #72413