Adverti horiz upsell
Organic Modeling and Animation - Part Two (IK Setu
Organic Modeling and Animation - Part Two (IK Setu
sdb1987, added 2005-09-20 22:23:15 UTC 33,365 views  Rating:
(0 ratings)
Page 3 of 3



This article was printed in the 1998 siggraph issue
of 3D Design magazine, for an article Alex Alvarez wrote entitled 'Organic Modeling and Animation in Maya V.1',

Alex is director and instructor at Gnomon Training Center, a HIGHEND3D.COM strategic partner. Alex teaches advanced
acharacter nimation classes covering these techniques and many more at Gnomon. I have learned a great deal from his
animation classes and highly recommend anyone interested in character animation to take his classes.

Maya's toolset for high-res character deformation and animation offers great precision, flexibility and intuitiveness. With PowerAnimator, the performance with such geometry seriously hindered productivity as the package had no built in solution for working with heavy models. Setting up deformations was slow in both set-up time and performance. There was very little room for spontenaity as everything needed to be planned and synchronized. One had to create low-res versions for different aspects of the model split into different project files. I would animate the face in a separate module called SoundSync, animate the head and neck rotations in PowerAnimator, the low-res body in another project file, export the animation curves from these projects to disk, and finally import the anim data into the high-res 'hero' file for rendering.

In this month's article I will be concentrating on animation set-up and workflow for my character Lanker. The tools we will be using Bindskin, Clusters, Lattices, Sculpts, Flexors, Blendshape, SetDriven Key and Layers, all of which are features found in the base module of Maya.

Section One: Attaching Lanker to his Skeleton

With the skeleton complete we now need to set up our skeleton driven surface deformations. While we still have PowerAnimator style clusters (groups of vertices), the focal point of Maya's new found character animation strengths are the incredibly powerful and versatile methods for designing deformations.

When dealing with rigid characters, such as a robot, geometry can simply be parented to the joints. But with deforming characters such as Lanker, clusters must be created on the geometry, and it is the clusters which are parented to the joints. These clusters can be groups of the geometry's vertices or groups of a lattice's points, meaning that a lattice is first added to the geometry and then a cluster is added to the lattice.


Figure One


Figure Two

While clusters can be created manually as illustrated in part one of this series, Maya offers a tool called Bindskin which automates this process. Figure 1 shows the result of selecting the hip, knee, ankle and ball joints, selecting the leg geometry and invoking Skinning/Bindskin. Figure 2 shows the result of selecting the same joints, but instead of selecting the geometry, a lattice was first assigned to the geometry and the lattice was bound. The options chosen within the Bindskin dialogue box were SelectedJoints and Closest Point binding. The latter option is telling Bindskin to create clusters for us on the selected surface(s) or lattice where one cluster is created per bone. The points selected by the software for inclusion simply depends on proximity. This first step gives us a good start, yet there are a few issues remaining such as tucking, bulging and case specific deformations such as the bulging that may occur in the thigh if Lanker sat down in a chair. An important note at this point is that one must be able to get the skeleton back into the pose it was in when bound for later editing reasons. The techniques for storing skeletal poses illustrated in part two of the series are useful for this purpose.


Figure Three


Figure Four

With the basic attachment of the leg geometry to the skeleton, it is important to understand what happened and how to edit this initial phase. By opening the hypergraph, it is evident that clusters were created on the geometry and parented to the joints. But the thing to note is that the clusters that are created by Bindskin are not weighted, thus when we bend the leg the knee deformation looks inaccurate. Figure 3 shows the the effect of selecting the hip joint and invoking Deformations/Edit Membership so that we can view the clusters and modify which joint clusters the vertices belong to. The vertices highlighted in yellow are associated with the selected joint, while the other vertices are color coded so that we can distinguish how the clusters were made. We can now add/remove vertices from the selected joint by shift/control dragging around the target vertices. Once we are happy with the cluster allocations, we can continue to fine tune the deformation by now editing weights using the Set Editor as shown in part one of the series. Figure 4 shows the knee with the default weights of 1, and then with the vertices near the nearcap weighted to .5.


Figure Five

While we could continue editing vertex weights one by one, this can clearly become a time consuming process as it was in PowerAnimator. Maya, however, offers some flexibility at this point. The next thing we can do to the leg is to add flexors. Flexors are created by selecting a joint and choosing Skinning/Create Flexor which will automatically open a dialogue box seen in Figure 5. (Note: It is important to make sure the skeleton is in its 'bind pose' before adding flexors). There are three types of flexors which can be added: Lattice, Sculpt and Joint Cluster. These can be added to either a joint or bone, where if a joint is selected, the bone which decends down from it would be the modified bone. A joint flexor is used for knees, elbows and so on, while a bone flexor is used for bicep, tricep, etc.


Figure Six

What happens when a JointCluster flexor is added is that the weights of the pre-existing clusters are modified (ie no new object is created) so that they fade through the joint. Figure 6 illustrates this as the weights of the vertices are no longer all at 1. The enveloping of where the fading begins and ends can be controlled by selecting the 'J' now visible at the joint and editing its attributes in the attribute editor.


Figure Seven

Sculpt flexors are no different than manually adding a Sculpt deformer to the geometry and then parenting this Sculpt to the joint. The technique to use when the Sculpt flexor is created is to use Set Driven key so that as the joints bend, the Sculpt flexor(s) becomes more pronounced by either transforming, scaling, rotating or changing strength and falloff. This can be very effective for elbows and kneecaps, where a few sculpts could be added to create the knee cap definition which appears as the knee bends as in Figure 7.


Figure Eight


Figure Nine

The last flexor is the lattice, where a new lattice is created around the selected joint or bone. When first created, the lattice may appear a bit oversized for the geometry, however, which is the reason for the 'position the flexor' option when creating a lattice flexor. When this option is checked, the lattice can be moved, rotated and scaled to better suit the geometry as in Figure 8. The nice thing about lattice flexors is that the equivalent of Set Driven Key is built in. When we bend the knee, for example, we can see that the lattice has already modified our deformation by smoothing out the affected area. But if we select the lattice, it?s unique attributes such as 'rounding' and 'creasing' will appear in the channel box for editing. If we modify these to interactively design the deformation as in Figure 9, when we straighten the leg back to it's 'bind pose', the flexor assumes its original, neutral, shape. We could, however, tweak the effect even more by layering some Set Driven Key relationships between the knee joint?s rotation and the actual position of the lattice flexor's points. A useful tip at this point is that if there are not enough divisions in the lattice flexor, it's unique attributes may not work. At least four divisions must exist in S,T and U for all rounding, creasing, etc to work.


Figure Ten


Figure Eleven

Once the clusters, vertex weights, and flexors have been added and tweaked, the next level of control which can be added is Blendshape. As shown in part one, Blendshape is a morphing tool which offers a high level of interactivity and flexibility. Figure 10 shows copies of each of the three surfaces which make up the leg moved over to the side. A lattice has been added to all three surfaces with enough divisions to have a decent amount of control over the surfaces. The choice of a lattice is so that we can avoid breaking our seams. Each of these three copies have also been set as Blendshape targets for the bound originals by using Deformations/Blendshape. While we still have yet to modify the copies, the Blendshape morph sliders for each surface has been moved up to one. At this point, if we modify the duplicates, the original bound geometry will deform. Thus we can use these Blendshape targets for a wide variety of deformation modifications. A very important note, however, is to change the order of deformations. Since we created the Blendshape targets after binding the leg geometry to the skeleton, the Blendshapes will be calculated after the clusters which are parented to the joints. What we want, however, is for them to be calulated first. Thus the leg geometry morphs and then is bent by the skeleton. Otherwise, the leg will bend and then slide back to its original straight position when the Blendshape is activated. The order of deformation is modified by selecting the affected geometry, clicking on the Inputs button on the Status line and choosing Complete list from the pull down menu. This will open a window which lists all the nodes which affect the geometry. By middle mouse button dragging one item to the position of another, their order will be modified. The item at the top of the list is calculated last. Figure 11 shows what type of effects can be achieved with this technique.


Figure Twelve


Figure Thirteen


Figure Fourteen

With the legs now set up, the same techniques are used for Lanker's arms and fingers. The regions which become a bit more tricky, however, are the pelvis, shoulder and knuckles. The reasons for this is that these regions contain more than one surface which can easily separate at the seams if care is not taken. When a deformation needs to occur in this type of situation, the easiest solution is to use lattices as they will maintai n the relationship between adjacent surfaces. However, it is important to make sure that any part of the surfaces which affect the seam in any way are included in this latttice. Figure 12 shows a lattice which has been added to the pelvic region, including the vertices of the torso below the waist, the blend surfaces which connect the pelvis to the legs, and the top two rows of vertices on each leg. It is also important to have enough divisions on this lattice so that the left and right hip joints can be associated with the respective halves of the lattice. At this point, we can now select the left hip joint, the left half of the lattice points and invoke Bindskin. This has now created a cluster of those points and parented it to the joint. Bending the leg at this point gives as an undesirable result, however, as seen in Figure 13. What we now must do is edit the weights of the lattice points in the cluster using the Set Editor, so that the lattice points at the middle and top edges have a weight of zero, and then fade up to one towards the center. After editing the weights a bit, a much smoother deformation can be achieved (Figure 14).

The above technique, while generating a decent result, is not perfect. The final solution to this is to apply some SetDrivenKey relationships between the rotation of the hip joint and the position of the lattice points. The methodology for setting up SetDrivenKey was illustrated in part two for forward kinematic controls and would be the same here. The hip joint would be the 'driver' and the lattice points would be the 'driven'. The great thing about this is how multiple relationships can be generated between the same driver and driven. Thus when the hip rotates in the positive X direction, the lattice points can assume one shape, while when the hip rotates in the negative X direction, they can do something completely different.


Figure Fifteen

With the legs and hip region finished, the rest of the character can be set up. The above lattice technique is good for the shoulders, knuckles and head/neck region. Figure 15 shows various areas of Lanker's body with all the lattices visible and tweaked. When animating, however, it is nice to turn off the display of the lattices to clean up the window by using Display/Hide/Deformers/Lattices.

Section Two: Organizing a Custom Workflow for Animating

Once the surface attachments have been finalized and the kinematic controls set, animation can begin. Two issues will present themselves at this point, however, one being performance and the other, workflow. While Maya's performance is impressive, it still can not playback animation on high-res characters in real-time. Furthermore, the number of controls set for the character's body can become confusing to select and keyframe when animating. The kinematics discussed in part two of the series included both forward and inverse kinematic controls created via IK handles, Selection Handles, Custom Attributes and Set Driven Key.

These controls are keyframed, from a basic point of view, by moving the marker on the timeslider to the desired frame, selecting the object and invoking Keys/Set Key. But the drawback to this basic approach appears when there are several objects in the scene which are often keyed at the same time, such as the multiple controls for a character's leg (ball_roll, toe_roll, heel, knee orientation). Features which can automate this process are Quick Select Sets, Hotkeys/ Hotkey driven Marking Menus and Scripts.

A Quick Select Set, implemented by selecting objects and invoking Edit/Sets/Create Quick Select Set, is a way of organizing separate objects into a group which, when selected, selects the members of the set. The difference between this and physically grouping the objects together is that grouping objects affects how they can be animated as they are now all children of a new transform node. A Quick Select Set is just a way of organizing things so that if 'select MyFootControlSet' is typed in the command line, several objects will be picked in one step, ready for keyframing.


Figure Sixteen

A complementary technique to this is the use of custom Hotkeys. While most programs will have some built in hotkeys such as command-O for File/Open, Maya allows for 'custom command objects' within the hotkey editor located in Windows/CustomizeUI/Hotkeys (figure 16). A script can thus be written and then associated with a hotkey. For example, we can have 'L' be a single key hotkey which executes 'select MyFootControlSet'. Or we could change the command to 'SetKeyframe MyFootControlSet' to have it automatically keyframe the members of the set without needing to select them first.


Figure Seventeen


Figure Eighteen


Figure Nineteen

Also very cool is the ability to create custom hotkey driven marking menus. The hotbox seen in figure 17 is activated by holding down the space bar and offers quick access to all the tools within Maya. The hotbox is an example of a built in hotkey driven menu. But what the user can do is to have other keyboard keys pop up custom menus which may contain custom command objects, or scripts. Thus a hotkey can pop up a menu which contains items such as 'pick head', 'pick left wrist', 'keyframe all body controls', and so on. Hotkey driven marking menus are created first within the marking menu editor located at Windows/CustomizeUI/Marking Menus (figure 18). By clicking on 'create marking menu set', an editor window appears with empty zones which can be modified by clicking with the right mouse button on an unassigned zone and choosing 'edit command'. Once the set as been designed, the set should be assigned to the hotkey editor by selecting the set within the marking menu editor and selecting this option. If the hotkey editor is now opened, this set will be available for assignment in the UserDefined section. Figure 19 shows as example of a custom hotkey driven marking menu.

Once a methodology for selecting scene and character elements has been chosen, the next desirable choice is to create a low-resolution version of the character to increase performance. By doing this, we will then animate using the low-res version and render from the high-res version.There are two methodologies for this type of workflow in Maya: having separate project files for the low-res and high-res models, or using Layers.


Figure Twenty


Figure Twenty-One


Figure Twenty-Two

As mentioned earlier, when animating in PowerAnimator, one had little choice but to split a character into several low-res files if one wanted to be able to click Play on the timeslider and achieve acceptable performance. This is an option as well in Maya, but, amazingly, is not necessary. The reason for this stems from the fact that when an object is made invisible, Maya breaks connections to it from a performance standpoint. The technique to use due to this is to split a character into Layers. A Layer is similar to our QuickSelectSets in the sense that they offer a means of organzing several objects together. Just like Layers in Photoshop, using the layer editor (accessed via Edit/Layers/Layer Editor) we can easily hide or show the selected layer. Figure 20 shows the Layer Editor for a project in which I have organized both the environment and Lanker into different components to optimize playback and interactive performance. I can therefore toggle quickly between the low-res body, high-res body, hands, head and so on. Even though the project contains quite a bit of data when everything is visible and textures displayed as seen in figure 21, yielding a playback speed of @ 2 fps, when I toggle off all but the bare minimum layers needed to animate the body as seen in figure 22, my playback jumps to the desired 30 fps. I can then create a hotkey which toggles the high-res/low-res models to quickly check my high-res surface deformations as I'm animating the low-res model.


Figure Twenty-Three

The specific methodology used to create the low-res version of Lanker was to use EditSurfaces/Rebuild Surfaces. This allowed me a quick way to select Lanker's different components and turn the third degree surfaces into one degree surfaces with total control over the number of spans generated in the u and v directions (figure 23). Once the low res geometry has been generated, it is bound to the same skeleton as the high-res geometry and placed on its own layer.

Section Four: Conclusion

While this three part series has been able to introduce the core functionality of Maya's character toolset, there are several techniques which could not be addressed due to space (they didn't want a six part series). Three of the main areas not discussed in detail are keyframing, the use of constraints and the use of dynamics.


Figure Twenty-Four

Once comfortable with the custom scripts, hotkeys, marking menus and layers for the character, the animation process is impressively streamlined and intuitive. A highlight of this workflow is the timeline. When an animated object is selected, it's keyframes appear on the timeline as red 'ticks' or lines. Aside from the visual aid, these ticks can be selected, moved, scaled, cut, copied, pasted and have their tangents modified... all within the timeslider. Ticks are selected for editing by Shift-clicking over the desired region. Furthermore, Maya allows for sound files to be imported into the timeslider. Audio waveforms appear behind the ticks and can be 'scrubbed' using the middle mouse button. Figure 24 shows the timeslider with audio, ticks and a region highlighted for editing.

Constraint animation can be used to improve workflow and precision when animating the interaction between a character and scene elements. This would include anything from picking an object up, where the object is constrained to the hand, or mounting a horse, where the character becomes constrained to the animal. The main concept to use as a starting point are Locators as constraint objects and Scripts to automate the turning on and off of multiple constraints.

Dynamic based animation would be implemented in two main scenarios. One would be having a character pick up an object and then throw it, where at the point which the object is to leave the hand, dynamics take over and the object is controlled by gravity and wind forces, for example. The second use would be softbody dynamics which are used to simultate anything from cloth to inertia driven flesh movement. Thus when a character hits the ground after a two story jump, the rippling movement of flesh can be realistically calculated based on elasticity and gravity. Maya provides full control over this elasticity as a greyscale image can control the rigidity of different regions of the geometry.