Monday, October 8, 2012

Avatar Rig Import/Export To XNA

I have been having trouble exporting an animated Avatar Rig for XNA with Maya 2013. It seems that the FBX exporter may need some work or the avatar rig for XNA is causing some problems. Either way I have found a work around for now. (Note: I would just put direct download links items you must download, but I want to avoid any legal nonsense.)

Here is the link for the avatar rig at the App Hub Education Catalog:


You will find the avatar rig and avatar animation pack. Both are very useful in understand how the avatar works in Maya, 3ds Max, or the XSI Soft Mod Tool.

You will need Maya 2013 and the XSI Soft Mod Tool for this tutorial(I have not tried earlier versions of Maya with the avatar). Here is the link for the XSI Soft Mod Tool:


Click the download now link at the bottom of the page. You do not need or want SoftImage for this tutorial. You will notice to use the tool commercially you must be a member of the XNA Creator's Club. This is only $99 a year and provides some awesome stuff like debugging your game on an Xbox! Please check out their website for further information:

Now that we're through the boring stuff, let's get to the nitty gritty. You will have noticed that either the avatar rig or animation pack will have specific downloads for Maya, 3ds Max, or Soft Mod Tool and the XNA framework. Choose Maya (if you are using that) and make sure its the GS 4.0 framework.

Once you have that downloaded the .zip file you will find some folders. Pay attention to the documentation folder and the .ma file. Load up the .ma in Maya. While that's working open up the documentation folder. Inside is a readme file. Open that one because it contains everything you need to know to export your new avatar animation to a .fbx file. Some of the options for exporting an .fbx has changed in Maya 2013 vs 2010, but it's still pretty similar.

Now that Maya has loaded and you have opened that .ma file grab an arm or leg controller. Move it...Wait. It's not moving. Why isn't it moving? Is it because the people who made this rig thought it was a good idea to turn off the IK's as the default in case you wanted to implement ragdoll physics? Yup. That took me awhile to figure out. So click on an arm, leg, or finger controller. Go to the Channel Box and if it says something like, "IKBlend" change the number to 1. Now the controller will behave like you would expect. You will have to do this for the arms, legs, and fingers.

The Problem:

I have found that if you export the avatar just as it is with any sort of leg animation it will not work in XNA. I am not sure if this is because of the fbx exporter in Maya or the rig. I have look around the internet and I can't seem to figure it out. I have also found that the fbx export 2013.3 is a mess and you should revert to 2013.1.

Here is my solution. Make sure that the avatar a leg and an arm keyframed. Export it as an .fbx in Maya. Use the readme file in the documentation folder from the avatar rig .zip file as guide for fbx options. Then export. Open up XSI Soft Mod Tool. Go to file -> Crosswalk -> import fbx. There will be an import dialogue box. The default settings should be correct other than the fps. Change that if necessary. Now that he avatar has imported play the animation. It should work all dandy. The avatar looks big and crazy because that is just the maximum size the mesh can be. Don't worry, that is fine. 

Now we have to download another file. Go to the avatar rig download and choose XSI Soft Mod Tool with the GS 4.0 frame work from the app hub. All you really need is the documentation on how to export this fbx file. Once it is download open up the readme file. Follow the directions on how to export and the fbx should now work perfected in XNA. You will find some warnings exporting from Maya and Soft Mod Tool, but I have not encountered any problems using this workflow.

PICTURES ARE COMING SOON!

No comments:

Post a Comment