Contents

USDPreviewSession

A session that enables you to present the contents of a Universal Scene Description (USD) stage.

Declaration

final class USDPreviewSession

Mentioned in

Overview

To create a USDPreviewSession, initialize one with a USDStage from USDKit:

let observer = ConnectedSpatialEndpointObserver()

let session = USDPreviewSession(stage: usdStage)

// Wait for a device to become available.
let endpoint = try await observer.endpoint

try await session.start(endpoint: endpoint)

After start(endpoint:parameters:viewerOptions:) returns, the session’s state transitions to SpatialPreviewSessionState.connected and the device starts loading the USD content. Then use USDKit to make edits to the USDStage to update the content. Changes on visionOS are automatically synchronized back to USDKit in your macOS app.

Topics

Structures

Initializers

Instance Properties

Instance Methods

Enumerations

See Also

Preview sessions