Repository: godotengine/godot (language: cpp)

Issue:
When you "Save to File" a mesh from a .glb, if UIDs are used the .import file becomes corrupted
### Tested versions

- Reproducible in: v4.4.dev5.official [9e6098432]

### System information

Godot v4.4.dev5 - Windows 10.0.22631 - Multi-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Laptop GPU (NVIDIA; 32.0.15.6614) - AMD Ryzen 5 5600H with Radeon Graphics (12 threads)

### Issue description

When you have a mesh with "Save to File" enabled from a .glb, if you reimport the .glb, causing the "save_to_file/path" in the import to switch to UID, the .import file becomes corrupted and you'll be unable to open the .glb import page.

These are the changes to the .import file that happen when you reimport:
![Image](https://github.com/user-attachments/assets/7564f661-483f-4162-8343-a8b683d8cbf1)


### Steps to reproduce

1. Import a .glb.
2. Open its import page and set one of its meshes to "Save to File". Set the path and save it to a new (.res) file.
3. Open the .glb's import page again. Notice that it opens.
4. In the .glb's import page, click into the "Save to File" path textbox and move your text cursor around a bit. Then reimport. What this did was switch the "save_to_file/path" in the .import file to UID, because for some reason when you do it the first time it'll save as a "res://" path.
5. Confirm that it's switched to UID by opening the .glb .import file in a text editor and checking that the "save_to_file/path" is now a UID.
6. Open the .glb's import page again. Notice that it does not open, and the .glb icon in the Godot FileSystem tab is now a red X.

### Minimal reproduction project (MRP)

[glb-export-mesh.zip](https://github.com/user-attachments/files/17878328/glb-export-mesh.zip)



Discussion / hints:
Forgot to mention: even if you revert the `path=`, `valid=false`, and `dest_files=` lines and only keep the UID in the .import file, the next time Godot touches that .import file it gets corrupted again anyway
Same as #101256

Fix patch:
diff --git a/editor/import/3d/resource_importer_scene.cpp b/editor/import/3d/resource_importer_scene.cpp
index 25ef0d3f0de7..db2a6d7dedc9 100644
--- a/editor/import/3d/resource_importer_scene.cpp
+++ b/editor/import/3d/resource_importer_scene.cpp
@@ -2877,8 +2877,7 @@ Error ResourceImporterScene::_check_resource_save_paths(const Dictionary &p_data
 		const Dictionary &settings = p_data[keys[i]];
 
 		if (bool(settings.get("save_to_file/enabled", false)) && settings.has("save_to_file/path")) {
-			const String &save_path = settings["save_to_file/path"];
-
+			const String save_path = ResourceUID::ensure_path(settings["save_to_file/path"]);
 			ERR_FAIL_COND_V(!save_path.is_empty() && !DirAccess::exists(save_path.get_base_dir()), ERR_FILE_BAD_PATH);
 		}
 	}


Test patch: