Creates a new Document, representing an empty glTF asset.
Clones this Document, copying all resources within it.
Creates a new AnimationChannel. Channels must be attached to an Animation for use and export; they are not otherwise associated with a Root.
Creates a new AnimationSampler. Samplers must be attached to an Animation for use and export; they are not otherwise associated with a Root.
Creates a new PrimitiveTarget, or morph target. Targets must be attached to a Primitive for use and export; they are not otherwise associated with a Root.
Returns the Logger instance used for any operations performed on this document.
Returns the glTF Root property.
Merges the content of another Document into this one, without affecting the original.
Overrides the Logger instance used for any operations performed on this document.
doc .setLogger(new Logger(Logger.Verbosity.SILENT)) .transform(dedup(), weld());
Applies a series of modifications to this document. Each transformation is asynchronous, takes the Document as input, and returns nothing. Transforms are applied in the order given, which may affect the final result.
await doc.transform( dedup(), prune() );
Made by Don McCurdy • TypeDoc documentation • Copyright 2023, MIT license
Wraps a glTF asset and its resources for easier modification.
Documents manage glTF assets and the relationships among dependencies. The document wrapper allow tools to read and write changes without dealing with array indices or byte offsets, which would otherwise require careful management over the course of a file modification. An internal graph structure allows any property in the glTF file to maintain references to its dependencies, and makes it easy to determine where a particular property dependency is being used. For example, finding a list of materials that use a particular texture is as simple as calling Texture.listParents().
A new resource Property (e.g. a Mesh or Material) is created by calling 'create' methods on the document. Resources are destroyed by calling Property.dispose().