title: I have MDLAsset created from an SCNScene. How do I extract MDLMeshs, MDLCamera(s), and MDLLights?
body: <p>I am struggling trying to traverse an <code>MDLAsset</code> instance created by loading an <code>SCNScene</code> file (.scn).</p>
  
  <p>I want to identify and extract the <code>MDLMesh</code>s as well as camera(s) and lights. I see no direct way to do that.</p>
  
  <p>For example I see this instance method on MDLAsset:</p>
  
  <pre><code>func childObjects(of objectClass: Swift.AnyClass) -&gt; [MDLObject]
  </code></pre>
  
  <p>Is this what I use?</p>
  
  <p>I have carefully labeled things in the SceneKit modeler. Can I not refer to those which would be ideal. Surely, there is a dictionary of ids/labels that I can get access to. What am I missing here?</p>
  
  <h2>UPDATE 0</h2>
  
  <p>I had to resort to pouring over the scene graph in the Xcode debugger due to the complete lack of Apple documentation. Sigh ...</p>
  
  <p><a href="https://i.stack.imgur.com/SRySG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SRySG.png" alt="enter image description here"></a></p>
  
  <p>A few things. I see the <code>MDLMesh</code> and <code>MDLSubmesh</code> that is what I am after. What is the traversal approach to get it? Similarly for lights, and camera.</p>
  
  <p>I also need to know the layout of the vertex descriptors so I can sync with my shaders. Can I force a specifc vertex layout on the parsed <code>SCNScene</code>?</p>