Hey!
I'm trying to add this line to my project:
var session = ObjectCaptureSession()
But it automatically says "Cannot find 'ObjectCaptureSession' in scope"
I cannot get this error to go away, so I haven't continued trying the snippets provided on your video.
Is there anything else I need to install or configure before this is ready?
I'm importing:
import RealityKit
import SwiftUI
import Firebase
In your video you mentioned that there is a sample code, but I can only find the snippets rather than a project. It's fine if there is no sample code, just that on the video you mentioned it, so it's confusing to not have the code, when it's mentioned so much on the video.
Xcode 15- Beta
iOS17 Sim installed
MacOS Ventura 13.3.1 a
Post
Replies
Boosts
Views
Activity
After getting around some issues we finally got "something" to run.
But we have 2 issues now
getDocumentsDir() is not found on scope.
I guess this function was only shown on the video, but not really implemented globally, now looking through some "eskimo" code I found docDir implementation.
Which doesn't work either in this case.
Because session.start() never runs, all I have is a Black Screen with an animation saying "Move iPad to start".
QUESTION:
A) How can I force this to work?
I'm hoping to get capture the images to later process at a Mac.
So I don't think I need the "checkpoint" part of configuration.
Since getDocumentsDir() or docDir are not working,
B) is there anyway to just select whatever folder we can, maybe hardcode it?
Here is my code:
import Foundation
import RealityKit
import SwiftUI
// import Firebase
struct CaptureView: View {
let docDir = try! FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: true)
var body: some View {
ZStack {
// Make the entire background black.
Color.black.edgesIgnoringSafeArea(.all)
if #available(iOS 17.0, *) {
var session = ObjectCaptureSession()
var configuration = ObjectCaptureSession.Configuration()
// configuration.checkpointDirectory = getDocumentsDir().appendingPathComponent("Snapshots/")
// session.start(imagesDirectory: docDir.appendingPathComponent("Images/"), configuration: configuration)
ObjectCaptureView(session: session)
} else {
Text("Unsupported iOS 17 View")
}
}
.environment(\.colorScheme, .dark)
}
}