Skip to content

Improve support for glTF → Model I/O conversion #67

@JaapWijnen

Description

@JaapWijnen

Hey there, I'm trying to load a .glb file through ModelIO I'm using the following code:

let assetURL = Bundle.main.url(forResource: path, withExtension: nil)!
let gltfAsset = try! GLTFAsset(url: assetURL)
let bufferAllocator = MTKMeshBufferAllocator(device: device)
let mdlAsset = MDLAsset(gltfAsset: gltfAsset, bufferAllocator: bufferAllocator)

The asset I'm trying to load is part of this pack: https://kenney.nl/assets/mini-dungeon (free to download) I'm specifically loading the banner asset in this example. Models > GLB Format > banner.glb

The loaded gltf asset seems to contain some data, the mdl asset seems to be empty. In the screenshot the upper part is some of the content of the gltf asset according to the Xcode debugger, the bottom part is the mdl asset.
Screenshot 2025-01-02 at 20 08 39

What could I be doing wrong here?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions