An object responsible for allocating mesh vertex data loaded from the asset.
- iOS 9.0+
- macOS 10.11+
- Mac Catalyst 13.0+
- tvOS 9.0+
You specify an allocator when loading an asset with the
initWithURL:vertexDescriptor:bufferAllocator: initializer. If you do not specify an allocator, or import an asset through other means, the
MDLAsset class uses an internal allocator object.
For example, to use the MetalKit framework for loading vertex data into GPU buffers for rendering with Metal, pass a
MTKMeshBufferAllocator object for the
bufferAllocator parameter. By specifying an allocator, you ensure that mesh data is copied a minimal number of times between being read from a file and being loaded into GPU memory for rendering.
Working with Asset Content
Returns the top-level object at the specified index in the asset.
The number of top-level objects in the asset.
Adds the specified object to the asset’s list of top-level objects.
Removes the specified object from the asset’s list of top-level objects.
The minimum region entirely enclosing the asset’s contents.
Returns the minimum region entirely enclosing the asset’s contents at the specified time sample.
The URL from which the asset was loaded, if available.
The description of the vertex data format to be used for loading mesh data from the asset.
An array of objects that can be reused in the asset's object hierarchy through instancing.