提交 d011b958 编写于 作者: K Kyle-Larson

New Error Reporting:

- Checks for ASCII and Version are done in the parse method instead of the load method.
- Load will properly forward errors to passed in onError functions.
上级 ad482004
......@@ -59,23 +59,22 @@
this.fileLoader.load( url, function ( text ) {
if ( ! isFbxFormatASCII( text ) ) {
try {
console.error( 'FBXLoader: FBX Binary format not supported.' );
self.manager.itemError( url );
return;
var scene = self.parse( text, resourceDirectory );
onLoad( scene );
}
if ( getFbxVersion( text ) < 7000 ) {
} catch ( error ) {
console.error( 'FBXLoader: FBX version not supported for file at ' + url + ', FileVersion: ' + getFbxVersion( text ) );
self.manager.itemError( url );
return;
window.setTimeout( function () {
}
if ( onError ) onError( error );
var scene = self.parse( text, resourceDirectory );
onLoad( scene );
self.manager.itemError( url );
}, 0 );
}
}, onProgress, onError );
......@@ -93,6 +92,24 @@
var loader = this;
if ( ! isFbxFormatASCII( FBXText ) ) {
throw new Error( 'FBXLoader: FBX Binary format not supported.' );
self.manager.itemError( url );
return;
//TODO: Support Binary parsing. Hopefully in the future,
//we call var FBXTree = new BinaryParser().parse( FBXText );
}
if ( getFbxVersion( FBXText ) < 7000 ) {
throw new Error( 'FBXLoader: FBX version not supported for file at ' + url + ', FileVersion: ' + getFbxVersion( text ) );
self.manager.itemError( url );
return;
}
var FBXTree = new TextParser().parse( FBXText );
var connections = parseConnections( FBXTree );
......
......@@ -92,6 +92,9 @@
};
var onError = function( xhr ) {
console.error( xhr );
};
var loader = new THREE.FBXLoader( manager );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册