[x3d-public] X3D python: Missing array?
Brutzman, Donald (Don) (CIV)
brutzman at nps.edu
Sat May 18 16:55:43 PDT 2019
This was a bug in X3DJSAIL code generation that inadvertently prevented some of the double methods from getting created. Fixed last night, checked in and deployed.
Specifically, the invocation below ".setOrientation(-0.59028,0.76927,0.2445,0.987861)" was looking for a method accepting 4 doubles in ViewpointObject.
That method now exists in X3DJSAIL:
public ViewpointObject setOrientation(double x,double y,double z,double angleRadians)
http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Navigation/ViewpointObject.html#setOrientation-double-double-double-double-
There is a similar method that accepts double arrays which should also work for Python programmers invoking
.setOrientation([-0.59028,0.76927,0.2445,0.987861])
public ViewpointObject setOrientation(double[] newArray)
http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Navigation/ViewpointObject.html#setOrientation-double:A-
So the problem you report below should be handled now. It is still reporting a similar error, which I believe is due to pyjnius incorrectly trying to match the X3DViewpointNode abstract class, instead of continued pipelining using the ViewpointObject concrete class.
Meanwhile I checked the build.all.python logs and found a few more "Invalid call, number of argument mismatch" errors. Have added additional custom set methods accepting double arrays as input values for MF arrays, SFMatrix types, MFColor*, etc. Will run the full build again tonight to see if any more remain.
On 5/18/2019 10:35 AM, John Carlson wrote:
> processSingleScene.pythonValidation:
>
> [echo] processSingleScene.python C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForWebAuthors\Chapter03Grouping\CoordinateAxesLines.future.py
>
> [echo] Loading X3D model as .py program, if successful then saving as round-trip .x3d version:
>
> [exec] Traceback (most recent call last):
>
> [exec] File "C:\x3d-code\www.web3d.org\x3d\content\examples\X3dForWebAuthors\Chapter03Grouping\CoordinateAxesLines.future.py", line 25, in <module>
>
> [exec] .addChild(x3dpsail.Viewpoint().setDescription("Oblique view").setOrientation(-0.59028,0.76927,0.2445,0.987861).setPosition(6,6,6))
>
> [exec] File "jnius\jnius_export_class.pxi", line 742, in jnius.JavaMethod.__call__
>
> [exec] jnius.JavaException: Invalid call, number of argument mismatch, got 4 need 1
>
> [echo] =====================
>
> I believe the above can be fixed by wrapping.
>
> Also, x3dpsail package python file has been created in the pyjnius folder, which includes all X3D python concrete classes. To show that I’m not importing any abstract classes, I ran the following:
>
> $ grep -v jsail x3dpsail.py
>
> import jnius_config
>
> jnius_config.set_classpath('.', 'c:/x3d-code/www.web3d.org/x3d/stylesheets/java/jars/X3DJSAIL.3.3.full.jar', '../../../jars/X3DJSAIL.3.3.full.jar')
>
> from jnius import autoclass
>
> The x3dpsail. prefix has been added to all python scenegraph files on my system. Please run a build. Thanks!
>
> 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