[x3d-public] Joe, which model?

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Thu Aug 12 18:15:26 PDT 2021


John, we do not have VRML or ClassicVRML parsers in X3DJSAIL Java or x3d.py Python.  They are hopefully mentioned in the TODO lists.

Contributions always welcome.

All supported conversions for X3DJSAIL are found at

  *   X3DJSAIL: X3D Java Scene Access Interface Library <https://www.web3d.org/specifications/java/X3dJavaSceneAuthoringInterface.html#Conversions> – Conversions
  *   https://www.web3d.org/specifications/java//X3dJavaSceneAuthoringInterface.html#Conversions<https://www.web3d.org/specifications/java/X3dJavaSceneAuthoringInterface.html#Conversions>

If you look at Javadoc you will find that every node and statement supports toStringX3D().  The X3D concrete class supports a ton of other conversions to files in other encodings and programming languages.  Look at top of hierarchy in X3DConcreteElement to see methods supported by all nodes and statements.

  *   X3D toStringX3D​ (indent)
  *   https://www.web3d.org/specifications/java//javadoc/org/web3d/x3d/jsail/Core/X3D.html#toStringX3D(int)<https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html#toStringX3D(int)>
  *   https://www.web3d.org/specifications/java//javadoc/org/web3d/x3d/jsail/X3DConcreteElement.html<https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/X3DConcreteElement.html>

Looking at any of the examples gives plenty of sample code & output, as do the build tests and all of the converted X3D Example Archives.

  *   https://www.web3d.org/specifications/java//X3dJavaSceneAuthoringInterface.html#Examples<https://www.web3d.org/specifications/java/X3dJavaSceneAuthoringInterface.html#Examples>
  *   https://www.web3d.org/specifications/java//examples/HelloWorldProgram.java<https://www.web3d.org/specifications/java/examples/HelloWorldProgram.java>
  *   https://www.web3d.org/specifications/java//examples/HelloWorldProgramOutputLog.txt<https://www.web3d.org/specifications/java/examples/HelloWorldProgramOutputLog.txt>

If there are any cases or samples you _can’t_ find in there, then let’s please add them.  These are unit tests performed in each build.

All of our primary HAnim models, converted from .x3d in every direction, are found at


  *   HumanoidAnimation X3D Examples Archive
  *   https://www.web3d.org/x3d/content/examples/HumanoidAnimation/

Have fun with VRML, X3D, HAnim, Java and Python!

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

From: John Carlson<mailto:yottzumm at gmail.com>
Sent: Thursday, August 12, 2021 2:59 AM
To: Brutzman, Donald (Don) (CIV)<mailto:brutzman at nps.edu>; Joseph D Williams<mailto:joedwil at earthlink.net>; X3D Graphics public mailing list<mailto:x3d-public at web3d.org>
Subject: Joe, which model?


For clarification, should I download the LOA4 VRML example in HAnim pt1 Annex A?  I’m wondering how to read VRML into X3DJSAIL or x3d.py? I know I can convert to XML using Michalis’ tool.  Does X3DJSAIL support createX3DFromString?

It would be convenient to provide me with a link

Thanks!

Note on the below…I scraped the DEFs from the model, I didn’t discover them.

John

On Tue, Aug 10, 2021 at 5:22 PM John Carlson <yottzumm at gmail.com<mailto:yottzumm at gmail.com>> wrote:
SAIScript.java is attached for your purvue (sp?). It's a real simple
script that loads the .x3d file, then prints out all the DEFs it
discovers in the scenegraph.  More development later as we narrow down
what we want to do.


Looks like there may be an issue with the containerField in the
humanoid_root of the .x3d file mentioned in the Subject?


Please advise.  I tried "children", but got a second set of errors
below.  I tried "joints," similar issues.


There are around 38 DEFs in the model, which seems a bit low.  I grabbed
the model with HAnimMotion.


$ javac -cp ~/pythonSAI/X3DJSAIL.4.0.full.jar SAIScript.java
$ java -cp ~/pythonSAI/X3DJSAIL.4.0.full.jar:. SAIScript
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException:
Invalid setContainerFieldOverride() value='skeleton', legal values for
HAnimJoint are containerField_ALTERNATE_VALUES='"children"'
         at
org.web3d.x3d.jsail.X3DConcreteNode.setContainerFieldOverride(X3DConcreteNode.java:401)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:631)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:619)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:619)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:490)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:453)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.loadModelFromFileX3D(X3DLoaderDOM.java:247)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.loadModelFromFileX3D(X3DLoaderDOM.java:231)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.loadModelFromFileX3D(X3DLoaderDOM.java:205)
         at SAIScript.main(SAIScript.java:47)
$ grep skeleton KoreanCharacterMotionAnnexD01Jin.x3d
       <HAnimJoint DEF='hanim_humanoid_root' center='0 30.53 -0.7076'
containerField='skeleton' name='humanoid_root'>



  $ java -cp ~/pythonSAI/X3DJSAIL.4.0.full.jar:. SAIScript
*** [X3DLoaderDOM error] Parent-child node relationship not found!
(parent HAnimHumanoid, child HAnimJoint, containerField='children')
Please report this problem to brutzman at nps.edu<mailto:brutzman at nps.edu>
*** [X3DLoaderDOM error] Incorrectly handled X3DJSAIL object
construction, current elementObject=HAnimHumanoid (HAnimHumanoid),
child="HAnimJoint", containerField="children",
java.lang.ClassCastException: class
org.web3d.x3d.jsail.HAnim.HAnimHumanoid cannot be cast to class
org.web3d.x3d.sai.Grouping.X3DGroupingNode
(org.web3d.x3d.jsail.HAnim.HAnimHumanoid and
org.web3d.x3d.sai.Grouping.X3DGroupingNode are in unnamed module of
loader 'app')
     This error can be caused by incorrect parent-child node
relationships or incorrect containerField values.
     X3D node typing is strict, check or validate your scene graph!
     This error can also be caused by X3DLoaderDOM DOM omissions in
X3DJSAIL. Please report mysterious problems, thank you.

java.lang.ClassCastException: class
org.web3d.x3d.jsail.HAnim.HAnimHumanoid cannot be cast to class
org.web3d.x3d.sai.Grouping.X3DGroupingNode
(org.web3d.x3d.jsail.HAnim.HAnimHumanoid and
org.web3d.x3d.sai.Grouping.X3DGroupingNode are in unnamed module of
loader 'app')
         at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:1352)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:619)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:619)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:490)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:453)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.loadModelFromFileX3D(X3DLoaderDOM.java:247)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.loadModelFromFileX3D(X3DLoaderDOM.java:231)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.loadModelFromFileX3D(X3DLoaderDOM.java:205)
         at SAIScript.main(SAIScript.java:47)
Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException:
Invalid setContainerFieldOverride() value='joints', legal values for
HAnimJoint are containerField_ALTERNATE_VALUES='"children"'
         at
org.web3d.x3d.jsail.X3DConcreteNode.setContainerFieldOverride(X3DConcreteNode.java:401)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:631)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:619)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:619)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:490)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.toX3dModelInstance(X3DLoaderDOM.java:453)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.loadModelFromFileX3D(X3DLoaderDOM.java:247)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.loadModelFromFileX3D(X3DLoaderDOM.java:231)
         at
org.web3d.x3d.jsail.X3DLoaderDOM.loadModelFromFileX3D(X3DLoaderDOM.java:205)
         at SAIScript.main(SAIScript.java:47)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20210813/2c9f1a18/attachment-0001.html>


More information about the x3d-public mailing list