diff options
| author | Juan Linietsky | 2017-07-23 18:48:05 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2017-07-23 18:50:25 -0300 |
| commit | 66009706c92671898b49a8a88cc626926b7a2d2c (patch) | |
| tree | 97aea718b2e6fbc413dcbd08beca1f59dee35504 /editor/editor_file_system.cpp | |
| parent | 380eae2cc0a7474ae46ed114ad6f12be35f40b90 (diff) | |
| download | godot-66009706c92671898b49a8a88cc626926b7a2d2c.tar.gz godot-66009706c92671898b49a8a88cc626926b7a2d2c.tar.zst godot-66009706c92671898b49a8a88cc626926b7a2d2c.zip | |
Diffstat (limited to 'editor/editor_file_system.cpp')
| -rw-r--r-- | editor/editor_file_system.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index f0f84416b..ed5811630 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1239,7 +1239,7 @@ void EditorFileSystem::_reimport_file(const String &p_file) { String importer_name; if (FileAccess::exists(p_file + ".import")) { - + //use existing Ref<ConfigFile> cf; cf.instance(); Error err = cf->load(p_file + ".import"); @@ -1254,6 +1254,7 @@ void EditorFileSystem::_reimport_file(const String &p_file) { } Ref<ResourceImporter> importer; + bool load_default = false; //find the importer if (importer_name != "") { importer = ResourceFormatImporter::get_singleton()->get_importer_by_name(importer_name); @@ -1262,6 +1263,7 @@ void EditorFileSystem::_reimport_file(const String &p_file) { if (importer.is_null()) { //not found by name, find by extension importer = ResourceFormatImporter::get_singleton()->get_importer_by_extension(p_file.get_extension()); + load_default = true; if (importer.is_null()) { ERR_PRINT("BUG: File queued for import, but can't be imported!"); ERR_FAIL(); @@ -1278,6 +1280,17 @@ void EditorFileSystem::_reimport_file(const String &p_file) { } } + if (load_default && ProjectSettings::get_singleton()->get("importer_defaults/" + importer->get_importer_name())) { + //use defaults if exist + Dictionary d = ProjectSettings::get_singleton()->get("importer_defaults/" + importer->get_importer_name()); + List<Variant> v; + d.get_key_list(&v); + + for (List<Variant>::Element *E = v.front(); E; E = E->next()) { + params[E->get()] = d[E->get()]; + } + } + //finally, perform import!! String base_path = ResourceFormatImporter::get_singleton()->get_import_base_path(p_file); |
