Skip to content

use scene names if they exist#22820

Open
ChristopherBiscardi wants to merge 1 commit intobevyengine:mainfrom
ChristopherBiscardi:scene-names
Open

use scene names if they exist#22820
ChristopherBiscardi wants to merge 1 commit intobevyengine:mainfrom
ChristopherBiscardi:scene-names

Conversation

@ChristopherBiscardi
Copy link
Contributor

Objective

glTF scenes often have names. Our loader code does not insert them. This results in tools like bevy_inspector_egui showing Entity on the scene's root entity instead of "MyPlayerScene" or whatever it was named in blender, etc.

Solution

Use names if they exist, otherwise use a default name based on the glTF index of the scene which mirrors other usage.

Testing

I loaded models/FlightHelmet/FlightHelmet.gltf and models/cube/cube.gltf into the 3d_scene example and wrote a small system to check for the existence of Name components. With this patch, the Scene and Scene0 names will log out (FlightHelmet doesn't have a name, so will print Scene0 while cube has a name, which is Scene without the index).

fn update(query: Query<&Name>) {
    for item in &query {
        dbg!(item);
    }
}

@ChristopherBiscardi ChristopherBiscardi added A-Assets Load files from disk to use for things like images, models, and sounds S-Needs-Review Needs reviewer attention (from anyone!) to move forward A-glTF Related to the glTF 3D scene/model format labels Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Assets Load files from disk to use for things like images, models, and sounds A-glTF Related to the glTF 3D scene/model format S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant