---
title: MDLAsset
framework: modelio
role: symbol
role_heading: Class
path: modelio/mdlasset
---

# MDLAsset

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

## Declaration

```swift
class MDLAsset
```

## Overview

Overview You create a 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, the 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 property. An asset may contain timed information, such as a series of mesh morphs. In such cases, the asset’s frameInterval property is nonzero and the startTime and 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:) and 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(_:)](modelio/mdlasset/canimportfileextension(_:).md)
- [init(url:)](modelio/mdlasset/init(url:)-1f4ym.md)
- [init(bufferAllocator:)](modelio/mdlasset/init(bufferallocator:).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)

### Exporting an Asset

- [canExportFileExtension(_:)](modelio/mdlasset/canexportfileextension(_:).md)
- [export(to:)](modelio/mdlasset/export(to:).md)

### Working with Asset Content

- [object(at:)](modelio/mdlasset/object(at:).md)
- [subscript(_:)](modelio/mdlasset/subscript(_:).md)
- [count](modelio/mdlasset/count.md)
- [childObjects(of:)](modelio/mdlasset/childobjects(of:).md)
- [add(_:)](modelio/mdlasset/add(_:).md)
- [remove(_:)](modelio/mdlasset/remove(_:).md)
- [boundingBox](modelio/mdlasset/boundingbox.md)
- [boundingBox(atTime:)](modelio/mdlasset/boundingbox(attime:).md)
- [url](modelio/mdlasset/url.md)
- [bufferAllocator](modelio/mdlasset/bufferallocator.md)
- [vertexDescriptor](modelio/mdlasset/vertexdescriptor.md)
- [masters](modelio/mdlasset/masters.md)

### Working with Timed Information

- [frameInterval](modelio/mdlasset/frameinterval.md)
- [startTime](modelio/mdlasset/starttime.md)
- [endTime](modelio/mdlasset/endtime.md)

### Working with Lights

- [placeLightProbes(withDensity:heuristic:using:)](modelio/mdlasset/placelightprobes(withdensity:heuristic:using:).md)
- [MDLProbePlacement](modelio/mdlprobeplacement.md)

### Constants

- [Asset File Types](modelio/asset-file-types.md)

### Initializers

- [init(URL:)](modelio/mdlasset/init(url:)-21tmw.md)
- [init(URL:vertexDescriptor:bufferAllocator:)](modelio/mdlasset/init(url:vertexdescriptor:bufferallocator:)-4rokm.md)
- [init(URL:vertexDescriptor:bufferAllocator:preserveTopology:error:)](modelio/mdlasset/init(url:vertexdescriptor:bufferallocator:preservetopology:error:)-7bivy.md)

### Instance Properties

- [animations](modelio/mdlasset/animations.md)
- [originals](modelio/mdlasset/originals.md)
- [resolver](modelio/mdlasset/resolver.md)
- [upAxis](modelio/mdlasset/upaxis.md)

### Instance Methods

- [loadTextures()](modelio/mdlasset/loadtextures().md)
- [object(atPath:)](modelio/mdlasset/object(atpath:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSFastEnumeration](foundation/nsfastenumeration.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### 3D Asset Basics

- [MDLObject](modelio/mdlobject.md)
- [MDLTransform](modelio/mdltransform.md)
- [MDLMesh](modelio/mdlmesh.md)
- [MDLSubmesh](modelio/mdlsubmesh.md)
- [MDLSubmeshTopology](modelio/mdlsubmeshtopology.md)
- [MDLNamed](modelio/mdlnamed.md)
