Skip to content
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 still cannot be used as an editor plugin #86035

Open
andreymal opened this issue Dec 11, 2023 · 1 comment

Comments

@andreymal
Copy link

Tested versions

4.2.1.rc1

System information

Linux

Issue description

This is a direct continuation of #85268, see that issue for context.

Although #85268 is technically fixed, something else prevents such inheritance from being implemented:

class MyEditorPluginBase : public EditorPlugin {
    GDCLASS(MyEditorPluginBase, EditorPlugin)
// ...
};
@tool
class_name MyEditorPlugin
extends MyEditorPluginBase

When trying to use this class as an editor plugin, Godot prints an error:

ERROR: Script inherits from native type 'MyEditorPluginBase', so it can't be assigned to an object of type 'EditorPlugin'.
   at: instance_create (modules/gdscript/gdscript.cpp:390)

Steps to reproduce

  1. Make a GDExtension subclass of EditorPlugin (the programming language used doesn't matter)
  2. Make a GDScript subclass of that GDExtension class
  3. Try to use it as an editor plugin (create plugin.cfg, enable it in the project settings)

Minimal reproduction project (MRP)

As requested by @YuriSizov, I made a godot-cpp example to make it easier to reproduce this issue (but note that I'm not a C++ developer and blindly copied code from the documentation):

NativeEditorPluginTest.zip

See also #85268 for a godot-rust example

@Lord-of-Madness
Copy link

Same with subclasses for EditorScript. Same bug same steps to reproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants