In Maya, hierarchies are structured in a top-down manner, with one node at the top (the parent node or root node) and other nodes (child nodes or leaf nodes) attached and interconnected beneath the top node.
The benefits of hierarchies is when we are selecting the parent node at the top of the hierarchy, it selects the items contained in the hierarchy below. When we are selecting a child node lower in the hierarchy, it selects any child nodes that are lower in the hierarchy. Also when the parent node of the hierarchy moves, the rest of the model (child nodes) also moves. It helps us save a lot of trouble when we are doing complex structures with relationships between components.
To view the hierarchy for the mechanical arm, use the Hypergraph (Panels > Hypergraph Panel > Hypergraph.).
One of the first step we did was, create a skeleton hierarchy. From the main menu, select Skeleton > Joint Tool. The Tool Settings window for the Joint Tool appears. The Joint Tool is used to create the joints and bones for a skeleton.
Then, click in the center of each pivot pin on the mechanical arm to place four joints as shown in the image above. When we are done with the placement of the last joint, press Enter to indicate that the last joint has been placed.
When we are done, it will appear as the image shown above. In the Hypergraph, when we select the joint1 node, the entire skeleton becomes selected but if we only select joint2, any rotations that we make on this node affect only joint2 and nodes below joint2 which does not include joint1 (above joint2).
The next step is Parenting a model into a skeleton hierarchy. First, in the Hypergraph, select the node named ArmEnd and Shift-select the node named joint4 then in the main menu, select Edit > Parent (Hotkey p). Take note: The order of selection is important. You want to select the child node first, and then Shift-select the item that will become the parent node second.
The next step is Applying IK to a skeleton hierarchy. The key point of IK is to allows users to control the joint rotations in a skeleton using an IK handle. From the main menu, select Skeleton > IK Handle Tool, click on the skeleton joint at the base of the mechanical arm and click on the skeleton joint at the tip of the mechanical arm like the image above (left). In the Hypergraph menu, select View > Frame All. In the Hypergraph, two new nodes appear in the hierarchy that represent the IK chain: an IK Handle node and an end effector node as shown in the image above (right).
Then, create a control object for an IK system as using the IK Handle to pose an IK chain is not a good practice. The IK Handle can be challenging to select in the scene view, a better practice is to create a control object. In the Hypergraph, select the ArmControl node then in the main menu, select Create > Annotation, a input window will appear. Type in ArmControl and click OK. In the scene view, the word ArmControl appears near the locator/control object. In the Hypergraph, two new nodes appear in a hierarchy beneath ArmControl as shown in the image above.
Before
After
Next, constraining an IK system meaning constrain the IK Handle to the control object (ArmControl) using a point constraint. A point constraint allows the transformation attributes of one object to be controlled by the transformations of another object.
Then, limit the range of motion of an IK system. Limit the range of motion of the arm to ensure that the IK system poses in a predictable manner. Lock the Translate X channel for ArmControl and lock the Rotate X and Z channels for SwivelBase. To lock, right click on the specific box then a drop-down menu will appear. From the drop-down menu, choose Lock Selected and it will be in dark blue color as shown in the image above.
The number of nodes in the IK system’s hierarchy at this point is way too long and it can be quite confusing so now, we have to simplify the display of the hierarchy. In the Hypergraph, right-click on joint1, and choose Collapse from the pop-up menu. The child nodes below joint1 disappear, simplifying the display of the hierarchy. The small arrowhead on the corner of the joint1 node indicates that a hierarchy exists below joint1. If you later need to view or select these nodes you can expand them again by right-click and click on expand.
Now, we apply parent constraints on an IK system. In the Hypergraph, with ArmControl still selected, Shift-select the CargoBox node. Take Note: The order of selection is important when you apply constraints. You must select the constraining object first, and the item to be constrained second.
In the main menu, select Constrain > Parent. Now, CargoBox is constrained to ControlArm. A new constraint node has been created below the CargoBox node in the Hypergraph. If you reposition the mechanical arm, CargoBox moves with it because of the constraint that is now applied.
Finally, we are done with this exercise! Next up will be doing an animtaion for an IK system. This exercise took 2 lessons to complete. It is quite long and tedious but it is a new learning experience for us!