Adverti horiz upsell
Character Setup for Real-Time in Maya 3.0
Character Setup for Real-Time in Maya 3.0
sdb1987, added 2005-09-25 00:51:50 UTC 70,970 views  Rating:
(0 ratings)
Page 1 of 2

The process of getting real-time characters ready for animation involves a balance between animator, programmer and engine. Most setup artists are confronted with the issue of delivering to the animator the flexibility of movement for a character while placed within the restrictions of a run time engine. Not only does the setup have to move the character correctly, it also has to be integrated into the run time as well as accessible to the programmers for direct manipulation. Our approach must be like that of a diplomat � the compromise of control for the animator and accessibility/performance for the programmer and engine.

The character setup outlined below delivers a simplistic character "rig" geared towards run time performance first and control to the animator second. The limitations of the engine dictate the structure of the setup and therefore the functionality intended for the animator must be worked around these restrictions.



Basic Setup Workflow:

The generic workflow for getting a real-time character ready for animation is as follows:

Model character > Create skeleton > Skin model > Edit deformation > Texture > Create controls for skeleton

Modeling Considerations:

First, let�s talk about modeling the character. The position the model should have before creating the skeleton is the "default modeling pose". This is the commonly seen "arms out feet shoulder width apart" pose.



One of the worst areas to work with when editing deformation is the shoulder (specifically the underarm area where the geometry is "compressed"). By modeling the arms half way down we take out some of the tedious weight editing while still retaining the spatial distance of joints needed during skinning.

Texturing Considerations:

The more traditional workflow (especially for NURBS characters) has the texturing occur before any setup begins. The reason is that during editing the deformation of a polygonal character some edges might need to be flipped in order to achieve the proper "look." This adds to the history of the character which for many engines is undesirable. The only history on the geometry itself should be the clusters from skinning.

So, once editing the deformation is finished duplicate the model and texture that. Once textured (again get rid of the history of all your projections) copy the skin weights over from the initial model to the textured model.

Creating the Skeleton:

Our first encounter with balancing the functionality of our setup with the restrictions of the run time starts with creating the skeleton. How many joints (DOF) can the engine take for each character? Can you include a toe joint or another forearm joint for the wrist rotation? Do you use joints for facial animation or will it be through some vertex morphing scheme? Does the skeleton have to be scalable so it can be applied to all characters regardless of body proportion/structure?

In my case we can only handle 19 joints per character. This is because we need over 20 plus entities along with a huge terrain and effects within a simulation running at 3200 X 880 at 60 fps. Ouch! There goes the toe joint along with the extra forearm joint.

Things to remember when drawing your joints:



* Draw your joints to match the mesh you�ve created. Joints outside the mesh are undesirable � remember the joints have an area of influence associated with them during the skinning process. Placement will determine which vertices will acquire weight and how much (weight is determined by proximity and dropoff).

* Draw the joints with a slight angle. The reasoning for this is twofold - anatomically speaking there are angles between joints. In Maya you are creating the Preferred Angle. This angle is used by the Inverse Kinematic Solver to determine which way to rotate the joints when you manipulate an IK Handle.

* The joints will be eventually controlled by other objects that the animator will keyframe. However, it is actually the rotation of the joints that are input into the engine for calculation. It is crucial then that the rotation axes of the joints are aligned as best as possible with the world coordinate system.

Build it and they will animate:

Construct the skeleton by building it in parts. I have the Auto Joint Orient on the default xyz. Start with the left leg first (hip > knee > ankle > ball). Position it then draw in the back joints all the way to the head of the character (root (hip) > lumbar > thoracic > cervical > cranium). Freeze transformations on the root joint ensuring the local axis is aligned with the world.

Now for arms. Create the arm structure � for the purposes of gaming we will not include the ulna/radius joint in the skeleton and try to mimic that in other ways. Less joints means less transformations that the run-time system will have to handle increasing performance. Consult w/the programmer as far as how many joints should be within the character to allow it the maximum range of motion yet manageable as far as data size and computation (overhead) goes.

So, back to arm creation � shoulder > elbow > wrist.

Since joints are in essence local axes of rotation let�s ensure that they will rotate properly. To do that the joint must have a "primary" axis. Giving a joint a "primary" axis helps your software determine a priority or order of rotation for the joint. In Maya we can accomplish this by working with the Auto Joint Orient option within the Joint Tool. We can access this directly through MEL as well.

We are going to take the MEL approach to change the order of rotation of the joints. What we are trying to accomplish is to give the joint a "primary" axis � an axis that will point down the length of the bone. In addition, we will try to align the axis as best we can with the world. This way, having the rotation of the joints "match" the world greatly increases the intuitiveness of the animation information an animator will be reading. If the knee joint was rotating on the Z axis during a run cycle yet the world axis of rotation for the same movement is the X there is no consistency. It might be confusing looking at the action curves of the character in relation to the world axis. No extra conversion of information is needed on my brain�s overhead.