Animation — Hierarchies and Groups (Adding Character) (3D Animation Using Maya) Part 1

To make the job of animating complex models and motions easier, you can link \t    objects together and bundle them into groups. Links are created hierarchically, which means that one object will be higher up on the list of influence than another. This top-level object is called a parent; under it are its children. Objects that are bundled together are called Groups and work similarly to Parent/Child hierarchies.

In these examples the Hypergraph is used to show the relationship between linked objects. In Figure 4.32, example a. there are two normal, unrelated objects. Example b. has the cone as parent. Example c. has the torus as parent. And, example d. has the two objects grouped together.

When a parent is moved, its children come with it. When a child is moved, the parent is unchanged. An example of when you would use a hierarchy is an abacus and its beads. If the whole abacus is being moved, the beads must move with it. When the beads slide around, the abacus sits still. So the abacus is the parent and the beads are the children.

Hierarchical relationships


Figure 4.32: Hierarchical relationships

Hierarchies can be used in many situations, but they often fit into one of two categories: multiple-part animations or multiple-motion animation. Multi-part is a collection of objects, such as a car body, wheels, steering wheel, doors, and trunk (see Figure 4.33). Multi-motion can be a single object, such as a flying saucer, that’s animated on one axis on multiple levels, such as oscillating up and down, while flying up and down. This secondary animation (the oscillation) can be difficult to achieve on a single transform node, so a hierarchy is established with multiple transform nodes.

Multi-part hierarchical animation

Figure 4.33: Multi-part hierarchical animation

Animation Exercise — Little Red Wagon

1.    Set your project to understanding_maya\Chapter04\animation_grouping.

2.    Open the scene animation_grouping_wagon_begin.ma.

You will see a red wagon that is composed of a body, four wheels, two axles, a steering hitch, and a handle. These different parts must remain together during animation; it would be nearly impossible to keep track of everything if you had to move and keyframe all the individual parts (see Figure 4.34). What we need is a series of subassemblies that can be animated on their own, while retaining their relationship to the greater assembly.

Wagon parts

Figure 4.34: Wagon parts

Group visualization

Figure 4.35: Group visualization

3.    Turn on the visibility of the GroupBox layer. This layer contains a set of boxes that mimic the arrangement of subassemblies you will use to rig the wagon (see Figure 4.35).

4.    Use the Outliner to examine the different subassemblies that make up the wagonGroupBox hierarchy (see Figure 4.36). At first there is only a wagonGroupBox node visible in the Outliner. By clicking on the plus sign next to the wagonGroupBox you can reveal its children nodes: yokeGroupBox and rearGroupBox. By clicking the plus sign next to yokeGroupBox, you can reveal the rest of the hierarchy: handleGroupBox and frontGroupBox.

5.    Now, click on each _GroupBox node in the Outliner to see which corresponding object is selected in the perspective view panel. Also, pay attention to the Channel Box to see what you’ll animate on a given group node.

These boxes are only here to assist you in visualizing how grouping works. If each piece of real geometry in the wagon (i.e., handle, wagon_body, wheel_FrontRight, etc.) were contained by an imaginary box, and you were to lift the imaginary box, all of its contents (the geometry) would come along for the ride.

In this multi-part mechanical assembly, the wagon, it’s important to group collections of your real geometry in sensible ways. What defines sensible? Well, in this case sensible groupings would include any objects that rotate together around a common pivot point. The rear wheels and axle are one simple example (see the rearGroupBox).

Outliner 

Figure 4.36: Outliner

Slightly more complex is the front assemblage. In it, the front wheels and axle rotate together as a group in order to roll (frontGroupBox), but this group also rotates with the yoke in order to turn (yokeGroupBox).

The handle functions similarly to the frontGroupBox, in that it rotates on its own to lift up and down, and turns with the yoke as a member of the yokeGroupBox.

Last, the entire wagon assembly needs to be able to turn and move around your scene, so the yokeGroupBox, rearGroupBox, and the wagon itself are all grouped under a node called the wagonGroupBox.

6.    Now, you’ll create the wagon’s hierarchy. First, hide the boxes by clicking the “V” button next to the GroupBoxLayer in the Layer Editor.

7.    In the Outliner, select the three objects that make up the rear assemblage: axle_rear, wheel_RearRight, and wheel_RearLeft. (Use the ctrl key plus LMB to control the selection.)

8.    Click Edit > Group options and reset the settings. Click the Group button to group these three objects together. When you group the objects, a new transform node called groupl is created. This groupl node is the parent of the three objects.

9.    Rename the groupl node rearGroup.

Go ahead and try rotating the rearGroup on its Z-axis. Notice how the pivot point is at the world origin (see Figure 4.37). Undo the rotation you just did, resetting the value to zero.

Group with bad pivot

Figure 4.37: Group with bad pivot

Centered axle pivot

Figure 4.38: Centered axle pivot

10.    Since newly created group nodes in Maya have their pivot points centered at the world origin, you will need to use the Modify > Center Pivot command. This places the rearGroup’s pivot at the center of its child geometry. If you rotate the rearGroup now you should get a much better result (see Figure 4.38).

11.    Next, select and then group together these three objects: axle_front, wheel_FrontRight, and wheel_FrontLeft. (You can use the ctrl-g hotkey.) Rename the group frontGroup and center its pivot.

12.  Select the newly created frontGroup as well as the handle and yoke objects. Group these together, and rename the new group yokeGroup. Notice that groups can contain other groups.

Since this group won’t be rotating at the geometric center of its child objects, the Center Pivot command won’t set the proper pivot. You’ll need to manually place the yokeGroup’s pivot point.

13. With yokeGroup still selected, pick the Move Tool, press the Insert key on your keyboard, and position the pivot point to the point where the yoke meets the wagon_body. This is the point around which the entire yokeGroup assembly will rotate when turning the wagon.

14.  The final hierarchical link to make is between the two top-level groups and the wagon_body object. Top-level groups are those that appear at the top of the scene view in the Hypergraph or with a plus/minus sign next to them in the Outliner. In other words, they’re at the top of their respective hierarchies. Select rearGroup, yokeGroup, and lastly wagon_body, and then click Edit > Parent options. Reset the settings and then click the Parent button.

Rotated yoke group

Figure 4.39: Rotated yoke group

15. Test  the system by moving and rotating the wagon_body. All of the other parts should come along for the ride. Pick the yokeGroup and rotate it around on the Y-axis (see Figure 4.39). Try spinning the rearGroup on the Z-axis. You’ve just built a multi-part assemblage that can be independently animated without falling apart!

16.  Save your work.

Transform Order

Hierarchies can be used to solve problems involving transformation order, too. If you stretch a sphere and then rotate it, you’ll see a propeller-like motion. This occurs because Maya evaluates scale, then rotation, and lastly translation of an object. What if you want to rotate the object, but maintain its elongated silhouette? It can be done by setting up a series of parented nodes above the object. Each node will handle one specific transform. This way, we can circumvent Maya’s natural transform order.

Next post:

Previous post: