Home Technical Talk

Writing a Maya Animation Exporter

polycounter lvl 12
Offline / Send Message
keres polycounter lvl 12
Hello, I am wanting to write an exporter so I can get skeletal meshes and animation from Maya into my engine, similar to ActorX for Unreal Engine.

I have a few questions, but to start things off, should I use MEL, Python, or the API for this situation? It is to my understanding that the capabilities of all of them differ in some way or another.

Thanks a ton! :D

Replies

  • Ashaman73
    Options
    Offline / Send Message
    Ashaman73 polycounter lvl 6
    You should write a converter instead of an exporter,i.e. fbx/collada as source format. This way you automatically support other modelling tools and don't need to use a given language, just code it in whatever language you are confortable with.
  • keres
    Options
    Offline / Send Message
    keres polycounter lvl 12
    FBX is so broken that I stopped trying to implement it after several weeks of struggling. The documentation and support is completely worthless. I have no doubt that the engines that support it received special support from Autodesk instead of wasting hours of work studying their poorly coded examples.
    I have heard this very thing what I am saying now from many other people, too.

    I'll check into collada. Thanks.

    Edit:

    I'd still like to know more about writing my own exporter, though.
  • monster
    Options
    Offline / Send Message
    monster polycounter
    I wrote an animation exporter in MaxScript. It exported to XML format. We used it in our game Hero Academy.

    We tried to use FBX, but it was too much hassle for our simple system.

    I would probably use Python for Maya, that way you can port it easily to Blender if you wanted to later.

    Here's some details on my exporter:
    • I created a StringStream (in memory) and printed all the data to that. When the stream is done, I print the entire thing to a file. This is much faster than printing directly to a file.
    • I didn't export keyframes. I exported everyframe (baked). But then I removed data where the object didn't move relative to it's parent. This kept the filesize down. (Actually I checked if the object had moved, and if it did I printed the new values.)
    • I chose XML because our engine was already parsing lots of XML files. If you don't have that you can just print to plain text.
    • Our models and animations were simple. If you have complex scenes you may want to create a plugin instead of a script.
Sign In or Register to comment.