<div dir="auto">What I did was test to see if the key was present before parsing.</div><div dir="auto"><br></div><div dir="auto">John</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 6, 2021 at 10:35 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="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="m_1475743061309453015WordSection1">
<p class="MsoNormal">See the code in x3d.py for details on use of Null and []<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Testing that a list is not empty before iterating avoids errors like
<span style="font-family:"Courier New",serif">object is not iterable</span><u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New",serif"><u style="font-family:"Courier New",serif"></u> <u style="font-family:"Courier New",serif"></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New",serif">all the best, Don<u style="font-family:"Courier New",serif"></u><u style="font-family:"Courier New",serif"></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New",serif">--
<u style="font-family:"Courier New",serif"></u><u style="font-family:"Courier New",serif"></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New",serif">Don Brutzman  Naval Postgraduate School, Code USW/Br        <a href="mailto:brutzman@nps.edu" target="_blank" style="font-family:"Courier New",serif">brutzman@nps.edu</a><u style="font-family:"Courier New",serif"></u><u style="font-family:"Courier New",serif"></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New",serif">Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    +1.831.656.2149<u style="font-family:"Courier New",serif"></u><u style="font-family:"Courier New",serif"></u></span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:"Courier New",serif">X3D graphics, virtual worlds, navy robotics https://</span>
<span style="font-size:10pt;font-family:"Courier New",serif"><a href="http://faculty.nps.edu/brutzman" target="_blank" style="font-family:"Courier New",serif">faculty.nps.edu/brutzman</a><u style="font-family:"Courier New",serif"></u><u style="font-family:"Courier New",serif"></u></span></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<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> John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> <br>
<b>Sent:</b> Sunday, December 5, 2021 10:41 PM<br>
<b>To:</b> Brutzman, Donald (Don) (CIV) <<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>>; Vince Marchetti <<a href="mailto:vmarchetti@kshell.com" target="_blank">vmarchetti@kshell.com</a>><br>
<b>Cc:</b> X3D Public Mailing List (<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>) <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>><br>
<b>Subject:</b> Re: X3DPSAIL x3d.py package updated and deployed to x3d.py, adding initial support for JSON export<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div style="border:1pt solid rgb(0,70,121);padding:2pt">
<p class="MsoNormal" style="line-height:12pt;background-color:rgb(0,70,121)"><span style="font-size:10pt;color:yellow">NPS WARNING: *external sender* verify before acting.<u></u><u></u></span></p>
</div></div></div><div lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word"><div class="m_1475743061309453015WordSection1">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p><u></u> <u></u></p>
<div>
<p class="MsoNormal">On 12/6/21 00:29, John Carlson wrote:<u></u><u></u></p>
</div>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<p><u></u> <u></u></p>
<div>
<p class="MsoNormal">On 12/6/21 00:19, John Carlson wrote:<u></u><u></u></p>
</div>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<p>Don, I will probably begin working on JSON export testing after I take the JSON import example for a short spin.  It's good to get a code download.<u></u><u></u></p>
<p>Note that SFVec3f should put a tuple in the structure when parsing JSON...normal JSON does not include tuples, so there needs to be a type conversion.<u></u><u></u></p>
<p>That is, centerOfRotation and position in Viewpoint should be tuples, not lists as JSON provides.<u></u><u></u></p>
</blockquote>
<p class="MsoNormal">Fixed as far as I am concerned right now.  I will try to remove my tuple soon.<u></u><u></u></p>
</blockquote>
<p class="MsoNormal">Tested removing tuple() without any problems.<br>
<br>
<u></u><u></u></p>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<p>I sent a previous message about HelloWorld.py and how the fields might be converted to lists in the the constructor call.<u></u><u></u></p>
</blockquote>
<p class="MsoNormal">That has been done, AFAICT.<u></u><u></u></p>
</blockquote>
<p>SFVec3f field values converted to lists from tuples, to clarify.  Good work!<u></u><u></u></p>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">John, please collect your comments and examples regarding JSON export flaws.  The build.examples.log.txt file is a good place to start.  Am returning to work this week, finishing
 up everything not yet done this year…<u></u><u></u></p>
</div>
</blockquote>
</blockquote>
</blockquote>
<p>I need to talk to you about making MF fields and nodes iterable.  Output fails in both JSON and XML output.<u></u><u></u></p>
<p>See traceback here:<u></u><u></u></p>
<p><u></u> <u></u></p>
<p><span style="font-family:"Courier New",serif;background-color:white;color:black">Traceback (most recent call last):
</span><span style="font-family:"Courier New",serif"><br>
 File "/c/x3d-code/<a href="http://www.web3d.org/x3d/content/examples/x3dinput.py" target="_blank" style="font-family:"Courier New",serif">www.web3d.org/x3d/content/examples/x3dinput.py</a>", line 141, in <module>
<br>
   print(scene.JSON()) <br>
 File "/c/x3d-code/<a href="http://www.web3d.org/x3d/content/examples/x3d.py" target="_blank" style="font-family:"Courier New",serif">www.web3d.org/x3d/content/examples/x3d.py</a>", line 12790, in JSON
<br>
   result += str(self.head.JSON(indentLevel=indentLevel+1, syntax=syntax)) <br>
 File "/c/x3d-code/<a href="http://www.web3d.org/x3d/content/examples/x3d.py" target="_blank" style="font-family:"Courier New",serif">www.web3d.org/x3d/content/examples/x3d.py</a>", line 10792, in JSON
<br>
   for each in self.children: <br>
TypeError: 'JSON_MFNode' object is not iterable</span><u></u><u></u></p>
<p><u></u> <u></u></p>
<p><span style="font-family:"Courier New",serif">I'm hoping we can spend some collaboration time working on these issues.  Otherwise, I will try to engage my python programmer to discuss options.</span><u></u><u></u></p>
<p><span style="font-family:"Courier New",serif">Pretty much all my code has been posted except for removing tuple().</span><u></u><u></u></p>
</div>
</div>
</div>

</blockquote></div></div>