<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ModelIO",
  "identifier" : "/documentation/ModelIO/MDLAsset",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Model I/O"
    ],
    "preciseIdentifier" : "c:objc(cs)MDLAsset"
  },
  "title" : "MDLAsset"
}
-->

# MDLAsset

An indexed container for 3D objects and associated information, such as transform hierarchies, meshes, cameras, and lights.

```
class MDLAsset
```

## Overview

You create a [`MDLAsset`](/documentation/ModelIO/MDLAsset) object by loading data from a URL, and you can export an asset to any of several file formats. To access the objects contained in an asset, use [Fast Enumeration](https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/Enumeration.html#//apple_ref/doc/uid/TP40008195-CH17-SW3), the [`object(at:)`](/documentation/ModelIO/MDLAsset/object(at:)) method, or subscripting. Each object in an asset can be the root of a hierarchy of objects. To traverse that hierarchy, use an object’s [`children`](/documentation/ModelIO/MDLObject/children) property.

An asset may contain timed information, such as a series of mesh morphs. In such cases, the asset’s [`frameInterval`](/documentation/ModelIO/MDLAsset/frameInterval) property is nonzero and the [`startTime`](/documentation/ModelIO/MDLAsset/startTime) and [`endTime`](/documentation/ModelIO/MDLAsset/endTime) properties indicate the range of sample times available in the asset data. For objects contained in the asset, you can use methods such as [`localTransform(atTime:)`](/documentation/ModelIO/MDLTransformComponent/localTransform(atTime:)) and [`boundingBox(atTime:)`](/documentation/ModelIO/MDLObject/boundingBox(atTime:)) to access object properties at a specific time sample. Requesting a sample outside the time range clamps to the start or end sample. Some asset formats support continuous sampling with interpolation for times between the samples stored in the asset; other asset formats are discrete. For an asset with discrete time information, requesting a sample time that falls between the samples stored in the asset returns data for the immediately preceding time.

## Topics

### Creating an Asset

[`+  canImportFileExtension:`](/documentation/ModelIO/MDLAsset/canImportFileExtension(_:))

Returns a Boolean value that indicates whether the [`MDLAsset`](/documentation/ModelIO/MDLAsset) class can read asset data from files with the specified extension.

[`-  initWithURL:`](/documentation/ModelIO/MDLAsset/init(url:)-1f4ym)

Initializes an asset from the file at the specified URL.

[`-  initWithBufferAllocator:`](/documentation/ModelIO/MDLAsset/init(bufferAllocator:))

Initializes an empty asset, using the specified buffer allocator.

[`-  initWithURL:vertexDescriptor:bufferAllocator:`](/documentation/ModelIO/MDLAsset/init(url:vertexDescriptor:bufferAllocator:)-1tchi)

Initializes an asset from the file at the specified URL, using the specified vertex descriptor and buffer allocator.

[`-  initWithURL:vertexDescriptor:bufferAllocator:preserveTopology:error:`](/documentation/ModelIO/MDLAsset/init(url:vertexDescriptor:bufferAllocator:preserveTopology:error:)-510xi)

Initializes an asset from the file at the specified URL, using the specified options for allocating and transforming data during import.

### Exporting an Asset

[`+  canExportFileExtension:`](/documentation/ModelIO/MDLAsset/canExportFileExtension(_:))

Returns a Boolean value that indicates whether the [`MDLAsset`](/documentation/ModelIO/MDLAsset) class can write asset data as a file with the specified format extension.

[`-  exportAssetToURL:`](/documentation/ModelIO/MDLAsset/exportAssetToURL:)

Writes asset data to a file at the specified URL.

[`-  exportAssetToURL:error:`](/documentation/ModelIO/MDLAsset/export(to:))

Writes asset data to a file at the specified URL and reports errors that occur during export.

### Working with Asset Content

[`-  objectAtIndex:`](/documentation/ModelIO/MDLAsset/object(at:))

Returns the top-level object at the specified index in the asset.

[`-  objectAtIndexedSubscript:`](/documentation/ModelIO/MDLAsset/subscript(_:))

Returns the top-level object at the specified index in the asset, using subscript syntax.

[`count`](/documentation/ModelIO/MDLAsset/count)

The number of top-level objects in the asset.

[`-  childObjectsOfClass:`](/documentation/ModelIO/MDLAsset/childObjects(of:))

Returns all objects contained in the asset of the specified class.

[`-  addObject:`](/documentation/ModelIO/MDLAsset/add(_:))

Adds the specified object to the asset’s list of top-level objects.

[`-  removeObject:`](/documentation/ModelIO/MDLAsset/remove(_:))

Removes the specified object from the asset’s list of top-level objects.

[`boundingBox`](/documentation/ModelIO/MDLAsset/boundingBox)

The minimum region entirely enclosing the asset’s contents.

[`-  boundingBoxAtTime:`](/documentation/ModelIO/MDLAsset/boundingBox(atTime:))

Returns the minimum region entirely enclosing the asset’s contents at the specified time sample.

[`URL`](/documentation/ModelIO/MDLAsset/url)

The URL from which the asset was loaded, if available.

[`bufferAllocator`](/documentation/ModelIO/MDLAsset/bufferAllocator)

An object responsible for allocating mesh vertex data loaded from the asset.

[`vertexDescriptor`](/documentation/ModelIO/MDLAsset/vertexDescriptor)

The description of the vertex data format to be used for loading mesh data from the asset.

[`masters`](/documentation/ModelIO/MDLAsset/masters)

An array of objects that can be reused in the asset’s object hierarchy through instancing.

### Working with Timed Information

[`frameInterval`](/documentation/ModelIO/MDLAsset/frameInterval)

The time interval between data samples in the asset.

[`startTime`](/documentation/ModelIO/MDLAsset/startTime)

The timestamp for the first timed data sample in the asset.

[`endTime`](/documentation/ModelIO/MDLAsset/endTime)

The timestamp for the last timed data sample in the asset.

### Working with Lights

[`+  placeLightProbesWithDensity:heuristic:usingIrradianceDataSource:`](/documentation/ModelIO/MDLAsset/placeLightProbes(withDensity:heuristic:using:))

Automatically creates and places light probes for use in illuminating a scene.

[`MDLProbePlacement`](/documentation/ModelIO/MDLProbePlacement)

Options affecting automatic placement of light probes in a scene, used with the [`placeLightProbes(withDensity:heuristic:using:)`](/documentation/ModelIO/MDLAsset/placeLightProbes(withDensity:heuristic:using:)) method.

### Constants

[Asset File Types](/documentation/ModelIO/asset-file-types)

Uniform Type Identifiers for file formats supported by the Model I/O framework.

## Relationships

### Conforms To

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`NSFastEnumeration`](/documentation/Foundation/NSFastEnumeration)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)