Wednesday, 20 July 2011

Week 13 Lab 2 (Skeleton)

Tip - Rigging
Always create a rig in any orthographic view. (Never user perspective view).
*Joint tool.

Parenting
1. Select Child Object.
2. Shift select Parent Object.
3. Press p to parent.

Unparent
1. Select Child Object.
2. Edit > Unparent.

Kinemetics
Forward Kinemetics (FK)
Inverse Kinemetics (IK)

FK Handle - Parent affects the Child Object.
IK Handle - Child Object affects the Parent Object instead.

*Select the right panels to help you with the outline of your animation.

Set some keyframes with IK Handle and it will show the animation moving.

To view hierarchies using the Hypergraph.
  1. From the perspective view’s panel menu, select Panels > Layouts > Two Panes Stacked. The workspace displays two panels stacked on top of each other with an identical perspective view of the scene.

  2. In the lower panel, select Panels > Hypergraph Panel > Hypergraph. The lower panel displays the Hypergraph.

  3. In the Hypergraph menu, select Graph > Scene Hierarchy. If the menu item appears dimmed, it indicates that the Hypergraph is already displaying the scene hierarchy 
    The Hypergraph displays with a black background by default. In order to see the relationships between the items, the background has been modified for the images in this lesson.

  4. In the Hypergraph menu, select View > Frame All to see all the components of your scene. 
Creating a skeleton hierarchy

To link the various components of the mechanical arm into a hierarchy that can be posed, you need to create a skeleton. A skeleton is a hierarchy of joints that are connected together with bones.
In the scene, a joint represents a special type of node that gets created in a skeleton hierarchy. A joint acts as the parent node for any other joints that occur in the hierarchy below it. Each joint has a rotational pivot point associated with it. A bone is the visual representation used in the scene view to connect the joints and help visualize the joint chain.
A skeleton is similar to a skeleton in the real world in that it acts as the underlying structure for the surfaces to be attached. While you can view the skeleton with its bones and joints in the scene view, it does not appear in your rendered images. Its purpose is to assist you in setting up and posing your models and characters and to visualize the motion you want to achieve.


Skeletons are integral to the animation of any character or hierarchical model. Examples of characters that use skeletons are two and four legged animals. Skeletons are also useful for animating other organic components such as the tail of an animal, a tentacle of an octopus, or a snake.
In the following steps, you create a simple skeleton consisting of four joints that you combine with the mechanical arm model into a skeleton hierarchy, allowing you to pose and animate the model.

To create a skeleton for the mechanical arm
  1. In the perspective view menu, select Panels > Orthographic > side. The view updates to display the side view.
    You need to view the components of the mechanical arm fully in the side view so you can draw the joints for the skeleton.

  2. Resize the side view to a larger size by dragging the border between the side and Hypergraph panel views downwards. 
  3. In the side view menu, select Shading > Wireframe (Hotkey 4).
  4. 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.
  5. In the Joint Tool settings window, do the following:
    • Click Reset Tool to set the tool to its default settings.
  6. In the side view, starting from the base of the mechanical arm, do the following:
    • Click in the center of each pivot pin on the mechanical arm to place four joints as shown in the image below.
    Try to click as close to the center of each pivot pin as you can, as the rotation of the joints on the model will be based on the location of the joints on the skeleton. As you place the joints, a bone appears, connecting each joint. (Because the model lies along the YZ plane, the joints are created close to the center of each corresponding joint on the mechanical arm model.)

    • After you place the fourth joint, press Enter to indicate that the last joint has been placed.


  7. In the Hypergraph, dolly the view to see the skeleton node hierarchy you just created. (It appears at the right side of the view.)

  8. In the Hypergraph, select the joint1 node. The entire skeleton becomes selected. Any rotations on this node also affect anything lower down the hierarchy.

  9. Select joint2 (You can also press the down arrow on your keyboard to select further down the hierarchy).






    The skeleton is selected from joint2 downwards in the hierarchy. Any rotations that you make on this node affect only joint2 and nodes below joint2.
Once a skeletal hierarchy is created, the various surface components can be added to the hierarchy.

 Example:

 Note: When you select the object first, that would be the child object. And when you shift select to another object, that object will be the parent after using the tool Parenting.


