<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>Reflect.py is copied from the pyjnius source.  I recommend going to the pyjnius source under the kivy user on GitHub.  If you want to review the mapping between python and java, you’re welcome, but I don’t expect you to find anything interesting (but maybe there could be a bug there, I’ve not looked).</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m one step ahead of you. Look at recent email where I suggest returning self instead of the return normal value of the JavaMethod.   I will repost.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>John</p><p class=MsoNormal><o:p> </o:p></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>Saturday, May 18, 2019 8:14 AM<br><b>To: </b><a href="mailto:yottzumm@gmail.com">John Carlson</a>; <a href="mailto:x3d-public@web3d.org">X3D Graphics public mailing list</a><br><b>Subject: </b>X3D Python binding X3DPSAIL progress: pyJNIus problem isolated</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>1. Have committed several fixes and produced a new build of X3DJSAIL, uploaded updated python examples for X3D Example Archives.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                https://www.web3d.org/x3d/content/examples/build.python.all.log.txt</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                http://www.web3d.org/x3d/content/examples/</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorldIndex.html</p><p class=MsoNormal>                http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorld.x3d</p><p class=MsoNormal>                http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorld.java</p><p class=MsoNormal>                http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorld.py</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>- - -</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>2. Latest work refactored setDEF() and setUSE() methods.  There is no way to invoke them incorrectly.  Local use with a concrete node explicitly calls the protected superclass.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>For example, in Java, the following pipelined methods always return the same updated ViewpointObject so that subsequent invocations are possible.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                new ViewpointObject().setDEF("ViewUpClose").setDescription("Hello world!").setCenterOfRotation(0.0f,-1.0f,0.0f).setPosition(0.0f,-1.0f,7.0f))</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The nearly identical call in Python should work exactly the same, if pyjnius mappings are correct.  However it fails.  Invocation and Python log excerpt follow.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                Viewpoint().setDEF("ViewUpClose").setCenterOfRotation(0,-1,0).setDescription("Hello world!").setPosition(0,-1,7)</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>=========================</p><p class=MsoNormal>Loading HelloWorld.py (pipeline syntax) with python, if successful then saving and validating as HelloWorld_RoundTrip2.x3d version:</p><p class=MsoNormal>Traceback (most recent call last):</p><p class=MsoNormal>   File "C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/HelloWorldScenes//HelloWorld.py", line 54, in <module></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.jsail.X3DConcreteNode' object has no attribute 'setCenterOfRotation'</p><p class=MsoNormal>=========================</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The Python traceback above is misdirecting but close scrutiny nevertheless reveals the problem.  The .setCenterOfRotation() method should have been found on the pipelined ViewpointObject.  Instead, pyjnius is mistakenly looking at superclass org.web3d.x3d.jsail.X3DConcreteNode.  That shouldn't happen.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The first hundred or so of the remaining errors in the build log are all attributable to this same error.  This same explanation applies to the .addChild() issues you've looked at, John.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Having pushed the pyjnius error around, am positive that there is no way to work around it in X3DJSAIL.  Nor would we want to break a strict object-oriented design to accommodate a mistake in a secondary implementation.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So, not fixed yet, but appears to be fully isolated as a problem in our pyjnius mapping, or possibly pyjnius itself.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>- - -</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>3. Specifically the error has to do with pyjnius preferentially looking for a superclass, rather than the object itself as specified, when returning a value from a method.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Recommend we next torment the X3D pyjnius binding you've created for further troubleshooting.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Once were fully confident about that, the problem is either (a) fixed, or (b) isolated to pyjnius itself.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>So where do we go next, reflect.py?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/src/python/pyjnius/</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/src/python/pyjnius/reflect.py</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>                https://pyjnius.readthedocs.io/en/stable/api.html</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Onward...</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>