godotengine / godotengine/godot

Resource Local to Scene Flag causes Post Import script to convert Resource from External to Built-in

Open
#97,127 3 comments 0 reactions 0 assignees View on GitHub
bug confirmed topic:import
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:
![expected](https://github.com/user-attachments/assets/6f3ec562-2343-4fb4-ad19-b54c54e93b75)

Actual:
![actual](https://github.com/user-attachments/assets/a1626d40-3b5b-48dc-a763-bb2324b0199f)

### 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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.