Explorar o código

Fixes the support of the 'keep on reimport' flag - Issue #20878.

Guillaume Laforte %!s(int64=6) %!d(string=hai) anos
pai
achega
d09ccf6f81
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      editor/import/resource_importer_scene.cpp

+ 3 - 3
editor/import/resource_importer_scene.cpp

@@ -972,7 +972,7 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String
 					} else {
 
 						ResourceSaver::save(ext_name, mat, ResourceSaver::FLAG_CHANGE_PATH);
-						p_materials[mat] = ResourceLoader::load(ext_name);
+						p_materials[mat] = ResourceLoader::load(ext_name, "", true); // disable loading from the cache.
 					}
 				}
 
@@ -1018,13 +1018,13 @@ void ResourceImporterScene::_make_external_resources(Node *p_node, const String
 
 									String ext_name = p_base_path.plus_file(_make_extname(mat->get_name()) + ".material");
 									;
-									if (FileAccess::exists(ext_name)) {
+									if (p_keep_materials && FileAccess::exists(ext_name)) {
 										//if exists, use it
 										p_materials[mat] = ResourceLoader::load(ext_name);
 									} else {
 
 										ResourceSaver::save(ext_name, mat, ResourceSaver::FLAG_CHANGE_PATH);
-										p_materials[mat] = ResourceLoader::load(ext_name);
+										p_materials[mat] = ResourceLoader::load(ext_name, "", true); // disable loading from the cache.
 									}
 								}