start(endpoint:parameters:viewerOptions:)
Connects to the specified endpoint and begins streaming the USD stage for spatial preview.
Declaration
nonisolated(nonsending) final func start(endpoint: SpatialPreviewEndpoint, parameters: USDPreviewSession.OptimizationParameters = .processed([.optimized, .compressed]), viewerOptions: USDPreviewSession.SpatialViewerOptions = .default) async throwsParameters
- endpoint:
The destination endpoint representing the device to connect to.
- parameters:
The optimization strategy to apply to the stage before transmission. Defaults to Processed(_:) with both
.optimizedand.compressedsteps enabled. - viewerOptions:
Interaction capabilities to enable in the remote viewer, such as export, annotations, and per-object manipulation. Defaults to Default.
Discussion
The session automatically optimizes and compresses the USDStage to ensure it runs well on visionOS. Pass USDPreviewSession.OptimizationParameters.unmodified to opt out of this feature. Disabling optimization may cause the session to throw USDPreviewSession.Error.assetUnshareable.