Dennis Fyra Kullberg
Dennis Fyra Kullberg

Reputation: 21

A-frame - glTF - Asset not found

I'm trying to import a gltf-model into my scene, but even with correct paths and references the console claims the "core:propertyTypes:warn "#model" asset not found. +0ms". Tried with a gltf-model exported from Blender by me as well as a downloaded working model. I am not having this problem with any .obj-files in the scene. Any suggestions to what I could try to change?

<a-assets>
<a-asset-item id="monster" src="/monster.gltf"></a-asset-item>
<a-asset-item id="separaterunner" src="/separaterunner.gltf"></a-asset-item>
<item id="plane" src="/plane.glb"></item>
</a-assets>

<a-entity id="separaterunner" gltf-model="gltf: #separaterunner"></a-entity>
<a-entity id="plane" gltf-model="gltf: #plane"></a-entity>
<a-entity id="monster" gltf-model="#monster"></a-entity>

If I use the same code structure for .gltf-files as for .obj-files I no longer get the error about "asset not found" but instead an error about cross origin requests. Why is that for .gltf but not for .obj?

Thanks

Upvotes: 2

Views: 1964

Answers (1)

Don McCurdy
Don McCurdy

Reputation: 11960

There's a syntax error in how you're using the gltf-model component, in two of those examples: it should be gltf-model="#foo", not gltf-model="gltf: #foo". (OBJ/MTL files are a bit different because there are two files required).

If the assets are still not found after fixing that, you may need to include more information about where the models are in your working folder, and how you're starting the local server (if you're using one).

Upvotes: 4

Related Questions