Contents

PhotogrammetrySession.Output

Status updates on the object-creation process.

Declaration

enum Output

Mentioned in

Overview

RealityKit’s Object Capture is a long-running background task. The session publishes messages status and error messages to outputs, a Swift AsyncSequence.

Your app can respond to these updates using a for-await-in loop inside of a Task, as this example demonstrates.

let waiter = Task {
    do {
        for try await output in session.outputs {
            switch output {
                case .processingComplete:
                    // RealityKit has processed all requests.
                case .requestError(let request, let error):
                    // Request encountered an error.
                case .requestComplete(let request, let result):
                    // RealityKit has finished processing a request.
                case .requestProgress(let request, let fractionComplete):
                    // Periodic progress update. Update UI here.
                case requestProgressInfo(let request, let progressInfo):
                    // Periodic progress info update.
                case .inputComplete:
                    // Ingestion of images is complete and processing begins.
                case .invalidSample(let id, let reason):
                    // RealityKit deemed a sample invalid and didn't use it.
                case .skippedSample(let id):
                    // RealityKit was unable to use a provided sample.
                case .automaticDownsampling:
                    // RealityKit downsampled the input images because of
                    // resource constraints.
                case .processingCancelled
                    // Processing was canceled.
                @unknown default:
                    // Unrecognized output.
            }
        }
    } catch {
        print("Output: ERROR = \(String(describing: error))")
        // Handle error.
    }
}

Topics

Monitoring session status

Monitoring request status

Monitoring data ingestion

Describing updates

Iterating outputs

Structures

Enumeration Cases

Enumerations

See Also

Monitoring the session