[x3d-public] X3DJSAIL reverses order of skin and skinCoord fields in HAnimHumanoid
John Carlson
yottzumm at gmail.com
Thu Feb 6 22:11:02 PST 2025
Swapping skinCoord and skin field order in my HAnimHumanoid templates
solved my issue. I just had to match against both coord (skin IFS) and
skinCoord when substituting a point attribute.
On Thu, Feb 6, 2025 at 10:11 PM John Carlson <yottzumm at gmail.com> wrote:
> Summary. Please make sure input XML and output XML order field in
> HAnimHumanoid agree in X3DJSAIL. or solve the DEF/USE problem.
>
> Most obvious, skinCoord and skin become reversed.
>
> We need to make sure all our tools agree on field order. I will work on
> WinterAndSpring (the original source).
>
> $ java -cp ~/Downloads/X3DJSAIL.4.0.full.jar
> org.web3d.x3d.jsail.CommandLine -toXML Gramps8Final.x3d >
> Gramps8Final.x3d.out
>
> Order switched between input XML and output XML:
>
> $ grep GrampsSkinCoord Gramps8Final.x3d*
> Gramps8Final.x3d: <Coordinate
> DEF="GrampsSkinCoord" containerField="skinCoord"
> Gramps8Final.x3d:
> <Coordinate USE="GrampsSkinCoord" />
> Gramps8Final.x3d.out: <Coordinate USE='GrampsSkinCoord'/>
> Gramps8Final.x3d.out: <Coordinate DEF='GrampsSkinCoord'
> containerField='skinCoord'/>
>
> If you're going to swap the fields, swap the DEF/USE too.
>
>
> ============================================================================================
> Less obvious:
>
> Original XML:
>
> Gramps8Final.x3d: <Coordinate
> DEF="GrampsSkinCoord" containerField="skinCoord"
> Gramps8Final.x3d:
> <Coordinate USE="GrampsSkinCoord" />
>
> ---------------------------------------------------------------------------------------------
> Translated JSON:
>
> Gramps8Final.json:
> "@DEF":"GrampsSkinCoord",
> Gramps8Final.json:
> "@USE":"GrampsSkinCoord"
>
> --------------------------------------------------------------------------------------------------------
> My GraalJS code (derived from JSON):
>
> .setSkinCoord(new
> Coordinate().setContainerFieldOverride("skinCoord").setDEF("Gramps
> .setCoord(new Coordinate().setUSE("GrampsSkinCoord"))
>
> -------------------------------------------------------------------------------------------------
> My Java code (doesn't compile):
>
> .setSkinCoord(((Coordinate)new
> Coordinate().setContainerFieldOverride("skinCoord")).
> .setCoord(new Coordinate().setUSE("GrampsSkinCoord"))
>
>
> ------------------------------------------------------------------------------------------------------
> Output X3DJSAIL XML (from GraalJS code):
>
> Gramps_WS.scaled1.x3d: <Coordinate USE='GrampsSkinCoord'/>
> Gramps_WS.scaled1.x3d: <Coordinate DEF='GrampsSkinCoord'
> containerField='skinCoord' point
>
> This seems to be the problem of DEF/USE in or field order HAnimHumanoid
> fields.
>
> Original too big to attach. See link:
> https://coderextreme.net/Gramps8.zip GitHub doesn't like large files.
>
> John
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20250207/90ae1735/attachment-0001.html>
More information about the x3d-public
mailing list