<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><span style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">With some
flimflamming around, I was able to clear up some of my
previous stacktraces. Now I'm stuck in JSON export, may
switch to XML export:</span></span></p>
<p><span style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;"><br>
</span></span></p>
<p><span style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">Traceback
(most recent call last):
</span></span></p>
<p><span style="font-family:monospace"></span></p>
<span style="font-family:monospace"> File
"/c/x3d-code/www.web3d.org/x3d/content/examples/x3dinput.py", line
148, in <module>
<br>
print(scene.JSON(indentLevel=0, syntax="JSON"))
<br>
File "/c/x3d-code/www.web3d.org/x3d/content/examples/x3d.py",
line 12792, in JSON
<br>
result += str(self.Scene.JSON(indentLevel=indentLevel+1,
syntax=syntax))
<br>
File "/c/x3d-code/www.web3d.org/x3d/content/examples/x3d.py",
line 12303, in JSON
<br>
result += each.JSON(indentLevel=indentLevel+1, syntax=syntax)
<br>
</span>
<p><span style="font-family:monospace">TypeError: JSON() got an
unexpected keyword argument 'indentLevel'<br>
</span></p>
<p><span style="font-family:monospace"><br>
</span></p>
<p><span style="font-family:monospace">A similar error appeared in
several places, and I got rid of the arguments, plus I removed
the 100 character limit on one exception in this diff:<br>
</span></p>
<p><br>
</p>
<span style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">diff
/c/x3d-code/www.web3d.org/x3d/stylesheets/python/x3d.py x3d.py </span><br>
3206c3206
<br>
< raise X3DTypeError(str(value)[:100] + ' element '
+ str(each) + ', type=' + str(type(each)) + ' is not a valid
_X3DNode or _X3DStatement fo<br>
r MFNode')
<br>
---
<br>
> raise X3DTypeError(str(value) + ' element ' +
str(each) + ', type=' + str(type(each)) + ' is not a valid
_X3DNode or _X3DStatement for MFNo<br>
de')
<br>
12303c12303
<br>
< result +=
each.JSON(indentLevel=indentLevel+1, syntax=syntax)
<br>
---
<br>
> result += str(each.JSON())
<br>
42407c42407
<br>
< result +=
each.JSON(indentLevel=indentLevel+1, syntax=syntax)
<br>
---
<br>
> result += each.JSON()
<br>
77412c77412
<br>
< result +=
self.geometry.JSON(indentLevel=indentLevel+1, syntax=syntax)
<br>
---
<br>
> result += self.geometry.JSON()
<br>
89062c89062
<br>
< result +=
each.JSON(indentLevel=indentLevel+1, syntax=syntax)
<br>
---
<br>
</span>
<p><span style="font-family:monospace">>
result += each.JSON()</span></p>
<p><span style="font-family:monospace"><br>
</span></p>
<p><span style="font-family:monospace">I was able to stumble through
to get some JSON output, but I don't particularly parse the
whole input yet. Code is attached, much more work is needed,
but at least this sample input is starting to see the light of
day!</span></p>
<p><span style="font-family:monospace">To run, unpack the zip, and
run $ python3 x3dinput.py</span></p>
<p><span style="font-family:monospace">A local HelloWorld.json is
the default input in the zip. Perhaps we can discuss the
progress tomorrow at 4pm? I've already noticed some issues,
but I will try to get to bed tonight. I have a lot more
confidence in my ability to at least create a sample JSON import
module/package. I'm a bit concerned that neither @version nor
@profile were output. More work is needed on JSON Export. There
are a few things I see in the JSON export, like multiple "meta"
objects, and SFVec3f being strings instead of arrays. I will
like get to geometry and appearance in the next few days.</span></p>
<p><br>
<span style="font-family:monospace"><span
style="font-family:monospace"><span
style="color:#000000;background-color:#ffffff;">{
</span><br>
"X3D":
<br>
{ "head":
<br>
{ "meta":
<br>
{
<br>
"@content":"HelloWorld.x3d",
<br>
"@name":"title"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":"Simple X3D model example: Hello World!",
<br>
"@name":"description"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":"30 October 2000",
<br>
"@name":"created"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":"11 June 2021",
<br>
"@name":"modified"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":"Don Brutzman",
<br>
"@name":"creator"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":"HelloWorld.tall.png",
<br>
"@name":"Image"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":<a class="moz-txt-link-rfc2396E" href="https://en.wikipedia.org/wiki/Hello_world">"https://en.wikipedia.org/wiki/Hello_world"</a>,
<br>
"@name":"reference"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":<a class="moz-txt-link-rfc2396E" href="https://en.wikipedia.org/wiki/Hello#.22Hello.2C_World.22_computer_program">"https://en.wikipedia.org/wiki/Hello#.22Hello.2C_World.22_computer_program"</a>,
<br>
"@name":"reference"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":<a class="moz-txt-link-rfc2396E" href="https://en.wikipedia.org/wiki/"Hello,_World!"_program">"https://en.wikipedia.org/wiki/"Hello,_World!"_program"</a>,
<br>
"@name":"reference"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":<a class="moz-txt-link-rfc2396E" href="https://en.wikibooks.org/w/index.php?title=Computer_Programming/Hello_world">"https://en.wikibooks.org/w/index.php?title=Computer_Programming/Hello_world"</a>,
<br>
"@name":"reference"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":<a class="moz-txt-link-rfc2396E" href="https://www.HelloWorldExample.net">"https://www.HelloWorldExample.net"</a>,
<br>
"@name":"reference2"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":<a class="moz-txt-link-rfc2396E" href="https://www.web3d.org">"https://www.web3d.org"</a>,
<br>
"@name":"reference"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":<a class="moz-txt-link-rfc2396E" href="https://www.web3d.org/realtime-3d/news/internationalization-x3d">"https://www.web3d.org/realtime-3d/news/internationalization-x3d"</a>,
<br>
"@name":"reference"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":<a class="moz-txt-link-rfc2396E" href="https://www.web3d.org/x3d/content/examples/HelloWorld.x3d">"https://www.web3d.org/x3d/content/examples/HelloWorld.x3d"</a>,
<br>
"@name":"reference"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":<a class="moz-txt-link-rfc2396E" href="https://X3dGraphics.com/examples/X3dForAdvancedModeling/HelloWorldScenes/HelloWorld.x3d">"https://X3dGraphics.com/examples/X3dForAdvancedModeling/HelloWorldScenes/HelloWorld.x3d"</a>,
<br>
"@name":"reference"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":<a class="moz-txt-link-rfc2396E" href="https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorld.x3d">"https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter01TechnicalOverview/HelloWorld.x3d"</a>,
<br>
"@name":"identifier"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":<a class="moz-txt-link-rfc2396E" href="https://www.web3d.org/x3d/content/examples/license.html">"https://www.web3d.org/x3d/content/examples/license.html"</a>,
<br>
"@name":"license"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":"X3D-Edit 4.0,
<a class="moz-txt-link-freetext" href="https://savage.nps.edu/X3D-Edit">https://savage.nps.edu/X3D-Edit</a>",
<br>
"@name":"generator"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":"HelloWorld.wrl",
<br>
"@name":"reference"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":"HelloWorld.x3dv",
<br>
"@name":"reference"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":"HelloWorld.x3db",
<br>
"@name":"reference"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":"HelloWorld.xhtml",
<br>
"@name":"reference"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":"HelloWorld.json",
<br>
"@name":"reference"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":"14 October 2021",
<br>
"@name":"translated"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":"X3dToJson.xslt,
<a class="moz-txt-link-freetext" href="https://www.web3d.org/x3d/stylesheets/X3dToJson.html">https://www.web3d.org/x3d/stylesheets/X3dToJson.html</a>",
<br>
"@name":"generator"
<br>
}
<br>
},
<br>
{ "meta":
<br>
{
<br>
"@content":"X3D JSON encoding:
<a class="moz-txt-link-freetext" href="https://www.web3d.org/wiki/index.php/X3D_JSON_Encoding">https://www.web3d.org/wiki/index.php/X3D_JSON_Encoding</a>",
<br>
"@name":"reference"
<br>
}
<br>
},
<br>
}
<br>
{ "Scene":
<br>
None{ "WorldInfo":
<br>
{
<br>
"@info":""Example scene to illustrate a simple X3D
model"",
<br>
"@title":"Hello World!"
<br>
}
<br>
}
<br>
{ "Group":
<br>
{ "Viewpoint":
<br>
{
<br>
"@DEF":"ViewUpClose",
<br>
"@centerOfRotation":"0 -1 0",
<br>
"@description":"Hello world!",
<br>
"@position":"0 -1 7"
<br>
}
<br>
},
<br>
{ "Transform":
<br>
{ "Shape":
<br>
{ "Appearance":
<br>
},
<br>
}
<br>
}
<br>
{ "Transform":
<br>
{ "Shape":
<br>
{ "Appearance":
<br>
},
<br>
}
<br>
}
<br>
}
<br>
}
<br>
}<br>
<br>
<br>
</span></span></p>
<p><span style="font-family:monospace"><br>
</span></p>
<p><span style="font-family:monospace"></span></p>
<br>
<span style="font-family:monospace"></span>
<p><span style="font-family:monospace"></span></p>
</body>
</html>