<p dir="ltr"></p>
<p dir="ltr">On Jul 2, 2016 5:10 PM, "Don Brutzman" <<a href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>> wrote:<br>
><br>
> b. Handle follow-on nodes by also inserting them, in a scene-valid manner.<br>
> b.1. When the first node in the ProtoBody is an X3DChildNode, any follow-on nodes can be wrapped in a Switch (with whichChoice="-1") to ensure they are non-rendering.<br>
> b.2. When first node in the ProtoBody is not an X3DChildNode, any follow-on nodes are still wrapped in a Switch which follows at the closest subsequent point in the scene graph that can accept children nodes.</p>
<p dir="ltr">Note that the closest subsequent point is likely to  be a parent array, since objects don't hold objects (they hold objects as values of attributes).  Is this what we want?  As to finding the parent array, I was thinking each object could contain a "../arrayElement" attribute which would have a value of the JSONPath from the root to the array element index that the ProtoInstance (for example) is contained within.  Doing this with nested protoinstances could get really tricky. I almost want to do the Proto expansion first, and then try to add the switch nodes in the Flattener.js.  hmm.  That may work a lot better.  Thank you John for thinking this through before implementation. </p>