@@ -255,6 +255,10 @@ Error EditorExportPlatform::_save_pack_file(void *p_userdata, const String &p_pa
255255 PackData *pd = (PackData *)p_userdata;
256256
257257 String simplified_path = p_path.simplify_path ();
258+ if (simplified_path.begins_with (" uid://" )) {
259+ simplified_path = ResourceUID::uid_to_path (simplified_path).simplify_path ();
260+ print_verbose (vformat (R"( UID referenced exported file name "%s" was replaced with "%s".)" , p_path, simplified_path));
261+ }
258262
259263 SavedData sd;
260264 sd.path_utf8 = simplified_path.trim_prefix (" res://" ).utf8 ();
@@ -349,7 +353,13 @@ Error EditorExportPlatform::_save_pack_patch_file(void *p_userdata, const String
349353Error 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) {
350354 ERR_FAIL_COND_V_MSG (p_total < 1 , ERR_PARAMETER_RANGE_ERROR, " Must select at least one file to export." );
351355
352- String path = p_path.replace_first (" res://" , " " );
356+ String path = p_path.simplify_path ();
357+ if (path.begins_with (" uid://" )) {
358+ path = ResourceUID::uid_to_path (path).simplify_path ();
359+ print_verbose (vformat (R"( UID referenced exported file name "%s" was replaced with "%s".)" , p_path, path));
360+ }
361+
362+ path = path.replace_first (" res://" , " " );
353363
354364 ZipData *zd = (ZipData *)p_userdata;
355365
@@ -1013,7 +1023,13 @@ Error EditorExportPlatform::_script_save_file(void *p_userdata, const String &p_
10131023 Callable cb = ((ScriptCallbackData *)p_userdata)->file_cb ;
10141024 ERR_FAIL_COND_V (!cb.is_valid (), FAILED);
10151025
1016- Variant path = p_path;
1026+ String simplified_path = p_path.simplify_path ();
1027+ if (simplified_path.begins_with (" uid://" )) {
1028+ simplified_path = ResourceUID::uid_to_path (simplified_path).simplify_path ();
1029+ print_verbose (vformat (R"( UID referenced exported file name "%s" was replaced with "%s".)" , p_path, simplified_path));
1030+ }
1031+
1032+ Variant path = simplified_path;
10171033 Variant data = p_data;
10181034 Variant file = p_file;
10191035 Variant total = p_total;
0 commit comments