GltfImporter

Overview

GltfImporter reads a glTF (.gltf/.glb) file or binary buffer and reconstructs its scene graph as Aspose.3D for TypeScript objects including nodes, meshes, materials, and animations. It is invoked automatically by Scene.open() when the source file has the .gltf extension or when a GltfLoadOptions instance is provided explicitly. Pass GltfLoadOptions to control which node hierarchies are loaded, how materials are resolved, and whether animation tracks are included during import.

Description

GltfImporter is a class in the Aspose.3D FOSS library for TypeScript that exposes 2 methods and 2 properties for programmatic use. It extends Importer, inheriting shared functionality from its parent type.

Core capabilities include: : gltfdata; `: buffer ; creates a new instance of the gltf importer. These operations enable developers to integrate gltfimporter functionality directly into TypeScript applications.

The class also provides the json property (holds the parsed json structure of the gltf file as a gltfdata object), the binary property (contains the binary buffer of the gltf file, or null if no binary chunk exists).

Instances are created through a single constructor that initializes the object with default values.

Properties

NameTypeAccessDescription
json: GltfDataReadHolds the parsed JSON structure of the GLTF file as a GltfData object
binary: Buffer | nullReadContains the binary buffer of the GLTF file, or null if no binary chunk exists

Methods

SignatureDescription
constructor()Creates a new instance of the GLTF importer
supportsFormat(fileFormat: FileFormat)boolean
importScene(scene: Scene, stream: Buffer | Uint8Array, options: LoadOptions)Loads GLTF data from a Buffer/Uint8Array into the provided Scene using LoadOptions

See Also