For the past few days I’ve tried creating a photogrammetry command line app in Xcode. But I keep getting an error when I try to run the code.
The error I get is the following:
[Photogrammetry] queueNextProcessingBatchIfNeeded(): Already running a job... not starting new one.
I’ve searched on Google but I can’t find anyone who has experienced the same issue.
The code I’m using is the following:
import Foundation
import RealityKit
let inputFolderUrl = URL(fileURLWithPath: "/Users/username/Desktop/AirForce", isDirectory: true)
let session = try! PhotogrammetrySession(input: inputFolderUrl, configuration: PhotogrammetrySession.Configuration())
try! session.process(requests: [.modelFile(url: URL(fileURLWithPath: "/Users/username/Desktop/MyModel.usdz"), detail: .preview)])
My system:
MacBook Air (M1, 2020)
macOS Monterey 12.0.1 (21A559)
Xcode Version 13.2.1 (13C100)
2
Answers
Use my code. It works. If you need more details on photogrammetry, read my Medium post.
Hello I had the same problem I solved it by adding a single line.
RunLoop.main.run()