@@ -256,6 +256,10 @@ Error EditorExportPlatform::_save_pack_file(void *p_userdata, const String &p_pa
256256 PackData *pd = (PackData *)p_userdata;
257257
258258 String simplified_path = p_path.simplify_path ();
259+ if (simplified_path.begins_with (" uid://" )) {
260+ simplified_path = ResourceUID::uid_to_path (simplified_path).simplify_path ();
261+ print_verbose (vformat (R"( UID referenced exported file name "%s" was replaced with "%s".)" , p_path, simplified_path));
262+ }
259263
260264 SavedData sd;
261265 sd.path_utf8 = simplified_path.trim_prefix (" res://" ).utf8 ();
@@ -350,7 +354,13 @@ Error EditorExportPlatform::_save_pack_patch_file(void *p_userdata, const String
350354Error EditorExportPlatform::_save_zip_file (void *p_userdata, const String &p_path, const Vector<uint8_t > &p_data, int p_file, int p_total, const Vector<String> &p_enc_in_filters, const Vector<String> &p_enc_ex_filters, const Vector<uint8_t > &p_key, uint64_t p_seed) {
351355 ERR_FAIL_COND_V_MSG (p_total < 1 , ERR_PARAMETER_RANGE_ERROR, " Must select at least one file to export." );
352356
353- String path = p_path.replace_first (" res://" , " " );
357+ String path = p_path.simplify_path ();
358+ if (path.begins_with (" uid://" )) {
359+ path = ResourceUID::uid_to_path (path).simplify_path ();
360+ print_verbose (vformat (R"( UID referenced exported file name "%s" was replaced with "%s".)" , p_path, path));
361+ }
362+
363+ path = path.replace_first (" res://" , " " );
354364
355365 ZipData *zd = (ZipData *)p_userdata;
356366
@@ -1014,7 +1024,13 @@ Error EditorExportPlatform::_script_save_file(void *p_userdata, const String &p_
10141024 Callable cb = ((ScriptCallbackData *)p_userdata)->file_cb ;
10151025 ERR_FAIL_COND_V (!cb.is_valid (), FAILED);
10161026
1017- Variant path = p_path;
1027+ String simplified_path = p_path.simplify_path ();
1028+ if (simplified_path.begins_with (" uid://" )) {
1029+ simplified_path = ResourceUID::uid_to_path (simplified_path).simplify_path ();
1030+ print_verbose (vformat (R"( UID referenced exported file name "%s" was replaced with "%s".)" , p_path, simplified_path));
1031+ }
1032+
1033+ Variant path = simplified_path;
10181034 Variant data = p_data;
10191035 Variant file = p_file;
10201036 Variant total = p_total;
0 commit comments