Maya: Grouping Objects in a Hierarchy

smallarrows.GIF

truck.gif

Hypergraph Window
The Hypergraph window is a visual representation of everything in your scene; the way they are grouped or parented and connected via history.  Individual objects are represented by grey boxes called nodes.

Select Window-> General Editors-> Hypergraph: Hierarchy

Use the Alt key to dolly or track the window.



Group Objects Together (Two Levels)

Pick
the objects you wish to be in one group.

Edit->Group will group together the selected objects forming a new node above them,
the new nodes pivot center is at 0,0,0..

hierarchy1.jpg

Before Grouping                               After Grouping



Animate Objects in a Hierarchy: 
Klennex® Box Truck Tutorial


Make the Wheels:

klennex1.jpg

In the Modeling Module:


Select Create->Polygon Primitives->Cylinder->option.jpg   
Select Axis  Z
Input Height divisions: 1
Input Cap divisions: 0
Click Create

Scale
it down in Z a bit to make it look more like a wheel.

Move the wheel +3 units in the Z axis.

Use Edit->Duplicate Special->option.jpg
Translate a copy -6 units in the Z axis

Make another copy and scale it down for the axil.

Pick all 3 parts, use Edit->Group to group them together
In Window-> General Editors-> Hypergraph: Hierarchy, name the group Backwheels

Make a copy of the group, translate the copy 6 units down the X axis.
In Window-> General Editors-> Hypergraph: Hierarchy, name the group Frontwheels



Make the body and the windshield:

Use a primitive polygon cube for the body, scale it and position it above the wheels.
Use a primitive polygon cube for the windshield, scale, rotate and position it above the truck.

Using the Select by Hierarchy button sroot.jpg pick all the parts of the truck, use Edit->Group to group them together. 

Use the move tool with the d key to move the pivot to the center of the front wheel.
(We will be poppin'' some wheelies later.)

Open the Window-> General Editors-> Hypergraph: Hierarchy to look at the grouping so far.
Double click on the truckgroup to change the name to group_to_rotate_back.

Tricky part: Edit->Group the truck one more time. This will add an extra pivot point for animation later.
The pivot should be at the rear wheel. If your pivot is not located at the rear wheel,
use the move tool with the d key to adjust the pivot.

Name this group truck in the hypergraph.



klennex2.jpg


Use the Hypergraph to pick the truck group, (the top of the hierarchy) move the truck up 1 unit in the Y axis, so the bottom of the wheels are hitting the ground.

Move the truck back -15 units in the X axis. We are ready for frame 1.

One more thing put a cone in the road, the truck will run over. Scale it 50%, and line it up under a tire.


Set up your options for animation:
Use Windows->Settings/Preferences->Preferences
     Choose the Settings section.
     Select Time: NTSC (30 fps)  (We record to video, 30 frames per second is the frame rate.)

Choose the Time Slider section.
     Set the Playback Start/End between 1 and 300.
     Set the Animation Start/End between 1 and 300.
     Select Playback Speed Play Every Frame, this will allow the simulation to process every frame.
     Your playback speed will not be accurate
     Click Save


Set Keyframe 1:
timeslider.jpg
Set the maximum playback on the time slider to 60, this is the box way over to the right on the time slider.

Use the Hypergraph to Select  the truck.

Move the timeline over to frame 1 at the bottom of the screen.

Highlight Translate X in the Channel Box.
Use the right mouse key over the numeric input area, choose Key Selected.



Set Keyframe 60:

Move the timeline over to frame 60.

Move the truck to +15 units in the X axis.

Use the right mouse key over the numeric input area in the channel box (Translate X), choose Key Selected.



Pop the first wheelie:
         
Move the time slider to the right until the truck just hits the cone in the road.
         
Use the Hypergraph to select the truck.

Highlight Rotate Z in the Channel Box.
Use the right mouse key over the numeric input area, choose Key Selected.

Move the time slider over a little more until the truck's front wheel is centered over the cone.
Rotate the truck  in the Z axis to pop the wheelie. (It should rotate around the pivot near the back wheel.

Use the right mouse key over the black area (rotate Z) in the channel box, choose Key Selected.

Move the time slider over a little more until the truck's front wheel clears the cone.
Rotate the truck  back to 0 in the Z axis.

Use the right mouse key over the numeric input area (rotate Z) in the channel box, choose Key Selected.



Pop the second wheelie:

Move the time slider over until the truck just hits the cone in the road with the back wheel.
         
Use the Hypergraph to select the group below which you named group_to_rotate_back.

Highlight Rotate Z in the Channel Box.
Use the right mouse key over the numeric input area, choose Key Selected.

Move the time slider over a little more until the truck's back wheel is centered over the cone.
Rotate the truck  in the Z axis to pop the wheelie. It should be rotating around the pivot near the front wheel.

Use the right mouse key over the numeric input area (rotate Z) in the channel box, choose Key Selected.

Move the time slider over a little more until the truck's back wheel clears the cone.
Rotate the truck  back to 0 in the Z axis.

Use the right mouse key over the numeric input area (rotate Z) in the channel box, choose Key Selected.



Use Expressions to animate the wheel groups turning:

Use the Hypergraph to Pick  the backwheels group.
         
Highlight Rotate Z in the channel Box, use the right mouse over the numeric input area, select Expressions...

Type:  rz =  truck.tx /  (2 * 3.1416)  * -360  in the lower section of the expression editor  (pi)
Hit Edit or create

Do the same for the front wheels.