Bitbybit Docs
    Preparing search index...

    Class BabylonGltf

    Index

    Constructors

    animations

    • Gets the animation groups of a loaded glTF asset container.

      Parameters

      Returns AnimationGroup[]

      animation groups

      gltf animation groups

    • Lists the names of the animation groups of a loaded glTF asset container.

      Parameters

      Returns string[]

      names of the animation groups

      list animation groups

    • Starts playing an animation group of a loaded glTF asset.

      Parameters

      Returns void

      play animation group

    • Stops an animation group of a loaded glTF asset.

      Parameters

      Returns void

      stop animation group

    get

    • Gets the root transform node of a loaded glTF asset. Material variant operations require this node.

      Parameters

      Returns TransformNode

      root transform node

      gltf root node

    • Gets all meshes of a loaded glTF asset container.

      Parameters

      Returns AbstractMesh[]

      meshes

      gltf meshes

    load

    • Loads a glTF or glb file from a url into the scene and returns the asset container. The container keeps references to the meshes, materials, animation groups and the root node so that features like material variants keep working.

      Parameters

      Returns Promise<AssetContainer>

      Babylon asset container of the loaded gltf

      gltf container from url

    • Loads a glTF or glb file from an uploaded asset file into the scene and returns the asset container.

      Parameters

      Returns Promise<AssetContainer>

      Babylon asset container of the loaded glTF

      gltf container from file

    variants

    • Lists the names of the KHR_materials_variants material variants declared by a loaded glTF asset.

      Parameters

      Returns string[]

      names of available material variants

      list material variants

    • Activates a KHR_materials_variants material variant by name, swapping the materials of the asset accordingly.

      Parameters

      Returns void

      select material variant

    • Gets the currently selected KHR_materials_variants material variant of a loaded glTF asset.

      Parameters

      Returns string | string[]

      name of the selected material variant, or nothing if none is selected

      get selected material variant

    • Resets the materials of a loaded glTF asset back to the original KHR_materials_variants default.

      Parameters

      Returns void

      reset material variant