<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:714162449;
        mso-list-template-ids:-1300051150;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">See the code in x3d.py for details on use of Null and []<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></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><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">all the best, Don<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">--
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">Don Brutzman  Naval Postgraduate School, Code USW/Br        brutzman@nps.edu<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    +1.831.656.2149<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New",serif">X3D graphics, virtual worlds, navy robotics https://</span>
<span style="font-size:10.0pt;font-family:"Courier New",serif">faculty.nps.edu/brutzman<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> John Carlson <yottzumm@gmail.com> <br>
<b>Sent:</b> Sunday, December 5, 2021 10:41 PM<br>
<b>To:</b> Brutzman, Donald (Don) (CIV) <brutzman@nps.edu>; Vince Marchetti <vmarchetti@kshell.com><br>
<b>Cc:</b> X3D Public Mailing List (x3d-public@web3d.org) <x3d-public@web3d.org><br>
<b>Subject:</b> Re: X3DPSAIL x3d.py package updated and deployed to x3d.py, adding initial support for JSON export<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:solid #004679 1.0pt;padding:2.0pt 2.0pt 2.0pt 2.0pt">
<p class="MsoNormal" style="line-height:12.0pt;background:#004679"><span style="font-size:10.0pt;color:yellow">NPS WARNING: *external sender* verify before acting.<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 12/6/21 00:29, John Carlson wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 12/6/21 00:19, John Carlson wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<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.<o:p></o:p></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.<o:p></o:p></p>
<p>That is, centerOfRotation and position in Viewpoint should be tuples, not lists as JSON provides.<o:p></o:p></p>
</blockquote>
<p class="MsoNormal">Fixed as far as I am concerned right now.  I will try to remove my tuple soon.<o:p></o:p></p>
</blockquote>
<p class="MsoNormal">Tested removing tuple() without any problems.<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p>I sent a previous message about HelloWorld.py and how the fields might be converted to lists in the the constructor call.<o:p></o:p></p>
</blockquote>
<p class="MsoNormal">That has been done, AFAICT.<o:p></o:p></p>
</blockquote>
<p>SFVec3f field values converted to lists from tuples, to clarify.  Good work!<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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…<o:p></o:p></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.<o:p></o:p></p>
<p>See traceback here:<o:p></o:p></p>
<p><o:p> </o:p></p>
<p><span style="font-family:"Courier New",serif;color:black;background:white">Traceback (most recent call last):
</span><span style="font-family:"Courier New",serif"><br>
 File "/c/x3d-code/www.web3d.org/x3d/content/examples/x3dinput.py", line 141, in <module>
<br>
   print(scene.JSON()) <br>
 File "/c/x3d-code/www.web3d.org/x3d/content/examples/x3d.py", line 12790, in JSON
<br>
   result += str(self.head.JSON(indentLevel=indentLevel+1, syntax=syntax)) <br>
 File "/c/x3d-code/www.web3d.org/x3d/content/examples/x3d.py", line 10792, in JSON
<br>
   for each in self.children: <br>
TypeError: 'JSON_MFNode' object is not iterable</span><o:p></o:p></p>
<p><o:p> </o:p></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><o:p></o:p></p>
<p><span style="font-family:"Courier New",serif">Pretty much all my code has been posted except for removing tuple().</span><o:p></o:p></p>
</div>
</div>
</body>
</html>