Register editor classes normally, rather than via ClassDB::set_current_api()

This commit is contained in:
David Snopek
2025-03-13 15:03:36 -05:00
parent 701505eb4f
commit 393465ce92
6 changed files with 31 additions and 66 deletions

View File

@ -61,10 +61,6 @@ void initialize_fbx_module(ModuleInitializationLevel p_level) {
#ifdef TOOLS_ENABLED
if (p_level == MODULE_INITIALIZATION_LEVEL_EDITOR) {
// Editor-specific API.
ClassDB::APIType prev_api = ClassDB::get_current_api();
ClassDB::set_current_api(ClassDB::API_EDITOR);
GDREGISTER_CLASS(EditorSceneFormatImporterUFBX);
GLOBAL_DEF_RST_BASIC("filesystem/import/fbx2gltf/enabled", true);
@ -72,7 +68,6 @@ void initialize_fbx_module(ModuleInitializationLevel p_level) {
GLOBAL_DEF_RST("filesystem/import/fbx2gltf/enabled.android", false);
GLOBAL_DEF_RST("filesystem/import/fbx2gltf/enabled.web", false);
ClassDB::set_current_api(prev_api);
EditorNode::add_init_callback(_editor_init);
}
#endif // TOOLS_ENABLED