[x3d-public] X3D python language binding, pyjnius validation

John Carlson yottzumm at gmail.com
Thu Apr 4 08:15:38 PDT 2019


Okay. I am in charge of the JavaScript.

I removed all references to stack space, classpath and jnius_config

It works on local files (not future.py files). I have not tried running python on things in the archive yet.

You will need to set the CLASSPATH env variable in build.xml.

I have checked in changes to serializers, and restarted my build.

I recommend regenerating python files and rerunning validation:

See below, existing error locally (needs to be debugged, serializer changed etc.  But first we need to patch it or autoclass.py, X3Dautoclass.py to see if we can get rid of the error.

Suggestions?

$ python abox.future.py
Traceback (most recent call last):
  File "abox.future.py", line 47, in <module>
    .setProtoField("myShape") \
  File "jnius\jnius_export_class.pxi", line 760, in jnius.JavaMethod.__call__
  File "jnius\jnius_conversion.pxi", line 78, in jnius.populate_args
  File "jnius\jnius_utils.pxi", line 205, in jnius.check_assignable_from
jnius.JavaException: Invalid instance of 'org/web3d/x3d/jsail/X3DConcreteNode' passed for a 'org/web3d/x3d/sai/Core/X3DNode'

Sent from Mail for Windows 10

From: Brutzman, Donald (Don) (CIV)
Sent: Thursday, April 4, 2019 7:57 AM
To: John Carlson
Cc: X3D Graphics public mailing list
Subject: Re: X3D python language binding, pyjnius validation

probably best if you stay in charge of the javascript modifications, that is your work.

a. do we need to set classpath value below as a settable parameter, or better, just have it use existing classpath?  that way location of X3DJSAIL.3.3.full.jar is controlled externally on local system, as intended.

b. need CommentsBlock to be available since it is part of conversions.

On 4/3/2019 10:28 AM, John Carlson wrote:
> For example, in python files you send me, I think the following line:
> 
> jnius_config.set_classpath('.', '../../../jars/X3DJSAIL.3.3.full.jar')
> 
> Is not working.
> 
> I believe that CommentsBlock may be taken out of the X3Dautoclass.py file, since I don’t use it.  But may later.
> 
> John
> 
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
> *From: *John Carlson <mailto:yottzumm at gmail.com>
> *Sent: *Wednesday, April 3, 2019 12:22 PM
> *To: *Brutzman, Donald (Don) (CIV) <mailto:brutzman at nps.edu>; X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
> *Subject: *RE: X3D python language binding, pyjnius validation
> 
> My guess would be the classpath set by jnius_config…. Method is not working.
> 
> John
> 
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
> *From: *Brutzman, Donald (Don) (CIV) <mailto:brutzman at nps.edu>
> *Sent: *Wednesday, April 3, 2019 12:17 PM
> *To: *John Carlson <mailto:yottzumm at gmail.com>; X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
> *Subject: *X3D python language binding, pyjnius validation
> 
> Hi John.  Status report.
> 
> a. am able to build on primary Windows 10 box,
> 
> b. still grappling with Visual Studio bug related to on Windows XP box,
> 
> c. have added build targets for X3D examples archives: clean.python and processScenes.python which work on first box,
> 
> d. .py generation works (see attached) but running self-validation of the two .py files still has problems.
> 
> Am getting a lot of these errors.  Do you have a bidirectional python-to-java mapping for x3djsail CommentsBlock when comments are encountered?
> 
> =====================
> 
> create python:
> 
> node xml2all.js C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Visualization//TextureBackgroundCube.x3d
> 
> TextureBackgroundCube.py produced from TextureBackgroundCube.x3d
> 
> test python:
> 
> Loading and running TextureBackgroundCube.py program, if successful then saving as round-trip .x3d version:
> 
> Traceback (most recent call last):
> 
>     File "C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForAdvancedModeling/Visualization//TextureBackgroundCube.py", line 5, in <module>
> 
>       from X3Dautoclass import *
> 
>     File "C:\x3d-code\www.web3d.org\x3d\stylesheets\java\src\python\pyjnius\X3Dautoclass.py", line 2, in <module>
> 
>       CommentsBlock = autoclass('org.web3d.x3d.jsail.Core.CommentsBlock')
> 
>     File "C:\Program Files\Python37\lib\site-packages\jnius\reflect.py", line 159, in autoclass
> 
>       c = find_javaclass(clsname)
> 
>     File "jnius\jnius_export_func.pxi", line 26, in jnius.find_javaclass
> 
> jnius.JavaException: Class not found b'org/web3d/x3d/jsail/Core/CommentsBlock'
> 
> Result: 1
> 
> =====================
> 
> In addition to example-project build.xml files, am also working with the pyjnius subdirectory build.xml still, but standing clear of your .py and .js files.
> 
> TIA for continuing insights and improvements.
> 
> all the best, Don
> 
> -- 
> 
> Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
> 
> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
> 
> X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
> 


all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190404/15f58a5a/attachment-0001.html>


More information about the x3d-public mailing list