<div dir="ltr">export field order - 3 options:<div>1.programmer order</div><div>2. input file order</div><div>3. web3d abstract specification standard order</div><div>- the 3rd one could be an option, the first 2 as it is now.</div><div><br></div><div>-Doug</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2026 at 5:32 PM GPU Group <<a href="mailto:gpugroup@gmail.com">gpugroup@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">"up to the programmer" so the algorithm we discussed in this thread would automate some of the programmer effort. If a DEF/USE will show up in multiple fields, and the programmer prefers the DEF to show up in a certain field, he/she can write that field out first, and the algorithm will automatically put the DEF in the first field in the exported file. If the programmer wants the DEF in a different field, he/she can rearrange so the preferred field is first. If the programmer doesn't care which field the DEF is in as long as DEF comes before USE, then the programmer doesn't need to worry about field ordering. <div>Does that sound right\?<br><div>-Doug<br><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2026 at 4:48 PM GPU Group <<a href="mailto:gpugroup@gmail.com" target="_blank">gpugroup@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">" 

Holger and Don pick different fields order (not order within a field) " got it. So it's not that it's impossible to control the order of fields on export / not that the order is fixed or derived from specifications by the code generator. Rather it's up to the programmer when directly generating an element tree/DOM, or when importing, the order of fields in the imported file?<div>-Doug<br><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2026 at 4:25 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">It’s kind of like when you try to export a struct in C and you have to choose a fixed order of fields.  Holger and Don pick different fields order (not order within a field) when exporting the struct.  JSON generally picks the properties as they were inserted.  If JSON had a fixed order of fields, like a class, there wouldn’t be an issue, I could order the fields in Java just like Don expected.  If I could write XML to JSON, then I wouldn’t be reliant on Holger and Don to produce JSON.  But then I would be accused of having my own JSON, and that just isn’t true.</div><div dir="auto"><br></div><div dir="auto">John </div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2026 at 4:40 PM GPU Group <<a href="mailto:gpugroup@gmail.com" target="_blank">gpugroup@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr">"

