[x3d-public] Status, X3DPSAIL (another error)

John Carlson yottzumm at gmail.com
Mon Apr 29 18:12:08 PDT 2019


This error as morphed into the following (not an error in pyjnius API?).  Fixes welcome.

$ python Collision.future.py
Warning: meta name newValue="permissions" has an unrecognized value not matching any of the optional string tokens.
Traceback (most recent call last):
  File "Collision.future.py", line 126, in <module>
    .setUrl(MFString(["../KelpForestExhibit/KelpTank.x3d","http://X3dGraphics.com/examples/X3dForWebAuthors/KelpForestExhibit/KelpTank.x3d","../KelpForestExhibit/KelpTank.wrl","http://X3dGraphics.com/examples/X3dForWebAuthors/KelpForestExhibit/KelpTank.wrl"])) \
  File "jnius\jnius_export_class.pxi", line 766, in jnius.JavaMethod.__call__
  File "jnius\jnius_export_class.pxi", line 843, in jnius.JavaMethod.call_method
  File "jnius\jnius_utils.pxi", line 91, in jnius.check_exception
jnius.JavaException: JVM exception occurred: Invalid setContainerFieldOverride() value='proxy', legal values for Inline are containerField_ALTERNATE_VALUES='"children" "watchList"

Sent from Mail for Windows 10

From: John Carlson
Sent: Friday, April 26, 2019 4:28 PM
To: Don Brutzman; X3D Graphics public mailing list
Subject: RE: Status, X3DPSAIL (another error)

YAE:

processSingleScene.pythonValidation:
     [echo] processSingleScene.python C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForWebAuthors\Chapter04ViewingNavigation\Collision.future.py
     [echo] Loading X3D model as .py program, if successful then saving as round-trip .x3d version:
     [exec] Warning: meta name newValue="permissions" has an unrecognized value not matching any of the optional string tokens.
     [exec] Traceback (most recent call last):
     [exec]   File "C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForWebAuthors\Chapter04ViewingNavigation\Collision.future.py", line 118, in <module>
     [exec]     .setTransparency(SFFloat(0.5)) \
     [exec] AttributeError: 'org.web3d.x3d.sai.Navigation.Collision' object has no attribute 'addChild'
     [exec] Result: 1
     [echo] =====================

This is a problem with the interface not having an addChild method, yet the concrete class does.  setProxy returns a concrete object type (CollisionObject), yet the interface, returns a Collision interface type.   The interface has no addChild method.  Suggestion is to use addChildren instead of addChild, but addChildren is undesirable for pipelining, so I am stuck. I need an addChild method in the interface, I think.  Note that I think that that concrete class violates the interface by returning a concrete class type instead of an interface type for setProxy.

Note: setProxy is called twice on CollisionObject.  I believe this is an error in the serializer, but I haven’t found it yet.  JavaScript assistance is welcome in the PythonPipeliningSerializer.js:

https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/src/python/pyjnius/PythonPipeliningSerializer.js

Other error reports are welcome.  I’m going to take a break after this bunch.

Super!

John



Sent from Mail for Windows 10

From: John Carlson
Sent: Friday, April 26, 2019 3:39 PM
To: Don Brutzman; X3D Graphics public mailing list
Subject: Status, X3DPSAIL

1. We conquered most of the attribute errors.   There might be one or a few left in the X3dForWebAuthors folder.
2. Outstanding error 1:

$ python foo.py
Traceback (most recent call last):
  File "foo.py", line 8, in <module>
    .setIS(IS() \
  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'

Code:

$ cat foo.py
import classpath
from org.web3d.x3d.jsail.Core.ProtoBodyObject import ProtoBodyObject as ProtoBody
from org.web3d.x3d.jsail.Core.ISObject import ISObject as IS
from org.web3d.x3d.jsail.Grouping.TransformObject import TransformObject as Transform

ProtoBody() \
  .addChild(Transform() \
   .setIS(IS() \
   ) \
  )

This is because setIS returns an X3DConcreteNode (in X3DConcreteNode) and the X3DConcreteNode is not a X3DNode, despite the fact that TransformObject derives from X3DNode.    Suggest cast to X3DNode or adding additional addChild methods with additional types as parameters to ProtoBodyObject.java. Casts are seen throughout the X3DJSAIL code for addChild.  Perhaps it would be preferable to add methods which avoid casts in application code (ok in library).

What do you think?

Will start python execution process to report on additional errors (mostly stack overflows, I think).

John


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20190429/bff5dbde/attachment.html>


More information about the x3d-public mailing list