<div dir="ltr">The most important thing is last in this email, problems validating default MFVec2f crossSection field in x3d.py.  The rest of the email is background.<div><br></div><div>To get x3d.py (x3djsonld.py) to handle HelloWorldProgramOutput.json,  I had to remove Extrusions from the example, and change to Spheres.<div><br></div><div>Below is the change to the example to make it work:<br><div><br></div><div>diff /c/x3d-code/<a href="http://www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.json">www.web3d.org/x3d/stylesheets/java/examples/HelloWorldProgramOutput.json</a> HelloWorldProgramOutput.json<br>1135c1135<br><                 { "Extrusion":<br>---<br>>                 { "Sphere":<br>2392c2392<br><                 { "Extrusion":<br>---<br>>                 { "Sphere":<br>2693c2693<br>< }<br>\ No newline at end of file<br>---<br>> }<br></div></div><div>============================================================</div><div>If one does not make the change to the JSON file, the following error appears.  x3djsonld.py is in X3DJSONLD/src/main/python.</div><div><br></div><div>$ python x3djsonld.py<br>'''<br>x3d.py package 4.0.63.7 loaded, have fun with X3D Graphics!<br>'''<br>from x3d import *<br>from x3d import SFBool<br>print(<br>Traceback (most recent call last):<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3d.py", line 4668, in assertValidMFVec2f<br>    MFVec2f(value)<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3d.py", line 9184, in __init__<br>    self.value = value<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3d.py", line 9206, in value<br>    value = [(x, y) for x, y, in value]<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3d.py", line 9206, in <listcomp><br>    value = [(x, y) for x, y, in value]<br>ValueError: too many values to unpack (expected 2)<br><br>The above exception was the direct cause of the following exception:<br><br>Traceback (most recent call last):<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3djsonld.py", line 256, in <module><br>    print(parseObject("X3D", data, 0))<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3djsonld.py", line 178, in parseObject<br>    out += parseObject(k, v,indent+1)<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3djsonld.py", line 163, in parseObject<br>    out += parseObject(k, v,indent+1)<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3djsonld.py", line 192, in parseObject<br>    out += parseArray("[", "]", parent, key, v,indent+1, fieldType)<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3djsonld.py", line 57, in parseArray<br>    out += parseObject(parent, d,indent+1)<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3djsonld.py", line 178, in parseObject<br>    out += parseObject(k, v,indent+1)<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3djsonld.py", line 175, in parseObject<br>    out += parseObject(k, v,indent+1)<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3djsonld.py", line 178, in parseObject<br>    out += parseObject(k, v,indent+1)<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3djsonld.py", line 125, in parseObject<br>    fieldInfo = getField(parent, key)<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3djsonld.py", line 14, in getField<br>    cls = eval(grandparent)()<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3d.py", line 38948, in __init__<br>    self.crossSection = crossSection<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3d.py", line 39005, in crossSection<br>    assertValidMFVec2f(crossSection)<br>  File "C:\Users\john\X3DJSONLD\src\main\python\x3d.py", line 4672, in assertValidMFVec2f<br>    raise X3DTypeError(str(value)[:100] + ' has type ' + str(type(value)) + ' but is not a valid MFVec2f') from error<br>x3d.X3DTypeError: [(1, 1, 1, -1, -1, -1, -1, 1, 1, 1)] has type <class 'list'> but is not a valid MFVec2f<br></div><div>============================================================</div><div>What's wrong with the is handling the Extrusion when crossSection is not set, thus x3d.py:</div><div><br></div><div>    @crossSection.setter<br>    def crossSection(self, crossSection):<br>        if  crossSection is None:<br>            crossSection = [(1, 1, 1, -1, -1, -1, -1, 1, 1, 1)] # default<br>        assertValidMFVec2f(crossSection)<br>        self.__crossSection = crossSection<br></div><div><br></div><div>Note that crossSection's default is not correct.</div><div><br></div><div>Thanks for any fixes to x3d.py.  I will try to fix it now.</div><div><br></div><div>John</div></div></div>