[x3d-public] json schema validation problem: "-children" commentsinside"head"element

John Carlson yottzumm at gmail.com
Sat Jul 2 05:02:38 PDT 2016


This is only in the prototype expander.  Now fairly sure there is a bug in my code.  The #comment in question in red, and I’m assuming it’s getting there because the textureTransform field did not get set:
"-appearance": {
                    "Appearance": {
                      "@DEF": "DECLDarkOak_INSTANCE_DarkOakAppearance",
                      "-children": [
                        {
                          "#comment": "textureTransform field IS exposed through the Prototype field interface with same name"
                        }
                      ],
                      "-textureTransform": {
                        "#comment": "NULL node as child"
                      },
                      "-material": {
                        "Material": {
                          "@diffuseColor": [
                            1,
                            0.45,
                            0.23
                          ]
                        }
                      },
                      "-texture": {
                        "ImageTexture": {
                          "@DEF": "DECLDarkOak_INSTANCE_wood_g",
                          "@url": [
                            "wood_g.jpg",
                            "http://www.web3d.org/x3d/content/examples/Vrml2.0Sourcebook/Chapter31-Prototypes/wood_g.jpg"
                          ]
                        }
                      }

Here’s a good one in the same file:

         "-textureTransform": {
                        "TextureTransform": {
                          "@center": [
                            0,
                            5
                          ],
                          "@rotation": 0.758,
                          "@scale": [
                            2,
                            0.5
                          ],
                          "@translation": [
                            0.5,
                            0
                          ]
                        }
                      },
>From the prototype expansion of:

examples/Vrml2.0Sourcebook/Chapter31-Prototypes/Figure31.5WoodAppearanceExternalPrototypes.json
Looking at the JSON, it looks like the node should appear like:

                      "-textureTransform": {
	         “-children”: [ {
                        "#comment": "NULL node as child"
	         }]
                      },

Which does pass schema without error. Why, I don’t know.  Is this the general way to get extra nodes into a containerField through JSON schema?  Roy?   Full prototype expanded file attached.

Hmm.
Sent from Mail for Windows 10

From: John Carlson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160702/5b3189bd/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Figure31.5WoodAppearanceExternalPrototypes.json
Type: application/json
Size: 5968 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160702/5b3189bd/attachment-0001.json>


More information about the x3d-public mailing list