[x3d-public] Upgrade model? AllenDutton Legacy

John Carlson yottzumm at gmail.com
Wed Jul 16 11:19:47 PDT 2025


Here are my X3D example files (found in
https://github.com/coderextreme/X3DJSONLD src/main/data that do not compile:

Christoph:
../data/bumpyfreewrljsonverse.x3d
../data/bumpyfreewrlsliders.x3d
../data/bumpyx_itesliders.x3d

Looking at Don's X3dToJava.xslt output to see if he fixed the issue:

../data/Gramps8Final.x3d
../data/JinConcat11c.x3d
../data/JinLOA4.x3d
../data/JinLOA4scaled1joe06c.x3d
../data/JinScaledV2L1LOA4OnlyMarkers11g.x3d
../data/JinScaledV2L1LOA4Sites07f.x3d
../data/JinScaledV2L1LOA4Sites08e.x3d
../data/JinScaledV2L1LOA4Sites10h.x3d

Me:
../data/variationalflowers2.x3d

The issues stem from 1) setNetworkMode and readInterval on the (wrong? DIS
nodes.  I ask Christoph Valentin to try to validate his tprev.??? example
so these can be updated.   2)  "error: code too large".  I'm going to see
if Don's X3dToJava.xslt does better.  3) use of non-implemented nodes.  My
bad.

On Wed, Jul 16, 2025 at 1:02 PM John Carlson <yottzumm at gmail.com> wrote:

