I'm getting unexpected results when exporting the contents of a SceneKit scene to a Collada (.dae) file. Here's what I have so far.
I created a simple scene with 5 spheres along the x-axis
var x:CGFloat = 0
for i in 0...4 {
let sphere = SCNNode(geometry: SCNSphere(radius: 1))
sphere.name = "sphere\(i+1)"
sphere.position = SCNVector3(x: x, y: 0, z: 0)
exportScene.rootNode.addChildNode(sphere)
x += 2
}
and exported the contents with
let url = URL(fileURLWithPath: pathName)
exportScene.write(to: url, options: nil, delegate: nil) { totalProgress, error, stop in
print("Export progress: \(totalProgress * 100.0)%")
}
When I load the .dae file into a 3D program (Cheetah 3D), I expect to have 5 identical spheres along the x-axis but instead the following appears. I had similar issues exporting to a .obj file.
The answer in the following says "Keep in mind that DAE doesn't handle all features of SceneKit, though" but the doesn't go into the limitations of the file format.
Easiest method to export a SceneKit scene as a Collada .dae file?
Q: Does anyone know how to export the contents of a SceneKit scene?