You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(macOS) Godot Editor quickly forgets about GDExtension class functions when pointing to .framework in the .gdextension file, rather than to the binary directly
#96403
Open
Ivorforce opened this issue
Aug 31, 2024
· 2 comments
When defining a custom GDExtension class, and a static method on it, it is properly registered in the godot editor on first launch.
However, as soon as the game is run for the first time (edit: or sometimes when the window is switched), the editor forgets about the method (though notably, not about the class). This is apparent in the code editor, as well as the documentation page. When the project is reloaded, the methods are available again, until first run.
Notably, the functions can still be called, even though the editor complains:
--- Debugging process stopped ---
res://main.gd:6 - Parse Error: Static function "test_function()" not found in base "GDScriptNativeClass".
res://main.gd:6 - Parse Error: Static function "test_function()" not found in base "GDScriptNativeClass".
[...]
Ever since I updated the macos binaries to be .dylib suffix, the ingame editor is responsive again, and doesn't forget about the classes.
I have created a PR for the template to account for this problem (godotengine/godot-cpp-template#49). However, this PR still needs to stay open, because it's still a bug even if it has a workaround: If the file suffix is incorrect, the extension unloads in the editor (at least on macOS).
Ivorforce
changed the title
Godot Editor forgets about gdextension class' static method after first launch
(macOS) Godot Editor forgets about GDExtension class functions after first launch when pointing to .framework in the .gdextension file, rather than to the binary directly
Oct 4, 2024
Ivorforce
changed the title
(macOS) Godot Editor forgets about GDExtension class functions after first launch when pointing to .framework in the .gdextension file, rather than to the binary directly
(macOS) Godot Editor quickly forgets about GDExtension class functions when pointing to .framework in the .gdextension file, rather than to the binary directly
Oct 4, 2024
I cannot reproduce this bug with Godot 4.4-dev3 as well as custom built master branch. It's possible it's been fixed already, just not released in 4.3 yet?
Tested versions
Reproducible in Godot 4.3.
System information
Godot v4.3.stable - macOS 13.6.7 - Vulkan (Forward+) - dedicated AMD Radeon RX 6600 XT - 11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz (16 Threads)
Issue description
When defining a custom GDExtension class, and a static method on it, it is properly registered in the godot editor on first launch.
However, as soon as the game is run for the first time (edit: or sometimes when the window is switched), the editor forgets about the method (though notably, not about the class). This is apparent in the code editor, as well as the documentation page. When the project is reloaded, the methods are available again, until first run.
Notably, the functions can still be called, even though the editor complains:
Before starting the game:
After:
Comments
It is possible that this issue is only present in the cpp gdextension (https://github.com/godotengine/godot-cpp/tree/fbbf9ec4efd8f1055d00edb8d926eef8ba4c2cce). I did not test any others.
Steps to reproduce
godot::ClassDB::bind_static_method("GDExample", D_METHOD("example_function"), &GDExample::example_function);
Minimal reproduction project (MRP)
https://github.com/Ivorforce/gdextension-staticmethod-amnesia
The text was updated successfully, but these errors were encountered: