Threepipe gltf-transform Plugins
    Preparing search index...

    Class GLTFDracoExporterBase

    GLTF Draco Exporter Base

    Extension of GLTFExporter2 that runs the output through gltf-transform for draco compression. Takes a PlatformIO instance as a constructor parameter, allowing use with both WebIO (browser) and NodeIO (Node.js).

    Hierarchy (View Summary)

    Implements

    • IExportWriter
    Index

    Constructors

    Properties

    _io: PlatformIO
    loader?: DRACOLoader2
    processors: ((obj: any, options: GLTFExporter2Options) => Promise<any>)[] = []
    ExportExtensions: ((writer: GLTFWriter2) => GLTFExporterPlugin)[] = ...

    Methods

    • Generates a .gltf (JSON) or .glb (binary) output from the input (Scenes or Objects)

      Parameters

      • input: Object3D<Object3DEventMap> | Object3D<Object3DEventMap>[]

        Scenes or objects to export. Valid options:

        • Export scenes
          exporter.parse( scene1, ... )
          exporter.parse( [ scene1, scene2 ], ... )
        • Export objects (It will create a new Scene to hold all the objects)
          exporter.parse( object1, ... )
          exporter.parse( [ object1, object2 ], ... )
        • Mix scenes and objects (It will export the scenes as usual but it will create a new scene to hold all the single objects).
          exporter.parse( [ scene1, object1, object2, scene2 ], ... )
          
      • onDone: (gltf: ArrayBuffer | { [key: string]: any }) => void

        Will be called when the export completes. The argument will be the generated glTF JSON or binary ArrayBuffer.

      • onError: (error: ErrorEvent) => void

        Will be called if there are any errors during the gltf generation.

      • options: GLTFExporter2Options = {}

        Export options

      Returns void

    • Parameters

      • obj: any
      • __namedParameters: { compress: boolean; dracoOptions?: EncoderOptions } & GLTFExporter2Options
      • throwOnError: boolean = false

      Returns Promise<Blob>