[x3d-public] X3DPSAIL x3d.py package updated and deployed to x3d.py, adding initial support for JSON export

John Carlson yottzumm at gmail.com
Sun Dec 5 22:41:10 PST 2021


On 12/6/21 00:29, John Carlson wrote:
>
>
> On 12/6/21 00:19, John Carlson wrote:
>>
>> Don, I will probably begin working on JSON export testing after I 
>> take the JSON import example for a short spin.  It's good to get a 
>> code download.
>>
>> Note that SFVec3f should put a tuple in the structure when parsing 
>> JSON...normal JSON does not include tuples, so there needs to be a 
>> type conversion.
>>
>> That is, centerOfRotation and position in Viewpoint should be tuples, 
>> not lists as JSON provides.
>>
> Fixed as far as I am concerned right now.  I will try to remove my 
> tuple soon.
Tested removing tuple() without any problems.
>>
>> I sent a previous message about HelloWorld.py and how the fields 
>> might be converted to lists in the the constructor call.
>>
> That has been done, AFAICT.

SFVec3f field values converted to lists from tuples, to clarify. Good work!

>>> John, please collect your comments and examples regarding JSON 
>>> export flaws.  The build.examples.log.txt file is a good place to 
>>> start.  Am returning to work this week, finishing up everything not 
>>> yet done this year…
>>>
I need to talk to you about making MF fields and nodes iterable. Output 
fails in both JSON and XML output.

See traceback here:


Traceback (most recent call last):
  File "/c/x3d-code/www.web3d.org/x3d/content/examples/x3dinput.py", 
line 141, in <module>
    print(scene.JSON())
  File "/c/x3d-code/www.web3d.org/x3d/content/examples/x3d.py", line 
12790, in JSON
    result += str(self.head.JSON(indentLevel=indentLevel+1, syntax=syntax))
  File "/c/x3d-code/www.web3d.org/x3d/content/examples/x3d.py", line 
10792, in JSON
    for each in self.children:
TypeError: 'JSON_MFNode' object is not iterable


I'm hoping we can spend some collaboration time working on these 
issues.  Otherwise, I will try to engage my python programmer to discuss 
options.

Pretty much all my code has been posted except for removing tuple().
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20211206/dfac37d5/attachment.html>


More information about the x3d-public mailing list