Converts a GLB-formatted Uint8Array to a JSONDocument.
Sets the Logger used by this I/O instance. Defaults to Logger.DEFAULT_INSTANCE.
Converts glTF-formatted JSON and a resource map to a Document.
Converts a GLB-formatted Uint8Array to a Document.
Loads a URI and returns a JSONDocument struct, without parsing.
Reads a Document from the given URI.
Registers extensions, enabling I/O class to read and write glTF assets requiring them.
Registers dependencies used (e.g. by extensions) in the I/O process.
Sets the vertex layout method used by this I/O instance. Defaults to VertexLayout.INTERLEAVED.
Converts a Document to glTF-formatted JSON and a resource map.
Converts a Document to a GLB-formatted Uint8Array.
Made by Don McCurdy. Documentation built with greendoc and published under Creative Commons Attribution 3.0.
I/O service for Deno.
The most common use of the I/O service is to read/write a Document with a given path. Methods are also available for converting in-memory representations of raw glTF files, both binary (Uint8Array) and JSON (JSONDocument).
NOTICE: Support for the Deno environment is currently experimental. See glTF-Transform#457.
Usage:
import { DenoIO } from 'https://esm.sh/@gltf-transform/core'; import * as path from 'https://deno.land/std/path/mod.ts'; const io = new DenoIO(path); // Read. let document; document = io.read('model.glb'); // → Document document = io.readBinary(glb); // Uint8Array → Document // Write. const glb = io.writeBinary(document); // Document → Uint8Array