Skip to content

Pbr GltfExtensionHandler: hashes to slashes#22943

Open
ChristopherBiscardi wants to merge 3 commits intobevyengine:mainfrom
ChristopherBiscardi:hash-to-slash
Open

Pbr GltfExtensionHandler: hashes to slashes#22943
ChristopherBiscardi wants to merge 3 commits intobevyengine:mainfrom
ChristopherBiscardi:hash-to-slash

Conversation

@ChristopherBiscardi
Copy link
Contributor

@ChristopherBiscardi ChristopherBiscardi commented Feb 13, 2026

Objective

The asset server doesn't handle paths with multiple # in them well, which leads to users trying to load the new-style standard material (post GltfMaterial/pbr inversion) like this:

let handle: Handle<StandardMaterial> = 
    asset_server.load("models/animated/Fox.glb#Material0#std");

and failing with

2026-02-13T18:39:46.765922Z ERROR bevy_asset::server: Could not find an asset loader matching: Loader Name: None; Asset Type: Some(TypeId(0x84f48d0a22ca9da8cd205decd68dcefa)); Extension: None; Path: Some("models/animated/Fox.glb#Material0#std");

Solution

On recommendation from @andriyDev , switching to use slashes fixes the pathing issue.

let handle: Handle<StandardMaterial> = 
    asset_server.load("models/animated/Fox.glb#Material0/std");

Testing

Used the gltf animated fox example to load a material as indicated above, and apply it to a 100x100x100 cube:

screenshot-2026-02-13-at-10 42 22@2x

The migration guide uses paths since so are the source of truth for the asset server, and there is currently no GltfAssetLabel for the new standard material handling. (This should be fixed also in a different PR).

@IceSentry IceSentry added A-Assets Load files from disk to use for things like images, models, and sounds C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Review Needs reviewer attention (from anyone!) to move forward A-glTF Related to the glTF 3D scene/model format labels Feb 13, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Assets Feb 13, 2026
@IceSentry IceSentry added the C-Bug An unexpected or incorrect behavior label Feb 13, 2026
Copy link
Contributor

@andriyDev andriyDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer we add a test that we can actually load this extra material, but I'll not block on that.

We should also change our asset loader stuff to ban these characters from asset labels, but that's a separate PR.

@IceSentry IceSentry added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Feb 13, 2026
@Zeophlite
Copy link
Contributor

Great catch, thankyou!

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 C-Bug An unexpected or incorrect behavior C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

4 participants