Contents

MDLAsset

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

Declaration

class MDLAsset

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

Exporting an Asset

Working with Asset Content

Working with Timed Information

Working with Lights

Constants

Initializers

Instance Properties

Instance Methods

See Also

3D Asset Basics