So I got frustrated with the standard functions for exporting X3D using the XML(), VMRL(), and JSON() methods of x3d.py. So I wrote a companion python script that surfs the x3d.py Scene, and properly formats the output.
This was necessary for several reasons.
- JSON export was completely broken.
- The skeleton and joint export order of the HAnimHumanoid node fields using x3d.py would theoretically dump all the DEF’d joints into the ‘joints’ field, and thus only produce one USE’d root joint in the 'skeleton field. Though I haven’t implemented HAnimHumanoid yet, I re-ordered the field export so that the ‘skeleton’ field will get writen to the file before the ‘joints’ field.
- ‘containerField’ was not implemented for XML export, which caused the textures to not work because they weren’t allocated to the proper texture field within the Material node.
- The ‘mapping’ field was missing from the TextureTransform object, so it wouldn’t export.
I fixed all these issues with with my RKSceneTraversal.py script. Please visit the RawKee GitHub site if you’d like to look at the code. I tried posting it here, but the block formatting was off.
Attached are some screenshots of XML, VRML, and JSON encodings.