Coordinate USE  gets placed before the Coordinate DEF "<div>Q.is the mis-ordering a) within peers or b) between HAnimHumanoid fields?</div><div>a) within peers - in a flat list <span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,0,0)">MFNode [in,out] segments [] [HAnimSegment]  or in the </span><span style="color:rgb(0,0,0)">hierarchical list: </span><span style="color:rgb(0,0,0)">MFNode [in,out] skeleton [] [HAnimJoint, HAnimSite] </span></div><div><span style="color:rgb(0,0,0)">b) between Humanoid fields - flat list exported first with USE then hierarchical list with DEF or vice versa</span></div><div><span style="color:rgb(0,0,0)">-Doug</span></div><div><br></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2026 at 3:01 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">With a fixed order of fields, the Coordinate USE  gets placed before the Coordinate DEF in HAnimSegment output.  If the browser or other tools expects DEF before USE in XML, etc., this is a failure mode.  A Java program can be authors intent, DEF before USE, but the Coordinates get flipped on XML output.</div><div dir="auto"><br></div><div dir="auto">John</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2026 at 3:11 PM GPU Group <<a href="mailto:gpugroup@gmail.com" target="_blank">gpugroup@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">"problem only shows up when HAnimHumanoid skinCoord/skin and HAnimSegment children/coord is involved"<div>Can you remind me of the problem? </div><div>Something about not being able to control / rearrange the order of the fields during export, and having a preference when authoring to put something in one field that's used in another field of the same node or its children nodes?</div><div> Is the preference for DEF placement something that makes the file prettier / nicer, or is it strictly a struggle to get DEF before USE and otherwise no preference over which field the node is DEFed in?</div><div>-Doug</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2026 at 1:58 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="auto">If you have problems duplicating, swap the order of the Coordinate nodes in the Java example (swap DEF and USE) or swap order of HAnimSegment children and coord fields.</div><div dir="auto"><br></div><div dir="auto">I don’t quite know how to detect author intended field order in a complex Java program.  I do know that x3d-tidy has a hard-coded field order, and X3DJSAIL has a defined order too, last I checked.</div><div dir="auto"><br></div><div dir="auto">If it’s been fixed, that’s good info too.</div></div><div dir="auto"><br></div><div dir="auto">I have tried small patches to x3d.py.  None of them worked.  You have to get into the code where XML, etc. output is done and test to see if DEF has been output, as you say, doug.   Then you have to reset for each encoding, which I’ve not done.</div><div dir="auto"><br></div><div dir="auto">John </div><div><div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2026 at 1:48 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="auto"><div><div style="font-size:inherit" dir="auto">I am attaching a Java example.  Python and is an hour away by car.  I have XML here, I’ll try to create a zip.  Sorting of HAnim fields between Java and Python may be different.</div></div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">Again, the problem only shows up when HAnimHumanoid skinCoord/skin and HAnimSegment children/coord is involved.</div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto"><br></div><div><br><div class="gmail_quote"></div></div></div><div dir="auto"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2026 at 12:48 PM GPU Group <<a href="mailto:gpugroup@gmail.com" target="_blank">gpugroup@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Q1. what are the formal names for <div>a) an element tree where no element can be duplicated -- each DEF and USE is a separate element</div></div></blockquote><div dir="auto"><br></div></div></div><div><div><div><div dir="auto">DOM Document?  Elements are Nodes in DOM.  There are other node types.</div></div></div></div><div><div><div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="auto"></div><div>b) a node tree where the same node can appear multiple times</div></div></blockquote><div dir="auto"><br></div></div></div></div><div><div><div><div dir="auto">Scene graph?</div></div></div></div><div><div><div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="auto"></div><div>Q2. do X3DJSAIL and x3d.py have the same issue - they are exporting from an element tree?</div></div></blockquote></div></div></div><div><div><div><div dir="auto"><br>X3d.py thinks it’s an element tree, as of 4.0.64.4.  X3DJSAIL can’t replace a USE with a DEF if the DEF is disconnected, so I would say there’s a problem.</div></div></div></div><div><div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="auto"></div><div>Q3. would a solution for x3d.py work with X3DJSAIL?</div></div></blockquote><div dir="auto"><br></div></div></div></div><div><div><div><div dir="auto">Good question.  I’ve tried developing a solution for x3d.py.  I’m more confident with Java.  Support for multi-threading in Python?  ????  Java should have a ThreadLocal solution.</div></div><div><div><div class="gmail_quote"></div></div></div></div></div><div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="auto"></div><div>Q4. are there links to the code generators for each (may send links privately if vulnerable to hackers)</div></div></blockquote><div dir="auto"><br></div></div></div><div><div><div dir="auto"><div style="font-size:inherit"><a href="https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/CreateX3dSceneAccessInterfaceJava.xslt" style="font-size:inherit" target="_blank">https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/CreateX3dSceneAccessInterfaceJava.xslt</a></div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto"><div style="font-size:inherit"><a href="https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/X3duomToX3dPythonPackage.xslt" style="font-size:inherit" target="_blank">https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/X3duomToX3dPythonPackage.xslt</a></div><br></div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">Commands to build in that folder:</div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">$ ant create.X3DJSAIL</div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">code appears in:</div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">java/src/org</div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">compiled byte code in</div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">java/jars</div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">$ ant create.X3DPSAIL</div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">code appears in python/x3d.py</div><div style="font-size:inherit" dir="auto"><br></div><div style="font-size:inherit" dir="auto">X3D-Edit can provide a complete environment.</div><br></div></div></div><div><div><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="auto"></div><div dir="auto">Q5. who has write permission on the code generators?</div></div></blockquote><div dir="auto"><br></div></div></div><div><div><div dir="auto">I believe Don gives privileges out.  He has told me to provide examples, and he will do the coding.  I have never changed either stylesheet directly, preferring to work in my own environment.  Vince is also working with x3d.py.  He recently tried an LLM DEF/USE patch.</div></div></div><div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="auto"></div><div>Q6. do stakeholders --including those who see no problem-- agree to allow those who see a problem to fix the problem they see?</div></div></blockquote><div dir="auto"><br></div></div></div><div><div><div dir="auto">AFAIK, only HAnim is directly affected by problems I am seeing.  That’s probably why no one else is seeing the problem.</div></div></div><div><div><div><div><div class="gmail_quote"><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="auto"></div><div>-Doug</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2026 at 11:40 AM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Note that Saxon does not support dynamic maps, so I suggest that e.g.:  ‘’’new Group().setUSE(“DEF_value”)’’’ continue to be used for USE nodes Saxon-generated Java code.</div><div dir="auto"><br></div><div dir="auto">Does any see an issue with what Doug proposed supporting this requirement?</div><div dir="auto"><br></div><div dir="auto">The USE x3dnode will be converted into a x3dnode reference, and some x3dnodes will have multiple references pointing at them, per specification.  Also, programmers can reuse DEF/USE x3dnodes in the scenegraph.  I don’t know if non-DEF/USE x3dnodes can be reused.  That seems like an error.  Comments?</div><div dir="auto"><br></div><div dir="auto">On XML output from Java, the USE elements will be restored.</div><div dir="auto"><br></div><div dir="auto">Can anyone analyze Comment instances and containerFields for USE nodes?  This might be a reason to stay with a strict tree, and try for author intent or field order canonicalization.  Or alternatively, as Don is pursuing, optional USE before DEF everywhere.  I am not opposed to that, it just means updating Blender import, I believe.</div><div dir="auto"><br></div><div dir="auto">Probably some examples would be great.</div><div dir="auto"><br></div><div dir="auto">John</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2026 at 10:38 AM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">Doug,</div><div dir="auto"><br></div><div dir="auto">I think it would work, yes.  The problem is getting the code into the X3DJSAIL stylesheet and getting a clean room solution, since I’ve been polluted by LLM code examples.</div><div dir="auto"><br></div><div dir="auto">I’m hoping Don or someone will step up to work on this.  Gotta turn the ship somehow.</div><div dir="auto"><br></div><div dir="auto">I can provide Java test cases. I’ve already provided one that orphans a DEF node.  This seems like the next logical step.  I’ve also provided JinOne that at one time, listed USE before DEF.</div><div dir="auto"><br></div><div dir="auto">The orphaned DEF node leads towards a solution, which means we will need the following:</div><div dir="auto"><br></div><div dir="auto">One follow-on test case will include a Java DAG.  There’s already an API for this using setUSE(node), but handling double+ add* and set* calls for same MFNode and SFNode parameters would be helpful, and there are tons of these.  These test cases were brought up a long time ago, in x3d.py work. Primarily, the focus will be outputting USE nodes to de-DAGify to XML.</div><div dir="auto"><br></div><div dir="auto">Then a double DEF.  This can throw an error, of course, or merely warn and replace one with USE.</div><div dir="auto"><br></div><div dir="auto">Are the requirements adequate?  Are people prepared to address these?</div><div dir="auto"><br></div><div dir="auto">The primary goal is to have a valid XML output from X3DJSAIL that will work with older technology.  Even help the Java programmer out a bit.  Not all Java code is generated by programs! ;) If the goal is to output invalid XML, you’re on your own!</div><div dir="auto"><br></div><div dir="auto">John</div><div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Sat, May 2, 2026 at 7:40 AM GPU Group <<a href="mailto:gpugroup@gmail.com" target="_blank">gpugroup@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Exporting</div><div>a) binary scene graph:</div>Lets say you start with a scene graph like a browser or editing tool would have internally, and the same node appears lets say twice in the scenegraph, and there's a name scope lookup table that holds (node address, string DEF name). And lets say you want to export, and your export function works in a single pass, in a serial branching manner, starting from the root node.<div>You could have a function writeNode(node) and a lookup table written (node address). The first time the node is encountered, writeNode() checks the written table, and if the node isn't listed, it adds it, and writes a full DEF. The second time the node is encountered, writeNode() finds it in the written list, and writes a USE.</div><div>b) weird graph with separate DEF and USE elements:</div><div>Now lets say you don't have a scene graph with binary nodes. Instead you have DEF and USE 'elements' / weird things --like x3d.py has.  Then what you suggest - an extra pass before exporting, to somehow consolidate the DEF and USE so they refer to a single thing, would help. On the  pre-pass, starting with a blank lookup table per nane scope written( DEF name, node), writeNode() could add  (DEF name, DEF element address, bool written = false) when it finds a full DEF, but not write anything out. Then on the second pass, when it hits a USE or DEF, it checks the written table with the DEF/USE name to get the full DEF element. If it hasn't been written yet (written flag false), writeNode() writes the element as a full DEF element, sets the written flag to true. If it has been written --written flag true-- it writes a USE element.</div><div>Would that work for X3DJSAIL?</div><div>-Doug</div></div><br><div class="gmail_quote"></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 1, 2026 at 11:03 PM John Carlson via x3d-public <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>> wrote:<br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"></blockquote></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">There are 2 distinct problems:  the Java input problem (mine) and the XML input problem (Don).  Solving the XML input problem doesn’t solve the Java input problem.<div dir="auto"><br></div><div dir="auto">My requirements:<div dir="auto"><br></div><div dir="auto">For XML output from X3DJSAIL, handle multiple paths to a DEF x3dnode in a directed acyclic graph.</div><div dir="auto"><br></div><div dir="auto">For XML output from X3DJSAIL, handle multiple DEF x3dnodes with same value and combine attributes, and replace second or further DEF x3dnodes with a USE xmlnode on output.</div><div dir="auto"><br></div><div dir="auto">For XML output from X3DJSAIL, only have an  DEF attribute value for the first of xmlnodes with same DEF/USE value.  The remaining x3dnodes with the same DEF/USE will have a USE value, and potentially a containerField value different from DEF and USE x3dnodes with the same DEF/USE value.   THE USE nodes will have a name attribute value where required.</div><div dir="auto"><br></div><div dir="auto">It appears that to meet these requirements a second pass on output will be required.   I believe the only way to avoid this is to only have one x3dnode for each DEF/USE value.  We could make that a requirement of X3DJSAIL users, but I haven’t seen any traction on that.</div><div dir="auto"><br></div><div dir="auto">It might be required that a second pass on input if USE is before DEF, especially if USE is before DEF.   We can’t avoid USE before DEF on output without a second pass.  Field order canonicalization and author intent are non-starters.</div><div dir="auto"><br></div><div dir="auto">So it appears like we need 3 passes, an input pass, a common DEF/USE x3dnode discovery pass, and an output pass.  I would prefer to put the discovery pass after the scene is built, because who knows what a Java developer is going to put together.</div><div dir="auto"><span><br></span></div><div dir="auto"><span>Thanks for reading,</span><br></div><div dir="auto"><span><br></span></div><div dir="auto"><span>John </span></div></div></blockquote></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
_______________________________________________<br>
x3d-public mailing list<br>
<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
<a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div>
</blockquote></div></div>
</blockquote></div></div>
</blockquote></div>
</blockquote></div></div>
</div>
</div>
</div>
</blockquote></div></div>
</div>
</blockquote></div>
</blockquote></div></div>
</blockquote></div>
</blockquote></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>