[X3D-Ecosystem] Fwd: RawKee Update - Implemented a companion export script for x3d.py

John Carlson yottzumm at gmail.com
Wed Mar 5 18:35:07 PST 2025


I couldn’t bring up X3DUOM.

HAnimHumanoid.joints might not be flagged in Castle anymore.  I haven’t
downloaded Castle for a while.

>From x3d tooltips 4.0, HAnimHumanoid, joints field, see the first Warning,
below.  In addition, the entry pretty plainly states that Joints in joints
field are USE nodes and should appear somewhere after the skeleton field.

Also below, see the HAnimJoint.containerField lists joints as a value.  The
rules may be different for VRML.

So as Aaron found, he had to reorder skeleton and joints when x3d.py had
the wrong order on output.

Indeed, the x3d.py x3dpsail page has “
*TODO:* When converting to other forms, check ordering of output for USE
nodes within HAnimHumanoid”

I’m guessing what we need is an actual example where the joints field is
placed first before skeleton field on output.   What I hope we can do is
download a python file with a skeleton field and a joints field from the
HAnimHumanoid archive, enable output of whatever encodings you want, run
the python file, and check the output.

I don’t see why Aaron has to write 700 lines of Python to apply a fix that
would take less than 10 lines of XSLT.  We’re burning his valuable time.
Plus AFAIK, Andreas’ solution for containerField should be applied

I’m all for replacing xslt with something else, but apparently my python
solution didn’t pass muster.  It seems like Aaron’s JSON solution may be
preferred, but we will see.

Not being able to upstream changes to stylesheets is extremely frustrating
and wastes people’s time.

John


