Search Unity

How to rig a humanoid model for Mecanim in Cheetah3D

Discussion in 'Formats & External Tools' started by JoeStrout, Dec 28, 2013.

  1. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    I've just worked out the process for rigging a humanoid model for use with Mecanim in the Cheetah3D modeling package. Since I couldn't find this laid out anywhere, but had to piece it together from several sources, I thought I'd share here so the maybe the next person in the same boat can have a leg up.

    Overview

    A "rig" is just a collection of joints, also known as bones, which form a little tree structure under the visible mesh of the model. Each vertex of the mesh is controlled by some combination of nearby bones. Cheetah3D makes it really easy to define the rig, and if you follow some simple guidelines, then Unity understands what the various bones mean, and can match them up to animations that may have been defined for completely different (but still humanoid) models. So the "big picture" is:

    1. Load a humanoid model into Cheetah3D.
    2. Add joints (bones), in an appropriate structure and with standard names.
    3. Bind the mesh to these joints.
    4. Save this file into the Assets folder of your Unity project.
    5. In Unity, set the avatar type to "Unity" and configure the avatar.
    Naming the Bones

    I couldn't find any definitive guide on what to name the bones, though it does seem to matter to some extent. Considering the bones wanted by the Ragdoll Wizard (under GameObject -> Create Other -> Ragdoll...), the guidelines in the documentation under Preparing your own character, and the names in the avatar configuration palette, this looks like a good hierarchy for reasonably simple characters:

    Root (Pelvis)
    Left Upper Leg (Hips)
    Left Lower Leg (Knee)
    Left Foot (Ankle)
    Right Upper Leg (Hips)
    Right Lower Leg (Knee)
    Right Foot (Ankle)
    Middle Spine
    Upper Spine
    Left Upper Arm (Shoulder)
    Left Lower Arm (Elbow)
    Left Hand (Ankle)
    Right Upper Arm (Shoulder)
    Right Lower Arm (Elbow)
    Right Hand (Wrist)​
    Head (Neck)​
    Names in parentheses identify where the joint is actually located; primary names indicate what part of the body they control. I used just the primary names, i.e. "Root," "Left Upper Leg," "Left Lower Leg," etc., and Unity slurped it up quite happily.

    Rigging Steps (Cheetah3D)

    1. Use the Tools -> Character -> Joint Tool menu command. Click where you want the root to be (i.e. the center of the pelvis).
    2. In the Properties, change the Display mode to Diamond, and the Color to a bright blue. This of course is optional, but makes it easier to see the rigging.
    3. While you're at it, in the Object browser, rename the newly created joint to Root.
    4. Now click for the Left Upper Leg, Left Lower Leg, and Foot (remember these should be located at the hip, knee, and ankle respectively). Name each one.
    5. Click the Root node to reselect it, and then click to create nodes for the right leg, just like the left ones.
    6. Reselect the Root node again, and now click to create the Middle Spine and Upper Spine.
    7. In similar fashion, create joints for the arms from the Upper Spine.
    8. Finally, again from Upper Spine, click to create the Head joint.
    9. Now, swing the camera around so you can see your model and rigging from other angles. You will probably need to adjust the front-to-back position of the nodes. You do this by selecting any node, and using the standard Move/Scale/Rotate tool. Note that when you move a node, all the subnodes move with it.
    10. Now we must actually connect the skin to the bones. Select the actual mesh object in the Object browser. Use the Add Tag button in the toolbar to add a Skeleton tag. Drag the Root of your bones from the Object browser, into the ID/joint list that appears in the properties list. Finally, click the OK button next to "Bind mesh" (I use the default Heat method). This should connect all the vertices to the appropriate bones.
    That's it! Now just save the file (in native .jas format) into a Unity project directory.

    Import Steps (Unity)

    1. Select the model in the Project window.
    2. In the Inspector, under the Rig tab, make sure the Animation Type is set to Humanoid, and set the Avatar Definition to "Create From This Model."
    3. Click "Configure...". If you followed the naming conventions and rig structure above, Unity should have automatically figured out what's what, and you won't have to do anythnig here (except perhaps tweak the muscle limits).
    4. Click Apply.
    At this point, you should have a fully rigged model and humanoid avatar, ready for use with any Mecanim humanoid animations!


    I hope this proves useful to someone. And, of course, I'm still a newbie myself; if anyone spots any mistakes or suboptimal steps here, I'll be grateful for the correction.

    Cheers,
    - Joe
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
  3. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Good stuff mate:cool:
     
  4. Jeff-Kesselman

    Jeff-Kesselman

    Joined:
    Apr 5, 2010
    Posts:
    99
    Your link is dead :(
     
  5. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Nuts, it sure is. Dreamhost upgraded their systems, and apparently broke my wiki. :mad: Just running the update script doesn't fix it. This may take a while to sort out, but I'll work on it!
     
  6. BrandyStarbrite

    BrandyStarbrite

    Joined:
    Aug 4, 2013
    Posts:
    2,076
    Thanks for posting this.
    I'm sure Cheetah users will be very grateful for this info, and saving them alot of stress too. :D