# ContainerHandler

Class · extends [`ResourceHandler`](https://api.playcanvas.com/engine/classes/ResourceHandler.md) · category: Asset

Source: https://github.com/playcanvas/engine/blob/970d89f6d3bc6667f4e1f88153abd6e7e82ed52c/src/framework/handlers/container.js#L206

Resource handler for the `container` asset type. Loads glTF and GLB files, whose meshes,
materials, textures, animations and Gaussian splats become one [ContainerResource](https://api.playcanvas.com/engine/classes/ContainerResource.md).

For glTF files, the asset options object can be used to pass load time callbacks for handling
the various resources at different stages of loading. The table below lists the resource types
and the corresponding supported process functions.

| resource   | preprocess | process | processAsync | postprocess |
| ---------- | :--------: | :-----: | :----------: | :---------: |
| global     |      √     |         |              |      √      |
| node       |      √     |    √    |              |      √      |
| light      |      √     |    √    |              |      √      |
| camera     |      √     |    √    |              |      √      |
| animation  |      √     |         |              |      √      |
| material   |      √     |    √    |              |      √      |
| image      |      √     |         |      √       |      √      |
| texture    |      √     |         |      √       |      √      |
| buffer     |      √     |         |      √       |      √      |
| bufferView |      √     |         |      √       |      √      |

Additional options that can be passed for glTF files:
[options.morphPreserveData] - When true, the morph target keeps its data passed using the options,
allowing the clone operation.
[options.morphPreferHighPrecision] - When true, high precision storage for morph targets should
be preferred. This is faster to create and allows higher precision, but takes more memory and
might be slower to render. Defaults to false.
[options.skipMeshes] - When true, the meshes and gaussian splats from the container are not
created. This can be useful if you only need access to textures or animations and similar.

For example, to receive a texture preprocess callback:

```javascript
const containerAsset = new Asset(filename, 'container', { url: url, filename: filename }, null, {
    texture: {
        preprocess: (gltfTexture) => {
            console.log("texture preprocess");
        }
    }
});
```

## Inherited from [ResourceHandler](https://api.playcanvas.com/engine/classes/ResourceHandler.md)

- `protected _app: AppBase`
- `handlerType: string = ''`
- `get app(): AppBase`
- `get maxRetries(): number` · `set maxRetries(value: number)`
- `get parsers(): ResourceParser[]`
- `addParser(parser: ResourceParser, decider?: any): void`
- `fetch(url: string | { load: string; original: string }, responseType: string, callback: ResourceHandlerCallback, asset?: Asset<string>): void`
- `load(url: string | { load: string; original: string }, callback: ResourceHandlerCallback, asset?: Asset<string>): void`
- `open(url: string, data: any, asset?: Asset<string>): any`
- `patch(asset: Asset<string>, assets: AssetRegistry): void`
- `removeParser(parser: ResourceParser): void`
