import "@babylonjs/loaders"; import type { Context } from "../../../context"; import * as BABYLON from "@babylonjs/core"; import * as Inputs from "../../../inputs"; /** * Advanced glTF/glb tooling on top of the basic import/export in io. It keeps the rich asset container * instead of collapsing everything into a single mesh, which unlocks KHR_materials_variants, animation * groups and other glTF level features that need the loaded asset graph. */ export declare class BabylonGltf { private readonly context; constructor(context: Context); /** * 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. * @param inputs asset file name and root url * @returns Babylon asset container of the loaded gltf * @group load * @shortname gltf container from url */ loadAssetContainerFromUrl(inputs: Inputs.Asset.AssetFileByUrlDto): Promise; /** * Loads a glTF or glb file from an uploaded asset file into the scene and returns the asset container. * @param inputs asset file * @returns Babylon asset container of the loaded glTF * @group load * @shortname gltf container from file */ loadAssetContainer(inputs: Inputs.Asset.AssetFileDto): Promise; /** * Gets the root transform node of a loaded glTF asset. Material variant operations require this node. * @param inputs asset container * @returns root transform node * @group get * @shortname gltf root node */ getRootNode(inputs: Inputs.BabylonGltf.AssetContainerDto): BABYLON.TransformNode; /** * Gets all meshes of a loaded glTF asset container. * @param inputs asset container * @returns meshes * @group get * @shortname gltf meshes */ getMeshes(inputs: Inputs.BabylonGltf.AssetContainerDto): BABYLON.AbstractMesh[]; /** * Lists the names of the KHR_materials_variants material variants declared by a loaded glTF asset. * @param inputs glTF root node * @returns names of available material variants * @group variants * @shortname list material variants */ listMaterialVariants(inputs: Inputs.BabylonGltf.GltfRootNodeDto): string[]; /** * Activates a KHR_materials_variants material variant by name, swapping the materials of the asset accordingly. * @param inputs glTF root node and variant name * @group variants * @shortname select material variant */ selectMaterialVariant(inputs: Inputs.BabylonGltf.SelectVariantDto): void; /** * Gets the currently selected KHR_materials_variants material variant of a loaded glTF asset. * @param inputs glTF root node * @returns name of the selected material variant, or nothing if none is selected * @group variants * @shortname get selected material variant */ getSelectedMaterialVariant(inputs: Inputs.BabylonGltf.GltfRootNodeDto): string | string[]; /** * Resets the materials of a loaded glTF asset back to the original KHR_materials_variants default. * @param inputs glTF root node * @group variants * @shortname reset material variant */ resetMaterialVariant(inputs: Inputs.BabylonGltf.GltfRootNodeDto): void; /** * Gets the animation groups of a loaded glTF asset container. * @param inputs asset container * @returns animation groups * @group animations * @shortname gltf animation groups */ getAnimationGroups(inputs: Inputs.BabylonGltf.AssetContainerDto): BABYLON.AnimationGroup[]; /** * Lists the names of the animation groups of a loaded glTF asset container. * @param inputs asset container * @returns names of the animation groups * @group animations * @shortname list animation groups */ listAnimationGroupNames(inputs: Inputs.BabylonGltf.AssetContainerDto): string[]; /** * Starts playing an animation group of a loaded glTF asset. * @param inputs animation group and playback options * @group animations * @shortname play animation group */ playAnimationGroup(inputs: Inputs.BabylonGltf.PlayAnimationGroupDto): void; /** * Stops an animation group of a loaded glTF asset. * @param inputs animation group * @group animations * @shortname stop animation group */ stopAnimationGroup(inputs: Inputs.BabylonGltf.AnimationGroupDto): void; private addContainer; }