0

Im trying to load a aframe model using Angular, but on calling the .obj and .mtl, all I see is a blank screen. I also get a warning on console saying 'core:a-assets:warn Asset loading timed out in 3000 ms'. I also tried putting 'a-assets timeout="10000"; but I still get the same screen and error. Any help ?

<a-asset-item id="Obj" src="../assets/scene.obj"></a-
asset-item>
<a-asset-item id="Mat" src="../assets/scene.mtl"></a-
asset-item>
<a-mixin id="model" scale="5 5 5"></a-mixin>

<a-entity mixin="model" obj-model="obj: #Obj; mtl: #Mat"></a-
entity>
Yashank
  • 743
  • 2
  • 7
  • 23

1 Answers1

0

First of all check out if your references are fine. Or maybe Your .mtl references a texture that can't be found.

If it's ok, I'd recommend converting Your model to a .GLtf, .dae, or threejs .json. They are recommended by the a-frame team, obj/mtl with multiple texture may not be working at all.

I've been using these with angularJS/IO and there were no issues with them.

Piotr Adam Milewski
  • 14,150
  • 3
  • 21
  • 42
  • After this, I tried working with gltf, but still no luck. A blank screen with assets timeout.. I created my asset item and linked it to a object model entity. Any clue where Im going wrong? – Yashank Oct 21 '17 at 16:59
  • I am also getting `Uncaught TypeError: Cannot read property 'lastIndexOf' of null at inferResponseType (aframe-master.js:73645) at HTMLElement.value (aframe-master.js:73503) at HTMLElement.wrappedMethod (aframe-master.js:75135)` in my console. Sorry,super new to this (y) – Yashank Oct 21 '17 at 17:24
  • @YashankVarshney You have Your own server, or are you working on glitch.me ? I remeber someone having trouble with models on glitch: https://stackoverflow.com/questions/45051403/archilogic-gltf-model-cant-be-loaded-in-a-frame/45053066#45053066 – Piotr Adam Milewski Oct 23 '17 at 13:29
  • I have my stuff saved in the assets folder of my Angular project. Im doing ng serve so im guessing it is my own test server where the files are being held. It feels like the assets is timing out before loading my obj files. Same is with Gltf files. – Yashank Oct 24 '17 at 06:33
  • You have any other assets in that location that you use ? Or could you try with the object at the index.html directory ? sorry, i'm a bit out of ideas, so i'm back to the location issues :P – Piotr Adam Milewski Oct 24 '17 at 09:12
  • Lmao, thanks for the input tho.. Im going to try putting the object in my index.html. Think that might work, but still no clue about Angular. Will keep you posted! – Yashank Oct 25 '17 at 09:48
  • @YashankVarshney Did you find a solution to this problem? I have the same issue and posted a question here - https://stackoverflow.com/questions/55077356/aframe-angular-7-unable-to-load-gltf-model – Niraj Mar 10 '19 at 12:19