Taos API Reference
    Preparing search index...

    Interface GltfModel

    interface GltfModel {
        meshes: GltfMeshData[];
        skin: Skeleton | null;
        skins: Skeleton[];
        clips: AnimationClip[];
        bounds: GltfBounds;
        nodes: GltfNodeInfo[];
        roots: number[];
        nodeOrder: Int32Array;
        meshInstances: GltfMeshInstance[];
        meshWeights: (number[] | undefined)[];
        lights: GltfLight[];
        materials: (Material | null)[];
        variants: string[];
        activeVariant: number;
        setVariant: (variant: string | number | null) => void;
        destroy: () => void;
    }
    Index

    Properties

    meshes: GltfMeshData[]
    skin: Skeleton | null

    First skin (= skins[0]), or null. Back-compat alias for single-skin callers.

    skins: Skeleton[]

    Every skin in the file, in glTF order (empty when the model is unskinned).

    clips: AnimationClip[]
    bounds: GltfBounds

    Object-space bounding sphere over all meshes (bind pose).

    nodes: GltfNodeInfo[]

    Full node graph (defaults resolved); index matches glTF node index.

    roots: number[]

    Root node indices (the active scene's nodes, or all parentless nodes).

    nodeOrder: Int32Array

    Node indices in parents-before-children order, for a flat world-matrix solve.

    meshInstances: GltfMeshInstance[]

    Mesh-bearing nodes paired with their GltfModel.meshes range.

    meshWeights: (number[] | undefined)[]

    Default morph weights per glTF mesh index (undefined when the mesh has none).

    lights: GltfLight[]

    KHR_lights_punctual light definitions, indexed by GltfNodeInfo.light. Empty when the model defines no lights.

    materials: (Material | null)[]

    Engine material per glTF material index (null for unused indices). One shared instance per glTF material — the target of KHR_animation_pointer channels.

    variants: string[]

    KHR_materials_variants: the ordered variant names, or empty when the model defines none. Pass a name or its index to GltfModel.setVariant.

    activeVariant: number

    Index of the active variant (into GltfModel.variants), or -1 for the model's default materials. Set by GltfModel.setVariant.

    setVariant: (variant: string | number | null) => void

    KHR_materials_variants: selects which material variant each primitive renders with, by reassigning every GltfMeshData.material (so consumers that read material per frame pick it up immediately). Pass a variant name, its index, or null/-1 to restore the model's default materials. Unknown names / out-of-range indices reset to the default. No-op when the model defines no variants.

    destroy: () => void

    Releases all GPU buffers and textures created by the loader.