import { Node } from "babylonjs/node" ; import { Scene } from "babylonjs/scene" ; import { GLTFData } from "./glTFData" ; import { _Exporter } from "./glTFExporter" ; /**
 * Holds a collection of exporter options and parameters
 */ export interface IExportOptions { param node returns shouldExportNode ? ( node ) : boolean ; param metadata returns metadataSelector ? ( metadata ) : any ; /**
     * The sample rate to bake animation curves
     */ animationSampleRate ? : number ; /**
     * Begin serialization without waiting for the scene to be ready
     */ exportWithoutWaitingForScene ? : boolean ; /**
     * Indicates if unused vertex uv attributes should be included in export
     */ exportUnusedUVs ? : boolean ; /**
     * Indicates if coordinate system swapping root nodes should be included in export
     */ includeCoordinateSystemConversionNodes ? : boolean ; } /**
 * Class for generating glTF data from a Babylon scene.
 */ export class GLTF2Export { param scene param filePrefix param options returns public static GLTFAsync ( scene , filePrefix , options ? ) { return scene . whenReadyAsync ( ) . then ( ( ) => { const glTFPrefix = filePrefix . replace ( /\.[^/.]+$/ , "" ) ; const gltfGenerator = new _Exporter ( scene , options ) ; return gltfGenerator . _generateGLTFAsync ( glTFPrefix ) ; } ) ; } private static _PreExportAsync ( scene , options ? ) { return Promise . resolve ( ) . then ( ( ) => { if ( options && options . exportWithoutWaitingForScene ) { return Promise . resolve ( ) ; } else { return scene . whenReadyAsync ( ) ; } } ) ; } private static _PostExportAsync ( scene , glTFData , options ? ) { return Promise . resolve ( ) . then ( ( ) => { if ( options && options . exportWithoutWaitingForScene ) { return glTFData ; } else { return glTFData ; } } ) ; } param scene param filePrefix param options returns public static GLBAsync ( scene , filePrefix , options ? ) { return this . _PreExportAsync ( scene , options ) . then ( ( ) => { const glTFPrefix = filePrefix . replace ( /\.[^/.]+$/ , "" ) ; const gltfGenerator = new _Exporter ( scene , options ) ; return gltfGenerator . _generateGLBAsync ( glTFPrefix ) . then ( ( glTFData ) => { return this . _PostExportAsync ( scene , glTFData , options ) ; } ) ; } ) ; } }