> Note that my first attempt at removing setContainerFieldOverride() from my
> code revealed JDK bugs.  I'm not saying it can't be done, I just need more
> time to go back to a "pre-override" days, perhaps.
>
> I really don't want my programs to not compile.
>
> I tried JDK 17, JDK 23 and JDK 24, and a version of GraalVM.  None worked!
>
> Backing out changes to JavaSerialer.js worked.  Here's the changes from
> the failing version.:
>
> $ git diff -c JavaSerializer.js
> warning: in the working copy of 'src/main/node/JavaSerializer.js', LF will
> be replaced by CRLF the next time Git touches it
> diff --git a/src/main/node/JavaSerializer.js
> b/src/main/node/JavaSerializer.js
> index 0e457190d..bcc6e24aa 100644
> --- a/src/main/node/JavaSerializer.js
> +++ b/src/main/node/JavaSerializer.js
> @@ -390,7 +390,6 @@ JavaSerializer.prototype = {
>                                 parseInt(a);
>                                 if (attrs.hasOwnProperty(a) &&
> attrs[a].nodeType === 2) {
>                                         var attr = attrs[a].nodeName;
> -                                       /*
>                                         if (attr === 'containerField' && (
>                                                 attrs[a].nodeValue ===
> "joints" ||
>                                                 attrs[a].nodeValue ===
> "skeleton" ||
> @@ -402,9 +401,7 @@ JavaSerializer.prototype = {
>                                                 //
> console.error("################## FOUND", attr, attrs[a].nodeValue);
>                                                 attr =
> "containerFieldOverride";
>
> -                                       } else
> -                                               */
> -                                       if (attr === "xmlns:xsd" || attr
> === "xsd:noNamespaceSchemaLocation" || attr === 'containerField' || attr
> === 'type') {
> +                                       } else if (attr === "xmlns:xsd" ||
> attr === "xsd:noNamespaceSchemaLocation" || attr === 'containerField' ||
> attr === 'type') {
>                                                 continue;
>                                         }
>                                         if (attr === "DEF") {
> @@ -549,7 +546,7 @@ JavaSerializer.prototype = {
>                                         }
>
>                                         str += '.'+method+"("+strval+")";
> -                                       if (/*attr ===
> 'containerFieldOverride' && */(attrs[a].nodeValue === "joints" ||
> attrs[a].nodeValue === "skeleton" || attrs[a].nodeValue === "segments" ||
> attrs[a].nodeValue === "viewpoints" || attrs[a].nodeValue === "skinCoord"
> || attrs[a].nodeValue === "skin" || attrs[a].nodeValue === "sites")) {
> +                                       if (attr ===
> 'containerFieldOverride' && (attrs[a].nodeValue === "joints" ||
> attrs[a].nodeValue === "skeleton" || attrs[a].nodeValue === "segments" ||
> attrs[a].nodeValue === "viewpoints" || attrs[a].nodeValue === "skinCoord"
> || attrs[a].nodeValue === "skin" || attrs[a].nodeValue === "sites")) {
>                                         //
> console.error("################## FOUND", method, attrs[a].nodeValue);
>                                                 str += ')'; // for cast
>                                         }
>
>
>
> On Sun, Jul 13, 2025 at 9:40 PM Don Brutzman <don.brutzman at gmail.com>
> wrote:
>
>> HAnimSite does not have a viewpoints field, but it does have a *children*
>> field which can work for that purpose.  Note *children *is the default *containerField
>> *value for the XML encoding of Viewpoint.
>>
>>    - X3D 4.0 Architecture, clause 26 Humanoid Animation (HAnim)
>>    component, 26.3.6 HAnimSite
>>    -
>>    https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS/Part01/components/hanim.html#HAnimSite
>>
>> Also please avoid use of *setContainerFieldOverride()* method.  It is
>> only there to support experimental efforts and perhaps should be private
>> (disallowing programmer usage).  I just did a search of over 4000
>> autogenerated Java source files in the X3D Examples Archive and did not
>> find a single instance.  If you ever need to use it, there is an error
>> somewhere.  Please consult the Javadoc to search for
>> setContainerFieldOverride you find the following explanation.
>>
>>    - X3DJSAIL, X3D Java Scene Access Interface Library, Javadoc, search
>>    *setContainerFieldOverride()*
>>    - *org.web3d.x3d.jsail > X3DConcreteNode* * > *
>>    *setContainerFieldOverride*
>>    - *Warning: containerFieldOverride describes a non-default (and quite
>>    possibly incorrect) field relationship of a node to its parent, overriding
>>    the default or alternate containerField value. Programmer usage is not
>>    ordinarily needed when using this API (in rare cases it may be needed for
>>    ProtoInstance nodes). Instead of using containerFieldOverride workaround
>>    methods, focus on defining correct parent-child node relationships instead.*
>>    -
>>    https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/X3DConcreteNode.html#setContainerFieldOverride(java.lang.String)
>>
>> If you want to upgrade that model, be my guest.  Be aware that conversion
>> may be a nontrivial task, from scene metadata:
>>     13
>> <https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Legacy/AllenDutton.html#13>
>>       <meta name='* error *' content='* Legacy model, not valid as X3D4
>> HAnim version 2.0 since HAnim version 1.0 has significant differences and
>> is no longer directly supported *'/>
>>
>> all the best, Don
>>
>> On Sun, Jul 13, 2025 at 2:14 PM John Carlson <yottzumm at gmail.com> wrote:
>>
>>> Is there a chance we can upgrade this model to V4.0, HAnim2?
>>>
>>>
>>> https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Legacy/AllenDuttonIndex.html
>>>
>>> I can do the work, I hope that my contribution will be added to the
>>> archive (in another folder).
>>>
>>> Let me know!
>>>
>>> Note that X3DJSAIL complains about a potentially valid
>>> cotainerField="viewpoints".  Castle Model Converter reports it's valid
>>>
>>> $ java -cp ~/Downloads/X3DJSAIL.4.0.full.jar
>>> org.web3d.x3d.jsail.CommandLine -validate AllenDutton.x3d
>>> [snip]
>>> Exception in thread "main" org.web3d.x3d.sai.InvalidFieldValueException:
>>> *** Invalid setContainerFieldOverride() value='viewpoints', legal values
>>> for HAnimSite are containerField_ALLOWED_VALUES='"children" "sites"
>>> "skeleton"'
>>>         at
>>> org.web3d.x3d.jsail.X3DConcreteNode.setContainerFieldOverride(X3DConcreteNode.java:422)
>>>         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 org.web3d.x3d.jsail.CommandLine.run(CommandLine.java:922)
>>>         at org.web3d.x3d.jsail.CommandLine.main(CommandLine.java:242)
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20250716/9ff216c6/attachment.html>


More information about the x3d-public mailing list