parse method

  1. @override
dynamic parse(
  1. dynamic json, [
  2. String? path,
  3. Function? onLoad,
  4. Function? onError,
])
override

Implementation

@override
parse(json, [String? path, Function? onLoad, Function? onError]) {
  if (isFbxFormatBinary(json)) {
    fbxTree = BinaryParser().parse(json);
  } else {
    var fBXText = convertArrayBufferToString(json);

    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 );

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

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