When will SCNScene be fully supported in swift?

I am using metal, metal kit and model IO in my swift iOS application. I would like to use SCNScene for some physics body work, but the function

+ (instancetype)sceneWithMDLAsset:(MDLAsset *)

mdlAsset

does not have a swift wrapper. Is there an ETA for when this will be supported?


Thanks

Accepted Reply

Have you tried this?

import SceneKit.ModelIO
//...
        let scene = SCNScene(MDLAsset: asset)


The method is declared in SceneKit/ModelIO.h and even in Objective-C, you get "no known class method for selector 'sceneWithMDLAsset:'" without #import <SceneKit/ModelIO.h> (or @import SceneKit.ModelIO;).

And the class method is imported as an initializer in Swift.

Replies

Apple tends to avoid future plans.


Best to use the bug reporter to file a request.

Have you tried this?

import SceneKit.ModelIO
//...
        let scene = SCNScene(MDLAsset: asset)


The method is declared in SceneKit/ModelIO.h and even in Objective-C, you get "no known class method for selector 'sceneWithMDLAsset:'" without #import <SceneKit/ModelIO.h> (or @import SceneKit.ModelIO;).

And the class method is imported as an initializer in Swift.

Thanks. I didn't find this import in any of the documentation.

I didn't find this import in any of the documentation.

Neither I. I searched a sample code using "sceneWithMDLAsset:" in Objective-C, and had found `#import <SceneKit/ModelIO.h>`.

And then seached inside the SDK folders to find where that header is declared as a module...


You may consider this as a documentation bug and send a Bug Report.

Thanks so much -- this still isn't documented as of late 2017! This is my preferred way to load OBJ files into SceneKit.