import { type IMeshPrimitive, type INode, type IMaterial, type ITextureInfo, type IAccessor } from "babylonjs-gltf2interface"; import { type Node } from "@babylonjs/core/node.js"; import { type Nullable } from "@babylonjs/core/types.js"; import { type IDisposable } from "@babylonjs/core/scene.js"; import { type IGLTFExporterExtension } from "../glTFFileExporter.js"; import { type Material } from "@babylonjs/core/Materials/material.js"; import { type BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js"; import { type BufferManager } from "./bufferManager.js"; /** @internal */ export declare var __IGLTFExporterExtensionV2: number; /** * Interface for a glTF exporter extension * @internal */ export interface IGLTFExporterExtensionV2 extends IGLTFExporterExtension, IDisposable { /** * Define this method to get notified when a texture info is created * @param context The context when loading the asset * @param textureInfo The glTF texture info * @param babylonTexture The Babylon.js texture */ postExportTexture?(context: string, textureInfo: ITextureInfo, babylonTexture: BaseTexture): void; /** * Define this method to get notified when a primitive is created * @param primitive glTF mesh primitive * @param bufferManager Buffer manager * @param accessors List of glTF accessors */ postExportMeshPrimitive?(primitive: IMeshPrimitive, bufferManager: BufferManager, accessors: IAccessor[]): void; /** * Define this method to modify the default behavior when exporting a node * @param context The context when exporting the node * @param node glTF node * @param babylonNode BabylonJS node * @param nodeMap Current node mapping of babylon node to glTF node index. Useful for combining nodes together. * @param convertToRightHanded Flag indicating whether to convert values to right-handed * @param bufferManager Buffer manager * @returns nullable INode promise */ postExportNodeAsync?(context: string, node: INode, babylonNode: Node, nodeMap: Map, convertToRightHanded: boolean, bufferManager: BufferManager): Promise>; /** * Define this method to modify the default behavior when exporting a material * @param context The context when exporting the material * @param node glTF material * @param babylonMaterial BabylonJS material * @returns nullable IMaterial promise */ postExportMaterialAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise; /** * Define this method to return additional textures to export from a material * @param context The context when exporting the material * @param node glTF material * @param babylonMaterial BabylonJS material * @returns List of textures */ postExportMaterialAdditionalTexturesAsync?(context: string, node: IMaterial, babylonMaterial: Material): Promise; /** * Define this method to modify the glTF buffer data before it is finalized and written * @param bufferManager Buffer manager */ preGenerateBinaryAsync?(bufferManager: BufferManager): Promise; /** Gets a boolean indicating that this extension was used */ wasUsed: boolean; /** Gets a boolean indicating that this extension is required for the file to work */ required: boolean; /** * Called after the exporter state changes to EXPORTING */ onExporting?(): void; }