Datasheet
CreAting And editing MAyA nodes
|
13
7. In the Outliner, select the gunBarrels object. Then Ctrl+click the housing object
(Cmd+click on the Mac), and choose Edit Parent from the main Maya menu at the top.
Parenting one object to another means you have made one transform node the child of
the second. When an object is a child node, it inherits its position, rotation, scale, and
visibility from the parent node. In the Outliner, you’ll notice that the housing node has a
plus sign beside it and the gunBarrels node is not visible. The plus sign indicates that the
node has a child node.
8. Click the plus sign next to the housing node to expand this two-node hierarchy. The gun-
Barrels node is now visible as the child of the housing node.
9. Select the housing node, and try rotating and translating it. The gunBarrels node follows
the rotation and translation of the housing node (see Figure 1.11).
Unlike the situation presented in the “Connecting Nodes with the Connection Editor”
section earlier in this chapter, the rotation and translation of the gunBarrels object are not
locked to the rotation and translation of the housing node; rather, as a child, its rotation,
translation, scale, and visibility are all relative to that of its parent.
10. Select the gunBarrels node, and try rotating and translating the object; then rotate and
translate the housing node. You’ll see the gun barrels maintain their position relative to
the housing node. You could create an animation in which the gun barrels rotate on their
own z-axis to spin around while firing, while the housing node is animated, rotating on
all three axes in order to aim.
11. Hit Undo a few times (hot key = Ctrl+z) until both the housing and gunBarrel objects are
back to their original positions.
12. In the Outliner, select the housing node, and MMB-drag it on top of the mount node. This
is a way to quickly parent objects in the Outliner.
13. Click the plus signs next to the mount and housing nodes in the Outliner to expand the
hierarchy. The lines indicate the organization of the hierarchy; the gunBarrels node is
parented to the housing node, which is parented to the mount node.
Figure 1.11
When the
gunBarrels node is
made a child of the
housing object, it
inherits changes
made to the hous-
ing object’s trans-
form node.
919774c01.indd 13 6/17/11 9:30:13 PM