To create an IK handle for the mechanical arm
  1. From the main menu, select Skeleton > IK Handle Tool > . The IK Handle Tool Settings window for the Joint Tool appears. When the mouse pointer is in the orthographic view its appearance changes to the tool's cross hair cursor.
  2. In the IK Handle Tool Settings window, do the following:
    • Click Reset Tool to set the tool to its default settings.
    • Set the IK Handle Settings: Current Solver - ikSCsolver.
    The ikSCsolver setting selects the IK Single Chain Solver. This solver ensures that the joints in the skeleton will lie along a single plane. This solver is well suited for the mechanical arm, because the arm doesn’t need to twist, unlike a real arm.
  3. Working in the side view, starting from the base of the mechanical arm, do the following:
    • Click on the skeleton joint at the base of the mechanical arm.
    • Click on the skeleton joint at the tip of the mechanical arm. (The IK Tool is designed to attach to the joints closest to your selection point.)
    In the side view, the IK handle is drawn as a line from the start and end joints of the IK chain.
  4. 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.
  5. In the Hypergraph, select the node named ikHandle1. The IK Handle (in combination with the end effector) is used by the IK solver to calculate the rotation of the joints in the IK chain. By default, the IK Handle is located at the last joint of the IK chain in the scene view.
  6. Select the Move Tool from the Toolbox, and drag the Move Tool’s Z axis manipulator (blue arrow) to reposition the mechanical arm. When you drag the manipulator, the skeleton and mechanical arm model are repositioned.
  7. Reset the mechanical arm to its previous position by selecting Edit > Undo, Redo, Repeat until the mechanical arm is positioned into its previous orientation.

    NoteWhen using the Undo feature, do not undo so many times you inadvertently undo the IK handle you’ve just created.
The next steps describe how to manipulate the IK Handle using a control object.


Creating a control object for an IK system
Using the IK Handle to pose an IK chain is generally not a good practice. The IK Handle can be challenging to select in the scene view, especially when it’s grouped into a hierarchy that includes a skeleton and other surface components. A better practice is to create a control object.
You create a control object to select and manipulate an IK system instead of directly using the IK Handle. You can create a control object with a curve or a locator, which are often used because they don’t appear in the rendered image.
The control object controls the movement of the IK Handle using a constraint. You can constrain the position, orientation, or scale of an object to other objects using constraints.
To create a control object:

  • Create and position the control object in the scene view.
  • Name the node for the control object in the Hypergraph.
  • Freeze transformations for the control object.
  • Label the control object in the scene view.
  • Constrain the IK Handle to the control object.

To create a control object using a locator
  1. From the main menu, select Create > Locator. A three-dimensional cross is created at the origin in the scene view.
  2. Select the Move Tool from the Toolbox.
  3. In the side view, reposition the locator slightly above and in front of the end of the mechanical arm as shown in the image below.
To easily identify the locator as a control object in the Hypergraph, rename the locator.

To rename the control object using the Hypergraph
  1. In the Hypergraph, right-click the node named locator1. Choose Rename from the pop-up menu that appears. The locator1 name is highlighted on the node.
  2. Type the name ArmControl and press Enter to save the name for the locator.
Before you constrain the IK handle to the control object, you need to freeze the transformations for the control object. Freeze Transformations zeros the transformations for an object without changing the position of the object. This is another good practice; If it becomes necessary to reset the arm to its default position, you can set the transformation on the control object to zero, and the arm will return to this default pose.

To freeze the transformations for the control object
  1. In the Hypergraph, select the node named ArmControl. The control object is selected in the scene view.
  2. In the main menu, select Modify > Freeze Transformations > .
  3. In the Freeze Transformation Options window do the following:
    • Select Edit > Reset Settings to set the tool to its default settings.
    • Click Freeze Transform.
    The transformations for ArmControl are set to zero. From this point onwards, you can reset its position to this location by zeroing its translations in the Channel Box.
To easily identify the locator as the control object in the scene view, label the control object using an annotation. An annotation is a text label that can be set to point at the labeled item. Annotations are useful because they always face the viewer, regardless of the orientation of the model in the scene view.

To label the control object in the scene view
  1. In the Hypergraph, select the ArmControl node.
  2. In the main menu, select Create > Annotation. A input window appears.
  3. Type 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.
  4. With the annotation still selected, select the Move Tool.
  5. In the side view, drag only the annotation so it appears slightly offset from the locator object as shown below. The annotation displays in any scene view so you can easily identify the control object for selection.

To simplify the display of the Arm Control node
  1. In the Hypergraph, right-click the ArmControl node. Choose Collapse from the pop-up menu. (You can also double-click a node to collapse or expand the hierarchy below it.) The ArmControl node appears as a single node instead of the previous three node hierarchy. The small arrowhead on the lower left-hand corner of the node indicates that the node is collapsed.
The control object must be linked to the IK Handle to control the IK Handle.

Constraining an IK system
You can 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. For example, you select and position ArmControl without having to touch the IK Handle. You also set the constraint so ArmControl maintains the current distance (offset) from the IK Handle. The offset ensures that the constrained IK handle doesn’t move to the same position as the control object.

To constrain the IK Handle to the control object
  1. In the Hypergraph, select the ArmControl node and then Shift-select the ikHandle1 node. The order of selection when applying a constraint is important: you must select the constraining object first, and the item to be constrained second.
  2. In the main menu, select Constrain > Point > . The Point Constraint Options window appears.
  3. In the Point Constraint Options window, do the following:
    • Select Edit > Reset Settings to set the tool to its default settings.
    • Turn on the Maintain Offset setting.
    • Click the Add button.
    The IK handle is constrained to the control object. In the Hypergraph, a constraint node is created beneath the ikHandle1 node.
  4. In the Hypergraph, select only the ArmControl node.
  5. In the Toolbox, select the Move Tool.
  6. In the side view, drag the manipulator to reposition the control object. (Experiment with a few different positions in the side view only.) When you drag the manipulator, the control object moves, which in turn moves the IKHandle. Because the IK handle controls the skeleton and the mechanical arm model, they also move. The offset between the control object and the IK Handle is maintained.
The Cargo Magnet does not continuously point downwards when rotated. Its orientation is based on the rotation it had in its original position.
The mechanical arm will be easier to pose if you set Cargo Magnet to be oriented downwards towards the floor of the scene regardless of the orientation of the other components of the arm.

You make CargoMagnet point downwards using an orient constraint. An orient constraint constrains the orientation (rotation) of the X, Y, and Z axes of one object to match those of the constraining (target) object.
In the next steps, you reset the position of the mechanical arm to its default position, and then apply an orient constraint to the last joint in the IK system so that its orientation matches the control object. The effect is that CargoMagnet points downwards regardless of any other movement in the scene.

To set the IK system to its default position
  1. In the Hypergraph, select the ArmControl node.
  2. Open the Channel Box by clicking the Show/Hide Channel Box icon .
  3. In the Channel Box, set the X, Y, and Z transformations for ArmControl to 0. Zeroing the transformations on ArmControl resets the mechanical arm to its home position because of the freeze transformations step you performed in the previous section.
  4. Close the Channel Box by clicking the Show/Hide Channel Box icon.

To apply an orient constraint for the IK system
  1. In the Hypergraph menu, select View > Frame All. The Hypergraph displays all the nodes in the scene.
  2. In the Hypergraph, select ArmControl and then Shift-select the node named joint4. (You may need to dolly and track the Hypergraph view to view these nodes.)
  3. In the Main Menu bar, select Constrain > Orient > .
  4. In the Orient Constraint Options window, do the following:
    • Select Edit > Reset Settings to set the tool to the default settings.
    • Click the Add button.
    Joint4 is constrained to have the same orientation as the control object. In the Hypergraph, the constraint node is created below the joint4 node in the hierarchy.
  5. With only the ArmControl node selected, use the Move Tool to reposition ArmControl in the side view.
    CargoMagnet maintains an orientation facing the floor of the scene regardless of how the mechanical arm is positioned in the side view.
In the next section, you learn how to limit the range of movement for the IK system.

Constraint
Point Constraint
Making the target object follow the master object.
In this scenario, the ArmControl is the master, and the IK handle is the slave.

Orient Constraint
Maintains the position of one particular object.
In this scenario, the magnet is under orient constraint, which makes it into a fixed position to the box.

Information taken from: Autodesk Maya 2011 - http://download.autodesk.com/us/maya/2011help/index.html?url=./files/Inverse_kinematics.htm,topicNumber=d0e17823

No comments:

Post a Comment