<div dir="auto">My understanding is that once you set up an IMPORT/EXPORT pair m, you can create ROUTEs that flow in either direction through.</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 5, 2022 at 1:30 AM Brutzman, Donald (Don) (CIV) <<a href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><div lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word"><div class="m_1657539907300624272WordSection1"><p class="MsoNormal">Correct.  Also, the reason an author might want to do this is easily to ROUTE events from parent scene to child scene, or vice versa.  Much less work than creating a prototype, too.<u></u><u></u></p><p class="MsoNormal"><u></u> <u></u></p><ul style="margin-top:0in" type="disc"><li class="m_1657539907300624272MsoListParagraph" style="margin-left:0in"><a href="https://www.web3d.org/x3d/content/X3dTooltips.html#IMPORT" target="_blank">https://www.web3d.org/x3d/content/X3dTooltips.html#IMPORT</a><u></u><u></u></li></ul><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:navy">IMPORT provides ROUTE access to a node that has a corresponding EXPORT statement within an Inline scene. These connections allow event values to be passed via ROUTE statements between a parent model and a child Inline model.<br></span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:rgb(68,119,119)">Hint:</span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:navy"> it is good practice to place IMPORT statements next to corresponding Inline scenes for readability.<br></span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:rgb(68,119,119)">Hint:</span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:navy"> see EXPORT statement for corresponding functionality within the related Inline model.<br></span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:rgb(238,85,0)">Warning:</span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:navy"> corresponding parent-scene IMPORT and child Inline-scene EXPORT statements are necessary in order to ROUTE values between a parent model and a child Inline model.<br></span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:rgb(68,119,119)">Hint:</span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:navy"> X3D Architecture 4.4.6 Import/Export semantics </span></b><b><span style="font-size:10pt;font-family:"Times New Roman",serif;color:navy"><a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1/Part01/concepts.html#ImportExportsemantics" target="_blank" style="font-family:"Times New Roman",serif">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1/Part01/concepts.html#ImportExportsemantics</a><u style="font-family:"Times New Roman",serif"></u><u style="font-family:"Times New Roman",serif"></u></span></b></p><p class="MsoNormal"><u></u> <u></u></p><ul style="margin-top:0in" type="disc"><li class="m_1657539907300624272MsoListParagraph" style="margin-left:0in"><a href="https://www.web3d.org/x3d/content/X3dTooltips.html#EXPORT" target="_blank">https://www.web3d.org/x3d/content/X3dTooltips.html#EXPORT</a><u></u><u></u></li></ul><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:navy">EXPORT exposes a local node for ROUTE passing of event values when the current Scene is included via Inline by a parent external world. These connections allow event values to be exchanged via ROUTE statements between a parent model and a child Inline model.<br></span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:rgb(68,119,119)">Hint:</span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:navy"> you can place EXPORT statements after Scene tag to show interfaces at top.<br></span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:rgb(68,119,119)">Hint:</span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:navy"> see IMPORT statement for corresponding functionality in the parent external world.<br></span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:rgb(238,85,0)">Warning:</span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:navy"> EXPORT statements are not allowed in prototype declarations.<br></span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:rgb(238,85,0)">Warning:</span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:navy"> corresponding parent-scene IMPORT and child Inline-scene EXPORT statements are necessary in order to ROUTE values between a parent model and a child Inline model.<br></span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:rgb(68,119,119)">Hint:</span></b><b><span style="font-size:13.5pt;font-family:"Times New Roman",serif;color:navy"> X3D Architecture 4.4.6 Import/Export semantics </span></b><b><span style="font-size:10pt;font-family:"Times New Roman",serif;color:navy"><a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1/Part01/concepts.html#ImportExportsemantics" target="_blank" style="font-family:"Times New Roman",serif">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1/Part01/concepts.html#ImportExportsemantics</a></span></b><u></u><u></u></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New""><u style="font-family:"Courier New""></u> <u style="font-family:"Courier New""></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"">all the best, Don<u style="font-family:"Courier New""></u><u style="font-family:"Courier New""></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"">-- <u style="font-family:"Courier New""></u><u style="font-family:"Courier New""></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"">Don Brutzman  Naval Postgraduate School, Code USW/Br        <a href="mailto:brutzman@nps.edu" target="_blank" style="font-family:"Courier New"">brutzman@nps.edu</a><u style="font-family:"Courier New""></u><u style="font-family:"Courier New""></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"">Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    +1.831.656.2149<u style="font-family:"Courier New""></u><u style="font-family:"Courier New""></u></span></p><p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New"">X3D graphics, virtual worlds, Navy robotics https://</span> <span style="font-size:10pt;font-family:"Courier New""><a href="http://faculty.nps.edu/brutzman" target="_blank" style="font-family:"Courier New"">faculty.nps.edu/brutzman</a><u style="font-family:"Courier New""></u><u style="font-family:"Courier New""></u></span></p></div></div><div lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word"><div class="m_1657539907300624272WordSection1"><p class="MsoNormal"><u></u> <u></u></p><div style="border-style:solid none none;border-top-width:1pt;padding:3pt 0in 0in;border-top-color:rgb(225,225,225)"><p class="MsoNormal"><b>From:</b> x3d-public <<a href="mailto:x3d-public-bounces@web3d.org" target="_blank">x3d-public-bounces@web3d.org</a>> <b>On Behalf Of </b>Michalis Kamburelis<br><b>Sent:</b> Monday, April 4, 2022 8:00 PM<br><b>To:</b> John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>><br><b>Cc:</b> X3D Graphics public mailing list <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br><b>Subject:</b> Re: [x3d-public] Using IMPORT / EXPORT to selectively include parts of glTF file in X3D, and multiply them as much as necessary<u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">The idea of IMPORT / EXPORT is that you use EXPORT within the "inner" file, and then you use Inline and IMPORT statements in the "outer" file to bring nodes from inner file into the outer file namespace.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Regards,<u></u><u></u></p></div><div><p class="MsoNormal">Michalis<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p><div><div><p class="MsoNormal">W dniu wt., 5.04.2022 o 04:39 John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> napisał(a):<u></u><u></u></p></div><blockquote style="border-style:none none none solid;border-left-width:1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in;border-left-color:rgb(204,204,204)"><div><p class="MsoNormal">Looks super-exciting Michalis.    I haven’t had much chance to work with IMPORT/EXPORT.   Can including file export to an included file?<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">J<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><div><div><p class="MsoNormal">On Mon, Apr 4, 2022 at 9:23 PM Michalis Kamburelis <<a href="mailto:michalis.kambi@gmail.com" target="_blank">michalis.kambi@gmail.com</a>> wrote:<u></u><u></u></p></div></div></div><div><div><blockquote style="border-style:none none none solid;border-left-width:1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in;border-left-color:rgb(204,204,204)"><p class="MsoNormal">( No real avocados were hurt while generating screenshots for this email :) )<br><br>I started to write an answer to Doug email "Other ways to use gltf ><br>like ExternProto" and then I realized that I just pursue a different<br>approach, so I may as well create a new thread. The goal is similar:<br>how to get *part* of glTF scene into X3D file? But here I decided to<br>do it using IMPORT / EXPORT + Inline, not ExternProto.<br><br>I thought that IMPORT / EXPORT may be nice, as IMPORT / EXPORT have an<br>explicit purpose "make something available to the outer scene".<br><br>So I tried how far can I take it. And  implemented it in<br>CGE/view3dscene, and made demos :) You can now use IMPORT / EXPORT to<br>selectively take (and reuse as many times as you wish) parts of inner<br>glTF models inside outer X3D file.<br><br>1. Older demo: I have already used this approach for animations in<br>glTF in CGE/view3dsdcene, i.e. I export them from glTF and you can<br>IMPORT and control them. See<br><a href="https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcastle-engine%2Fdemo-models%2Ftree%2Fmaster%2Fblender%2Fskinned_animation&data=04%7C01%7Cbrutzman%40nps.edu%7C90fe545048fe487a05a108da16b073ac%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637847244970756710%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=y5Mh8sqteN6MFYSFuR3vlJevG%2FTWs0wUQqxjCjQvmvY%3D&reserved=0" target="_blank">https://github.com/castle-engine/demo-models/tree/master/blender/skinned_animation</a><br>, file skinned_anim_run_animations_from_x3d.x3dv does<br><br>"""<br>DEF InlinedAnimations Inline {<br>   url "skinned_anim.glb"<br>}<br>IMPORT InlinedAnimations.jump AS jump<br>IMPORT InlinedAnimations.walk AS walk<br>"""<br><br>and then it can start  animations jump, walk. They are just TimeSensor<br>nodes in X3D. I can ROUTE events to them.<br><br>2. I have now extended this approach to glTF materials (X3D Appearance<br>nodes) and transformation groups and cameras (X3D Viewpoint /<br>OrthoViewpoint nodes). I can export anything named from glTF this way.<br><br>See <a href="https://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmichaliskambi%2Fx3d-tests%2Ftree%2Fmaster%2Fgltf%2Favocado_and_exports&data=04%7C01%7Cbrutzman%40nps.edu%7C90fe545048fe487a05a108da16b073ac%7C6d936231a51740ea9199f7578963378e%7C0%7C0%7C637847244970756710%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=9jRLppQrO0q6GPqX9tOEAR62mXEw8vWR3NzSS1HRVPE%3D&reserved=0" target="_blank">https://github.com/michaliskambi/x3d-tests/tree/master/gltf/avocado_and_exports</a><br>and attached screenshot with scene that can reuse Avocado appearance,<br>or transformation, or mesh.<br><br>It looks like this:<br><br>"""<br>Switch {<br>  children DEF InlinedAvocado Inline {<br>    url "glTF/Avocado.gltf"<br>  }<br>}<br>IMPORT InlinedAvocado.Avocado_2 AS AvocadoMeshes<br>IMPORT InlinedAvocado.CastleEncoded_2256_Avocado_d AS AvocadoAppearance<br>IMPORT InlinedAvocado.Avocado AS AvocadoTransform<br><br>Shape {<br>  appearance USE AvocadoAppearance<br>  geometry IndexedFaceSet { ... }<br>}<br>...<br>"""<br><br>3. Why IMPORT / EXPORT? I felt this way there's less extra concepts.<br><br>  A. Do not want to see original glTF? Then place "Inline" inside "Switch".<br><br>  B. Writing "IMPORT" is simpler than ExternProto, no need to repeat<br>the node declaration.<br><br>4. To make this work:<br><br>  A. The browser must make sure to generate EXPORT for all named<br>things when importing glTF file.<br><br>  B. The browser must be more tolerant for USE clauses than spec.<br><br>    X3D spec says (<br><a href="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1/Part01/components/networking.html#IMPORTStatement" target="_blank">https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1/Part01/components/networking.html#IMPORTStatement</a><br>) """Nodes imported into an X3D scene using the IMPORT statement may<br>not be instanced via the USE statement. """. I decided to ignore this<br>limit now in CGE/view3dscene, you can reUSE nodes you get with IMPORT.<br><br>    There seems to be no drawback from this. We only resolve USE<br>looking at IMPORTed names if the name cannot be found in non-imported<br>nodes. And it makes IMPORT / EXPORT much more powerful, also for<br>X3D<->X3D interaction.<br><br>5. Note: I'm not really trying to make a case that "IMPORT / EXPORT is<br>a better approach than ExternProto". They both seem reasonable<br>approaches. I just decided to test IMPORT / EXPORT approach to the<br>fullest, and I dabbled with it already in the demo with<br>skinned_anim_run_animations_from_x3d.x3dv .<br><br>Regards,<br>Michalis<u></u><u></u></p></blockquote></div></div><div><div><blockquote style="border-style:none none none solid;border-left-width:1pt;padding:0in 0in 0in 6pt;margin-left:4.8pt;margin-right:0in;border-left-color:rgb(204,204,204)"><p class="MsoNormal">_______________________________________________<br>x3d-public mailing list<br><a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br><a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><u></u><u></u></p></blockquote></div></div></blockquote></div></div></div></div></blockquote></div></div>