About Constraints


Constraints in Maya connect attributes of objects together so they behave in the same way. This can be useful when you want one object to rotate exactly like another, but you don't want the translate values to change. You can use a constraint to connect the rotate values from one object to another, leaving all other attributes unchanged. Constraints can also be animated and turned on and off, allowing you to connect attributes temporarily.

Constraint Types

Maya offers the following constraint types:

  • Point A point constraint connects the translate values of one object to another.

  • Orient An orient constraint connects the rotate values of one object to another.

  • Scale A scale constraint connects the scale values of one object to another.

  • Aim An aim constraint aims one object at another object. This type of constraint can be useful for controlling where a character is looking, for example.

  • Parent The parent constraint works similar to the parent function in Maya but allows you to offset the child object from the parent. You can also turn the constraint on and off and choose which attributes are being affected, which you can't do with the parent function.

  • Geometry A geometry constraint constrains the position of one object to the surface of another object. The pivot point of the constrained object determines where the constrained object sits on the surface.

  • Normal A normal constraint constrains an object's orientation values so that they align with the normals of another surface.

  • Tangent A tangent constraint constrains an object's orientation in the direction of a curve. If the constrained object is attached to a path, a tangent constraint ensures that the object always points in the direction of the path curve.

  • Pole Vector A pole vector constraint allows you to use an object to control the pole vector value of an IK Rotate Plane handle.

To create a point constraint:

1.

Create a NURBS sphere and a polygon cube.

2.

Translate the cube a few units away from the sphere.

3.

Select the sphere and -select the cube.

4.

From the Constrain menu, select the box next to Point (Figure 12.54).

Figure 12.54. Select the Point Constraint options.


5.

Turn on Maintain Offset (Figure 12.55).

Figure 12.55. Set the Maintain Offset option to keep the object at its current position.


This ensures that the initial position of the cube remains the same.

6.

Click Apply.

The cube's wireframe becomes pink when the sphere is selected. This means that the sphere is influencing the cube in some way.

7.

Select the sphere and translate it in any direction using the Move tool.

The cube will translate in the exact same way automatically.

Tips

  • Try adding an orient constraint using the same method as described in the preceding task. Then when you rotate the sphere, the cube will rotate in the same manner.

  • Which object gets constrained is determined by which object is selected first. If you want the cube to control the sphere, you would select the cube first and -select the sphere before creating the constraint.


Muting animation channels

The Mute Animation Channel function lets you temporarily turn off specified animation curves for an object, making it easier to focus on a particular aspect of the animation. For example, if you have a ball bouncing from the left side of the screen to the right, it might be difficult to focus your attention on the up-and-down motion due to the left-to-right motion. If you mute the left-to-right motion, you can see the up-and-down motion more clearly. When you have adjusted the up-and-down motion as you want, you can unmute the left-to-right motion.

To mute an animation channel:

1.

Create a NURBS sphere.

2.

Change the playback start time to 1 and the playback end time to 50.

3.

At frame 1, select the sphere and set a keyframe.

4.

Move to frame 40 and translate the sphere in the front view 20 units to the right. Set another keyframe.

5.

Move to frame 20 and set another keyframe.

6.

Move to frame 10 and translate the sphere up 10 units. Set a keyframe.

7.

Move to frame 30 and translate the sphere up 10 units. Set a keyframe.

You should now have a ball that moves across the screen and bounces up and down.

Now to see only the up-and-down motion, you need to mute the Translate X channel in the Channel Box.

8.

With the sphere selected, select Translate X in the Channel Box. Right-click the highlighted word and choose Mute Selected (Figure 12.56).

Figure 12.56. Select a channel to mute, right-click, and choose Mute Selected to temporarily disable the animation.


The channel turns brown, and as you drag through the timeline, the ball moves only up and down.

9.

To unmute the channel, select Translate X in the Channel Box. Right-click the highlighted word and choose Unmute Selected.



    Maya for Windows and Macintosh
    MAYA for Windows and MacIntosh
    ISBN: B002W9GND0
    EAN: N/A
    Year: 2004
    Pages: 147
    Authors: Danny Riddell

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net