Saturday, May 3, 2014

Rigging for Unity's Mecanim Humanoid

Been making a movie for my 3D real time animation class. Figuring out how to rig things properly for animation took a lot longer than it should have, so here are some notes.



Unity has a simple animation system called Mecanim. Rigging with Blender is not hard. There is an automatic rigger in Blender called Rigify, but the rig can't be mapped properly to Mecanim's humanoid avatar.

So the simplest way is to just rig the T-pose mesh by yourself. Make sure that all the meshes are joined together (Shift-J) in Blender before rigging/ painting.

These are the bones:
Hip
=> Spine -> Chest
=> Thigh.l -> Shin.l -> foot.l
=> Thigh.r -> Shin.r -> foot.r

Chest
=> Neck -> Head
=> Shoulder.l -> upperarm.l -> forearm.l -> hand.l -> three bones each finger
=> Shoulder.r -> upperarm.r -> forearm.r -> hand.r -> three bones each finger

Refer to this tutorial if you haven't rigged things before, but note that you just need the bones stated above for Unity's Mecanim system. The finger bones are optional.

Then,
Parenting the mesh to the armature with Automatic weights should work fine.

In Unity, Mecanim should no be able to configure the humanoid avatar by itself. The only thing left to do is to adjust the muscles so that the model moves in a custom way. For example, you want a pig to be stiffer than a woman.