Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Motion Capture
Constraints & Motion Capture
23 Basic Constraints 5
Understanding basic constraints 5
Objects and targets 6
Why use constraints? 6
Working with constraints 7
Creating or adding targets to a constraint 7
Removing constraint targets 8
Adjusting the target weights 8
Constraining an object’s position 11
Constraining an object to a point 11
Constraining an object to a surface 12
Constraining a pole vector of an IK handle 13
Constraining an object’s orientation 14
Matching an object’s orientation to another object 14
Constraining an object’s aim 15
Constraining an object to the normal of a surface 16
Constraining an object to a tangent 17
Controlling “up” 18
Constraining an object’s scale 19
Constraining an object’s scaling values 19
24 Motion Capture 21
Getting started with motion capture 21
Basic procedure for simple motion capture 21
Terminology 22
Using the Device Editor 23
Learning about motion capture 24
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
Position
• Point Constraint
Motion Ca pture
• Geometry Constraint
Cons tra ints &
Orientation
• Orient Constraint
• Aim Constraint
• Normal Constraint
• Tangent Constraint
Scale
• Scale Constraint
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.
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.
Tip
Motion Ca pture
Cons tra ints &
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.
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.
Note
When you remove a target, it also removes any animation curves attached
to the constraint for that target.
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.
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.
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.
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.
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.
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.
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.
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.
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:
• 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.
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.
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.
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
Terminology
Before using motion capture, you should become familiar with a few simple
terms.
Motion capture To capture motion, you use a motion capture device.
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.
Device Outliner
Device Editor
tabs
Device Outliner The top section is the Device Outliner. The Device Outliner lists the defined
Motion Ca pture
devices, the device structures, and what the devices are attached to. For
Cons tra ints &
Note
If you’ve already defined the clock device, un-define it and flush the undo
queue before running the demo script.
easiest way to remove the command from the undo queue is to use the
Cons tra ints &
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.
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
Attaching attributes to device axes
Attachment tab
for axis
Motion Ca pture
Cons tra ints &
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.
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 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.
Tip
Motion Ca pture
Cons tra ints &
If you accidentally delete an attachment, you can always undo the deletion.
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.
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.
Motion Ca pture
Cons tra ints &
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.
We recommend you add a few more seconds to the duration and start
recording before the actor begins a move.
3 Select Record.
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.
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.
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.
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.
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.
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.
Motion Ca pture
Cons tra ints &
Filter settings
Resampler settings
1 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.
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.
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.
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.
freeing memory
buttons
attaching 28
D motion capture 37
full-body motion capture 42
constraint reset 8 data server devices 25
motion capture 22
H multiple devices
motion capture 41
Preview button 35, 40
previewing takes 35
handler mappings 36 multiple target weights
using expressions 11
multiple targets R
I adjusting weights 8
Read Take button 40
weighted average 7
IK handle constraints 13 Record button 33, 34
Inactive Filters list 39 recording
Inactive Resamplers list 39 N motion capture 33
multiple devices 41
node 35 stopping 34
M Node box 27 Recording Duration box 33
normal Rehearse button 33
magnetic capture systems 43 constraining 16 rehearsing motion capture 33
mapping 30 Numbered Takes option 37, 38, relative mapping 31
absolute 31 41
removing constraint objects 8
changing 36 numbering takes 37, 38
device 36 resamplers 36, 39
handler 36 review phase 34
relative 31
Mapping tab 36
O
matching orientations 14 Object option 28 S
mayaClockServer program 26 objects
Save Attachments button 32
memory definition 6
Save Virtual Device button 40
freeing 37 selection 6
saving device attachments 31,
motion offset values
32
capturing 33 mapping 30, 36
saving motion capture files 36
motion capture 21 optical systems 42
scale
basic procedure 21 Options tab 41
constraints 6, 19
device 22 orientation
scale values
file format 36 constraints 5, 14
mapping 30, 36
freeing memory 37 matching another object 14
full-body procedure 42 script
Outliner
magnetic systems 43 attachments 31
Device 23, 26
recording 33 device attachments 32
rehearsing 33 selecting constraint objects 6
saving files to disk 36
servers 22
P selecting constraint targets 6
Selection option 28
stopping recording 34 point constraints 11 servers
terminology 22 pole vector constraints 13 clock 26
.mov file format 36 position constraints 5, 11 motion capture 22
Y-axis
orientation 17
U
up vector
aim 17