<html 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;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Very clever adding a () around the entire expression!  I like it!  What a stroke of inspiration!</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Would you prefer something like X3Dautoclass.py instead of  org/…</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Loren suggested adding a prefix, say x3dpsail to each variable, so we only expose one thing to the python namespace.  But we have to change all the generated code in that case to have a prefix before each constructor.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Can we do both?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thinking.  Maybe I will arrive at a compromise if you don’t have a good idea.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p><p class=MsoNormal>Sent from <a href="https://go.microsoft.com/fwlink/?LinkId=550986">Mail</a> for Windows 10</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:brutzman@nps.edu">Brutzman, Donald (Don) (CIV)</a><br><b>Sent: </b>Sunday, May 12, 2019 2:39 PM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a><br><b>Cc: </b><a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>Re: X3DJSAIL updated; python pyjnius mapping, javascript warnings,cleaner .py export syntax</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>On 5/11/2019 6:46 PM, John Carlson wrote:</p><p class=MsoNormal>> Fixed, checked in.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>thank you.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Found some issues with PythonPipeliningSerializer.js:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>- Netbeans provides a number of warnings, worked as follows to clear them.</p><p class=MsoNormal>- semicolons added where indicated</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>- printSubArray method had a number of issues</p><p class=MsoNormal>-- nested variable v defined multiple times, renamed it to vv within nested scope</p><p class=MsoNormal>-- irregular indentation led to variable v later being out of scope;</p><p class=MsoNormal>-- reason was premature completion of integer "for (var v in values)" loop</p><p class=MsoNormal>-- moved closing } to put everything appropriate within loop, please check</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>- thanks for fixing "if (attrType.startsWith("SF"))"</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>- changed some identity operators == to equality operators ===</p><p class=MsoNormal>                https://stackoverflow.com/questions/359494/which-equals-operator-vs-should-be-used-in-javascript-comparisons</p><p class=MsoNormal>note that Douglas Crockford is quoted as</p><p class=MsoNormal>                "JavaScript has two sets of equality operators: === and !==, and their evil twins == and !=. The good ones work the way you would expect. [...] The lack of transitivity is alarming. My advice is to never use the evil twins. Instead, always use === and !==."</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>- i worked on removing line-continuation characters completely by wrapping entire expression in one extra set of parentheses</p><p class=MsoNormal>- comments now appear on a new line for readability</p><p class=MsoNormal>- changed \r\n to \n for consistency throughout, seemed OK</p><p class=MsoNormal>- output line breaks inserted between sections and otherwise minimized for readability</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Still getting an error: Unexpected 'const'</p><p class=MsoNormal>const DOUBLE_SUFFIX = '';</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Checked in these changes to PythonPipeliningSerializer.js.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Clean example attached - better and better.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> Do you have an example we can test with?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I continue focusing on HelloWorld.x3d and corresponding HelloWorld.py</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Moving around and removing sections of .x3d source can push the error around...</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Each time, am only able to get errors in .py file of the form</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>     .addChild(Viewpoint().setDEF("ViewUpClose").setCenterOfRotation(0,-1,0).setDescription("Hello world!").setPosition(0,-1,7))</p><p class=MsoNormal>     AttributeError: 'org.web3d.x3d.sai.Navigation.X3DViewpointNode' object has no attribute 'setCenterOfRotation'</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>     .setMaterial(Material().setDEF("MaterialLightBlue").setDiffuseColor(0.1,0.5,1))</p><p class=MsoNormal>     AttributeError: 'org.web3d.x3d.sai.Shape.X3DMaterialNode' object has no attribute 'setDiffuseColor'</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>     .setTexture(ImageTexture().setDEF("ImageCloudlessEarth").setUrl(["earth-topo.png","earth-topo.jpg","earth-topo-small.gif","http://www.web3d.org/x3d/content/examples/Basic/earth-topo.png","http://www.web3d.org/x3d/content/examples/Basic/earth-topo.jpg","http://www.web3d.org/x3d/content/examples/Basic/earth-topo-small.gif"]))))))))</p><p class=MsoNormal>     AttributeError: 'org.web3d.x3d.sai.Texturing.X3DTextureNode' object has no attribute 'setUrl'</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>so it sure looks like it has something to do with incorrect handling of direct methods, it seems OK when a method is found in abstract parent of an object class.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> Thanks,</p><p class=MsoNormal>> </p><p class=MsoNormal>> John</p><p class=MsoNormal>> </p><p class=MsoNormal>> Index: PythonPipeliningSerializer.js</p><p class=MsoNormal>> </p><p class=MsoNormal>> ===================================================================</p><p class=MsoNormal>> </p><p class=MsoNormal>> --- PythonPipeliningSerializer.js       (revision 28463)</p><p class=MsoNormal>> </p><p class=MsoNormal>> +++ PythonPipeliningSerializer.js       (working copy)</p><p class=MsoNormal>> </p><p class=MsoNormal>> @@ -82,7 +82,7 @@</p><p class=MsoNormal>> </p><p class=MsoNormal>>                          values.pop();</p><p class=MsoNormal>> </p><p class=MsoNormal>>                  }</p><p class=MsoNormal>> </p><p class=MsoNormal>> -               if (type.startsWith("SF")) // TODO fix this javascript, test is not working</p><p class=MsoNormal>> </p><p class=MsoNormal>> +               if (attrType.startsWith("SF"))</p><p class=MsoNormal>> </p><p class=MsoNormal>>               return     lead+values.join(j)+trail; // avoid array brackets on SF types</p><p class=MsoNormal>> </p><p class=MsoNormal>>           else</p><p class=MsoNormal>> </p><p class=MsoNormal>>               return '['+lead+values.join(j)+trail+']';</p><p class=MsoNormal>> </p><p class=MsoNormal>> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10</p><p class=MsoNormal>> </p><p class=MsoNormal>> *From: *John Carlson <mailto:yottzumm@gmail.com></p><p class=MsoNormal>> *Sent: *Saturday, May 11, 2019 8:39 PM</p><p class=MsoNormal>> *To: *Brutzman, Donald (Don) (CIV) <mailto:brutzman@nps.edu></p><p class=MsoNormal>> *Cc: *X3D Graphics public mailing list <mailto:x3d-public@web3d.org></p><p class=MsoNormal>> *Subject: *RE: X3DJSAIL updated support for setting with doubles; pythonpyjniusmapping</p><p class=MsoNormal>> </p><p class=MsoNormal>> ==========================================</p><p class=MsoNormal>> </p><p class=MsoNormal>>  >2. Also tried to get PythonPipeliningSerializer.js to avoid brackets on simple and numeric types.</p><p class=MsoNormal>> </p><p class=MsoNormal>>  >Checked in block that didn't work, please fix and check back in:</p><p class=MsoNormal>> </p><p class=MsoNormal>>                                  if (type.startsWith("SF")) // TODO fix this javascript, test is not working</p><p class=MsoNormal>> </p><p class=MsoNormal>>               return     lead+values.join(j)+trail; // avoid array brackets on SF types</p><p class=MsoNormal>> </p><p class=MsoNormal>>           else</p><p class=MsoNormal>> </p><p class=MsoNormal>>               return '['+lead+values.join(j)+trail+']';</p><p class=MsoNormal>> </p><p class=MsoNormal>> ==========================================</p><p class=MsoNormal>> </p><p class=MsoNormal>> I logged type, and these appear to be Java types.  So we’ll have to change type to attrType or something. Will do.</p><p class=MsoNormal>> </p><p class=MsoNormal>> John</p><p class=MsoNormal>> </p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>all the best, Don</p><p class=MsoNormal>-- </p><p class=MsoNormal>Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman@nps.edu</p><p class=MsoNormal>Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149</p><p class=MsoNormal>X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>