I’ve written a GDExtension that calculates and returns an Image. While I am able to call this from a script at runtime, when I try to call it from a script with a @tool annotation from within the editor, it fails with the errors like:
ERROR: Cannot call GDExtension method bind 'get_octaves' on placeholder instance.
ERROR: Cannot call GDExtension method bind 'generate_height_map' on placeholder instance
I would like to use this extension from within the editor so that I can preview the generated images. I thought by changing the initialization level that this might get around this, but I’m still not able to call these methods from inside a @tool script.
Is there any way to do this?
void initialize_example_module(ModuleInitializationLevel p_level) {
if (p_level != MODULE_INITIALIZATION_LEVEL_CORE) {
// if (p_level != MODULE_INITIALIZATION_LEVEL_EDITOR) {
// if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
return;
}
...
}