---
title: "init(bufferAllocator:)"
framework: modelio
role: symbol
role_heading: Initializer
path: "modelio/mdlasset/init(bufferallocator:)"
---

# init(bufferAllocator:)

Initializes an empty asset, using the specified buffer allocator.

## Declaration

```swift
init(bufferAllocator: (any MDLMeshBufferAllocator)?)
```

## Parameters

- `bufferAllocator`: The allocator object to use for loading or creating mesh data associated with the asset, or nil to use a default allocator.

## Return Value

Return Value A new asset object.

## Discussion

Discussion Use this initializer when you want to programmatically populate an asset with content (for example, for use in exporting to a file) while controlling the allocation of mesh data buffers associated with the asset. For example, to use the MetalKit framework for loading vertex data into GPU buffers for rendering using Metal, pass a MTKMeshBufferAllocator object for the bufferAllocator parameter.

## See Also

### Creating an Asset

- [canImportFileExtension(_:)](modelio/mdlasset/canimportfileextension(_:).md)
- [init(url:)](modelio/mdlasset/init(url:)-1f4ym.md)
- [init(url:vertexDescriptor:bufferAllocator:)](modelio/mdlasset/init(url:vertexdescriptor:bufferallocator:)-1tchi.md)
- [init(url:vertexDescriptor:bufferAllocator:preserveTopology:error:)](modelio/mdlasset/init(url:vertexdescriptor:bufferallocator:preservetopology:error:)-510xi.md)
