[x3d-public] JSON schema: type for IMPORT, EXPORT
Don Brutzman
brutzman at nps.edu
Sun May 7 19:25:49 PDT 2017
x3d-3.3-JSONSchema.json says
"IMPORT": {
"type": "array",
"EXPORT": {
"type": "array",
but likely should be structured similarly to
"ROUTE": {
"type": "object",
Diagnostic: test scene X3dHeaderPrototypeSyntaxExamples.json attached, with excerpt:
{ "IMPORT":
{
"@AS":"someInlineRoot",
"@importedDEF":"someName",
"@inlineDEF":"someInline"
}
},
{ "PositionInterpolator":
{
"@DEF":"StayInPlace",
"@key":[0,1],
"@keyValue":[0,0,0,0,0,0]
}
},
all the best, Don
--
Don Brutzman Naval Postgraduate School, Code USW/Br brutzman at nps.edu
Watkins 270, MOVES Institute, Monterey CA 93943-5000 USA +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
-------------- next part --------------
{ "X3D": {
"encoding":"UTF-8",
"@profile":"Immersive",
"@version":"3.3",
"@xsd:noNamespaceSchemaLocation":"http://www.web3d.org/specifications/x3d-3.3.xsd",
"JSON schema":"http://www.web3d.org/specifications/x3d-3.3-JSONSchema.json",
"head": {
"component": [
{
"@name":"Geospatial",
"@level":1
},
{
"@name":"NURBS",
"@level":2
},
{
"@name":"Core",
"@level":2
},
{
"@name":"Navigation",
"@level":1
},
{
"@name":"Text",
"@level":1
}
],
"meta": [
{
"@name":"title",
"@content":"X3dHeaderPrototypeSyntaxExamples.x3d"
},
{
"@name":"description",
"@content":"X3D scene header and prototype syntax examples. This example header indicates that the content is XML encoded, follows the Interactive Profile and explicitly lists additional necessary components. The X3D header may also contain additional semantic information. Used for specification EXAMPLE excerpts in 19776:1 XML Encoding."
},
{
"@name":"created",
"@content":"14 October 2002"
},
{
"@name":"modified",
"@content":"7 May 2017"
},
{
"@name":"creator",
"@content":"Don Brutzman"
},
{
"@name":"specificationSection",
"@content":"X3D encodings, ISO/IEC 19776-1.3, Part 1: XML encoding, 4.3 XML file syntax"
},
{
"@name":"specificationUrl",
"@content":"http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/concepts.html#XMLFileSyntax"
},
{
"@name":"identifier",
"@content":"http://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/X3dHeaderPrototypeSyntaxExamples.x3d"
},
{
"@name":"generator",
"@content":"X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit"
},
{
"@name":"license",
"@content":"../license.html"
},
{
"@name":"translated",
"@content":"07 May 2017"
},
{
"@name":"generator",
"@content":"X3dToJson.xslt, http://www.web3d.org/x3d/stylesheets/X3dToJson.html"
},
{
"@name":"reference",
"@content":"X3D JSON encoding: http://www.web3d.org/wiki/index.php/X3D_JSON_Encoding"
}
]
},
"Scene": {
"-children":[
{ "ExternProtoDeclare":
{
"@name":"ViewPositionOrientation",
"@url":["../../Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation","https://savage.nps.edu/Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation","../../Savage/Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation","https://savage.nps.edu/Savage/Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation"],
"field": [
{
"@name":"enabled",
"@accessType":"inputOutput",
"@type":"SFBool"
},
{
"@name":"traceEnabled",
"@accessType":"initializeOnly",
"@type":"SFBool"
},
{
"@name":"set_traceEnabled",
"@accessType":"inputOnly",
"@type":"SFBool"
},
{
"@name":"position_changed",
"@accessType":"outputOnly",
"@type":"SFVec3f"
},
{
"@name":"orientation_changed",
"@accessType":"outputOnly",
"@type":"SFRotation"
},
{
"@name":"outputViewpointString",
"@accessType":"outputOnly",
"@type":"MFString"
}
]
}
},
{ "ProtoDeclare":
{
"@name":"NewWorldInfoNode",
"ProtoBody": {
"-children":[
{ "WorldInfo":
{
"@DEF":"ExamplePrototypeBody"
}
}
]
}
}
},
{ "ProtoInstance":
{
"@name":"NewWorldInfoNode"
}
},
{ "ProtoDeclare":
{
"@name":"EmissiveMaterial",
"ProtoInterface": {
"field": [
{
"@name":"onlyColor",
"@accessType":"inputOutput",
"@type":"SFColor",
"@value":[1,0,0]
}
]
},
"ProtoBody": {
"-children":[
{
"#comment":"Override default diffuseColor value 0.8 0.8 0.8"
},
{ "Material":
{
"@diffuseColor":[0,0,0],
"-children":[
{
"#comment":"Connect emissiveColor field of current node to onlyColor field of parent ProtoDeclare."
}
],
"IS": {
"connect": [
{
"@nodeField":"emissiveColor",
"@protoField":"onlyColor"
}
]
}
}
}
]
}
}
},
{ "ProtoDeclare":
{
"@name":"ShiftGroupUp2m",
"ProtoInterface": {
"field": [
{
"@name":"children",
"@accessType":"inputOutput",
"@type":"MFNode",
"-children":[
{ "Group":
{
"@DEF":"DefaultNodeValue",
"@bboxSize":[2,2,2],
"-children":[
{
"#comment":"Authors need to override this node when creating the ProtoInstance fieldValue name=\"children\""
}
]
}
}
]
}
]
},
"ProtoBody": {
"-children":[
{ "Transform":
{
"@translation":[0,2,0],
"-children":[
{ "Group":
{
"IS": {
"connect": [
{
"@nodeField":"children",
"@protoField":"children"
}
]
}
}
}
]
}
}
]
}
}
},
{ "ProtoInstance":
{
"@name":"ShiftGroupUp2m"
}
},
{
"#comment":"===================="
},
{ "Viewpoint":
{
"@DEF":"ExampleSingleElement",
"@description":"Hello syntax"
}
},
{ "Group":
{
"@DEF":"ExampleChildElement",
"-children":[
{ "Shape":
{
"-geometry":
{ "Box":
{
}
},
"-appearance":
{ "Appearance":
{
"-material":
{ "Material":
{
"@diffuseColor":[0.6,0.4,0.2]
}
}
}
}
}
}
]
}
},
{ "Transform":
{
"@DEF":"TransformExampleUSE",
"@rotation":[0,1,0,0.78],
"@translation":[0,2.5,0],
"-children":[
{ "Group":
{
"@USE":"ExampleChildElement"
}
}
]
}
},
{ "Collision":
{
"-proxy":
{ "Shape":
{
"-children":[
{
"#comment":"note that Collision proxy Shape is not rendered"
},
{
"#comment":"alternative: Text string='\"He said, \\"Immel did it!\\"\"'"
}
],
"-geometry":
{ "Text":
{
"@string":["He said, \"Immel did it!\""]
}
},
"-appearance":
{ "Appearance":
{
"-material":
{ "Material":
{
}
}
}
}
}
},
"-children":[
{ "Group":
{
"@USE":"ExampleChildElement"
}
}
]
}
},
{ "Transform":
{
"@translation":[0,-2.5,0],
"-children":[
{ "Shape":
{
"-appearance":
{ "Appearance":
{
"-material":
{ "ProtoInstance":
{
"@name":"EmissiveMaterial",
"fieldValue": [
{
"@name":"onlyColor",
"@value":[0.2,0.6,0.6]
}
]
}
}
}
},
"-geometry":
{ "Text":
{
"@string":["X3D Header Prototype syntax examples","(view console for EXTERNPROTO output)"],
"-fontStyle":
{ "FontStyle":
{
"@justify":["MIDDLE","MIDDLE"],
"@size":0.6
}
}
}
}
}
}
]
}
},
{ "ProtoInstance":
{
"@name":"ViewPositionOrientation",
"fieldValue": [
{
"@name":"enabled",
"@value":true
}
]
}
},
{ "TimeSensor":
{
"@DEF":"Clock",
"@cycleInterval":4,
"@loop":true
}
},
{ "OrientationInterpolator":
{
"@DEF":"Spinner",
"@key":[0,0.5,1],
"@keyValue":[0,1,0,0,0,1,0,3.14159,0,1,0,6.28318]
}
},
{ "ROUTE":
{
"@fromField":"fraction_changed",
"@fromNode":"Clock",
"@toField":"set_fraction",
"@toNode":"Spinner"
}
},
{ "ROUTE":
{
"@fromField":"value_changed",
"@fromNode":"Spinner",
"@toField":"rotation",
"@toNode":"TransformExampleUSE"
}
},
{ "Inline":
{
"@DEF":"someInline",
"@url":["someUrl.x3d","http://www.web3d.org/x3d/content/examples/Basic/X3dSpecifications/someUrl.x3d"]
}
},
{ "IMPORT":
{
"@AS":"someInlineRoot",
"@importedDEF":"someName",
"@inlineDEF":"someInline"
}
},
{ "PositionInterpolator":
{
"@DEF":"StayInPlace",
"@key":[0,1],
"@keyValue":[0,0,0,0,0,0]
}
},
{ "ROUTE":
{
"@fromField":"fraction_changed",
"@fromNode":"Clock",
"@toField":"set_fraction",
"@toNode":"StayInPlace"
}
},
{ "ROUTE":
{
"@fromField":"value_changed",
"@fromNode":"StayInPlace",
"@toField":"set_translation",
"@toNode":"someInlineRoot"
}
}
]
}
}
}
More information about the x3d-public
mailing list