diff options
Diffstat (limited to 'editor/import')
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 16 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.h | 4 |
2 files changed, 14 insertions, 6 deletions
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 5d356604f4..22a11e11cb 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -2088,18 +2088,26 @@ ResourceImporterScene::ResourceImporterScene() { singleton = this; } -void ResourceImporterScene::add_importer(Ref<EditorSceneFormatImporter> p_importer) { +void ResourceImporterScene::add_importer(Ref<EditorSceneFormatImporter> p_importer, bool p_first_priority) { ERR_FAIL_COND(p_importer.is_null()); - importers.insert(0, p_importer); + if (p_first_priority) { + importers.insert(0, p_importer); + } else { + importers.push_back(p_importer); + } } void ResourceImporterScene::remove_post_importer_plugin(const Ref<EditorScenePostImportPlugin> &p_plugin) { post_importer_plugins.erase(p_plugin); } -void ResourceImporterScene::add_post_importer_plugin(const Ref<EditorScenePostImportPlugin> &p_plugin) { +void ResourceImporterScene::add_post_importer_plugin(const Ref<EditorScenePostImportPlugin> &p_plugin, bool p_first_priority) { ERR_FAIL_COND(p_plugin.is_null()); - post_importer_plugins.insert(0, p_plugin); + if (p_first_priority) { + post_importer_plugins.insert(0, p_plugin); + } else { + post_importer_plugins.push_back(p_plugin); + } } void ResourceImporterScene::remove_importer(Ref<EditorSceneFormatImporter> p_importer) { diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h index a3aeac4022..04fcc4268b 100644 --- a/editor/import/resource_importer_scene.h +++ b/editor/import/resource_importer_scene.h @@ -224,12 +224,12 @@ class ResourceImporterScene : public ResourceImporter { public: static ResourceImporterScene *get_singleton() { return singleton; } - void add_post_importer_plugin(const Ref<EditorScenePostImportPlugin> &p_plugin); + void add_post_importer_plugin(const Ref<EditorScenePostImportPlugin> &p_plugin, bool p_first_priority = false); void remove_post_importer_plugin(const Ref<EditorScenePostImportPlugin> &p_plugin); const Vector<Ref<EditorSceneFormatImporter>> &get_importers() const { return importers; } - void add_importer(Ref<EditorSceneFormatImporter> p_importer); + void add_importer(Ref<EditorSceneFormatImporter> p_importer, bool p_first_priority = false); void remove_importer(Ref<EditorSceneFormatImporter> p_importer); virtual String get_importer_name() const override; |