Merge pull request #106403 from Raftatul/import_script
Check if import script is subtype of EditorScenePostImport
This commit is contained in:
commit
433bb0d6a4
1 changed files with 2 additions and 0 deletions
|
|
@ -3205,6 +3205,8 @@ Error ResourceImporterScene::import(ResourceUID::ID p_source_id, const String &p
|
|||
Ref<Script> scr = ResourceLoader::load(post_import_script_path);
|
||||
if (scr.is_null()) {
|
||||
EditorNode::add_io_error(TTR("Couldn't load post-import script:") + " " + post_import_script_path);
|
||||
} else if (scr->get_instance_base_type() != "EditorScenePostImport") {
|
||||
EditorNode::add_io_error(TTR("Script is not a subtype of EditorScenePostImport:") + " " + post_import_script_path);
|
||||
} else {
|
||||
post_import_script.instantiate();
|
||||
post_import_script->set_script(scr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue