Maya Constraints

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Maya Constraints as PDF for free.

More details

  • Words: 10,404
  • Pages: 47
Constraints & Motion Capture

Constraints & Motion Capture 23 Basic Constraints

5

Understanding basic constraints Objects and targets

5

6

Why use constraints?

6

Working with constraints

7

Creating or adding targets to a constraint Removing constraint targets

8

Adjusting the target weights

8

Constraining an object’s position

7

11

Constraining an object to a point

11

Constraining an object to a surface

12

Constraining a pole vector of an IK handle Constraining an object’s orientation

13

14

Matching an object’s orientation to another object Constraining an object’s aim

15

Constraining an object to the normal of a surface Constraining an object to a tangent Controlling “up”

16

17

18

Constraining an object’s scale

19

Constraining an object’s scaling values

24 Motion Capture

19

21

Getting started with motion capture

21

Basic procedure for simple motion capture Terminology

14

21

22

Using the Device Editor

23

Learning about motion capture

24

Using Maya: Dynamics 3

Dynamics Contents Defining motion capture devices

25

Listing devices and attachments

26

Attaching attributes and commands Attaching attributes

27

Attaching commands

28

Modifying existing attachments Mapping device data

31

33

Rehearsing the motion

33

Recording the motion

33

Reviewing the motion

34

Saving files to disk

36

Using filters and resamplers Reviewing takes

39

40

Using multiple devices

41

Performing full-body motion capture Tips for full-body motion capture

4

Using Maya: Dynamics

29

30

Saving attachments Capturing motion

27

42 42

23

Basic Constraints Using basic constraints, you can control the position, orientation, or scale of one object based on the position, orientation, or scale of one or more “target” objects. In addition, you can impose specific limits on objects and automate animation processes. For example, if you want to quickly animate a sled sliding down a bumpy hill, you might first use a Geometry Constraint to constrain the sled to the surface. You could then use a Normal Constraint to make the sled sit flat on the surface. After you create these constraints, you key the sled’s positions at the top and bottom of the hill. The animation is then complete. This chapter describes how to use these constraints, including:



“Understanding basic constraints” on page 5



“Working with constraints” on page 7



“Constraining an object’s position” on page 11



“Constraining an object’s orientation” on page 14



“Constraining an object’s scale” on page 19

Understanding basic constraints You can constrain an object’s position, orientation, or scale to a target(s). There are eight basic constraints:

Position Point Constraint



Geometry Constraint



Pole Vector Constraint

Cons tra ints & Motion Ca pture



Orientation •

Orient Constraint



Aim Constraint

Using Maya: Animation

5

Basic Constraints Understanding basic constraints •

Normal Constraint



Tangent Constraint

Scale •

Scale Constraint

Objects and targets When describing constraints, we use the terms object and target, where: •

Object is the name of the transform you constrain.



Target is the name of the DAG node(s) to which the object is constrained.

Tip When working with constraints, always select the object last. In other words, to add, change, or remove targets, select the target, then select the constrained object.

Why use constraints? If two objects share a common DAG parent, you can use an expression or a connection to copy a set of translation, rotation, or scale values from one object to another. However, if the two objects have different parent transforms, this procedure may produce wildly different motions, as in the following example.

Example: Why constraints are useful 1

Create three objects: a sphere named s and two cones named c1 and c2.

2

Parent c1 to s.

3

Connect the translation value of c2.t to c1.t.

4

Select c2 and drag it using the Move Tool. The two cones should appear as one.

5

Rotate s by 90 degrees (on any axis).

6

Select c2 and drag it using the Move Tool. Notice that the two cones are no longer coincident.

6

Using Maya: Animation

Basic Constraints Working with constraints Since c1 and c2 are no longer parented to the same transform, this simple scheme cannot work. However, by placing a Point Constraint on c1 and selecting c2 as the target, you could then move c2 and c1 would follow regardless of the objects’ parent transforms.

Working with constraints You create all constraints in the same way, whether you are using them to control position, orientation, or scale.

The constraint work flow consists of these basic tasks: •

Creating or adding targets to a constraint



Removing constraint targets



Adjusting the target weights

Creating or adding targets to a constraint To create a constraint or add targets to an existing constraint, you first select the targets, then the constrained object, and finally the constraint type.

To create or add targets to a constraint: 1

Select the target object or objects (shift-click to select more than one target).

2

Select the object you want to constrain.

3

Select Animation→Constraint to select the constraint type. After you select a constraint type, the constrained object moves to its new constrained position or orientation. If multiple targets are used, their combined effect, in general, is the weighted average of each of their individual effects. Cons tra ints & Motion Ca pture

Tip If you cannot add a constraint by selecting the constraint type, check the option box (❐) for that constraint to be sure the Add Targets option is selected. If the specified constraint type does not already exist for the selected object, Maya creates one. If the object already has a constraint of the type specified, Maya adds the targets to it and applies the current option box settings.

Using Maya: Animation

7

Basic Constraints Working with constraints The Reset button sets the constraint operation to Add targets. However, since all option box settings are applied each time you add a target, you probably don’t want to select this unless you are creating a new constraint.

Removing constraint targets Once added, a constraint target influences the constrained object. You can end this influence by removing the target from the constraint.

To remove targets from a constraint: 1

Select the first constraint target you want to remove.

2

Shift-click to select any additional targets you want to remove.

3

Select the constrained object.

4

Use the Constraint pull-down menu to open the option box (❐) for the constraint type you want to remove targets from.

5

Select Remove Targets in the option box.

6

Click Add/Remove at the bottom of the option box.

7

Reset the option box by selecting Add Targets.

8

Click the Close button. The constrained object updates its position to reflect the target removal(s). When you remove the last constraint target, you also remove the constraint.

Note When you remove a target, it also removes any animation curves attached to the constraint for that target.

Adjusting the target weights For a constraint with multiple targets, you can control the influence of individual targets by adjusting their target weights.

To set a target weight using the Channel Box: 1

Select the constrained object. The constraint is listed in the Shapes section of the Channel Box. The target weights are listed next to the target names, as shown in the following figure.

8

Using Maya: Animation

Basic Constraints Working with constraints

The constraint is listed here. The target weights are listed here.

2

Enter values for the target weights. You can also set keys by clicking on a Target Weight box with the right mouse button.

To set a target weight using the Attribute Editor: Select the constrained object.

2

Open the Attribute Editor, Window→Attribute Editor.

3

Select the tab for the constraint.

4

Open the Extra Attributes section. The target weights are listed next to the target name, as shown in the following figure.

Using Maya: Animation

Cons tra ints & Motion Ca pture

1

9

Basic Constraints Working with constraints

The target weights are listed here.

10

Using Maya: Animation

Basic Constraints Constraining an object’s position 5

Enter values for the target weights. You can also set keys by clicking on a Target Weight box with the right mouse button.

Note Setting all target weights to 0 does not remove the constraint, but causes it to “freeze” the object.

Tip You can often get useful results using expressions to drive multiple target weights based on the value of a single dynamic attribute. For example, you could constrain an object to move from target to target by setting one weight to a value on the range (0 to 1) and setting the other to 1 minus that value.

Constraining an object’s position This section describes the various ways you can constrain an object’s position, including: •

Constraining an object to a point—the Point Constraint



Constraining an object to a surface—the Geometry Constraint



Constraining a pole vector of an IK handle—the Pole Vector Constraint

Constraining an object to a point

The object’s orientation is not affected.

To constrain an object’s position based on the target’s position: 1

Select the target object or objects. (Shift-click to select more than one target.)

2

Select the object you want to constrain.

3

From the Animation menu bar or Hotbox, select Constraint→Point. Using Maya: Animation

11

Cons tra ints & Motion Ca pture

A Point Constraint causes an object to move to and follow the position of a target object or to the average position of several target objects. This constraint is useful for having one object match the motion of another without regard for its parent transform or orientation. You can also use this constraint to animate one object to follow a series of targets by animating the constraint weight.

Basic Constraints Constraining an object’s position If you select only one object as the target, the rotate pivot point of the constrained object moves to the rotate pivot point of the target. If you select several target objects, the constrained object moves to the average of the target objects’ pivots (see “Adjusting the target weights” on page 8). Once you constrain an object, moving the target object also moves the constrained object in the same way.

Constraining an object to a surface The Geometry Constraint restricts a constrained object to a surface, curve, or mesh. Specifically, the object’s rotate pivot point is constrained to the target surface. Geometry Constraint targets can be NURBS surfaces, NURBS curves, or polygon surfaces. It is similar to creating a motion path for an object, except that the object can move freely over the surface of the target geometry. This constraint is useful for constraining an object’s location to a surface such as a floor or staircase. The constrained object’s orientation is not affected.

Tip Unlike the Point Constraint, you can set keys for the position of the geometry-constrained object (or apply a Point Constraint to it also). The object’s geometry-constrained position will be the point on the target surface, closest to the keyed (or point-constrained) position.

To constrain an object to a surface: 1

Select the target surface, curve, or mesh. (Shift-click to select more than one target.)

2

Select the object you want to constrain.

3

From the Animation menu bar or Hotbox, select Constraint→Geometry. When you move the constrained object, it is constrained to the target surface. If you move the target surface, the constrained object will follow and move to the point on the target surface closest to the object’s previous position.

12

Using Maya: Animation

Basic Constraints Constraining an object’s position If you add more than one target, the object is constrained to the target surface that has the highest weight. (See “Adjusting the target weights” on page 8.)

Notes If all the targets have the same weight, as happens when you create a Geometry Constraint, the target used is the one with the lowest index. The target index indicates the order in which you selected the targets during the constraint creation (the first target selected has the lowest index). You should animate the target weights such that only one target has the highest weight at any given frame. The Geometry Constraint is history dependent. The end result of an object’s animation depends on where the object started.

Constraining a pole vector of an IK handle The Pole Vector constraint applies only to IK handles that use the rotate plane IK solver (see “Creating IK handles” on page 238 of Chapter 12, “Posing and Animating Skeletons”). The effect is similar to the Constraining an object to a point above, except this constraint controls the location of the Pole Vector end-point. You can use constraints with inverse kinematics to create realistic character movements simply. For example, say you want to animate an inverse kinematic character riding a bicycle. You can key the rotation of pedals on the bicycle, then constrain the effector of the character’s leg skeleton to the pedal. Now the leg of your character follows the keyed rotation of the pedals, creating the illusion that the character is pedaling the bicycle. For more information on inverse kinematics, refer to the Character Animation section of this book.

To create (or add targets to) a Pole Vector Constraint: Select the first constraint target.

2

Shift-click to select any additional targets.

3

Select the handle for the pole vector you want to constrain.

4

From the Animation menu bar or Hotbox, select Constraint→Pole Vector.

Using Maya: Animation

Cons tra ints & Motion Ca pture

1

13

Basic Constraints Constraining an object’s orientation The IK chain rotates so that the Pole Vector lies at the target pivot. If you add multiple targets, the Pole Vector is placed at the weighted average of the target positions. For example, if you select two targets with the same weight, the IK chain rotates so that the Pole Vector is halfway between them.

Tip Remember, you can produce useful results by combining multiple target weights with an expression.

Constraining an object’s orientation This section describes the various ways you can constrain an object’s orientation, including: •

Matching an object’s orientation to another object—the Orient Constraint



Constraining an object’s aim—the Aim Constraint



Constraining an object to the normal of a surface—the Normal Constraint



Constraining an object to a tangent—the Tangent Constraint Only one of these constraints can be present on a given object, as each connects to the x, y, and z rotation attributes of the object. Aim, Normal, and Tangent Constraints have the same Aim and Up parameter options.

Matching an object’s orientation to another object The Orient Constraint matches the orientation of one object to that of a target object(s) without changing the constrained object’s location. This constraint is useful to make several objects orient in sync. For example, you can make a group of people look in the same direction at the same time by animating one head and then constraining the orientation of all the others to this head. If you select several target objects, the constrained object’s orientation is an average of their orientations.

To constrain the orientation of one object to another:

14

1

Select a target object or objects. (Shift-click to select more than one target.)

2

Select the object you want to constrain.

3

From the Animation menu bar or Hotbox, select Constraint→Orient.

Using Maya: Animation

Basic Constraints Constraining an object’s orientation If you have only one target object, the constrained object changes to the target’s orientation. If you have several targets, the constrained object changes to the targets’ average orientation (see “Adjusting the target weights” on page 8). When you rotate the target object(s), the constrained object also rotates.

Constraining an object’s aim Note The effect of multiple targets for orient constraints can be non-intuitive and is not recommended for targets that differ greatly in orientation. The Aim Constraint aligns the aim vector of one object to follow the movement of a target object or objects. The Aim Constraint is useful for lights and cameras; you can aim a light at an object or a group of objects, for example, to follow their animation.

To create (or add targets to) an Aim Constraint: 1

Select a target object or objects. (Shift-click to select more than one target.)

2

Select the object you want to constrain.

3

From the Animation menu bar or Hotbox, select Constraint→Aim→❐ to display the Aim Options window.

4

Click Add/Remove. When you move the target object, the aim vector of the constrained object (the X-axis is the default) repositions itself to aim at the target.

5

Change the vectors if you want to aim the selected axis of the constrained object. You can aim the constrained object by changing one of these vectors: Sets the aim vector—the vector in local coordinates that orients to the target. The default is the X-axis: 1.0, 0.0, 0.0.

Up Vector

Sets the local up vector—the vector in local coordinates that aligns with the world up vector. You can use the Up Vector option to control the roll of the constrained object as it moves across the up axis. The default is Y-up: 0.0, 1.0, 0.0.

Using Maya: Animation

15

Cons tra ints & Motion Ca pture

Aim Vector

Basic Constraints Constraining an object’s orientation World Up Vector Sets the world up vector—the vector in world coordinates

that the local up vector should align with. The default is yup: 0.0, 1.0, 0.0. 6

Click Close.

Constraining an object to the normal of a surface The Normal Constraint limits the orientation of an object to the normal of the constraining surface or mesh on which it travels. This constraint is useful for keeping an object perpendicular to a surface, usually when the surface is deformed, such as a ship sailing over a section of choppy water.

To constrain an object’s orientation to the normal of the surface: 1

Select the target surface or mesh.

2

Select the object you want to constrain.

3

From the Animation menu bar or Hotbox, select Constraint→Normal→❐ to display the Normal Options window.

4

Click Add/Remove. As you move the constrained object along the surface, the aim vector reorients itself to the normal of the surface.

5

Change the vectors if you want to aim the selected axes of the constrained object. You can align the axes of the constrained object to the normal using the following options: Aim Vector

Sets the aim vector—the vector in local coordinates that orients to the normal. The default is the X-axis: 1.0, 0.0, 0.0.

Up Vector

Sets the local up vector—the vector in local coordinates that aligns with the world up vector. You can use the Up Vector option to control the roll of the constrained object as it moves across the up axis. The default is Y-up: 0.0, 1.0, 0.0.

World Up Vector Sets the world up vector—the vector in world coordinates

that the local up vector should align with. The default is Yup: 0.0, 1.0, 0.0. 6

16

Click Close.

Using Maya: Animation

Basic Constraints Constraining an object’s orientation

Constraining an object to a tangent The Tangent Constraint limits the orientation of an object to the tangent of the constraining curve (path) on which it travels. This constraint is useful for having an object follow a path’s direction, such as a roller coaster car following the tracks.

To constrain an object’s orientation to the tangent of a curve: 1

Select the target curve.

2

Select the object you want to constrain.

3

From the Animation menu bar or Hotbox, select Constraint→Tangent→❐.

4

Click Add/Remove. As you move the constrained object along the surface, the aim vector reorients itself to the tangent of the curve’s surface.

5

Change the vectors if you want to aim the selected axes of the constrained object. You can align the axes of the constrained object to the tangent using the following options: Aim Vector

Sets the aim vector—the vector in local coordinates that orients to the tangent. The default is the X-axis: 1.0, 0.0, 0.0.

Up Vector

Set the local up vector—the vector in local coordinates that aligns with the world up vector. You can use the Up Vector option to control the roll of the constrained object as it moves across the up axis. The default is Y-up: 0.0, 1.0, 0.0.

World Up Vector Sets the world up vector—the vector in world coordinates

that the local up vector should align with. The default is Yup: 0.0, 1.0, 0.0. 6

Click Close. Cons tra ints & Motion Ca pture

Using Maya: Animation

17

Basic Constraints Constraining an object’s orientation

Controlling “up” Depending on the type of scene you are creating, you may want more control of the object’s orientation. For example, if you were animating a roller-coaster car along a curved and looped track, it would be useful to control the car’s Y-axis orientation (Up Vector) along each keyframe. There are several attributes that control an object’s orientation, including: •

Aim Vector



Up Vector



World Up Type



World Up Vector



World Up Object The Aim Vector, Up Vector, World Up Vector, and World Up Type attributes behave identically for the Aim, Tangent, and Normal Constraints.

Aim Vector This vector in local coordinates of the constrained object points at the target (for Aim Constraint), aligns with the normal (for Normal Constraint) or the curve tangent (for Tangent Constraint). The default value is (1.0, 0.0, 0.0).

Up Vector This is the vector in local coordinates of the constrained object that is aligned based on the World Up Type. The default value is (0.0, 1.0, 0.0).

World Up Type This parameter (available only through the command line and Attribute Editor) controls how the Up Vector is aligned. The World Up Type can have one of five values:

18



Scene—the Up Vector is aligned with the up-axis of the scene and the World Up Vector and World Up Object attributes are ignored.



Object—the Up Vector is aimed as closely as possible to the origin of the space of the World Up Object and the World Up Vector attribute is ignored.



Object Rotation—the World Up Vector is interpreted as being in the coordinate space of the World Up Object, transformed into world space, and the Up Vector is aligned as closely as possible to the result.

Using Maya: Animation

Basic Constraints Constraining an object’s scale •

Vector—the Up Vector is aligned with the World Up Vector as closely as possible.



None—no calculation is performed by the constraint, with the resulting Up Vector orientation based on the previous orientation of the constrained object.

Notes If you set the World Up Type to None, the Aim, Tangent, and Normal constraints are history dependent. The end result of an object animation depends on where the object started. If you set the Aim and Up Vectors to be collinear, Maya will interpret the World Up Type as None. The default World Up Type is “vector”.

World Up Vector This is the vector in world coordinates (if World Up Type is vector) or in the local space of the World Up Object (if World Up Type is object rotation) that the up vector should align with. The default value is (0.0, 1.0, 0.0)

World Up Object The World Up Object is the DAG object used for World Up Type “object” and “objectrotation”. The default value is no up object, which is interpreted as world space.

Constraining an object’s scale This section describes how you can constrain an object’s scale.

Constraining an object’s scaling values

To constrain an object’s scale: 1

Select the target object.

2

Select the object you want to constrain. Using Maya: Animation

19

Cons tra ints & Motion Ca pture

The Scale Constraint limits the scaling values of an object to the scaling values of the target object. This constraint is useful for scaling all objects in a hierarchy at once in accordance to the scaling changes applied to one object.

Basic Constraints Constraining an object’s scale 3

From the Animation menu bar or hotbox, select Constraint→Scale. When you scale the target object, you will also scale the constrained object with the same scaling values.

20

Using Maya: Animation

24

Motion Capture With motion capture, you record real physical motion using a motion capture device. You can use this real-life data to animate characters or objects in a scene. Motion capture lets you generate large amounts of complex motion. You must plan your motion capture animations meticulously and set them up carefully. This chapter describes how to set up and perform motion capture in Maya. It includes the following information:



“Getting started with motion capture” on page 21



“Defining motion capture devices” on page 25



“Listing devices and attachments” on page 26



“Attaching attributes and commands” on page 27



“Capturing motion” on page 33



“Using filters and resamplers” on page 39



“Reviewing takes” on page 40



“Using multiple devices” on page 41



“Performing full-body motion capture” on page 42

Getting started with motion capture This section provides background information on motion capture for the first-time user. Cons tra ints & Motion Ca pture

Basic procedure for simple motion capture The workflow for a simple motion capture sequence consists of a few basic steps.

To create a simple motion capture sequence: 1

Create a target geometry in Maya. Using Maya: Animation

21

Motion Capture Getting started with motion capture 2

Attach the geometry to the motion capture device.

3

Rehearse the motion for the actions that will be performed.

4

Record the motion.

5

Review the recorded motion and insert it into your scene. It takes a few additional steps to create a full-body motion capture sequence. For details, see “Performing full-body motion capture” on page 42.

Terminology Before using motion capture, you should become familiar with a few simple terms. Motion capture device

To capture motion, you use a motion capture device. The motion capture device samples motion and records it. With a motion capture device, you can achieve real-time monitoring and recording of data. Supported data-server devices in Maya will have servers provided by the device vendors. You can write your own servers for custom devices with the Maya Motion Capture Developer’s Tool Kit. In general, the mouse and keyboard are not motion capture devices.

Server

A server is a stand-alone program that communicates with a device. Maya can talk to the server to get device data. Devices that require servers are called data-server devices.

Axis

A motion capture device provides information on different axes, arranged in a hierarchy. Axes give important information such as if the data is a rotation value, a translation value, or just a number. An axis can be connected (or attached) to an attribute in a Maya scene.

Attachment

The connection between a device axis and an object’s attribute is called an attachment. The attachment “tells” the device what attribute in the scene you want to change.

Button

Some motion capture devices have buttons. A button can execute a command or act as a clutch for an axis. However, button presses cannot be recorded as motion capture data.

22

Using Maya: Animation

Motion Capture Getting started with motion capture

Using the Device Editor You use Maya’s Device Editor to control the motion capture process. To display the Device Editor, select Window → AnimationEditors → Device Editor.

Device Outliner

Device Editor tabs

The top section is the Device Outliner. The Device Outliner lists the defined devices, the device structures, and what the devices are attached to. For information on how to use the Device Outliner, see “Defining motion capture devices” on page 25.

Tab sections

The lower section provides several tabs that allow you to work with devices and manage motion capture data. •

The Attachment tab provides settings for making attachments, as described in “Attaching attributes and commands” on page 27.

Using Maya: Animation

23

Cons tra ints & Motion Ca pture

Device Outliner

Motion Capture Getting started with motion capture •

The Mapping tab provides settings for modifying attribute attachments, as described in “Changing the attachment and device mappings” on page 36.



The Filters tab lets you define filters and resamplers that you can use when previewing motion data or converting it to animation curves. For details, see “Using filters and resamplers” on page 39.



The Options tab includes miscellaneous options for writing and reading takes, as described in “Numbering takes” on page 37, “Reviewing takes” on page 40, and “Using multiple devices” on page 41.



The Controls tab provides the settings for rehearsing, recording, and reviewing your motion capture sequences. These procedures are described in “Capturing motion” on page 33.

Learning about motion capture To help you learn about motion capture, we’ve provided a “toy” motion capture server, the mayaClockServer program. This simple program reads the SGI system clock and outputs three rotation values, in radians: the angle of the second hand, the angle of the minute hand, and the angle of the hour hand. It does not require any special hardware. The binary is located in the /usr/aw/maya/bin directory and is called mayaClockServer. To view mayaClockServer options, enter: /usr/aw/maya/bin/mayaClockServer -h

We’ve also included an example script for using mayaClockServer. To see a demo of the clock, enter the following in the Script Editor: mayaClockDemo

The script launches mayaClockServer using the MEL system command, defines a device named “clock,” creates three analog clock hands, and connects the geometry to the clock.

Note If you’ve already defined the clock device, un-define it and flush the undo queue before running the demo script.

24

Using Maya: Animation

Motion Capture Defining motion capture devices

Defining motion capture devices Most motion capture devices are data-server devices. To use a data-server device, you need a server. For more information on using the server for a specific device, see the documentation provided by the device vendor. Some devices do not need servers. These devices are installed via the IRIX desktop. If such a device is visible to the IRIX desktop and supported by Maya, it will be listed in the Device Outliner when you start Maya. For data-server devices, use the defineDataServer command to define the device in Maya. To do this, enter the following command in Maya’s Script Editor after you start the device server: defineDataServer -device <deviceName> -server <serverName>;

where: •

<deviceName> is a unique device name. Choose one that will be easy for you to remember later.



<serverName> is the name of the communication interface defined to talk to the server, as defined in the server setup. For example, if you started the clock device but it did not appear in the Device Editor, you would enter: defineDataServer -device clock -s mayaClockServer

To undefine a device, use this syntax. defineDataServer -device <deviceName> -undefine;

An important interaction exists between defining and un-defining data servers and the undo queue.

Using Maya: Animation

25

Cons tra ints & Motion Ca pture

When you undo a defineDataServer command, the connection with the dataserver device does not break until the defineDataServer command is off the undo queue. When you undo an undefine of a data server, the connection with the server does not break until the command is off the undo queue. The easiest way to remove the command from the undo queue is to use the flushUndo MEL command.

Motion Capture Listing devices and attachments

Listing devices and attachments The Device Outliner lists the devices and their attachments. Click to expand/ collapse Device Axis

This is the only way to see how devices are attached to their target attributes. Since devices are not normal Maya dependency graph nodes, they do not appear in the regular Outliner or in the Hypergraph.

Expanding device listings The devices and their attachments appear in the following order: •

The left-most items in the Device Outliner are the devices.



The next level shows the axes, indented to indicate their positions in the device hierarchy.



The final level shows the attachments between the device and an attribute.

To expand or collapse an item: Click the arrow to the left of the item.

To expand or collapse all of the item’s children: Shift-click the arrow to the left of the item.

Example: Listing the mayaClock device If you ran the mayaClockDemo MEL script, the clock name (clock) should be listed in the left column in the Device Outliner. (If it is not, follow the directions in “Defining motion capture devices” on page 25.) To show all of the device’s children, shift-click the arrow to the left of the clock name. The first level of children in the clock are the three axes: hours, minutes, and seconds.

26

Using Maya: Animation

Motion Capture Attaching attributes and commands For complex devices, an indented list of axes is displayed, each with its own children. Eventually a device listing ends with attribute attachments. The attachments describe how the device is connected to Maya attributes.

Attaching attributes and commands You use the Device Editor’s Attachment tab to create attachments. There are two types of attachments: attribute attachments and command attachments. •

An attribute attachment is a connection between an attribute and a device axis.



A command attachment is a command that is issued when a button is pressed.

Attaching attributes Attaching attributes to device axes Attachment tab for axis

Cons tra ints & Motion Ca pture

To attach an attribute to a device axis: 1

Select the Maya object.

2

In the Device Outliner, select the axis you want to attach.

3

Under the Attachment tab, type the name of the Maya node that has the attribute to attach in the Node box

Using Maya: Animation

27

Motion Capture Attaching attributes and commands

or click the right mouse button in the Node box to display a pop-up menu that lists all of the selected nodes and pick the node you want. 4

Type the name of the attribute in the Attribute box

or click the right mouse button in the Attribute box to display a pop-up menu that lists all of the key-able attributes for the specified node and select an attribute. 5

Specify whether you want to make the attachment per Selection or per Object. Choose Object for most motion capture purposes. When you explicitly connect the device to a target attribute, that connection will always take effect. Choose Selection if you want to make the connection only for the currently selected object. This is useful when you are interactively manipulating objects with an input device, but not for basic motion capture work. If you use the Selection mode, the Node box is ignored.

6

If a device has a button, you can specify that a button is a “clutch” that makes the connection only while the button is pressed. Select a button name using the Clutch menu. You cannot record a button press as motion capture data.

7

Click Add to make the attachment between the device axis and the attribute.

Attaching commands You can use command attachments with devices that have buttons. When you press the button, Maya executes the command associated with the button.

To attach a command to a button:

28

1

In the Device Outliner, select a button.

2

Under the Attachment tab, type the command you wish to execute in the Command box.

3

If you want the command to execute repeatedly while the button is pressed, turn on Continuous.

Using Maya: Animation

Motion Capture Attaching attributes and commands Generally, you will want to execute the command once per button press. To do this, turn Continuous off. You can also execute a command every time any button is pressed or released, or if any axis changes on a specified device. The device must have at least one button.

To attach a command to any device change: 1

In the Device Outliner, select a device with at least one button.

2

Under the Attachment tab, enter the command you want to execute whenever any button on the device is pressed or released or whenever any axis on the device changes value. To delete a command attachment or an attribute attachment, select the attachment in the Device Outliner and click Delete.

Modifying existing attachments You can also modify existing attachments using the Attachment tab.

To modify attachment mapping: 1

In the Device Outliner, select the attachment.

2

Change the attachment values.

3

Under the Attachment tab, click Update.

To delete an attachment: 1

In the Device Outliner, select the attachment.

2

Under the Attachment tab, click Delete. Remember, a single axis may have more than one attachment.

If you accidentally delete an attachment, you can always undo the deletion.

Using Maya: Animation

29

Cons tra ints & Motion Ca pture

Tip

Motion Capture Attaching attributes and commands

Mapping device data Sometimes the data coming from the device is in the wrong unit system or needs an adjustment to its scale or offset. You can modify the scale and offset values for incoming device data using the Mapping tab of the Device Editor. Mapping tab

There are two types of mappings: attachment mappings and device mappings. Both mappings affect the scale and offset of the device data. The device data is multiplied by the scale term and then the offset is added. •

Attachment mappings apply to attribute attachments. These mappings are recommended for motion capture work. You can undo them.



Device mappings apply to axes. You cannot undo them.

Important Using device and attachment mapping together is error-prone and may produce unintentional results.

To modify the scale or offset of your motion capture data: 1

In the Device Outliner, select the axis or attachment you want to modify. Select an axis if you want the Mapping tab to control a device mapping. Select an attachment if you want the Mapping tab to control an attachment mapping.

2

30

Under the Mapping tab, select Absolute or Relative mapping.

Using Maya: Animation

Motion Capture Attaching attributes and commands With Absolute mapping, motion is scaled and offset with respect to the origin. If you move a device a foot away from the origin, the target attribute also changes its value to be one foot away from the origin. Absolute mapping is useful for motion capture. With Relative mapping, motion is adjusted relative to the last device position, without regard to the origin. If you move a device one foot to the right, the target attribute moves one foot to the right.Relative mapping is useful for desktop input devices that always return to some resting position. 3

If you are working with device mapping, choose whether you want to apply your mapping to World space or View mode. Select World for motion capture work. If View mode is used, the device coordinates are translated into the space of the active camera.

Saving attachments Since devices are not defined as dependency graph nodes, their definitions, attachments, and mappings are not saved in Maya files. Creating an attachments script lets you reload the attribute attachments, command attachments, and mappings when you need them. This saves you having to attach the device to each of its target attributes every time you load a file. You must define the device before running the attachment script. The MEL script will remake all of the attribute attachments, command attachments, and mappings, provided the device is defined and the target attributes and nodes have the same names as they did when you saved the script.

Cons tra ints & Motion Ca pture

Using Maya: Animation

31

Motion Capture Attaching attributes and commands

Click here to save the script

To create an attribute attachments script: 1

In the Device Outliner, select the device, its axes, or its attachments.

2

Under the Controls tab, click Save Attachments.

3

Select a path and name for the attachments MEL script. Be sure you save the script in your scripts path so Maya can see it when you want to reattach your scene.

4

Click OK. The next time you load the scene, define the device, if needed, and run the attachments script from the Script Editor.

32

Using Maya: Animation

Motion Capture Capturing motion

Capturing motion For each motion to capture, there are three different phases of the capture process: rehearse, record, and review. For each of these steps, you’ll use the Device Editor’s Controls tab.

Rehearsing the motion You may wish to have the performer rehearse the motion you’re interested in before you record. During this rehearsal phase, any of the actor’s questions can be worked out to perfect the move. If the scene is not too heavy, you may be able to view the motion in real time. Any animation curves attached to the target attributes are not affected by the Rehearse mode.

To rehearse the motion: 1

Under the Controls tab, select Rehearse.

2

Select Enable Monitor to specify that the target attributes are getting live data from the device. When you switch from other phases, this step is performed automatically for all devices.

Recording the motion The settings for beginning recording are also under the Controls tab.

To record the motion: Under the Controls tab, turn on Enable Record for each device you want to record.

2

Make sure the Recording Duration box has enough recording time (in seconds) for your planned motion.

Cons tra ints & Motion Ca pture

1

We recommend you add a few more seconds to the duration and start recording before the actor begins a move. 3

Select Record.

Using Maya: Animation

33

Motion Capture Capturing motion All the record-enabled devices begin recording data, using the current time as a start time for the recording.

Tip The recording frequency is determined by the device, not by the frame rate of Maya. Once the duration is met, the recording stops and advances to the review phase. At this point, the data is not yet part of your Maya animation and is not saved to a Maya file. Data that you can preview or convert into animation curves is called a take.

Tip To stop a recording before the duration expires, select either Rehearse or Review under the Controls tab. •

Review will take you to the review mode, the same as if the duration expired.



Rehearse will not bring the device data into Maya.

If you accidentally chose Rehearse and want to see the motion in your scene, click the Preview or Apply Take buttons. Click Preview to create a preview version of the take; click Apply Take to make an animation curve version of the take. 4

When you are ready to convert the take to animation curves, click Apply Take.

Important If a device has a take and you select Record, that take is lost unless you first click Write Take to save it or Apply Take to convert it to animation curves.

Reviewing the motion In the review phase, Maya applies the motion data you have recorded to the target attributes. Your preview data is applied to all devices and axes that have Apply Take enabled (as indicated by Enable Apply Take). Animation curves that are attached to the target attributes are not affected at this time.

34

Using Maya: Animation

Motion Capture Capturing motion During the review phase, you can click Preview to view the take in a preview form; this does not change the data.You can also click Apply Take to convert the take to animation curves in the review phase.

Viewing a take in preview form A preview is done automatically when you enter the review phase. This lets you review the newly captured motion faster than by using Apply Take and leaves the animation curves unchanged. Preview data is not visible in the Graph Editor.

To view a take in preview form: Under the Controls tab, click Preview. When an attribute attachment is formed, a node (blendDevice) is attached to the target attribute. The blendDevice node determines whether you will view live device data (Enable Monitor) or the animation curve that is attached to the attribute. In this form, the data is stored in the blendDevice node. Playing over the recorded time range will show the newly recorded data, leaving any animation curves unchanged. If you save your scene to a Maya file, preview data is not saved as part of the scene. To save preview data, use the Write Take button (as described in “Saving files to disk” on page 36).

Note If you are doing a batch render, be sure to save the motion as animation curves (using Apply Take). Otherwise the motion will not be part of the render.

Converting a take to animation curves

Under the Controls tab, click Apply Take. When you convert the take to animation curves, the new data replaces any existing animation curves. Older data outside of the newly recorded time range still exists, but any old data within the recorded time range does not.

Using Maya: Animation

35

Cons tra ints & Motion Ca pture

To convert the take to animation curves:

Motion Capture Capturing motion When the take is converted to either preview form or animation curves, all device mappings, attachment mappings, filters, and resamplers are applied to the take data.

Changing the attachment and device mappings You can change the scale and offset values in a mapping without affecting the preview data or animation curves.

To change the attachment and device mappings on the take: 1

Change the values using the Mapping tab (as described in “Modifying existing attachments” on page 29).

2

Reapply the take by clicking Preview or Apply Take.

Saving files to disk You can write out a take as an ASCII file, then read the file back into the scene and review it later. Motion capture files use the .mov file format. This file format is called “move” in the file browser. It is not related to any movie file format. For information on the .mov file format, see the online document, Maya File Formats. Since a single scene may have dozens of motions, you probably do not want to save each move as a separate Maya file, especially after you have selected the final versions of the motion. It is much easier to save only the motion as a separate file.

To save a take to disk: 1

Under the Controls tab, click Take File. Maya will display a file browser.

2

If this is a new file, specify a path using the file browser and specify a new filename. The base filename appears in the box. From now on, if the Take box changes, the path stays the same; only the filename changes.

3

36

Once you’ve specified a valid filename, click Write Take to save the take to disk.

Using Maya: Animation

Motion Capture Capturing motion A take name is required for each device.

Note If you want to save a take every time you enter the review phase, select Write Take on Review under the Controls tab.

Freeing memory After applying the recorded data, the take data is still in a take buffer. For small takes this may not be a problem, but for large takes you may want to free this memory.

To free the take data for all devices: •

Under the Controls tab, click Clear. You cannot undo this action.

Numbering takes A particular motion may require three takes or more. Since it may be difficult to determine which take is best as you record and coming up with unique names for each version of the same move is error-prone, Maya features an easy way to number your takes. Take numbering inserts a number between the move name and its extension (by default, .mov). This number can be incremented to form a take number for that move. The take filename is constructed by inserting the value of the Number box before the extension of the name in the Take box. For example, if the Take box displays clock.mov and the Number box displays a value of 2, the file is saved as clock.002.mov.

Cons tra ints & Motion Ca pture

Using Maya: Animation

37

Motion Capture Capturing motion

To number your takes: 1

Under the Options tab, select Numbered Takes. Whenever the Take box changes, the Number box is reset to the value in Starting Take.

2

If you want to automatically increment the take number whenever a take is written, also select Auto-Increment.

3

When your motion data looks good and you want to convert it to animation curves, click the Apply Take under the Controls tab.

Viewing numbered takes (Example) Take numbering also makes it easier to view different versions. For example, if you have five versions of the clock.mov file that used take numbering, you could view them by completing the following steps:

38

1

Select clock.001.mov using the take browser (the Take File button).

2

Read the takes into the device by clicking Read Take under the Controls tab.

3

See the first take in Maya by clicking Preview or Apply Take.

4

See the second take by changing the value in the Number box to 2,then clicking Read Take and clicking Preview.

Using Maya: Animation

Motion Capture Using filters and resamplers

Using filters and resamplers You can use filters and resamplers to affect your motion capture data. Filters and resamplers let you achieve effects such as demangling Euler angles or resampling data to a specific frequency with a given kernel. You use the Filters tab to create filters and resamplers. Filters and resamplers are applied when you create a Preview, Apply Take, or Review. You cannot apply filters and resamplers while you monitor devices, only when you convert your data to animation curves using the Apply Take button or convert it to blendDevice nodes using the Preview button. A resampler may change the temporal values of the data; a filter will not. Filter settings

Use these buttons to change between active and inactive list.

Resampler settings

To create a filter or resampler:

1

Cons tra ints & Motion Ca pture

The same procedure applies to both filters and resamplers. Place the pointer in the Active or Inactive Filters (or Resamplers) list and click the right mouse button. Maya displays a list of available filters (or resamplers). 2

Select the filter (or resampler) name in the list to create it. The filter or resampler name appears in the Active or Inactive Filters list.

Using Maya: Animation

39

Motion Capture Reviewing takes 3

To view or change the attributes of a filter or resampler, double-click its name in the list. The Attribute Editor for the filter appears.

4

To move an item back and forth between the Active and Inactive lists, click its name in the list and use the << and >> buttons.

Reviewing takes It is not practical to connect a motion capture device to every machine on which you want to view captured motions. Instead, you use a virtual device. A virtual device behaves like a real device in review mode. You can make the same attachments to a virtual device as to a real device. You can read take data into a virtual device and apply it to the target attributes. Virtual devices cannot have buttons.

To define a virtual device based on a real device: 1

Select the real device in the Device Outliner. Under the Controls tab, click Save Virtual Device.

2

Select the path and specify a MEL script name. When you execute the MEL script, a virtual device is defined with the same name as the real device. If you have attachment scripts, they will work with the virtual device without any changes. You can use virtual devices to import numeric data into Maya. In many cases, you can use the movIn command. However, if you are using filters or resamplers, we recommend using a virtual device.For more information, see the documentation for the defineVirtualDevice command.

To read data into a virtual device: Reading data into a virtual device is the same as reading in data to a real device.

40

1

Under the Controls tab, click Take File.

2

Select the take using the browser that appears.

3

Click Read Take to load the take.

4

Click Preview or Apply Take to make the data visible in your animation.

Using Maya: Animation

Motion Capture Using multiple devices

To specify how Maya interprets incoming take data: Use the Options tab to set the units used in the take and time-stamping of the data. If a take has time-stamp data, turn on Time Stamps in the Read Take Options section. If you want to ignore time-stamp information, select Use Frequency in the Read Take Options section and type a value in the Frequency box, in Hertz. Since the .mov file format does not contain information about how data is to be interpreted, the order of data in the take file is important. The order of columns of data in the file must match the order of axes in the device. If you are creating a virtual device by hand, the order of definition is extremely important and must match your data. If time stamps were used with the write take, the first column of data is the time-stamp information. The take is applied with the starting time as the starting time of the recording, if time stamps were used. If you turn on Use Current Time As Apply Take Start Time under the Controls tab, Maya uses the current time as the start time for the take when you click Preview or Apply Take.

Using multiple devices You can record and work with many devices simultaneously. Use the Controls tab to set recording options for each device. To view a device’s current settings, select the device name in the Device Outliner, then select the Options tab. If you do not wish to record data for a device, turn off Enable Record in the Controls tab.



If you do not want to apply data to the target attributes of a device, turn off Enable Apply Take under the Controls tab.

To record multiple devices: 1

Under the Controls tab, turn on Write Take on Review.

2

Specify a take name for each device.

3

Under the Options tab, select Numbered Takes and Auto-Increment.

Using Maya: Animation

41

Cons tra ints & Motion Ca pture



Motion Capture Performing full-body motion capture With this method, each device automatically saves unique files for each take and you don’t have to manually change the take number and take names.

Performing full-body motion capture The most important task of any motion capture is to plan every step in advance. This is especially true for a large project.

To create a full-body motion capture: 1

Select a motion capture device.

2

Choose a method for calculating the motion. The method is device-dependent and may use inverse kinematics, forward kinematics, constraints, or a combination of the three.

3

Build a skeleton based on the actor’s proportions. If possible, digitize the actor’s joint positions with your motion capture device.

4

Attach the performance skeleton to the device.

5

Connect the performance skeleton to the character skeleton.

6

Rehearse the actions to be performed.

7

Record the motion.

8

Review the recorded motion and insert it into your scene.

Tips for full-body motion capture With full-body motion capture, carefully thought-out sensor placement and skeletal design are essential.

Using an optical system If you use an optical system, just bring the data into Maya. You will need to make a virtual device to read in the motion. See the documentation for the defineVirtualDevice command. We recommend using a single format for all of the motion you import into Maya. You can write a MEL script to define the virtual device that matches the data. With this method, you have to explicitly define the virtual device only once; other times you can run the script that calls the virtual device definition.

42

Using Maya: Animation

