godotengine / godotengine/godot
Resource Local to Scene Flag causes Post Import script to convert Resource from External to Built-in
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
v4.3.stable.official [77dcf97d8]
### System information
Godot v4.3.stable - Ubuntu 24.04.1 LTS 24.04 - X11 - Vulkan (Forward+) - integrated AMD Radeon Graphics (RADV RENOIR) - AMD Ryzen 7 7730U with Radeon Graphics (16 Threads)
### Issue description
Setting the flag, local to scene, on an external resource will cause a post import script (EditorScenePostImport) that loads that resource to convert it from external to built-in for that scene. Expected resource to remain external until runtime which then a duplicate of the resource would be made for it's scene.
Expected:

Actual:

### Steps to reproduce
1. Unzip and open project
4. View `cube/cube.tscn` to confirm shared `Integrity` resource on meshes `Cube_Healthy` and `Cube_Damaged` loaded as external
5. Open `cube/cube_integrity.tres` and set `Local to Scene` to true
6. Reimport by opening `cube/cube.glb` and clicking button at bottom of import dialog
7. Review `cube/cube.tscn` to view shared `Integrity` resource on meshes is now a built-in rather then reference the external.
### Minimal reproduction project (MRP)
[load-external-resource-as-local.zip](https://github.com/user-attachments/files/17034633/load-external-resource-as-local.zip)
Contributor guide
Research direction
Open the attached minimal reproduction project and follow the reimport steps, focusing on cube/cube.tscn, cube/cube_integrity.tres, cube/cube.glb, and the EditorScenePostImport path. Compare the resource references before and after reimport; done means the Local to Scene resource remains external after the post-import script runs.
Written by the indexing model from the issue text.
Assessment
- Domain
- game-dev, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100