5
\$\begingroup\$

I have a pretty simple character rig animation. How can I export the raw data of that animation?

I'm looking for some way to export a raw text array of data that tells exactly what every joint does on every frame. This means rotation, translation, etc.

EDIT: Thanks for the answers so far. We are looking for a way to get something like this: This would be one joint of a 14 frame animation.

 <joint>
      <name> rightShoulder </name>
      <xPos>12 14 16 18 19 20 21 24 26 28 32 34 36 38 </xPos>
      <yPos>100 99 98 97 96 95 94 93 92 91 90 91 92 95 </yPos>
 </joint>

We are also trying to keep the file lightweight. So we will be ONLY including this data, no meshes, cameras or anything else. I've been looking into .DAE but it seems pretty heavy.

Any suggestions? If nothing standard works, how would one go about writing their own Maya exporter? Does something like this seem possible?

\$\endgroup\$
  • \$\begingroup\$ I don't off the top of my head what the API calls are for this, but you can certainly do it using MEL or Python. I've written scripts before to export data about the position of objects. \$\endgroup\$ – jhocking Jan 13 '12 at 15:37
  • \$\begingroup\$ Thanks guys. While the below answer is a correct one, for this particular case we ended up exporting as an .FBX file, then importing into unity. We have more experience with Unity and from there it seemed easier to simply grab the X and Y location of each joint. \$\endgroup\$ – Dave Chenell Jan 17 '12 at 15:22
3
\$\begingroup\$

I just wrote my own exporter to my own custom format by reading and messing around with stuff from Rob the Bloke's site.

I haven't actually tested exported joints yet but according to my sources and current work they are not stored in the simple XYZ like your mini format prints out. Instead each poly is given a weighted set of transforms and the transforms are what are animated. You could convert it to the format you are looking for but it is generally better to send the bone weights and transforms all to the GPU letting the shader actually transform the triangle. Vertex Blending using Shaders on GP wiki

\$\endgroup\$
0
\$\begingroup\$

I've found that the DirectX (.x) model format is pretty nice. It will export the mesh, armature, and animations. The animations can be exported as key frame or every frame. It's not actually the joints that are controlled but the bones. And of course bones are just a matrix transform with a list of vertices and weights.

Don't let the name fool you, this of course can be used for DirectX or OpenGL. It's fairly simple to parse these files to get animation data. The exported files are all in plain text and are easy to follow.

I found some example code for writing an importer here. And a pretty useful explanation of the format in general here, along with animation details at the bottom.

\$\endgroup\$
  • \$\begingroup\$ That's nice and all, but can you provide a Maya .x exporter? The best I've seen is cvXporter but that seems to be out-of-date chadvernon.com/blog/resources/cvxporter \$\endgroup\$ – jhocking Jan 12 '12 at 20:03
  • \$\begingroup\$ I imagine any exporter for .x would be somewhat old, since the .x format its self is no longer supported by Microsoft. Does the exporter you mentioned not work? There are others: okino.com/conv/exp_xof.htm \$\endgroup\$ – MichaelHouse Jan 12 '12 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.