Using XSI Rigs with the Unity Games Engine – Part 1
Recently I’ve been doing some rigging and animation for a games project, where the final assets will need to be exported to the Unity engine. This means that we won’t be able to give the game engine a straight XSI rig to play with – we’ll need to simplify it a bit first.
What we want to give the engine is a bunch of nulls, all in a single hierarchy, as if it’s a full FK rig. The nulls make the information easy to transfer (we’ll just need them, the geometry and the envelope data) and keeping them in a FK hierarchy will make for better animation blending in the engine (as a general rule: blending between local rotations = good, blending between translations = bad!).
At the same time, however, we’ll still want to keep all the benefits of an XSI rig – from basic things like IK chains to expressions and ICE Trees. The solution to this is to go ahead and make the best, most advanced, most complicated XSI Rig you fancy…
So here you go, one rig I made earlier. Now, instead of enveloping as we would normally, we’re going to want to make a bunch of nulls, Pose constrain them to the appropriate bones or controllers and organise them into a hirarcical FK structure. You’re welcome to do this manually if you really want, I just went ahead and made a script to do most of the work for me…
DemonProject_CreateENVnulls_pub_v01pys (text file, rename it to a .pys to use)
This will do most of the work for you (with a few provisos listed in the opening comments – please read them before you use it). At the moment though I haven’t put in a way to sort and structures built outside of the COG/Hips (such as IK feet) so you’ll have to do that yourself for now. Once this tool has been run then you’ll have something which should go from looking a like this:
…to something like this:
As you can see, there’s a ton of nulls which have been made rather quickly and plenty of tedious sorting avoided.
HOWEVER! Sometimes when making a reverse foot I end up with bones pointing the ‘wrong’ way down the chain. I’ve included a function in the script which will look for these and compensate the Pose constraint accordingly so that the null’s local translationswill work properly. The way the script finds these bones is by looking and seeing if their effector is constraining another effector (say, if the foot’s effector is constaining a leg effector to create an IK control). If your method is different then you can either adapt the script or run this little tool instead:
DemonProject_CompNulls__pub_v01pys (text file, rename it to a .pys to use)
Now it’s just a simple case of tidying up the hirarchy and hiding the envelope nulls group…
…and now we can go ahead, envelop the geometry to these nulls and animate on our nice, fancy XSI rig. Later on we’ll be using these nulls to put together the animation clips. But more on that later…
Edit: here, in fact!






January 14th, 2010 at 12:19 am
[...] Using XSI Rigs with the Unity Games Engine – Part 1 [...]