14th January 2010

Using XSI Rigs with the Unity Games Engine – Part 2

As a follow up to Part 1, I’m now going to run through how to bake out your animation into a Unity-friendly format. The benifit of this particular way of doing it is that the animators will be free to add any extra controls they fancy (such as a direction constraint for the head, for example) in their own scenes – we’re going to be ripping the animation from the _env nulls we created in part 1 rather than the rig so as long as they’re intect we should be fine.

Right, first things first, we need some lovely animation to save out…

...lovely animation.

...lovely animation.

What we’re going to do now is plot the local transforms of the nulls, save it to an action clip and export that out to use later. This is a tedious task which, as always, can be eased by nabbing someone’s script….

DemonProject_ExportGroup_pub_v02pys (text file, rename it to a .pys to use)

This script will prompt the user to select a group containing all of the _env nulls we want to export (though it could include anything really), which should have been created if you used any of my tools from Part1. It will then plot the local transformations and automatically create and save an action clip to your project root. Do this for each animation sequence and we’ll be good to go.

Now, create a new scene (making sure that the frame-rates and things are set up correctly and are the same as the animation scenes) and import the model everyone has been animating with.

Imported Rig

Imported Rig

Now we need to delete all the skeleton objects. This will free the nulls from their constraints and will allow us to add action clips to them.

Deleted Skeleton

Deleted Skeleton

..like so! Now we can bring in our action clips and set them up in a row in the Animation Mixer:

Imported Clips

Imported Clips

We can’t export this just yet as Unity won’t care about any action clips. We’ll have to apply the actions to the nulls but, because of the way XSI likes to do things, we need to first select them all in the mixer and freeze them into a single new, shiny clip.

Freezing Action Clips

Freezing Action Clips

Now we’ve just got the single, all-encompassing action clip we can apply it. If you do this correctly you’ll be able to delete the clip afterwards and the model will still animate correctly. You’ll need to select the frozen clip from the explorer to do this, as shown in the image below…

Applying Frozen Clip

Applying Frozen Clip

With this done we’re good to go! The last step is just exporting the model out as an .fbx file (the option is found under “File > Crosswalk > Export FBX…”). Strip out all the things we don’t need (i.e. lights, cameras etc) and you’ll have a file that Unity will be able to work with. Just make sure to note down what frames reference what clips and everyone will be (relatively) happy!

FBX Export

FBX Export


Comments and Feedback

  1. Peter Agg WIP Blog » Using XSI Rigs with the Unity Games Engine – Part 1
    January 14th, 2010 at 12:21 am

    [...] Using XSI Rigs with the Unity Games Engine – Part 2 [...]


Leave a Reply