diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp index 7d3c7b5680b..a5a7ace2b13 100644 --- a/tools/editor/editor_import_export.cpp +++ b/tools/editor/editor_import_export.cpp @@ -810,9 +810,11 @@ Error EditorExportPlatform::export_project_files(EditorExportSaveFunction p_func Ref imd = memnew( ResourceImportMetadata ); //imd->set_editor(); + for (List::Element *F=atlas_images.front();F;F=F->next()) { imd->add_source(EditorImportPlugin::validate_source_path(F->get()),FileAccess::get_md5(F->get())); + } diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp index ea7242c185e..9029ef1c5e3 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp @@ -1217,21 +1217,30 @@ Error EditorTextureImportPlugin::import2(const String& p_path, const Ref::Element *E=source_map[i].front();E;E=E->next()) { - String apath = p_path.get_base_dir().plus_file(from->get_source_path(E->get()).get_file().basename()+".atex"); + String apath; + String spath = from->get_source_path(E->get()).get_file(); + + if (p_external) { + apath = p_path.get_base_dir().plus_file(spath.basename()+"."+from->get_source_path(E->get()).md5_text()+".atex"); + } else { + apath = p_path.get_base_dir().plus_file(spath.basename()+".atex"); + } Ref at; if (ResourceCache::has(apath)) { + at = Ref( ResourceCache::get(apath)->cast_to() ); } else { at = Ref( memnew( AtlasTexture ) ); + } at->set_region(region); at->set_margin(margin); at->set_path(apath); atlases[E->get()]=at; - print_line("Atlas Tex: "+apath); + } } if (ResourceCache::has(p_path)) {