Motion Capture Performing full-body motion capture If no filtering is needed, try using the MEL movIn command. This does not require the construction of a virtual device. To use all of the take management functionality and filters, you must define a virtual device and make attachments to it. Since most optical systems let you solve for joint angles, you can use forward kinematics. For a skeleton constructed with the same orientation as the solved optical skeleton, just attach the device to the rotations of the joints.

Using a magnetic capture system For a magnetic capture system, connecting the sensor axes to handles of RP of MC IK solvers works well.

Tips for working with full-body motion capture data •

Work with a skeleton that has the same proportions as the actor. You can create a character based on the actor’s body. If you are using a magnetic system, you can place sensors on opposite sides of each of the actor’s joints. Record the sensor’s location at each placement. You can construct a skeleton that has joints located between opposing sensor positions. If magnetic noise is not a problem, this will produce an accurate copy of the actor’s skeleton.



If this is not possible or the character is dissimilar to the actor, create a skeleton based on the actor and solve for that skeleton. You can use constraints, expressions, and connections to map joint rotations and the root position from the actor skeleton to a character.



When you select a device using the Device Outliner, the Controls tab will show the take information for that device.



It is worth taking extra time to ensure that your data is as clean as possible. For option systems, this mean rigorous calibration of both the space and the actor. For magnetic systems, the freer the space of magnetic noise, the better the result. Cons tra ints & Motion Ca pture

Using Maya: Animation

43

Motion Capture Performing full-body motion capture

44

Using Maya: Animation

Index A absolute mapping 31 Active Filters list 39 Active Resamplers list 39 adding constraint objects 7 adjusting target weights 8 aim constraints 15 aim vectors 18 default values 18 Apply Take button 34, 35, 38 attachment for motion capture 22 attachment mappings 30 Attachment tab 29 attachments command 28 deleting 29 listing 26 making 27, 28 modifying 29 saving 31, 32 attachments script 31 Attachments tab 27 Attribute box 28 attributes attaching 27 Auto-Increment option 38, 41 axis 22 motion capture 22

buttons attaching 28 constraint reset 8 motion capture 22

capturing motion 33 changing device mapping 36 channel box setting target weight 8, 9 Clear button 37 clock server 26 clutch 22 commands attaching 28 attaching commands 28 constraint targets adding 7 removing 8 constraints aim 15 basic 5 basic procedure 7 IK handle 13 orientation 5, 14 point 11 pole vector 13 position 5, 11 reset button 8 scale 6, 19 surface 12 surface normal 16 tangent 17 Controls tab 32, 33, 35, 36, 37, 40 converting takes to curves 35 curves converting takes to 35 removing animation 8 tangent constraints 17

D

default values aim vectors 18 up vectors 18 world up vectos 19 device attachments saving 31, 32 device axis 22 Device Editor 23 device mappings 30, 36 Device Outliner 23, 26 devices attaching 29 listing 26 mapping 36 mappings 30 motion capture 22 multiple motion capture 41

E Enable Apply Take option 34, 41 Enable Monitor option 33 Enable Record button 41 Enable Record option 33 Euler angles 39 expressions driving multiple target weights 11

F filters motion capture 36, 39 Freeing memory motion capture 37 freeing memory motion capture 37 full-body motion capture 42

Index

B

C

data server devices 25

Using Maya: Animation

1

Index

H handler mappings 36

I IK handle constraints 13 Inactive Filters list 39 Inactive Resamplers list 39

M magnetic capture systems 43 mapping 30 absolute 31 changing 36 device 36 handler 36 relative 31 Mapping tab 36 matching orientations 14 mayaClockServer program 26 memory freeing 37 motion capturing 33 motion capture 21 basic procedure 21 device 22 file format 36 freeing memory 37 full-body procedure 42 magnetic systems 43 recording 33 rehearsing 33 saving files to disk 36 servers 22 stopping recording 34 terminology 22 .mov file format 36

2

Using Maya: Animation

multiple devices motion capture 41 multiple target weights using expressions 11 multiple targets adjusting weights 8 weighted average 7

N node 35 Node box 27 normal constraining 16 Numbered Takes option 37, 38, 41 numbering takes 37, 38

Preview button 35, 40 previewing takes 35

R Read Take button 40 Record button 33, 34 recording motion capture 33 multiple devices 41 stopping 34 Recording Duration box 33 Rehearse button 33 rehearsing motion capture 33 relative mapping 31 removing constraint objects 8 resamplers 36, 39 review phase 34

O Object option 28 objects definition 6 selection 6 offset values mapping 30, 36 optical systems 42 Options tab 41 orientation constraints 5, 14 matching another object 14 Outliner Device 23, 26

P point constraints 11 pole vector constraints 13 position constraints 5, 11

S Save Attachments button 32 Save Virtual Device button 40 saving device attachments 31, 32 saving motion capture files 36 scale constraints 6, 19 scale values mapping 30, 36 script attachments 31 device attachments 32 selecting constraint objects 6 selecting constraint targets 6 Selection option 28 servers clock 26 motion capture 22

Index

setting target weights 9 channel box 8, 9 skeletons proportions for 43 Starting Take box 38 stopping motion capture recording 34 surface constraining to a tangent 17 constraining to normal 16 constraints 12

T Take File button 40 takes converting to curves 35 definition 34 freeing data 37 numbering 37, 38 previewing 35 reviewing later 40 viewing 35 tangent constraining 17 target weights adjusting 8 setting 9 targets definition 6 selection 6 using multiple 7, 8 Terminology for motion capture 22 Time Stamps option 41

V view mode 31 Viewing takes in preview form 35 virtual devices 40, 43

W world space 31 world up objects 19 world up type aligning up vector 18 none 19 object 18 object rotation 18 scene 18 vector 18 world up vectors default values 19 Write Take button 34 Write Take on Review option 37, 41

Y Index

U

up vectors 18 controlling 17 default values 18 setting world up type 18 world 17 Use Current Time As Apply Take Start Time option 41 Use Frequency option 41

Y-axis orientation 17

up vector aim 17

Using Maya: Animation

3

Related Documents

Maya Constraints
November 2019 21
Constraints
November 2019 18
Constraints
May 2020 16
Maya
June 2020 32
Maya
October 2019 60
Maya
May 2020 40