Tuesday, 27 March 2012

Animation Chronicles - Episode 6: Rigid skinning

Preparing a new article for the UDK vs CryEngine 3 SDK series, I had to rig a non-organic object (read: not a character) in order to test the animated object pipeline with something simple. It also gave me the opportunity to make a skeleton from scratch and learn about skinning (or binding, in Maya language), which is the topic of this article.

For a number of reasons that don't need explaining, I chose to rig a vehicle, an helicopter to be precise. I took the Black Hawk from the CryEngine 3's sample assets. However, it wasn't rigged, so I had to it myself as I wanted to try and export this model into UDK. Good exercise.


Here's the beast:


The actual CryEngine asset comes with a collision mesh, a damaged mesh and several Levels Of Detail meshes. As you'd expect, each and every part that can be animated comes as a separate mesh. To make things simpler, I decided to only keep the base mesh and the collision mesh.

For a reason that I will discover later, that sample helicopter doesn't have a skeleton, so I have to make one.  I made the decision to only animate the rotors, the stabilizer, the main doors (not front ones), and the landing gears. Everything else will be counted as part of the hull. Because all the elements are rigid (as opposed to a character's skin or clothing which can be stretched), the skeleton is rather straight forward: one root joint, one joint for the hull, and then one for each movable part, centred on the (physical) pivot point of the object.

Note that the mesh is pink because the screenshot was taken after it got skinned.
Now that the skeleton is done, I can start skinning. In Maya, it's called "binding", as you bind a mesh to a joint. You've got two types of binding: smooth bind, in which you must define the influence each joint has on each vertex (about the same as in Max), and the rigid bind, where all vertices are fully bound to the selected joint. Rigid bind makes the skinning lighting fast for this kind of object as the only thing you have to do is select the mesh(es) and the joint, then click Rigid Bind.

If you mess up, you can use the Detach Skin function to unskin a mesh. If during the operation the mesh moves by itself, you can undo and detach again, making sure you've selected "Bake History" in the options.

The nice thing about Maya, is that it's much more flexible than Max when it comes to rigging. In my experience, once you start skinning in Max, you can't make any change to the skeleton without having to start your skinning all over again.

Note that you can't do a rigid bind on a "leaf" joint, it has to be the parent of a joint chain, otherwise it simply won't work.


However, the mesh only actually gets skinned to the root joint of the chain. Once the skinning is done, you could (if you wanted to) delete that end joint. I'm keeping it in case I need to re-skin the object. It isn't necessarily exported, so it's fine.

Once everything is skinned, I can create my control rig. 


At the time of writing, I'm having problems figuring out the correct setup to IK the landing gears, but as it's not preventing me from carrying on, I'll do that some other time.

In the end, the whole thing was actually quite easy. The only painful part was to align the joints correctly, but it was only problematic because the meshes I was using had inappropriate pivots.