I created a simple model in an obj and attempted to load it as an Asset
let bundle = NSBundle.mainBundle()
let path = bundle.pathForResource("Torus", ofType: "obj")
var torusModel = MDLAsset(URL: NSURL(string: path!)!)
Error message: Could not load data from /Users/jason/Library/Developer/Xcode/DerivedData/MetalDemo-auxpwrdxoklbrpbtkxmrhkecewhb/Build/Products/Debug/Met ... orus.obj
Here's the working code:
let bundle = NSBundle.mainBundle()
let path = bundle.pathForResource("Model", ofType: "obj")
let url = NSURL(fileURLWithPath: path!)
let asset = MDLAsset(URL: url)
let scene = SCNScene(MDLAsset: asset)
Step 1) Get the path of the model file
Step 2) Load the file into a MDLAsset
Step 3) Create a SCNScene with the asset (alternatively you can find the model inside the asset and add it to an existing scene)