Post

Replies

Boosts

Views

Activity

Reply to Black Screen with the text "Move iPad to start"
I fixed this by running startSession outside the body. That was causing the issue. @MainActor func startSession() { guard #available(iOS 17.0, *) else { return } do { let session = ObjectCaptureSession() var configuration = ObjectCaptureSession.Configuration() configuration.checkpointDirectory = getDocumentsDir().appendingPathComponent("Snapshots/") try session.start(imagesDirectory: getDocumentsDir().appendingPathComponent("Images/"), configuration: configuration) self.session = session } catch { sessionError = error } } Also added: .onAppear { startSession() } after .environment(\.colorScheme, .dark) Here is the final part of the code inside the ZStack if let session = session { ObjectCaptureView(session: session) if case .ready = session.state { Button(action: { session.startDetecting() }) { Text("Continue") .foregroundColor(.white) .padding() .background(Color.blue) .cornerRadius(10) } } else if case .detecting = session.state { Button(action: { session.startCapturing() }) { Text("Start Capture") .foregroundColor(.white) .padding() .background(Color.blue) .cornerRadius(10) } } } else if let error = sessionError { Text("Failed to start ObjectCaptureSession: \(error.localizedDescription)") } else { Text("Initializing...") } As you can see I changed the CreateButton part because it was also not defined in the video. So I went back to the old way of creating buttons. Hope this helps you move fwd
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’23
Reply to Assertion failed after calling session.startDetecting() - Xcode 15.0 beta1 (15A5160n)
[Deleted]
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to Assertion failed after calling session.startDetecting() - Xcode 15.0 beta1 (15A5160n)
Now can anyone please explain how to disable the Metal API Validation? I tried switching this to "Disabled" or "OpenGL ES" Cleaned the Build folder, built again. But I am still getting the same error.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to Problem with testing Object Capture for iOS
So it seems the ObjectCaptureSession is not available on the simulator, so you need to attach a device that has LiDAR and runs iOS 17 to get rid of this issue.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to Black Screen with the text "Move iPad to start"
I fixed this by running startSession outside the body. That was causing the issue. @MainActor func startSession() { guard #available(iOS 17.0, *) else { return } do { let session = ObjectCaptureSession() var configuration = ObjectCaptureSession.Configuration() configuration.checkpointDirectory = getDocumentsDir().appendingPathComponent("Snapshots/") try session.start(imagesDirectory: getDocumentsDir().appendingPathComponent("Images/"), configuration: configuration) self.session = session } catch { sessionError = error } } Also added: .onAppear { startSession() } after .environment(\.colorScheme, .dark) Here is the final part of the code inside the ZStack if let session = session { ObjectCaptureView(session: session) if case .ready = session.state { Button(action: { session.startDetecting() }) { Text("Continue") .foregroundColor(.white) .padding() .background(Color.blue) .cornerRadius(10) } } else if case .detecting = session.state { Button(action: { session.startCapturing() }) { Text("Start Capture") .foregroundColor(.white) .padding() .background(Color.blue) .cornerRadius(10) } } } else if let error = sessionError { Text("Failed to start ObjectCaptureSession: \(error.localizedDescription)") } else { Text("Initializing...") } As you can see I changed the CreateButton part because it was also not defined in the video. So I went back to the old way of creating buttons. Hope this helps you move fwd
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to Problem with testing Object Capture for iOS
This was fixed by attaching a device with iOS 17 In my case it's an iPad with Lidar and iOS 17 installed. I read on a different comment that ObjectCaptureSession is not available on the simulator.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to how to download sample app?
It hasn't been published yet, just wait a few days. They are working hard on this.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to Support in Xcode 14.2
Hello! ObjectCaptureSession and ObjectCaptureView are NOT available on simulators yet. You need a real device attached to xCode to get rid of this error.
Topic: Graphics & Games SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jun ’23
Reply to Problem with testing Object Capture for iOS
I understand that the sample code is not yet available. Thank you in advance.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’23