<div dir="ltr">Is there a debate between using "-childNodeFieldNameNotFound" and "-field"? Or are both required? Seems a bit much to require "-childNodeFieldNameNotFound".<br><div><div><br>So would the following be correct for a script node? Specifically, I'm wondering if line 12 should be "@value" or "-value" because it's an array.<br><br>{<br>     "Script":<br>     {<br>          "-field":<br>          [<br>               {<br>                    "field":<br>                    {<br>                         "@name":"textureField",<br>                         "@type":"MFNode",<br>                         "@accessType":"initializeOnly",<br>                         "@value":<br>                         [<br>                              {<br>                                   "ImageTexture":<br>                                   {<br>                                        "@DEF":"Image1",<br>                                        "@url":["image1.png","images/image1.png"]<br>                                   }<br>                              },<br>                              {<br>                                   "ImageTexture":<br>                                   {<br>                                        "@DEF":"Image2",<br>                                        "@url":["image2.png","images/image2.png"]<br>                                   }<br>                              }<br>                         ]<br>                     }<br>               }<br>          ]<br>     }<br>}<br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 4, 2015 at 6:28 PM, Don Brutzman <span dir="ltr"><<a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">cc: x3d-public (hope copying this answer out to community is OK with you Aaron, apologies if not)<br>
<br>
On 5/3/2015 10:13 PM, Aaron Bergstrom wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Is there an example of a Script node in X3D JSON format that I can look at?<br>
</blockquote>
<br>
All of the source examples in the following include JSON (draft encoding) conversions.<br>
<br>
X3D Example Archives: X3D for Web Authors, Chapter 09 - Event Utilities Scripting<br>
<a href="http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/" target="_blank">http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/</a><br>
<br>
Example:<br>
<a href="http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/ScriptControlEvents.x3d" target="_blank">http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/ScriptControlEvents.x3d</a><br>
<a href="http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/ScriptControlEvents.js" target="_blank">http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/ScriptControlEvents.js</a><br>
<br>
and<br>
<a href="http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/ScriptControlEvents.json" target="_blank">http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/ScriptControlEvents.json</a><br>
<br>
JSON excerpt below.<br>
<br>
We do not yet have a final convention for the best way to handle<br>
- Script/field*<br>
- ProtoDeclare/ProtoInterface/field*<br>
- ProtoInterface/fieldValue*<br>
<br>
I doubt the following will change a whole lot.  Probably more interesting is how people will write native Javascript up at the HTML level to animate a scene graph- we could use more examples like that.  Maybe this scene is good for starting that.<br>
<br>
Also interesting is whether X3DOM might be able to load and execute Javascript in the X3D Script node without having to otherwise convert it.  I believe that is possible... with a SMOP.   8)<br>
<br>
Small matter of programming (SMOP)<br>
<a href="https://en.wikipedia.org/wiki/Small_matter_of_programming" target="_blank">https://en.wikipedia.org/wiki/Small_matter_of_programming</a><br>
<br>
Others mileage may vary regarding JSON/HTML/X3D integration... these ideas will be really interesting to develop and test out.  As with most other "hard" parts of X3D, implementation evaluation and spiral improvement will get us to creating another "easy" part of X3D.<br>
<br>
===========================<br>
        { "Script":<br>
          {<br>
            "@DEF":"ControlScript",<br>
            "@url":["ScriptControlEvents.js", "<a href="http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/ScriptControlEvents.js" target="_blank">http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter09-EventUtilitiesScripting/ScriptControlEvents.js</a>"],<br>
            "@directOutput":false,<br>
            "@mustEvaluate":false,<br>
            "-childNodeFieldNameNotFound":[<br>
      ,<br>
              { "field":<br>
                {<br>
                  "@accessType":"inputOnly",<br>
                  "@name":"buttonMotionDone",<br>
                  "@type":"SFBool"<br>
                }<br>
              },<br>
              { "field":<br>
                {<br>
                  "@accessType":"outputOnly",<br>
                  "@name":"motion",<br>
                  "@type":"MFVec3f"<br>
                }<br>
              },<br>
              { "field":<br>
                {<br>
                  "@accessType":"initializeOnly",<br>
                  "@name":"buttonDown",<br>
                  "@type":"SFBool",<br>
                  "@value":true<br>
                }<br>
              },<br>
              { "field":<br>
                {<br>
                  "@accessType":"outputOnly",<br>
                  "@name":"lightColor",<br>
                  "@type":"SFColor"<br>
                }<br>
              }<br>
            ]<br>
            "-field":[<br>
              { "field":<br>
                {<br>
                  "@accessType":"inputOnly",<br>
                  "@name":"buttonMotionDone",<br>
                  "@type":"SFBool"<br>
                }<br>
              },<br>
              { "field":<br>
                {<br>
                  "@accessType":"outputOnly",<br>
                  "@name":"motion",<br>
                  "@type":"MFVec3f"<br>
                }<br>
              },<br>
              { "field":<br>
                {<br>
                  "@accessType":"initializeOnly",<br>
                  "@name":"buttonDown",<br>
                  "@type":"SFBool",<br>
                  "@value":true<br>
                }<br>
              },<br>
              { "field":<br>
                {<br>
                  "@accessType":"outputOnly",<br>
                  "@name":"lightColor",<br>
                  "@type":"SFColor"<br>
                }<br>
              }<br>
            ]<br>
          }<br>
        },<br>
        { "ROUTE":<br>
          {<br>
            "@fromField":"isActive",<br>
            "@fromNode":"ButtonTimer",<br>
            "@toField":"buttonMotionDone",<br>
            "@toNode":"ControlScript"<br>
          }<br>
        },<br>
===========================<br>
<br>
all the best, Don<span class="HOEnZb"><font color="#888888"><br>
-- <br>
Don Brutzman  Naval Postgraduate School, Code USW/Br       <a href="mailto:brutzman@nps.edu" target="_blank">brutzman@nps.edu</a><br>
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   <a href="tel:%2B1.831.656.2149" value="+18316562149" target="_blank">+1.831.656.2149</a><br>
X3D graphics, virtual worlds, navy robotics <a href="http://faculty.nps.edu/brutzman" target="_blank">http://faculty.nps.edu/brutzman</a><br>
</font></span></blockquote></div><br></div>