Exported Babylon File in IOS ARKit

I was trying to load exported .babylon file in iOS native using ARKit with below code.

func showLocalBabylonFile(scene: SCNScene) -> SCNScene? {
    let url = Bundle.main.url(forResource: "art.scnassets/temp", withExtension: "babylon")
    if((url) != nil) {
        print("url not nil");
        
        let scnSceneSource: SCNSceneSource? = SCNSceneSource(url: url!);
        if(scnSceneSource != nil) {
            print("scnSceneSource not nil");
            
            let scnScene:SCNScene? = scnSceneSource!.scene();
            return scnScene;
        }
        else {
            print("scnSceneSource nil");
        }
    }
    else {
        print("url nil");
    }
    
    return nil;
}

This code is returning nil on calling code

let scnScene:SCNScene? = scnSceneSource!.scene();

value of scnScene is null.

Can anyone tell why is that?

Hi and welcome to the forum,

The SCNSceneSource docs say it is for .dae, .abc and .scn files. I don’t think it can load .babylon files.

2 Likes

Thanks for the reply.

Can you provide information about how can we show babylon content in ioARKit?

Maybe indirectly by exporting to .GLB out of BJS. Import into Blender. Export as .dae or .abc. I do not see a .scn export from Blender.