[x3d-public] X3DJSAIL CommandLine enhancement; Issue with JinLOA4.x3d

John Carlson yottzumm at gmail.com
Wed Feb 14 16:07:16 PST 2024


See requested X3DJSAIL CommandLine possible enhancement—read in X3D XML as
DOM into X3D scenegraph and write out X3D scenegraph (X3D typed object) as
XML for round-tripping.  I want to do this without writing Java source code.

I have been looking for a way to read in an XML file and output XML, but
this doesn’t seem to be possible with the X3DJSAIL CommandLine program.  I
don’t know the right combination of parameters.  I can provide Java code
which does this and shows the problem, but ideally, I could do this with
CommandLine.

Apologies for any possible obtuseness of the below report.

There appears to an issue with X3DJSAIL X3DLoaderDOM.java or
X3D.toFileX3D().  Base Java XML parser and transformer appears to be OK.  I
have not been able to debug this, unfortunately, beyond some initial
stuff.  The problem appears to be with long attribute values—they get
removed along with the attribute itself.

I don’t really have a clue what’s going on, and the issue is only with one
IndexedFaceSet/Coordinate/TextureCoordinateset, within the skull* named
HAnim parents.  They happens to have the longest attribute values in the
file.  I have not tried moving the attributes in the file yet, or
duplicating the HAnimJoint elsewhere in the file.

There’s also warnings with the original file that need to be fixed.  See
enclosure for link to archive.

If desired, I can convert XML file to python or java for additional testing
to determine whether the problem it with the loader or XML output.  I don’t
know if the Java will compile.

Thanks!

John

On Wed, Feb 14, 2024 at 4:38 AM John Carlson <yottzumm at gmail.com> wrote:

> Additional issues with JinLOA4.x3d in archives:
>
> Humanoid Animation X3D Examples Archive, Characters, Jin LOA 4 (web3d.org)
> <https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Characters/JinLOA4Index.html>
>
>
> $ java -cp ~/pythonSAI/X3DJSAIL.4.0.full.jar
> org.web3d.x3d.jsail.CommandLine -validate /c/x3d-code/
> www.web3d.org/x3d/content/examples/HumanoidAnimation/Characters/JinLOA4.x3d
> CommandLine parameter: "-validate" for model validation
> parameter: source file JinLOA4.x3d filesize 684156 bytes
> Parsing using Document Object Model (DOM) based X3DLoaderDOM...
> [info] HAnimJoint name newValue='l_tarsal_distal_interphalangeal_1'
> includes an unrecognized value not matching any of the optional string
> tokens.
>        Supported values are found in X3D Tooltips for HAnimJoint.name at
> https://www.web3d.org/x3d/content/X3dTooltips.html#HAnimJoint.name
> [info] HAnimJoint name newValue='r_tarsal_distal_interphalangeal_1'
> includes an unrecognized value not matching any of the optional string
> tokens.
> [info] HAnimJoint name newValue='l_tarsal_distal_interphalangeal_1'
> includes an unrecognized value not matching any of the optional string
> tokens.
> [info] HAnimJoint name newValue='r_tarsal_distal_interphalangeal_1'
> includes an unrecognized value not matching any of the optional string
> tokens.
> validate results: success, no problems noted
>
> Beyond that, X3DJSAIL seems unable to handle extremely long lines.
> JinLOA4.x3d has a long line around 17697 characters long, when I load it
> with X3DLoaderDOM.java and write it back out to JinLOAscaled.x3d, one of my
> IndexedFaceSet’s attributes disappear?
>
> # Search for an empty Coordinate node or the string "51 38 41" in
> examples/JinLOA4.x3d examples/JinLOA4scaled.x3d and list the first 200
> characters of each line.
>
> $ egrep Coordinate"/?>|51 38 41" examples/JinLOA4.x3d
> examples/JinLOA4scaled.x3d|cut -c1-200
>


examples/JinLOA4.x3d:
>             <IndexedFaceSet coordIndex='51 38 41 -1 41 43 51 -1 43 52 171
> -1 171 151 43 -1 49 42 41 -1 41 38 49 -1 44 186 171
> examples/JinLOA4scaled.x3d:
>                     <Coordinate/>
> examples/JinLOA4scaled.x3d:
>                     <TextureCoordinate/>
>
> # chop off the first 17395 characters of each line of examples/JinLOA4.x3d
> examples/JinLOA4scaled.x3d, sort the lines then count identical lines.
>
> $ cut -c17696- examples/JinLOA4.x3d examples/JinLOA4scaled.x3d |sort|uniq
> -c
>    5331
>       1 '>
>
> This certainly could be an issue with Java, I will report back when I have
> more details.
>
> John
>
> On Wed, Feb 14, 2024 at 2:35 AM John Carlson <yottzumm at gmail.com> wrote:
>
>> The archive version of JinLOA4.x3d has some issues in view3dscene has
>> issue, some of which I provide a patched example for:
>>
>> < means old
>> > means new
>>
>> $ diff /c/x3d-code/
>> www.web3d.org/x3d/content/examples/HumanoidAnimation/Characters/JinLOA4.x3d
>> examples/JinLOA4.x3d
>> 29,32c29,32
>> <         <MetadataString name='authorName' value='Jin Hoon Lee and Min
>> Joo Lee, Chul Hee Jung and Myeong Won Lee'/>
>> <         <MetadataString name='authorEmail' value='
>> myeongwonlee at gmail.com'/>
>> <         <MetadataString name='creationDate' value='31 March 2011'/>
>> <         <MetadataString name='gender' value='female'/>
>> ---
>> >         <MetadataString name='authorName' value='"Jin Hoon Lee and Min
>> Joo Lee, Chul Hee Jung and Myeong Won Lee"'/>
>> >         <MetadataString name='authorEmail' value='"
>> myeongwonlee at gmail.com"'/>
>> >         <MetadataString name='creationDate' value='"31 March 2011"'/>
>> >         <MetadataString name='gender' value='"female"'/>
>>
>> Also, view3dscene.exe (recent version) reports:
>>
>> 1 warnings:
>>
>> X3D: Invalid index 44 (should be less than count 44) for field
>> TextureCoordinate.point (type: MFVec2f)
>>
>> Scene URL: "examples/JinLOA4.x3d".
>> Use "File->View Warnings" menu to view these warnings again.
>>
>>
>> Attached, unfixed. I think my jin.js did patch this, but I don't see a
>> reason to, right now.  Will proceed without fixes to do scaling and
>> centering, since it's a non-fatal warning.
>>
>> John
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20240214/7beb6bb7/attachment.html>


More information about the x3d-public mailing list