# GltfExporter

Class · category: Exporter

Source: https://github.com/playcanvas/engine/blob/970d89f6d3bc6667f4e1f88153abd6e7e82ed52c/src/extras/exporters/gltf-exporter.js#L145

Implementation of the GLTF 2.0 format exporter.

## Methods

### build

```ts
build(entity: Entity, options?: object): Promise<ArrayBuffer>
```

Converts a hierarchy of entities to GLB format.

**Parameters**

- `entity` ([`Entity`](https://api.playcanvas.com/engine/classes/Entity.md)): The root of the entity hierarchy to convert.
- `options` (`object`, optional, default `{}`): Object for passing optional arguments.
    - `options.maxTextureSize` (`number`, optional): Maximum texture size. Texture is resized if over the size.
    - `options.stripUnusedAttributes` (`boolean`, optional): If true, removes unused vertex attributes:

      - Texture coordinates not referenced by materials
      - Vertex colors if not used by materials
      - Tangents if no normal maps are used
      - Skinning data if no skinned meshes exist

      Defaults to false.

**Returns** `Promise<ArrayBuffer>`: - The GLB file content.

## Inherited from CoreExporter

- `new GltfExporter()`
