godotengine / godotengine/godot

Metadata on scenes inherited from files gets erased when re-importing the file

Open
#100,757 0 comments 1 reaction 0 assignees View on GitHub
discussion topic:import
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

Tested on v4.3.stable, v4.4.dev7

### System information

macOS Sequoia (15.2.0) - Multi-window, 1 monitor - Metal (Forward+) - integrated Apple M4 Pro (Apple9) - Apple M4 Pro (14 threads)

### Issue description

When adding metadata to a scene that is inherited from an imported scene (i.e. from a `.glb` or a `.blend` file), the metadata is erased when re-importing the original file.

This warning sometimes prints when opening a project, which could be a hint here:

```
scene/resources/packed_scene.cpp:254 - Node './@StaticBody3D@44753' was modified from inside an instance, but it has vanished.
```

### Steps to reproduce

- Add a `.glb` file to your project
- This is also an issue with at least `.blend` files, which use the same pipeline as `.glb` files. I'm not sure if it's an issue with other file types.
- Create an inherited scene from that file
- Add metadata to a node somewhere in the inherited scene
- Re-import the file
- See that the metadata is erased

https://github.com/user-attachments/assets/6eda1d6e-9f47-445d-864d-5c36295c1107

This behavior should either be fixed, or the ability to add metadata to nodes in scenes that inherit from imported files should be disabled.

### Minimal reproduction project (MRP)

https://github.com/TranquilMarmot/godot-import-metadata-erase-bug

- Open project
- Open `cube.tscn` (this is an inherited scene from `cube.glb`)
- The first time opening the project, it will probably erase the metadata - give the imported `Cube` `MeshInstance3D` node some metadata (can be anything)
- Re-import `cube.glb`
- Check that the metadata in `cube.tscn` was erased

Contributor guide

Open the contributing guide

Research direction

Start with the linked MRP: open cube.tscn, inspect metadata on the imported Cube MeshInstance3D node, then re-import cube.glb. Read scene/resources/packed_scene.cpp around the reported warning and trace the inherited-scene reimport behavior. Done means metadata is preserved after re-import, or metadata editing on such nodes is prevented.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.