[x3d-public] python pyjnius mapping: setDEF troubleshooting

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Wed May 15 04:39:55 PDT 2019

among other things we said:

On 5/14/2019 10:48 PM, Brutzman, Donald (Don) (CIV) wrote:> Traceback (most recent call last):
>     File "HelloWorld.future.py", line 54, in <module>
>       .addChild(Viewpoint().setDEF("ViewUpClose").setCenterOfRotation(0,-1,0).setDescription("Hello world!").setPosition(0,-1,7))
> AttributeError: 'org.web3d.x3d.sai.Navigation.X3DViewpointNode' object has no attribute 'setCenterOfRotation'
> oh no, that is not correct!  it is the setDEF() method that returns the incorrect return type, which the subsequent setCenterOfRotation(0,-1,0) can't operate on.
> OK so that gets me closer to understanding what you were saying about setDEF.
> Similar issue:  ViewpointObject setDEF() is an @Override method.
> 	@Override
> 	public final ViewpointObject setDEF(String newValue)
> i'll take a deeper look at setDEF() lineage next time.

On 5/15/2019 12:30 AM, John Carlson wrote:
> > Was the setDEF case when we had to pass the DEF value to the constructor instead of a setter?  I think we can do that, if desired.

Looking at current errors in build.python.all.log.txt, the majority have a setDEF() method which thwarts the first of second pipelined method that follows.  This seems to be the primary culprit.

Looking very closely at ViewpointObject method invocation

	public final ViewpointObject setDEF(String newValue)

... via Netbeans IDE shows that this method actually overrides *two* parent methods, which is atypical.  One overwritten method is in X3DConcreteNode (which is OK) and one in interface org.web3d.x3d.sai.Navigation.Viewpoint which is bad and likely cause of our unintended misdirection in the class hierarchy.

This might be adjustable, avoiding the dual-inheritance case.  Of note is that setDEF() and setUSE() do not actually appear in the X3D Java SAI Specification, I added them early in the design process for consistency.  So we have some latitude here.

So I think/hope we might have finally localized the variations in X3DJSAIL that provoke the undesired behavior in Pyjnius.  If so, our sleuthing and attempted fixes will be able to have an effect.

I will do some experimentation with setDEF/setUSE (probably Thursday night) and see if that can get fixed.

If you can find a way to move the list of imports out of each source conversion (e.g. HelloWorld.py) and into a configuration .py file, then we will be a lot closer to our goal of Pythonic duck typing...

Slogging onward.  Thanks for continuing efforts John.

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

More information about the x3d-public mailing list