[x3d-public] x3d.py users...quick question and answer.

John Carlson yottzumm at gmail.com
Mon Jan 31 13:20:36 PST 2022


I'm guessing I have to so something like

value=SFColor((0.9,0.9,0.9))

??  No!

I will look through examples of generated JSON from X3dToPython.xslt, found
in flower2.py.  I will try the following:
flowers2.py:
 field(name='diffuseColor',accessType='inputOutput',type='SFColor',value=(1,0.5,0)),
flowers2.py:
 field(name='specularColor',accessType='inputOutput',type='SFColor',value=(1,0.5,0)),

Looks like it works, for anyone confused why you can't pass 3 (actually 4)
values to SFColor!

I'm approaching near completion of x3djsonld.py, except for HAnim it
appears.  I might call you Joe, so prepare to video (on Zoom?).  I haven't
looked into these issues yet, so let me do that first.

X3dToPython.xslt is still preferred, as I haven't handled children
(comments) and value in Shape and Text.

Note:  I am reading in JSON.


Traceback (most recent call last):
  File
"C:\Users\john\X3DJSONLD\src\main\python\net\coderextreme\data\ViewFrustumPrototype.py",
line 17, in <module>
    field(name="lineColor", accessType="inputOutput", appinfo="RGB color of
ViewFrustum outline, default value 0.9 0.9 0.9", type="SFColor",
value=SFColor(0.9,0.9,0.9)),
TypeError: SFColor.__init__() takes from 1 to 2 positional arguments but 4
were given
Error: ../python/net/coderextreme/data/ViewFrustumPrototype.py failed to
parse
python ../python/x3djsonld.py ../data/x3dconnector.json
../python/net/coderextreme/data/x3dconnector.py
../python/net/coderextreme/data/x3dconnector.py
python ../python/x3djsonld.py ../data/x3dconnectorProto.json
../python/net/coderextreme/data/x3dconnectorProto.py
../python/net/coderextreme/data/x3dconnectorProto.py
python ../python/x3djsonld.py ../data/X3dHeaderPrototypeSyntaxExamples.json
../python/net/coderextreme/data/X3dHeaderPrototypeSyntaxExamples.py
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20220131/0ec99275/attachment.html>


More information about the x3d-public mailing list