Initializes an empty asset, using the specified buffer allocator.
SDKs
- iOS 10.0+
- macOS 10.12+
- Mac Catalyst 13.0+
- tvOS 10.0+
Framework
- Model I/O
Declaration
init(bufferAllocator: MDLMesh Buffer Allocator?)
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
A new asset object.
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 MTKMesh
object for the buffer
parameter.