-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
A subclass of an GDExtension subclass of EditorPlugin cannot be used as an editor plugin #85268
Comments
Please provide a minimum project, there may be many different aspects of how you've set this up that might cause this |
@AThousandShips ok added |
Edit: Looks like a few places need to be updated. I'll make a PR. |
FYI, it is also possible to directly register an I don't know the API for how it's done from Rust, but in godot-cpp, you can have code like:
This will cause the editor plugin to be registered as soon as the GDExtension is loaded. There's probably a way to do this from Rust as well! |
@dsnopek I can't because of a godot-rust bug godot-rust/gdext#494 (which can't be painlessly fixed until godotengine/godot-proposals#2241 is implemented) |
There is another error in 4.2.1.rc1:
Should I create a separate issue about this? |
@andreymal It may be is just a continuation of this one, but feel free to open a new report. I would also appreciate if you could make an MRP that uses |
Godot version
4.1.3
System information
Linux
Issue description
I'm trying to make an editor plugin on Rust:
But due to some limitations, I still have to use GDScript for some specific things.
So I tried to make a subclass of this Rust class:
This would work if
MyEditorPluginBase
was a GDScript class, but since it's a GDExtension class in my case, it doesn't work:But it obviously IS EditorPlugin!
If I understand correctly, this behavior is caused by this function, which checks some mysterious "instance base type" instead of real inheritance:
godot/editor/editor_node.cpp
Lines 3456 to 3458 in fa4a653
godot/modules/gdscript/gdscript.cpp
Lines 260 to 263 in fa4a653
Since the documentation doesn't say that the script must be a direct subclass of EditorPlugin (and an indirect subclass works fine in GDScript), I interpret this behavior as a Godot bug.
Steps to reproduce
See above
Minimal reproduction project
gdext_editor_plugin_test.zip
The text was updated successfully, but these errors were encountered: