Importer class which can import GLTF and VRM files. Supports multiple formats including glTF 1.0/2.0, GLB, VRM 0.x/1.0, and Draco compressed files.

Methods

  • Import GLTF or VRM from pre-loaded ArrayBuffers. Useful when you have already loaded the file data and want to avoid additional network requests.

    Parameters

    • files: GltfFileBuffers

      A map of file names to ArrayBuffers. File names should include extensions and match URIs used in the glTF

    • Optionaloptions: GltfLoadOption

      Optional loading configuration. If using the files option, keys must match the URIs of the ArrayBuffer values

    • Optionalcallback: RnPromiseCallback

      Optional callback function for progress tracking

    Returns Promise<Expression>

    A Promise that resolves to an Expression containing: - renderPasses[0]: model entities - renderPasses[1]: model outlines (if applicable)

    Will reject the promise if the files cannot be parsed or are in an unsupported format

  • Import GLTF or VRM file from a URL. Automatically detects the file format and uses the appropriate importer.

    Parameters

    • url: string

      The URL of the glTF/VRM file to import

    • Optionaloptions: GltfLoadOption

      Optional loading configuration. The files property is ignored for URL imports

    • Optionalcallback: RnPromiseCallback

      Optional callback function for progress tracking

    Returns Promise<Expression>

    A Promise that resolves to an Expression containing: - renderPasses[0]: model entities - renderPasses[1]: model outlines (if applicable)

    Will reject the promise if the file cannot be fetched or parsed