2

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

  • Hi, did you find out what the problem is? I am using ng serve to serve gltf file and it does not load. I get the same message in the console core:propertyTypes:warn – Niraj Mar 10 '19 at 10:45

1 Answers1

4

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).

Don McCurdy
  • 10,975
  • 2
  • 37
  • 75
  • Thankyou Don for taking your time. I am using a localserver run through Meteor with all the assets placed in the "public" folder. I've also tried using the asset uploader both preloaded and inline and when I do the "asset not found"-problem vanishes. Though in that case I get errors related to the gltf-loader-component instead, but that might warrant another question. – Dennis Fyra Kullberg Mar 29 '17 at 09:01
  • Hi @DennisFyraKullberg– I'm not familiar with Meteor at all, sorry, but I assume you'd need to post details if it's part of the problem. It might be worth testing the snippet you gave somewhere like Codepen or Neocities, without Meteor, after uploading your files. Process of elimination to find the problem(s). :) – Don McCurdy Mar 30 '17 at 04:59