[x3d-public] X3DJSAIL Python: setShape() Method not found onCollidableShapeparent interface, cannot find in returned object. Need cast.

John Carlson yottzumm at gmail.com
Sun Nov 25 05:14:56 PST 2018


Actually, I am bamboozled by these errors.

John

Sent from Mail for Windows 10

From: John Carlson
Sent: Sunday, November 25, 2018 7:07 AM
To: X3D Graphics public mailing list
Subject: RE: X3DJSAIL Python: setShape() Method not found onCollidableShapeparent interface, cannot find in returned object. Need cast.


Note, that we already have this style that works.  Attached.

John
Sent from Mail for Windows 10

From: John Carlson
Sent: Sunday, November 25, 2018 7:04 AM
To: X3D Graphics public mailing list
Subject: X3DJSAIL Python: setShape() Method not found on CollidableShapeparent interface, cannot find in returned object. Need cast.

We need the right style to cast abstract returned objects to concrete objects in python.  See attached example.

processScene.python:
     [exec] Traceback (most recent call last):
     [exec]   File "C:\x3d-code\www.web3d.org\x3d\content\examples\Basic\RigidBodyPhysics\UniversalJointfuture.py", line 73, in <module>
     [exec]     .setDEF("BOX-GEOM-1") \
     [exec] AttributeError: 'org.web3d.x3d.sai.RigidBodyPhysics.X3DNBodyCollida' object has no attribute 'setShape'
     [exec] Result: 1
     [echo] C:\x3d-code\www.web3d.org\x3d\content\examples\Basic\RigidBodyPhysics\UniversalJointfuture.py

We should probably grant a prize to whoever gets the right casting that works in all instances.

My best bet for short term is to fold the setDEF into the object constructor.

What do people think?




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


More information about the x3d-public mailing list