Reputation: 728
I am working three.js in a javascript based mobile application. I am using .fbx file for 3D model. But its not supporting the binary format in FBXLoader. I don't know much about 3D models and formats. Any help would be appreciated.
Error in console: FBXLoader: !!! FBX Binary format not supported !!!
here is my loading fbx code:
var loader = new THREE.FBXLoader( manager );
// alert(loader);
loader.load( 'img/watcher.FBX', function( object ) {
alert(object);
object.traverse( function( child ) {
if ( child instanceof THREE.Mesh ) {
// pass
}
if ( child instanceof THREE.SkinnedMesh ) {
if ( child.geometry.animations !== undefined || child.geometry.morphAnimations !== undefined ) {
child.mixer = new THREE.AnimationMixer( child );
mixers.push( child.mixer );
var action = child.mixer.clipAction( child.geometry.animations[ 0 ] );
action.play();
}
}
} );
scene.add( object );
}, onProgress, onError );
Upvotes: 3
Views: 6876
Reputation: 2659
If you look at the header of the javascript file or https://github.com/yamahigashi/FBXLoaderJS' github repo, you can see it says: ASCII and version 7 format
/**
* @author yamahigashi https://github.com/yamahigashi
*
* This loader loads FBX file in *ASCII and version 7 format*.
*
* Support
* - mesh
* - skinning
* - normal / uv
*
* Not Support
* - material
* - texture
* - morph
*/
An alternative is to use glTF and the FBX converter to glTF, and use the glTF loader.
Note there is another issue with Binary FBX files, that may cause problem sometimes. In the 2016.0, a change was made to support large file (> 2Gb). This change only affects the binary FBX file format. Those cannot be read with older readers because the file pointers are not of the same size. But for the rest, the files are pretty much compatibles. For sure that does not affect the javascript loader here since I am mentioning this for people using the FBX SDK, but worth mentioning.
Upvotes: 1