*joints*
<https://www.web3d.org/x3d/content/X3dTooltips.html#HAnimHumanoid.joints>
*[joints accessType
inputOutput
<https://www.web3d.org/x3d/content/X3dTooltips.html#accessType>, type
MFNode <https://www.web3d.org/x3d/content/X3dTooltips.html#MFNode> array,
empty list] [HAnimJoint
<https://www.web3d.org/x3d/content/X3dTooltips.html#HAnimJoint>]*
The joints field contains a list of USE references for all HAnimJoint node
instances found within the preceding skeleton hierarchy.
*Hint:* order is irrelevant since names are contained in the original DEF
objects.
*Hint:* these USE nodes can be utilitized by inverse kinematics (IK) and
animation engines.
*Warning:* the number of contained <HAnimJoint USE='*'
containerField='joints'/> nodes at top level of HAnimHumanoid needs to
match the number of corresponding HAnimJoint node instances found within
the preceding skeleton hierarchy.
*Warning:* top-level HAnimJoint USE nodes must include
containerField='joints' for proper validation and operation.
*segment*
<https://www.web3d.org/x3d/content/X3dTooltips.html#HAnimHumanoid.segments>

*containerField*
<https://www.web3d.org/x3d/content/X3dTooltips.html#HAnimJoint.containerField>
*[containerField type
NMTOKEN
<https://www.web3d.org/x3d/content/X3dTooltips.html#NMTOKEN>
(children|skeleton|joints)
"children"]*
containerField is a field-label prefix indicating this node's field
relationship to its parent node, for example <Transform><Shape
containerField='children'/></Transform>.
*Hint:* default containerField values for each node are correct in most
cases, so the need to override default containerField values is rare.
*Hint:* example values include containerField='geometry' for Box node,
containerField='children' for Group node, containerField='proxy' for hidden
proxy shape within a Collision node, etc.
*Warning:* containerField attribute is only part of XML encoding for X3D
scenes, and corresponds to the always-declared field names in the
ClassicVRML and VRML97 file encodings.
*Hint:* USE node instances are allowed to have a containerField value that
is different than the corresponding DEF declaration of that node.
*Hint:* X3D Scene Authoring Hints, containerField
https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#containerField


On Wed, Mar 5, 2025 at 1:41 PM Joe D Williams <joedwil at earthlink.net> wrote:

> Hi John,
>
>
>
> ‘joints’ is that silly field child of Humanoid that lists the Joint nodes
> with a list collection of USE notations.
>
>
>
> ‘joints’ is not a field of skeleton. It is a field of Humanoid.
>
>
>
> So, Humanoid and Joint are nodes while skeleton is a node type
>
> (otherwise called a 'container')
>
> Same as the keyword 'geometry' is a node type and IndexedFaceSet is a node
> name.
>
>
>
> skin is also a container, could be called a node type.
>
>
>
> The node type says what node names can appear in the container.
>
> The node name says what data is in the node.
>
>
>
> So:
>
> There are two container fields for HAnimJoint, ‘skeleton’ (for the first
> one, the root),
> and ‘children’ (default for the rest of the Joint hierarchy).
>
> See, when you look at the Classic, the name of the 'nodetype'
> (containerfield) is the first text and then in the xml it gets to be
> containerfield='nodetype'
>
>
> Done that way to eliminate the need for wrapper tags (maybe called
> container tags) in the xml, if I recall.
>
> In xml, we get an attr rather than a tag; thank goodness for all good
> favors.
>
>
>
> All Fine,
>
> Joe
>
> -----Original Message-----
> From: X3D Ecosystem public discussion <x3d-ecosystem at web3d.org>
> Sent: Mar 5, 2025 10:53 AM
> To: X3D Ecosystem public discussion <x3d-ecosystem at web3d.org>
> Cc: John Carlson <yottzumm at gmail.com>
> Subject: [X3D-Ecosystem] Fwd: RawKee Update - Implemented a companion
> export script for x3d.py
>
>
> Correction.
>
> ---------- Forwarded message ---------
> From: John Carlson <yottzumm at gmail.com>
> Date: Wed, Mar 5, 2025 at 12:44 PM
> Subject: Fwd: [X3D-Ecosystem] RawKee Update - Implemented a companion
> export script for x3d.py
> To: X3D Ecosystem public discussion <x3d-ecosystem at web3d.org>
>
>
> There are three container fields for HAnimJoint, ‘skeleton’, ‘children’
> (default) and ‘joints’.  I don’t disagree with Joe.
>
> Until tools ignore the missing joints field, it’s still with us.
>
> John
> On Wed, Mar 5, 2025 at 12:22 PM Joe D Williams <joedwil at earthlink.net>
> wrote:
>
>> Only the first Joint, root, has containerField 'skeleton'
>>
>> All other child Joints are containerField 'children'
>>
>>
>>
>> the keyword 'skeleton' is not a Node, it is a container, a type
>>
>>
>>
>> Classic
>>
>>
>>
>>  skeleton [
>>     DEF Joe_HumanoidRoot ...Joint ...
>>
>>  ]
>>
>>
>>
>> xml
>>
>> <Joint  DEF='Joe_HumanoidRoot' ...  containerField='skeleton'
>>
>>
>> HAnimHumanoid is a node, not a type.
>>
>>
>>
>> Joe
>>
>>
>>
>> -----Original Message-----
>> From: X3D Ecosystem public discussion <x3d-ecosystem at web3d.org>
>> Sent: Mar 5, 2025 10:06 AM
>> To: John Carlson <yottzumm at gmail.com>
>> Cc: Bergstrom, Aaron <aaron.bergstrom at und.edu>, X3D Ecosystem public
>> discussion <x3d-ecosystem at web3d.org>
>> Subject: Re: [X3D-Ecosystem] RawKee Update - Implemented a companion
>> export script for x3d.py
>>
>>
>>
>> I suppose I could do a quick check to see if the root node in the
>> ‘skeleton’ field has DEF=’somestring’ defined. And if so, and only then
>> perform the flip.
>>
>>
>>
>> That would make it more portable.
>>
>>
>>
>> *From:* John Carlson <yottzumm at gmail.com>
>> *Sent:* Wednesday, March 5, 2025 11:50 AM
>> *To:* Bergstrom, Aaron <aaron.bergstrom at und.edu>
>> *Cc:* X3D Ecosystem public discussion <x3d-ecosystem at web3d.org>
>> *Subject:* Re: [X3D-Ecosystem] RawKee Update - Implemented a companion
>> export script for x3d.py
>>
>>
>>
>> Just to be aware, if skeleton comes before joints, then this code would
>> flip them.  You need to compare jIdx to sIdx before flipping them, AFAIK.
>> I realize that you’ve ordered them properly elsewhere.
>>
>
>>
>>
>>
>> On Wed, Mar 5, 2025 at 10:57 AM Bergstrom, Aaron <aaron.bergstrom at und.edu>
>> wrote:
>>
>>
>>
>> if nType == "HAnimHumanoid":
>>
>> jIdx = -1
>>
>> sIdx = -1
>>
>> for idx in range(len(mNodeList)):
>>
>> if mNodeList[idx] == "joints":
>>
>> jIdx = idx
>>
>> elif mNodeList[idx] == "skeleton":
>>
>> sIdx = idx
>>
>> if sIdx != -1 and jIdx != -1:
>>
>> mNodeList[jIdx] = "skeleton"
>>
>> mNodeList[sIdx] = "joints"
>>
>>
>>
>>
>>
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-ecosystem_web3d.org/attachments/20250305/1f80392f/attachment-0001.html>


More information about the X3D-Ecosystem mailing list