Closed frank-1992 closed 2 years ago
RealityKit is iOS 13+, there are known issues with lower version usage, maybe https://stackoverflow.com/questions/71000365/realitykit-app-and-lower-ios-deployment-target will help you.
iOS 16 is available already I will be dropping iOS 12 support anytime soon.
RealityKit is iOS 13+, there are known issues with lower version usage, maybe https://stackoverflow.com/questions/71000365/realitykit-app-and-lower-ios-deployment-target will help you.
thank you
RealityKit is iOS 13+, there are known issues with lower version usage, maybe https://stackoverflow.com/questions/71000365/realitykit-app-and-lower-ios-deployment-target will help you.
I have participated in the discussion below this link. Now that xcode14 has been fixed, can the code here be used without combine?
I have participated in the discussion below this link. Now that xcode14 has been fixed, can the code here be used without combine?
SceneRecorder needs to be notified when a new frame rendered. If you can find another approach to get such information form RealityKit you are welcome to contribute :)
you can trigger sceneRecorder?.render() manually, for example by timer or CADisplayLink, but it will be inaccurate.
I have participated in the discussion below this link. Now that xcode14 has been fixed, can the code here be used without combine?
SceneRecorder needs to be notified when a new frame rendered. If you can find another approach to get such information form RealityKit you are welcome to contribute :)
you can trigger sceneRecorder?.render() manually, for example by timer or CADisplayLink, but it will be inaccurate.
Thanks for your answer, I will try it
I have participated in the discussion below this link. Now that xcode14 has been fixed, can the code here be used without combine?
SceneRecorder needs to be notified when a new frame rendered. If you can find another approach to get such information form RealityKit you are welcome to contribute :)
you can trigger sceneRecorder?.render() manually, for example by timer or CADisplayLink, but it will be inaccurate.
I have finished it. Can you help to check it, is it ok?
@available(iOS 13.0, *) extension SceneRecorder: ARSessionDelegate { public func session(_ session: ARSession, didUpdate frame: ARFrame) { render() } }
`import Foundation import RealityKit import SCNRecorder import Combine import ARKit
private var cancellableKey: UInt8 = 0
@available(iOS 13.0, *) extension ARView: SelfSceneRecordable {
var _cancelable: Cancellable? { get { objc_getAssociatedObject( self, &cancellableKey ) as? Cancellable } set { objc_setAssociatedObject( self, &cancellableKey, newValue, .OBJC_ASSOCIATION_RETAIN ) } }
public func injectRecorder() { do { sceneRecorder = try SceneRecorder(self)
session.delegate = sceneRecorder
#endif
}
catch { assertionFailure("\(error)") }
} }
@available(iOS 13.0, *) extension SceneRecorder: ARSessionDelegate { public func session(_ session: ARSession, didUpdate frame: ARFrame) { render() } } ` I have tested it
inaccurate
emmm, but my project must be set to iOS10.0(minimum deployments)
please don't confirm third party classes to third party protocols. it might lead to unexpected results. I don't remember if I used session delegate somewhere inside the library, if not it should be fine.
It might be a bit inaccurate because the session(_ session: ARSession, didUpdate frame: ARFrame)
function is called a moment before the content is rendered. But it might be ok.
Another thing here is that the content might be changed from somewhere else, without changing ARFrame, so this callback won't fire. but It should still work for reality kit.
public func renderer(_ renderer: SCNSceneRenderer, updateAtTime time: TimeInterval) ok thanks for your suggestion, do you think this protocol will be better?
it will, but RealityKit doesn't use SceneKit, so it just won't work. You can just create you own delegate conforming to ARSessionDelegate and call render from there.
When I set the minimum deployments 'iOS 10.0' and run the example ,
_cancelable = scene.subscribe( to: SceneEvents.Update.self ) { [weak sceneRecorder] (_) in sceneRecorder?.render() }
SceneEvents.Update will crash, can you help to me?