[x3d-public] including ProtoInterface keys in the JSON encoding

John Carlson yottzumm at gmail.com
Thu Dec 10 19:18:55 PST 2015


Yep, sure does.  Thanks for the good work.   I’ll look for a downloadable version soon.   More on that later.

John
> On Dec 10, 2015, at 9:13 PM, Don Brutzman <brutzman at nps.edu> wrote:
> 
> Tonite's update X3D-Edit build 3.3.99 works for me creating ArchPrototype.json... hopefully you too.
> 
> https://savage.nps.edu/X3D-Edit/ <https://savage.nps.edu/X3D-Edit/>
> 
>    "Scene": {
>        "#comment":[
>          "Add any ROUTEs here that connect ProtoInstance to/from prior nodes in Scene (and outside of ProtoDeclare)"
>        ],
>        "-children":[
>          { "ProtoDeclare":
>            {
>              "@name":"ArchPrototype",
>              "@appinfo":"Create an arch. Can modify general parameters: clearSpanWidth, riseHeight, depth, topAbutmentHeight, pierWidth, pierHeight. - Possibility to create shapes related to an arch: ArchHalf; IntradosOnly; ArchFilled; ArchHalfFilled; Lintel. See the reference file ArchModelingDiagrams.pdf to find further information. See also ArchPrototypeScript_more_readable.js.js.",
>              "ProtoInterface": {
>                  "#comment":[
>                    "COLOR OF ARCH",
>                    "INPUT PARAMETERS",
>                    "General parameters: measures in meters",
>                    "Parameters to create to create shapes related to arch: put true to apply"
>                  ],
>                  "field": [
>                    {
>                      "@name":"diffuseColor",
>                      "@accessType":"inputOutput",
>                      "@appinfo":"color of arch",
>                      "@type":"SFColor",
>                      "@value":[0.2,0.8,0.8]
>                    },
> etc.
> 
> On 12/10/2015 5:45 PM, Don Brutzman wrote:
>> John, sorry for the issue - versionitis with X3D-Edit I think, will work on a refreshed build.
>> 
>> Meanwhile the online version from a few days back is correct. So the rest of them in the JSON archive ought to be OK too.
>> 
>> http://x3dgraphics.com/examples/X3dForAdvancedModeling/Buildings/ArchPrototype.json
>> 
>> http://www.web3d.org/x3d/content/examples/X3dExampleArchivesJsonScenes.zip
>> http://www.web3d.org/x3d/content/examples/X3dExampleArchivesJsonScenes.zip.MD5
>> 
>> ===========================================
>> 
>> On 12/10/2015 1:47 PM, John Carlson wrote:
>>> When I convert this file: examples/X3dForAdvancedModeling/Buildings/ArchPrototype.x3d to JSON, no ProtoInterface is included.  I am using xmlsh and the X3dToJson.xslt downloaded from the website.  I will try X3D-Edit next.  No luck there either.  Have either the website or X3D-edit been updated yet?  I must be patient.  I need to run the stylesheet for some of my tests, rather than having a canned JSON file. Thanks for your hard work Don!
>>> 
>>> Oh, I see, you want me to try to work with the JSON file to see if it will load.  It partially loads minus the arch.  the axes load fine.  The .x3d I have is not up to date, but the JSON -> XML produced a similar file.
>>> 
>>> John
>>>> On Dec 6, 2015, at 7:43 PM, Don Brutzman <brutzman at nps.edu <mailto:brutzman at nps.edu>> wrote:
>>>> 
>>>> Again, great refinement you suggested.
>>>> 
>>>> Treating ProtoInterface similarly to ProtoBody seems to work well.
>>>> 
>>>> Example attached, please advise.
>>>> 
>>>> 
>>>> On 12/6/2015 1:09 PM, Don Brutzman wrote:
>>>>> On 12/4/2015 8:55 PM, John Carlson wrote:
>>>>>> I was able to get my scripts working loading from either X3D XML -> Cobweb or X3D XML -> JSON -> Cobweb by inlining them.  My scripts don’t use ProtoInterface, so the lack of that didn’t cause an issue.  So the good news is, we have Prototypes and Scripts partially working with X3D JSON and the X3D JSON loader, albeit via XML for now until we can get native tool support.  We do need ProtoInterfaces for a complete tool, but I’m hoping that will come without many more additional changes to my X3D JSON Loader (Don, can you change X3dToJson.xslt to output ProtoInterface keys?  If you like I can be an alias for field Thank you.)
>>>>> 
>>>>> Previously we omitted ProtoInterface keys for terseness.
>>>>> 
>>>>> However it does make more sense to include them, for symmetry with XML encoding and also since author scripts might be adding class attributes or HTML callbacks etc. to elements in the DOM tree.
>>>>> 
>>>>> Added to Issues list of TODO action items, will work on it.
>>>>> 
>>>>> http://www.web3d.org/x3d/stylesheets/X3dToJson.html#Issues
>>>> 
>>>> all the best, Don
>>>> --
>>>> Don Brutzman  Naval Postgraduate School, Code USW/Br brutzman at nps.edu <mailto: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
>>>> <ArchPrototype.json>
>>> 
>> 
>> 
>> all the best, Don
> 
> 
> all the best, Don
> -- 
> Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu <mailto: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 <http://faculty.nps.edu/brutzman>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20151210/004e3155/attachment-0001.html>


More information about the x3d-public mailing list