Search code examples
aframe

Implementation of A-Frame Extras FBX loader


Seeking an example of FBX loading within A-frame. Aframe Extras docs say that the FBX loader is experimental and only ASCII format is supported. Now I've exported the correct format yet I cannot view the file in my scene. Any ideas?

<a-entity fbx-model="src: url(https://mannymeadows.github.io/Noosa/models/FBX-DEMO.fbx);" material="color: red" crossorigin="anonymous">

Demo - http://codepen.io/MannyMeadows/pen/mmaLWv


Solution

  • You're using the fbx-model component correctly. In the JS console you'll see an error thrown from: THREE.FBXLoader.parseMesh:

    aframe-extras.min.js:1 Uncaught TypeError: Cannot use 'in' operator to search for '1926113552' in undefined
      at e.exports.THREE.FBXLoader.parseMesh (aframe-extras.min.js:1)
      at e.exports.THREE.FBXLoader.parseMeshes (aframe-extras.min.js:1)
      at e.exports.THREE.FBXLoader.parse (aframe-extras.min.js:1)
      at aframe-extras.min.js:1
      at XMLHttpRequest.<anonymous> (three.js:29211)
    

    To verify that your model is good, try opening it in FBX Review.

    If that works, THREE.FBXLoader just can't read the file for some reason. It's not uncommon unfortunately: FBX is a complex format, and isn't easy to support on the web. You can file a bug on three.js, but may ultimately want to convert to another format like OBJ or glTF.