How to add an model to an Scene Node.

Oscar de la Hera
AR Tips And Tricks
Published in
2 min readJul 16, 2018

Please note that this article is based on the free Apple ARKit app detailed in this post.

Step One: Import your scene as a .dae

Make sure you add it to art.scnassets.

Left: How to add the file; Right: The added file.

Step Two: Convert your .dae to a scn.

With your .dae file selected go to the Mac Nav Bar Menu and click Editor → Convert to SceneKit scene file format (.scn)

Step Three: Add the model to the scene

In this particular example, this function will fall under the func renderer(_ renderer: SCNSceneRenderer, didAdd node: SCNNode, for anchor: ARAnchor)

let yourSCN:SCNScene? = SCNScene(named: "art.scnassets/yourAddedFile.scn");let sceneNode:SCNNode = adamASTLSCN!.rootNode.childNode(withName: YOUR_MODELS_NAME, recursively: false)!;node.addChildNode(sceneNode);

Please note that YOUR_MODELS_NAME is the identity of your model within the scene that you added. This is found on the Utilities Menu on the RHS, in the Node Inspector. In the example shown below, its AdamA__1_

Thats It.

Oscar

--

--

Oscar de la Hera
AR Tips And Tricks

Oscar is an award-winning Spanish Inventor whose work impacts lives through brands that include Nike, MoMA and Samsung.