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

John Carlson yottzumm at gmail.com
Sun Nov 25 05:07:21 PST 2018


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/4ac77139/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: UniversalJoint.py
Type: application/octet-stream
Size: 4519 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20181125/4ac77139/attachment-0001.obj>


More information about the x3d-public mailing list