-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
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
EditorExportPlugin raises error everytime you run the game with F5 because of "abstract native class" #73525
Comments
I've experienced a similar issue with a tool script using On running the project (F5), it gives 4.0 rc2, Win x64, Forward+ |
Can confirm that it happens in 4.0 rc3 as well. |
Still an issue with 4.0rc5. It looks like #70700 added that check, which happens while analyzing the gdscript, so I'm still experimenting, hoping I can find an easy fix or workaround... |
Ah: godot/core/object/class_db.cpp Lines 363 to 370 in 1d14c05
You can't instantiate any editor code while running. |
I don't know think the problem is not allowing editor or "abstract" code to run while the game is running. I think the problem is considering I mean, To customize any exports through plugins I need to:
The above will ALWAYS make problems with running the game, even though it is the required steps to make it work for filtering exports. This is what makes no sense to me and makes it impossible to use In 3.x I could just do the same steps above and run the game just fine. I think this is a regression #73525, and |
So I had looked at #74025 but I guess I didn't understood what it was doing, so I got confused by how it would fix the problem which led to the comment above. |
Right, it's registered as a normal full class: godot/editor/register_editor_types.cpp Line 133 in 2ec0da1
But the recently added gdscript analyzer check which tries to determine if a parent class is abstract, instead only checks if it can be instantiated right now. The fact that editor types can't be instantiated when running the project leads to the analyzer incorrectly interpreting them as being "abstract". |
Thanks a lot for explaining! |
Editor code is not instantiable outside of the editor (https://github.com/godotengine/godot/blob/1d14c054a12dacdc193b589e4afb0ef319ee2aae/core/object/class_db.cpp#L369). This is fine for editor plugins and the like, but the GDScript analyzer balks at it, causing F5 runs to fail: godotengine#73525. Instead, we really just want to know if the type is abstract - so add a new ClassDB method to check that and nothing else.
I have this problem too: static func create_open_file_dialog() -> ConfirmationDialog:
var d
if Engine.is_editor_hint():
d = EditorFileDialog.new()
d.file_mode = EditorFileDialog.FILE_MODE_OPEN_FILE
d.access = EditorFileDialog.ACCESS_RESOURCES
else:
d = FileDialog.new()
d.file_mode = FileDialog.FILE_MODE_OPEN_FILE
d.access = FileDialog.ACCESS_RESOURCES
d.resizable = true
return d I was using this in Godot 3 so I could test my plugin UIs with F5 like regular "game scenes", but now Godot 4 complains of the only presence of |
Meanwhile, a workaround: Casting the if Engine.is_editor_hint():
_exporter = (GitVersionInjector as Variant).new()
add_export_plugin(_exporter) Presumably this would also work with other classes that might have this issue. |
Ran into this issue extending EditorNode3DGizmoPlugin so can confirm it works with that too. |
EditorDebuggerPlugin seems to suffer the same issue and the same workaround |
@chrisb123 are you trying to run a scene of the plugin? Or just your game? (If the latter it doesn't make any sense) |
I'm using the example from the official documentation found here. I cant find any other information on using the editor debug plugin. I get the same error mentioned above and applying the fix found above does result in the debugger getting a custom debug plugin tab |
Oh sorry, I thought you were using the GDScript addon of the same name. |
So the issue here is that user scripts end up trying to access Editor-only classes at runtime? |
In my project, I'm not actually accessing the Editor-only classes during game runtime. However, my scripts are still loaded/parsed, and the compiler complains about it. The script code is never executed. At least, this is what I believe to be happening, based on the fact that casting the Editor-only class to a Variant fixes the compile error, and there are no further errors during runtime. |
If there is a chance to bring the fix in 4.3? From the documentation, it is not abstract. |
If you're able please test the linked PR to help it along: |
I had never built the Godot binary yet, I need first to setup my environment ... @AThousandShips I have setup my build env under windows uses master branch D:\development\workspace\godot>scoop list
Installed apps:
Name Version Source Updated Info
---- ------- ------ ------- ----
7zip 23.01 main 2024-02-10 09:28:27
dark 3.14 main 2024-07-03 06:42:42
gcc 13.2.0 main 2024-07-03 06:41:37
make 4.4.1 main 2024-07-03 06:41:39
mingw 13.2.0-rt_v11-rev1 main 2024-07-03 06:42:40
nodejs 21.6.1 main 2024-02-10 09:28:37
python 3.12.4 main 2024-07-03 06:43:07
scons 4.7.0 main 2024-07-03 06:43:09 when I run
Any ideas? |
Not familiar with that error, are you low on storage space? |
So after a lot of investigation, I find out it was a local firewall Comodo issue ... what the hell |
I build Godot rebased on master and run the example project The parse error |
@AThousandShips what would be the next steps to move forward here? |
This specific issue is then resolved by this, the remaining isn't a bug IMO, editor classes are editor only, that should be a proposal instead I'd say, but not relevant for this issue report |
fine, means this pr can be merged? |
Yes, please comment on it that it solves the problem for you to help it along, it's still waiting for a decision |
Editor code is not instantiable outside of the editor (https://github.com/godotengine/godot/blob/1d14c054a12dacdc193b589e4afb0ef319ee2aae/core/object/class_db.cpp#L369). This is fine for editor plugins and the like, but the GDScript analyzer balks at it, causing F5 runs to fail: godotengine#73525. Instead, we really just want to know if the type is abstract - so add a new ClassDB method to check that and nothing else. Update core/object/class_db.cpp Apply code review comments Co-Authored-By: Bryce <[email protected]>
Editor code is not instantiable outside of the editor (https://github.com/godotengine/godot/blob/1d14c054a12dacdc193b589e4afb0ef319ee2aae/core/object/class_db.cpp#L369). This is fine for editor plugins and the like, but the GDScript analyzer balks at it, causing F5 runs to fail: godotengine#73525. Instead, we really just want to know if the type is abstract - so add a new ClassDB method to check that and nothing else. Update core/object/class_db.cpp Apply code review comments Co-Authored-By: Bryce <[email protected]>
Editor code is not instantiable outside of the editor (https://github.com/godotengine/godot/blob/1d14c054a12dacdc193b589e4afb0ef319ee2aae/core/object/class_db.cpp#L369). This is fine for editor plugins and the like, but the GDScript analyzer balks at it, causing F5 runs to fail: godotengine#73525. Instead, we really just want to know if the type is abstract - so add a new ClassDB method to check that and nothing else. Update core/object/class_db.cpp Apply code review comments Co-Authored-By: Bryce <[email protected]>
Editor code is not instantiable outside of the editor (https://github.com/godotengine/godot/blob/1d14c054a12dacdc193b589e4afb0ef319ee2aae/core/object/class_db.cpp#L369). This is fine for editor plugins and the like, but the GDScript analyzer balks at it, causing F5 runs to fail: godotengine#73525. Instead, we really just want to know if the type is abstract - so add a new ClassDB method to check that and nothing else. Update core/object/class_db.cpp Apply code review comments Co-Authored-By: Bryce <[email protected]>
Godot version
4.0 rc2
System information
Manjaro Linux using i3, Foward+
Issue description
I've added an ExportPlugin to my addon and everytime I run the game in the editor I know get this error:
I even tried to guard it with an

Engine.is_editor_hint()
call but it doesn't work, I still get the same error even though line 54 shouldn't be executing:Weirdly enough, this guard works fine in other parts of the project, but fails here.
Steps to reproduce
Just create a script that extends
EditorExportPlugin
, and try to create an instance of it in anEditorPlugin
scriptMinimal reproduction project
See "Steps to Reproduce"
The text was updated successfully, but these errors were encountered: