parse method

dynamic parse(
  1. dynamic FBXBuffer, [
  2. String path = '',
  3. Function? onLoad,
  4. Function? onError,
])
override

Implementation

parse(FBXBuffer, [String path = '', Function? onLoad, Function? onError]) {
  if (isFbxFormatBinary(FBXBuffer)) {
    fbxTree = new BinaryParser().parse(FBXBuffer);
  } else {
    var FBXText = convertArrayBufferToString(FBXBuffer);

    if (!isFbxFormatASCII(FBXText)) {
      throw ('THREE.FBXLoader: Unknown format.');
    }

    if (getFbxVersion(FBXText) < 7000) {
      throw ('THREE.FBXLoader: FBX version not supported, FileVersion: ' +
          getFbxVersion(FBXText));
    }

    fbxTree = TextParser().parse(FBXText);
  }

  // console.log( fbxTree );

  TextureLoader textureLoader = TextureLoader(this.manager)
      .setPath(
          (this.resourcePath == '' || this.resourcePath == null) ? path : '')
      .setCrossOrigin(this.crossOrigin);

  return FBXTreeParser(textureLoader, this.manager, this.innerWidth, this.innerHeight).parse();
}