Export to GLTF Issue

I've been trying to find a way to export the skeleton for a skinned and animated figure and noticed that if I load one from an FBX file and then export it to a GLTF file (using File->Export and selecting .gltf as the export type), I can produce a file that contains the skeletal hierarchy, albeit with the values for the joint matrices set to the currently selected animation frame. Unfortunately, that's about all it seems to contain, as the mesh info is completely missing from the GLTF file. Some of this data seems to be accessible using techniques in the "Simple ASCII Export.js"example script, but it would be nice to find a way to also let me export all the data needed to animate a skinned figure using a script. Is this possible?

If not, I can think of several hybrid approaches that might work, such as manually advancing an animation through all it's keyframes while exporting a GLTF for each frame and then using some kind of external script to process all the exported files to capture all the joint positions. The mesh could then be exported to an OBJ file, but this still doesn't handle getting access to the mesh weighting values, but perhaps there is a way to export this using a script?. I'm also not sure how to get the pose position matrices. I imagine all this information is available in the FBX file but, so far, the structure of this format seems to not be very well documented and my attempts to parse it have not yielded much success.

If anyone can suggest any other approaches, or can clue me in on some more advanced scripting techniques that might solve some of the issues I've mentioned, please let me know.

Wayne
 
Hi Wayne.
You find me confused - do you want just the skeleton inside the gltf file (I dont think that´s supported at least in the gltf-viewer I use). You say you exported just the skeleton from an FBX file and the mesh is missing - well...yes...
OBJ don´t support animation data.
If I take the Alien.jas file from the Help and export to gltf the animation is there in the viewer; got two errors via Validation report though:
glTFValidationReport.jpg

AlienWalkglTF.gif

the FBX file but, so far, the structure of this format seems to not be very well documented
http://help.autodesk.com/view/FBX/2020/ENU/

Cheers
Frank
 
First, thanks for taking the time to reply and offer help. I'm sorry if my post wasn't as coherent as I wanted it to be, but I'll try to clarify. First, the meta problem I'm trying to solve is to find a way to write code for JavaFX that will load and display a skinned character animation, such as the Alien Walk example. Using some code I found that Oracle published back in 2009, I'm currently able to load and animate a Maya .ma file, but this code can only read files from a version of Maya circa 2009. Also, I don't own and can't afford to use Maya, so I've been trying to find a path that will let me export the needed data from Cheetah and then modify my JavaFX code to load it.

I was able to accomplish this in a crude way by using Cheetah to manually export a series of OBJ files (one file for each keyframe of the animation) which I can then load into JavaFX using a OBJ file importer I wrote. This works, but it's very tedious to manually export and merge all the files and generates a ton of data, as I have to update all the vertices for each keyframe. The Maya code I have can handle all the mesh deformation steps and only requires updating the joint positions to drive the animation, which also makes keyframe interpolation easier. So, my goal has to been to figure out some way to write an export script for Cheetah that will export all the data I need to drive the animation. The individual problems needed to do this, seem to boil down to:

1. Export the mesh, material, texture and UV data (can extract from .obj file, but requires extra steps to merge with other data)

2. Export the skeleton and mesh weighting data (can get skeleton from GTLF, but mesh weighting data not included)

3. Export the joint position matrices for each animation keyframe (possible to reconstruct by manually exporting a series of GTLF files with one file for each keyframe)

4. Export the joint matrices for the "pose" position (I have yet to find a way to do this.)

BTW, I repeated your experiment and loaded the Alien Walk.jas file and then exported it as GTLF. The resulting file is 258,886 bytes. If you open the file (it's ASCII, in JSON format) and look inside, you'll see it has entries that correspond to the validation report you included, but I can find no mesh, or animation-related data in the file. I do see a strange chunk of base-64-encoded data in the file that begins:

"uri" : "data:application\/octet-stream;base64,\/9j\/4AAQSkZJRgABAQAAAQABAAD\/...

but I have no idea what that encodes. Do you?

Wayne
 
I've learned a little bit more about how to extract the JoInt positions using the attached script "ExportObjects.js". If I open the "Alien Walks" example, select the "Take 0" in the "Takes" tabs and run the script, the resulting output file seems to contain the joint positions for the Bind Pose. If I then select "Walk" in the Takes tab and run the script again, the output file seems to contain the joint positions for the first keyframe of the walk cycle. Then, if I click the timeline to advance to the next keyframe, I seem to get the joint positions for that keyframe. Now, if I could figure out a way to automate selecting the various poses in the script...
 

Attachments

  • ExportObjects.js.zip
    1.3 KB · Views: 201
Back
Top