(Maya教程) Autodesk Maya Tutorials Collection (ENG) collect 影印版 (www xuexi111 com) PDF
(Maya教程) Autodesk Maya Tutorials Collection (ENG) collect 影印版 (www xuexi111 com) PDF
(Maya教程) Autodesk Maya Tutorials Collection (ENG) collect 影印版 (www xuexi111 com) PDF
This tutorial shows you how to set up a comic book type magazine for character
animation. This Setup is the one used to create the target poses used in the Blended
Comic Book tutorial.
In this tutorial:
Using the Wrap Deformer
Using Wire Deformers
Clustering Curve CVs as Animation Handles
Creating a Reset Pose Shelf Button
Strategies for Blend Shape Target Creation
A Taste of Maya
Comic Book Setup Questions? visit www.aliaswavefront.com/tasteofmaya
Note: Before you start: This tutorial requires Maya scene files. If you havent installed the tutorial files go to the
Try Maya section of the Taste of Maya CDROM to install.
Starting Maya: You can start Maya by double-clicking the Maya 2.5 Evaluation icon on the desktop or from
Start Programs Maya 2.5 Evaluation Maya.
In Maya: Once the tutorial files have been installed you will need to set the current project in order to access
the Maya scene files. To set the current project from within Maya select File Project Set... and
Navigate to the directory where you installed the Maya scene files. Select the directory: Maya_tutorial_data
and press OK.
Character Control
The animators job is to bring life to an object. When you animate you have clear ideas of how the object/
person/animal will move. To create this movement, your character must be manipulated into sequences of
poses.
Before you can animate your character, the character must be setup. This setup is much like creating a
puppet that will be able to perform movements based on input from the animator. Maya provides a
powerful suite of tools to do this type of work.
In this tutorial you will work with Mayas deformer tools to create a control mechanism for the comic book.
This setup will allow you to move the comic book into human-like poses.
2 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Comic Book Setup
Wrap Deformer
The wrap deformer lets you use any object as a deforming object. Other deformers in Maya such as the lattice
deformer work from a predefined shape such as a cube. The wrap deformer can be a NURBS or polygonal
surface in any shape you need. In this tutorial you will work with a NURBS plane as a wrap deformer. Think of
the wrap deformer as an object that will control the object/s it is connected to.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms A Taste of Maya 3
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Comic Book Setup Questions? visit www.aliaswavefront.com/tasteofmaya
When working with an object that is made up of more than one surface it is better to simplify this group of
objects down to a single surface or deformable shape.
One way to do this is to create a Wrap deformer object.
1 Open comicBookStart.ma
Select File Open Scene ...
Select comicsetupstart.ma
Press Open
This file contains three objects under the group node comicBookGroup: comicBookObject, wrapPlane
and wireCurves.
4 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Comic Book Setup
If the comic book frontCover texture does not appear on the magazine cover you will need to establish the path
to this source image.
In Hypershade/Visor double click the frontCover material from the Visors Materials folder.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms A Taste of Maya 5
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Comic Book Setup Questions? visit www.aliaswavefront.com/tasteofmaya
The Image Name attribute will need the absolute path to the comicBook.iff image located in the
sourceimages directory.
Click on the folder icon then navigate to the sourceimages directory.
Select comicBook.iff and press Open.
Tip: If you find that you have selected objects in the wrong order, simply press z to undo and reverse your
selection order and try it again.
The comicBook group is now being controlled by the wrapPlane shape. To move or deform the
comicBook objects you will move or deform the wrapPlane object. This single surface is a much simpler
object to manipulate.
Note: The pickmask is located on the status line and is also known as the selection mask. From this portion of the
status line you can select which objects or components of objects are selectable and/or which are masked
from selection. See the fundamentals tutorial for more information on this powerful feature of Maya.
LMB drag select a CV on the wrapPlane object.
Press w to display the transform manipulator
Translate the CV and confirm that the comicBook object follows along. Press z to undo.
You could begin building targets by tweaking these CVs into a pose then duplicating the comicBook
group to form a snapshot of this pose. But to make the process a little easier you are going to create a
more generalized method of tweaking using wire deformers and clusters.
Wire Deformer
Another Maya deformer is the Wire Deformer. This deformer turns a NURBS curve into a object that will
deform a surface much like a wire inside a piece of cloth.
6 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Comic Book Setup
1 Create wire deformers between the wireCurves and the wrapPlane using the Wire Tool.
Selection order is not used for envoking this function. You will select the objects as you are prompted by the
tool. This is the difference between Selection/Action and Tool methods of working in Maya.
Select Deform Wire Tool...
The bottom of the Maya window contains a line called the Help Line. You can toggle this section of the
UI under the Options menu. The Help Line provides tips and usages for tools and selection operations.
The Wire Tool will prompt you to select the object you want the curve to deform first.
Select the wrapPlane in the Outliner
Press Enter to validate the selection.
Note that the Help Line prompts you to then select the curves
Ctrl select the wire curves in the Outliner. These curves are located under the wireCurves group.
Press Enter to validate the selection
The curves will now deform the wrapPlane as you move them. To move the curves you will cluster the curve
CVs. The clusters will, in a sense, move the curve CVs positioning up into worldspace. This will make it easier
to control the curve CVs transformation and allow for keyframing of the curve CVs.
Once you have created your wire curves you can hide or template the wrapPlane. Templating the
wrapPlane will keep a wire version visible but not selectable. Hiding the wrapPlane will keep it out of
view and only selectable in the Outliner.
To see the objects and curves clearly, use wireframe mode by pressing the 4 key.
In the Outliner select the wrapPlane and press Display Object Components Templates this will turn
the wrapPlane object into a templated object, one that is visible but not selectable.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms A Taste of Maya 7
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Comic Book Setup Questions? visit www.aliaswavefront.com/tasteofmaya
Pattern of Cluster assignments to wire curve CVs, note center clusters are clustering 3 CVs each.
Tip: When you create the cluster the selection of the curve will be cleared. You will need to select the curve in the
Outliner again and press F8 twice to get back to component mode for CV selection. Use the g hotkey to
repeat the last command once you have selected the next CVs to be clustered. In this case the Deform
Create Cluster command will be repeated on the selected CVs.
Repeat this for the rest of the CVs on this curve using the above image as a guide. Use the g
hotkey to repeat last command, to speed up your workflow.
Repeat this for the other CVs on the mid and bottom curves in the following manner:
Edge CVs: The two edge CVs of each curve get a cluster
Center CVs: The center three CVs of each curve get a cluster
Mid curve CVs: The CV between the center and the edge gets a cluster. See the figure above
but also experiment with different configurations.
Note: The curves provided for making the wire deformers have been tweaked or shaped into the curved pattern
in order to better control the surface they are associated with. It is a subtle thing that provides a little more
control over the wrapPlane surface.
8 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Comic Book Setup
Pick Mask
In the Pick Mask select All Objects Off.
In the Pick Mask deformer button RMB pulldown select Clusters.
Now with only clusters as selectable objects you can quickly select the clusters and translate them to
form your poses. This prevents you from accidentally selecting other objects like the curves or comic
book surfaces.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms A Taste of Maya 9
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Comic Book Setup Questions? visit www.aliaswavefront.com/tasteofmaya
Channel Box of wrapPlane object showing Dropoff, Wrap Samples and wire attributes
Wrap
When you create a wrap deformer the object that is the wrap gets two attributes added to it. You can see
these attributes in the channel box when the wrapPlane is selected:
Dropoff: This attribute controls how the wrap influence diminishes over distance. Values between 4 and
8 seems to work fairly well but you can also see what happens at a value of 20.
10 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Comic Book Setup
Wrap Samples: This attribute controls how accurately the wrap is deforming the surface or surfaces. The
higher the value the more accurate the deformation will follow but also more slowly as this increases the
computational overhead. A value of 15 is fairly accurate without too much calculation. Higher sample values
can slow down performance.
Wire
When you create a wire deformer using one or many curves a deformer object is created called a wire.
Sometimes it may be hard to get at this node. You can usually find it as a related tab in the Attribute Editor
when you select one of the curves that you are using as a wire deformer. You can also see it as an Output node
in the Channel Box. This is the preferred method of accessing related nodes and attributes.
Dropoff Distance: Each curve in the wire deformer has an entry for dropoff distance. In this case you will see
3 attributes [0], [1], [2]. A value of 6 in each of these seems to work pretty good but again, experiment with
these settings.
Envelope: This attribute controls the amount of influence the wire will have on the surface. Typically this
value is kept at 1 but if you needed to exagerate the influence or decrease the influence you can adjust it here.
Rotation: This attribute controls the amount of rotation that the surface will get normal to the curve.
Experiment with this attribute, you may find that in certain poses it will help the surface follow the curves
bend without twisting too much. Valid values are from 0 to 1.
Note: You cannot use the Hotbox representation of the main menus in this manner to create a shelf button.
This will create a shelf button for this command on the currently displayed shelf.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms A Taste of Maya 11
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Comic Book Setup Questions? visit www.aliaswavefront.com/tasteofmaya
When it is highlighted MMB drag it to the Shelves editor above the Reset Transformation
command also known as makeIdentity. (You may have to press the enter key before the
makeIdentity command to make room for the select -r... command to go above.)
Here is what the two commands in the shelf button editor will look like:
select -r clustersGroup;
makeIdentity;
Now add a selection clear command. Under the makeIdentity line add:
select -cl;
Note that if you LMB drag select nothing in the perspecive view this is the command that is
echoed to the Script Editor.
You should now have three lines:
select -r clustersGroup;
makeIdentity;
select -cl;
Once you have the command looking right then press the enter key on the numeric keypad to
validate. Press Save All Shelves to save the shelves to the Maya preferences.
Test the operation by translating some clusters and then press this shelf button to make sure it is
working as intended.
You can build and edit shelf buttons in this manner to create handy macros for often repeated
commands and series of commands.
12 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Comic Book Setup
Select the comicBookObject group and press Ctrl d or select Edit Duplicate to make a copy of the
comicBookObject in its rest pose.
Rename this group as comicBookBase
Individual targets
The first strategy is to create individual movements that can be added together to form poses. For example you
could create a target that just has the arm move and another target that has the leg move. When you create a
blend shape using the default settings, a slider is created for each target. By combining these two targets you can
put the character into the needed pose. This technique allows for reuse of targets to create many different poses.
In-Between targets
With this strategy you create a series of poses that complete a motion. When you create the blend shape you
specify In-Between in the Create Blend Shape Option Box. This will create a single slider that transitions
through each target.
Individual
1. Create a pose and then duplicate the comicBookObject group and translate this copy to a place behind your
work area. Rename this group to something meaningful about the part of the object you are deforming,( ie.
headBending).
2. Reset the clusters back to their default position.
3. Pose the comic book again and duplicate the comicBookObject group again.
4. Repeat this process until you have several target posed groups that will lead into one another and not
overlap too much.
In-Between
1. Create a pose then duplicate the comicBookObject group, translate this copy to a place behind your work
area. Rename this group to a numbered pose to identify the sequence order.
2. Translate the clusters to the next pose in the sequence.
3. Duplicate the comicBookObject group, translate and rename this group to the next numbered sequence.
4. Repeat until the poses have been created to complete the performance.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms A Taste of Maya 13
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Comic Book Setup Questions? visit www.aliaswavefront.com/tasteofmaya
CONCLUSION
There are many ways to animate a character in Maya. Each of Mayas deformers has its strengths and
because you can layer these deformers you have several options for getting the shape to go where you
want it to go.
Create simple control handles that quickly let you put the character where you want it. If you find that you
need more control then add it in. But it is usually best to keep things simple at first.
Learn each deformers attributes and what they control. Work on very simple mockups first. Then apply
what you have learned to the full model.
14 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Blended Comic Book - Part 2
This tutorial shows you how to use Mayas blend shape deformer tools to animate a
comic book.
In this tutorial:
Creating individual and in-between blend shape animation
Keyframing blend shape animation
Deleting and Editing blend shapes
Strategies for creating blend shape targets
A Taste of Maya
Blended Comic Book Questions? visit www.aliaswavefront.com/tasteofmaya
Note: Before you start: This tutorial requires Maya scene files. If you havent installed the tutorial files go to the Try
Maya section of the Taste of Maya CDROM to install.
Starting Maya: You can start Maya by double-clicking the Maya 2.5 Evaluation icon on the desktop or from Start
Programs Maya 2.5 Evaluation Maya.
In Maya: Once the tutorial files have been installed you will need to set the current project in order to access the
Maya scene files. To set the current project from within Maya select File Project Set... and Navigate to the
directory where you installed the Maya scene files. Select the directory: Maya_tutorial_data and press OK.
Layers:
The duplicated posed targets of the comic book in these Maya scene files have been organized into layers.
These layers can be made visible by accessing the layer bar, Options Layer Bar. To toggle the visibility of
each layer press the RMB (Right Mouse Button) on the layer button, and select Visible.
Comic Book Cover Texture:
The source image for the comic book cover texture is located in the sourceimages directory. You may have to
re-establish the path to this texture in the Hyper Shade Editor. This process is shown below.
Blendshape Animation
Blend shape animation in Maya is the technique of deforming a base object by blending through a series of
target objects. These target objects are deformed into the poses that the base object will assume or morph
into. The blendshape is then keyframed at the desired pose at the desired time.
2 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Blended Comic Book
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 3
Blended Comic Book Questions? visit www.aliaswavefront.com/tasteofmaya
4 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Blended Comic Book
heartBeatPoses
otherPoses
Open the Outliner to view these object groups as well as lighting and camera objects.
These objects are actually groups of objects. In the Outliner you can LMB on the + sign to the left of the object
name to open the nested objects. These objects may be parents of other objects as well.
The comicBook object has been texture mapped. Press the 5 key for shaded display, 6 key for texture shaded
and the 7 key for textures with lighting in the perspective view.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 5
Blended Comic Book Questions? visit www.aliaswavefront.com/tasteofmaya
6 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Blended Comic Book
2 Create a blend shape between the serve targets and the comicBookBase objects.
Create a blend shape relationship between the bow targets and the comicBookBase objects. Selection order is
important.
In the Layer Bar RMB toggle Visibiltiy for the ServePoses layer to see these objects in the viewport.
If the Layer Bar is not visible select Options Layer Bar from the main menu.
In the Outliner open the servePoses group to see its contents. There are several groups each listed in
order servePose1, servePose2, etc.... These groups will be the targets for the blend shape.
Select these target groups in the Outliner by holding down the Ctrl key and LMB selecting each one or
Shift select the top group in the list then the bottom group in the list to select these groups/objects
quickly and in order.
With the Ctrl key pressed select the comicBookBase group to add this to the selected objects list last.
This order of selection is important. The targets first and the base object last. The order of target selection will
also determine the order of target slider or target position in the blend shape.
In the Main Menu select Animation as the menu set. (Left hand upper corner)
Select Deform Create Blend Shape option box. Confirm that Blend Shape is reset to the default
values by pressing Reset. The default settings will make Individual targeted sliders. But we want to
do an In-Between blend shape first. Later we will do an individual blend shape.
Select In-Between check box so that it is checked.
Press Create to create the blend shape.
Open the blend shape editor
Select Window Animation Editors Blend Shape ...
A blend shape slider should be created in this window. Adjust the slider through its range to see the
base object morph between the series of target poses.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 7
Blended Comic Book Questions? visit www.aliaswavefront.com/tasteofmaya
To change time LMB drag in the Time Slider time line. The current time field will reflect the current
frame.
Once a pose has been reached at the proper time, keyframe the slider by pressing the Key button in the blend
shape window.
Adjust the current time in the time slider. Key the poses for the desired time until you have a rough
animation sequence.
If you just want a linear progression through the pose set a keyframe at frame 1 with a slider value
of 0, change current time to frame 90 and set the slider to a value of 1 and press key.
You may have to adjust the Range Slider, expanding the playback range to 1 - 90 frames.
Press the play button to see the progression through the poses over time.
Note: To edit the blend shape you will use the same type of selection/action. For example to delete a blend shape slider
you would select the target that corresponds to the slider then the base object and then select Deform Edit
Blend Shape Add/Remove/Swap to edit the blend shape in the manner necessary.
In-Between targets
With this strategy you create a series of poses that complete a motion. When you create the blend shape you
specify In-Between in the Create Blend Shape Option Box. This will create a single slider that transitions
through each target. This is what you just did to make the comic book serve the ball.
Individual targets
This strategy involves creating individual movements that can be combined together to form poses. For
example you could create a target that just has the arm moved or posed and another target that has the leg
moved or posed. When you create a blend shape using the default or individual settings, a slider is created for
each target. By combining these two targets you can put the character into the needed poses. This technique
allows for reuse of targets to create many different poses by combining them. You need to be careful in
selecting how you transform between some poses. They may not be compatible without using some sort of
transition pose.
8 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Blended Comic Book
Blend Shape for Comic Book Bow below the serve Blend Shape.
The default settings for blend shape will create blend shape sliders for each individual target you have
selected. Each of these sliders will contribute to the shape of the base object.
If the comicBookBase object looks a little chunky texture-wise press 3 to increase the display smoothness.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 9
Blended Comic Book Questions? visit www.aliaswavefront.com/tasteofmaya
Tip: Another handy feature of the Blend Shape editor is the KeyAll button. This lets you apply a key on all the sliders at
once at the current frame.
You can work in a rough manner and clean up the animation in the graph editor. Note that some targets may
not flow smoothly into each other and also that some poses will add to each other and require mid-range
values to compensate.You may find that you cannot get to a pose without the need for some additional in-
between target poses.
The second tutorial that is related to this example explains how to setup the comic book as a character for
quickly creating these target poses.
10 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Blended Comic Book
Individual
1. Create a pose and then duplicate the comicBookObject group and translate this copy to a place behind your
work area. Rename this group to something meaningful about the part of the object you are deforming,( ie.
headBending).
2. Reset the clusters back to their default position.
3. Pose the comic book again and duplicate the comicBookObject group again.
4. Repeat this process until you have several target posed groups that will lead into one another and not
overlap too much.
In-Between
1. Create a pose then duplicate the comicBookObject group, translate this copy to a place behind your work
area. Rename this group to a numbered pose to identify the sequence order.
2. Translate the clusters to the next pose in the sequence.
3. Duplicate the comicBookObject group, translate and rename this group to the next numbered sequence.
4. Repeat until the poses have been created to complete the performance.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 11
Blended Comic Book Questions? visit www.aliaswavefront.com/tasteofmaya
CONCLUSION
The power of Mayas blend shapes comes from quickly creating morphing and blending between objects of like
or disimilar shapes. There are many ways to animate a character in Maya. Each of Mayas deformers has its
strengths and because you can layer these deformers you have several options for getting the shape to go where
you want it to go.
Blend shape animation can be broken down into two basic techniques:
1. Each portion of the shape is blended individually, this is a common technique for blending facial animation.
A blend for each facial muscle.
2. The entire shape is blended into complete poses, happy face, sad face, mouth phonems, and other
expression based shapes.
Learn How the Target Poses used in this tutorial were created:
The Comic Book Setup tutorial further illustrates Mayas powerful deformer tools. Layering deformers to create a
structure that is easy to control is the goal of this tutorial. The target poses used in the bow and serve blend shape
were created using the character setup you will learn in the Comic Book Setup tutorial.
12 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Expressions
Expressions
3 Introducing Expressions 11
About expressions 12
Where you create expressions 13
4 Quick Start 15
Preparing for the examples 15
Creating a simple expression 17
Controlling multiple attributes of an object 23
Controlling attributes in two objects 28
Controlling attributes conditionally 32
Notes on the predefined time variable 43
5 Expression Syntax 45
Expressions and MEL 46
Elements of an expression 47
Attributes 49
Static attributes 49
Dynamic attributes 49
Custom attributes 50
Attribute names 51
Data types of attributes 51
Assigning a value to an attribute 55
Variables 56
Data types of variables 57
Predefined variables 57
Custom variables 59
Constants 62
Arithmetic, logic, and relational operators 63
Arithmetic operators 63
Relational operators 65
Logical operators 67
Operator precedence 68
Conditional statements 69
if statements 69
if-else statements 70
else if statements 71
General syntax rules 73
Comments in expressions 75
Programming features 75
Notes for C programmers 75
Expression language keywords 76
Flow control statements 77
Flow control errors 88
String usage 90
Shortcut assignment operators 91
Shortcut increment and decrement operators 92
Arrays 93
Boolean symbolic constants 95
Common expression errors 95
Error message format 95
Common error messages 97
6 Editing Expressions 99
Finding expressions 99
Finding by expression name 100
Finding by selected object 101
9 Functions 203
Understanding functions 205
Function syntax 206
Data types 208
Understanding function examples in this chapter 208
Limit functions 209
abs 209
ceil 210
floor 210
clamp 211
min 212
max 212
sign 212
trunc 213
Exponential functions 214
exp 214
log 214
log10 214
pow 215
sqrt 215
Trigonometric functions 216
cos 216
cosd 218
sin 219
sind 224
tan 224
tand 225
acos 225
acosd 226
asin 226
asind 226
atan 227
atand 227
atan2 227
atan2d 228
hypot 228
Vector functions 229
angle 229
cross 230
dot 231
mag 231
rot 232
unit 233
Conversion functions 234
deg_to_rad 234
rad_to_deg 234
hsv_to_rgb 235
rgb_to_hsv 235
Array functions 236
clear 236
size 237
sort 237
Random number functions 239
gauss 239
noise 241
dnoise 242
rand 243
sphrand 244
seed 246
Curve functions 249
linstep 249
smoothstep 252
hermite 254
General commands 259
eval 259
print 261
system 263
Other functions and commands 264
Expressions are instructions you type to control an object attribute over time.
An attribute is a characteristic of an object, for instance, X scale, Y translate,
visibility, and so on.
Though you can create an expression to animate attributes for any purpose,
theyre ideal for attributes that change incrementally, randomly, or
rhythmically over time.
Expressions
Eric Saindon
Expressions are also useful for linking attributes between different objects
where a change in one attribute alters the behavior of the other. For instance,
you can make the rotation of a tire dependent on the forward or backward
movement of a car.
This chapter has the following topics:
About expressions on page 12
Where you create expressions on page 13
About expressions
Expressions offer an alternative to difficult keyframing tasks. In keyframing,
you set the values of attributes at selected keyframes in the animation, and
Maya interpolates the action between the keyframes. With expressions, you
write a formula, then Maya performs the action as the animation plays.
Expressions are often as simple as a few words or lines. In the following
example expressions, note the variation in length and detail (rather than
their purpose).
Example
Ball.translateX = Cube.translateX + 4;
Example
if (frame == 1)
Cone.scaleY = 1;
else
{
Cone.scaleY = (0.25 + sin(time)) * 3;
print(Cone.scaleY + "\n");
}
Though many expressions look like math or a programming language, you
dont need to be a mathematician or programmer to learn how to use them.
If youre fond of programming, expressions offer unlimited animation
techniques that would challenge the skill of keyframing experts.
You can use an expression to animate any keyable, unlocked object attribute
for any frame range. You can also use an expression to control per particle or
per object attributes. Per particle attributes control each particle of an object
individually. Per object attributes control all particles of an object
collectively.
You cannot apply an expression to an attribute already animated with any of
these techniques:
keys
set driven key
constraint
motion path
another expression
any other direct connection
If you do so, youll see an error message in the Script Editor and the
Command Lines response area.
Though you cant control a single attribute with two of the preceding
techniques, you can control one attribute with keyframes, another with an
expression, another with a constraint, and so on.
Also, you can use a single expression to assign values to several attributes of
one or more objects.
Expressions
You cannot start the Expression Editor from every attribute text field in the
Channel Box and Attribute Editor. Use WindowExpression Editor if
necessary.
The expression text field expands as you type text, so you can write
expressions of unlimited length. You can also edit expressions with a text
editor such as jot by selecting it from the Editor pull-down menu above the
text field.
The easiest way to learn about expressions is to work through examples. For
this reason, we provide the following introductory lessons. Expressions that
control particle attributes are more complex than for other objects. For
examples, see Chapter 8, Particle Expressions.
Expressions
In this chapter, youll learn about the following topics:
Creating a simple expression on page 17
Controlling multiple attributes of an object on page 23
Controlling attributes in two objects on page 28
Controlling attributes conditionally on page 32
Notes on the predefined time variable on page 43
5 Enter 0 for the starting frame of the Time Slider and the Range Slider, and
enter 300 for the ending frame of the Time Slider and Range Slider.
Important
For the lessons to work correctly, you must enter 0 for the starting frame of
the Time Slider and Range Slider. Press your keyboards Enter key after
each entry. Rewind the animation to frame 0. After doing the lessons, read
Notes on the predefined time variable on page 43 for details on why the
lessons require the starting frame to be 0.
Specifying a range of 300 frames gives ample time to see the effects youll
create in the examples.
6 In the General Preferences window, click Save and Close.
7 At the top edge of the workspace, select ShadingSmooth Shade All to
display all objects you create in the scene with smooth shading.
This will enhance the look of the objects you create in the examples.
8 From the menu bar, choose WindowExpression Editor to display the
Expression Editor.
9 Make sure these default Expression Editor menu options are selected:
Select FilterBy Object/Attribute Name
Object FilterSelected Objects
Attribute FilterAll
Finding expressions in Chapter 6 gives details on these options.
Expressions
3 Select DisplayNURBS SmoothnessFine to set Balls display smoothness
to fine resolution.
Maya displays the object with extra polygons to make it look smoother in
the workspace. This doesnt affect the underlying models geometry. It alters
only its display.
Ball.scaleY = time + 1;
Enter the expression with the same upper and lowercase spelling shown.
Entries in the expression field are type case sensitive.
The semicolon (;) signifies the end of the expression statement. Each
statement in an expression must end with a semicolon. The only exception is
when the expression has a single statement.
An error message appears in the Script Editor and Command Lines
response area if the expression has incorrect syntax or typing mistakes.
Edit text the same way you edit other text fields in Maya.
0 0
1 0.0417
2 0.0833
Expressions
3 0.125
24 1.0
240 10.0
If you ever need to change the playback rate, you can do so by choosing
OptionsGeneral Preferences. Expand the General Preferences window,
display the Units folder, and choose the desired rate from the Time menu.
Regardless of what animation playback rate you choose, you can find the
time elapsed in the animation at any frame with this formula:
frame
time = ---------------
rate
For example, if the frame rate is 24 frames/second and the animation is at
frame 1, the elapsed time is 1 divided by 24, or 0.0417. At frame 6, the
elapsed time is 6 divided by 24, which equals 0.25.
0 0 1
1 0.0417 1.0417
2 0.0833 1.0833
3 0.125 1.125
24 1.0 2.0
Maya executes the expression each frame. This causes the object size to scale
along its Y-axis, stretching its height during playback.
The scaling is smooth because the geometry stretches in synch with the small
time increments of the animation playback.
Expressions
remembering the name of the expression
remembering the name of the object and attribute you controlled with the
expression
examining each expression in the scene thats controlled by an expression
In this example, youll find the expression ScaleBallHeight by its name. See
Chapter 6, Editing Expressions for details on the other methods.
2 Choose Select FilterBy Expression Name.
3 Click ScaleBallHeight in the Expressions list.
The expression appears in the expression text field.
Ball.scaleY = time + 1;
Summary
In this lesson, you learned how to:
name an expression and type it in the expression text field
Expressions
To prepare the scene:
1 From the Modeling menu, choose PrimitivesCreate NURBSSphere.
This creates a NURBS sphere with an X scale, Y scale, and Z scale of 1.
2 In the Channel Box or elsewhere, name the sphere Planet.
3 Select DisplayNURBS SmoothnessFine to set the Planets display
smoothness to fine resolution.
4 Display the Expression Editor and select Select FilterBy Object/Attribute
Name.
5 Rewind the animation to frame 0.
This names the expression so you can find it more easily later.
3 Enter these statements in the expression text field:
The expression has three statements. Each statement sets an attribute to the
value of the predefined variable time.
4 Click Create to compile the expression.
An error message appears in the Script Editor and Command Lines
response area if the expression has incorrect syntax.
Planet disappears because clicking Create also executes the expression at the
current frame after compiling. At frame 0, time is 0, so the value of the
scaleX, scaleY, and scaleZ attributes becomes 0. Planet has no size, so it
disappears.
Expressions
Planet.scaleX = time;
Planet.scaleY = Planet.scaleX;
Planet.scaleZ = Planet.scaleX;
2 Click Edit to compile the expression.
3 Play the animation.
The expression works the same as the previous one. The first statement sets
Planet.scaleX to the value of time.
The second statement sets Planet.scaleY to the value of Planet.scaleX.
Because youve set Planet.scaleX to the value of time, Planet.scaleY also has
the value of time. Youre simply transferring one attributes value to another.
The third statement also sets Planet.scaleZ to the value of the attribute
Planet.scaleX.
The next three statements assign the contents of $increment to the three scale
attributes of Planet. The scale attributes therefore receive the value of time
divided by 5 each frame. This makes the object increase uniformly in scale
slowly as the animation plays.
2 Click Edit.
3 Play the animation.
The result is the same as with the previous expression
4 Stop and rewind the animation.
You can make a change to the variable assignment in the second statement
without altering the other statements.
Expressions
Because you assigned time * 2 to the variable $increment, the expression sets
all three attributes to the value of time * 2 as the animation plays. This makes
the three scale attributes increase at a rate twice as fast as would occur if you
assigned them the value of time alone.
4 Stop and rewind the animation.
This concludes the example. Before starting the next example, delete the
scene and create a new scene.
Summary
In this lesson, you learned how to:
link multiple attributes of the same object with a single expression
use a variable you defined in an expression
modify a single assignment to an attribute without changing other
statements
To see an objects local rotation axes, select the object, then choose
DisplayObject ComponentsLocal Rotation Axes.
Each object rotates around its local X-axis by the degree value resulting from Expressions
time * 10. After 1 second, for example, the rotateX attribute of each object is
one degree times 10, or 10 degrees. After 2 seconds, its 2 degrees times 10,
or 20 degrees.
Maya works in degree angle units, by default. You can change the angular
units to radians by choosing OptionsGeneral Preferences and displaying
the Units folder.
With the animation playing at 24 frames per second, each objects rotateX
attribute has these values:
0 0 0
1 0.0417 0.417
2 0.0833 0.833
3 0.125 1.25
24 1.0 10
The values in this chapter are rounded to four significant digits. The actual
values might have many more digits.
To see the degree value of Can.rotateX at different frames, select Can,
display the Channel Box, and stop the animation at selected frames. The
Channel Box updates its values after you stop the animation.
To see the degree value of Cone.rotateX at different frames, select Cone
instead of Can. The Channel Box displays values for the selected object.
2 Stop and rewind the animation.
You can edit the expression to make Can rotate slower than Cone.
Expressions
statements are in a single expression. You dont need to edit two
expressions.
Before starting the next example, delete the scene and create a new scene.
Summary
In this lesson, you learned how to:
control rotateX attributes in two objects using the same expression
increase the rotation of each object in synch with animation time
rotate one object at half the speed of the other object
Important
When you compare the value of time to a number in an expression, Maya
interprets time as seconds rather than milliseconds, minutes, or any other
unit of time. In the example, Maya interprets 2 as 2 seconds.
The expression checks whether the value of time is less than two seconds. If
so, it does the assignment Balloon.scaleY = time. If time is not less than two
seconds, the assignment doesnt occur.
Notice the indentation of Balloon.scaleY = time under if (time < 2). Maya
ignores all indentation, extra spaces, and blank lines between statements. We
used the indentation to make the expression easier to read. You could have
also written the expression as follows:
if (time < 2) Balloon.scaleY = time;
This isnt as easy to read. Consistent, organized spacing is a good habit to
develop. This book shows examples of good spacing style.
4 Click Create to compile the expression.
Balloon flattens.
Expressions
The expression executes when you click the Create button. Because the
animation is at frame 0, animation time is 0. Because time is less than 2,
Maya sets Balloon.scaleY equal to the value of time, which equals 0.
A scaleY value of 0 flattens the object in the Y dimension.
5 Play the animation.
The flattened Balloons scale increases along its Y-axis. It inflates as the
animation plays.
0 0 0
1 0.0417 0.0417
2 0.0833 0.0833
3 0.125 0.125
24 1.0 1.0
47 1.96 1.9583
48 2.0 1.9583
49 2.04 1.9583
The if statements condition, (time < 2), is a comparison. The condition must
be surrounded by parentheses to isolate it from assignment that follows it.
Expressions
Balloon inflates for 2 seconds. After 2 seconds, Balloon stops inflating and its
position skips from a Y-axis position of 0 to 2. Youll eliminate the motion
skip in a later step.
The second if statement increases the translateY position of Balloon after the
animation time rises above two seconds. The >= symbols mean greater than
or equal to. Whenever time is greater than or equal to 2, the expression
assigns Balloons translateY the value of time. The translateY value therefore
increases for the rest of your animations playback range.
Notice that a semicolon ends each statement. Forgetting a semicolon after
each statement causes a syntax error, and the changes youve made to the
expression wont take effect.
Important
Always examine the Script Editor for error messages after you edit an
expression and click the Create button. If you alter a previously successful
expression and a syntax error occurs, Maya executes the previous
successful expression when you play the animation. This might make you
believe your editing changes took effect.
Balloon doesnt return to the origin because the expression doesnt assign
Balloon a starting point for the beginning of the animation.
5 To make Balloon return to the origin, change the expression to this:
if (time == 0)
Balloon.translateY = 0;
if (time < 2)
Balloon.scaleY = time;
if (time >= 2)
Balloon.translateY = time;
The new first statement sets Balloon.translateY to 0 whenever time equals 0.
The == symbols mean is equal to. In conditional statements, be careful to type
== rather than =. The = symbol means assign the value to.
Note that you can put the three statements in any order in this example.
When Maya plays each frame, it executes each statement in the expression in
the order listed. In this example, the statements work independently, so their
order doesnt matter.
We put the statements in the order of time execution because its easier to
see the logic of the expression. If you ever need to change the expression,
youll be able to grasp the expressions actions more quickly.
6 Click Edit.
7 Stop and rewind the animation again.
The flattened Balloon returns to its correct position at the origin.
Expressions
As mentioned before, Balloon skips from Y-axis position 0 to 2 after two
seconds of animation play. You can eliminate the skipping and make
Balloon rise smoothly from the origin.
Balloon inflates for 2 seconds, then rises slowly with time from its position at
the origin.
When time is greater than or equal to 2, the translateY position of Balloon
becomes 2 minus 2, which is 0. As time increases beyond 2 seconds, the
translateY position increases in the same increments that time increases.
if (time < 2)
Balloon.scaleY = time;
else
Balloon.translateY = time - 2;
2 Click Edit.
3 Play the animation.
The else keyword sets Balloon.translateY to time - 2 when (time < 2) is false.
In English terms, the combination of the if and else statements says, If time
is less than two seconds, set Balloon.scaleY to the value of time. Otherwise
(when time is greater than or equal to two seconds), set Balloon.translateY to
time minus two.
Expressions
To make the expression easier to read:
1 Change the expression to this:
if (time < 2)
{
Balloon.translateY = 0;
Balloon.scaleY = time;
}
else
Balloon.translateY = time - 2;
We removed this statement from the previous version of the expression:
if (time == 0)
Balloon.translateY = 0;
In its place, we put the statement Balloon.scaleY = time in a segment
enclosed by the braces { and }. Maya evaluates both the statements between
the braces if the condition (time < 2) is true.
2 Click Edit.
Expressions
To further refine Balloons appearance:
1 Change the expression to this:
if (time < 2)
{
Balloon.translateY = 0;
Balloon.scaleY = time * 0.6;
Balloon.scaleX = time * 0.5;
Balloon.scaleZ = time * 0.5;
}
else
Balloon.translateY = time - 2;
2 Click Edit.
Balloon disappears from view because its scale attributes are 0.
The scaleX, scaleY, and scaleZ attributes are 0 at frame 0 because time is 0.
Any number multiplied by 0 is 0.
3 Play the animation.
Summary
Using an expression is a combination of logic and experimentation. Problem
solving starts with breaking a task into smaller problems you can solve and
later refine.
In this lesson, you learned how to:
control an attribute conditionally with an if statement
use good spacing and indentation for expressions
use relational operators such as <, <=, and ==
use multiple if statements to control different conditions
use an if-else statement in place of multiple if statements to make an
expression easier to read and comprehend
refine an expression with a combination of analysis and experimentation
Expressions
value of Balls scaleY attribute to time + 1, which equals 0.0417 + 1, or 1.0417.
Because Balls scaleY attribute was 1 when you created it, rewinding the
animation sets scaleY to a value 0.0417 larger than its initial value.
This discrepancy means the Ball scaleY is larger than its scaleX and scaleZ
attributes in the first frame of the animation. Though the difference is not
substantial in this example, other cases might be more significant.
To start your animation at frame 1 and get the same result as the example,
you can subtract 0.0417 from the attribute:
Ball.scaleY = (time - 0.0417) + 1;
When you rewind the animation, the expression sets Balls scaleY value to
(0.0417 - 0.0417) + 1. This equals 1, its original scaleY value.
When you use the predefined time variable, be aware of the starting frame
number and the associated time value.
After doing the lessons in this chapter, remember to change your Time
Sliders starting frame, ending frame, and frame rate to the desired values
when you start other projects. To do this, select OptionsGeneral
Preferences and display the appropriate tabs in the General Preferences
window.
Expressions
rotation.
Tristan Ikuta
This chapter describes the following topics:
Expressions and MEL on page 46
Elements of an expression on page 47
Attributes on page 49
Variables on page 56
Constants on page 62
Arithmetic, logic, and relational operators on page 63
Operator precedence on page 68
Conditional statements on page 69
General syntax rules on page 73
Comments in expressions on page 75
Elements of an expression
An expression is made of one or more statements. Statements follow the
rules of algebra, so theyll seem familiar if youve studied math. Each
statement has several elements as in the following example:
Statement
Variable
Expressions
=. In the example, Ball.rotateZ receives the value of the
statement sin(time) + 6. (Ignore what this assignment does;
its for illustration only.) You can also use = to assign a value
to a variable.
Function A special word that you provide with an entry called an
argument. In this example, the argument is time. Based on
the value of the argument, Maya does a calculation for the
function and returns a new value or takes some other action.
In the example, the function sin(time) returns the sine of the
value of time, which evaluates to a number between -1 and
1.
Maya has many convenient built-in functions and
commands that do math calculations, conversions, and so
on. See Chapter 9 for details.
Example
Heres an expression with the fewest elements possible:
Value assigned
Ball.scaleY = 5;
Attributes
An attribute is a characteristic of an object or other item in a scene. There are
many ways to set attributes in Mayawith the Attribute Editor, Channel
Box, menu selections, and of course, expressions. You can set attributes to
control virtually anything in your animation.
There are three types of attributes you work with in Maya:
static
dynamic
custom
Static and dynamic attributes have a predefined purpose. They are standard
attributes Maya provides for objects and items that make up a scene. Custom
attributes are attributes you define for an object.
Static attributes
Static attributes are attributes an object has by default. They exist the
moment you create the object and throughout its lifetime.
For example, the transform node of a NURBS sphere has static attributes
scaleX, scaleY, scaleZ, rotateX, and so on. You can set the values of these
attributes with the Attribute Editor, Channel Box, expressions, and other
Expressions
techniques after you create the object.
Dynamic attributes
Dynamic attributes have predefined names and purposes, but Maya adds
them to an object in response to your user interface selections.
For example, suppose you create a particle object and display its particle
shape folder in the Attribute Editor. If you click one of the following buttons
in the Add Dynamic Attributes section of the Attribute Editor, Maya adds a
dynamic attribute to the node:
Clicking the General button lets you add a custom attribute (see the next
topic). Clicking any of the other buttons lets you add one or more dynamic
attributes with names that are the same or similar to the button name.
An object has no dynamic attributes unless your actions cause Maya to add
them to the object. By adding only required attributes, Maya runs faster.
When you add a dynamic attribute to an object, the attribute appears in the
Attribute editor for the selected object or node.
Note
Because soft body geometry is a particle shape node coupled with
geometry, a soft body has the same static and dynamic attributes as a
particle object.
Custom attributes
Custom attributes are attributes you optionally add from the New folder of
the Add Attribute window.
Attribute names
Static, dynamic, and custom attributes follow the same naming conventions
and represent the same types of data.
A full attribute name has this format:
object.attribute
where object is the name of the object node, and attribute is the name of the
attribute. A period (.) separates the name of the object and attribute.
You must spell the object and attribute name with uppercase and lowercase
letters as they appear in the Expression Editors Objects and Attributes lists.
Expressions
You cannot spell attribute names with the common English spellings shown
in the Attribute Editor or by default in the Channel Box.
See Using attribute names in expressions in Chapter 6 for more details.
Example
Ball.scaleY
Note
Scientists often refer to a vector as a quantity that specifies both a
magnitude and direction. In Maya, a vector is simply a related group of
three floating point numbers that set an attribute or variable.
Vector array data types are useful for animating position, velocity,
acceleration, color, and other particle attributes made of three components.
Float array attributes are useful for setting lifespan, opacity, and other
particle attributes that have a single number value.
Attributes having a vector array or float array data type are also called per
particle attributes. See Chapter 8 for details on working with particle
attributes.
If you have programming experience, note that for vector array data types,
Maya represents the specified attribute for each particle of the object with a
single element of an array. Each element is made of three floating point
numbers. In a float array, Maya represents the specified attribute for each
particle with a vector array element thats a floating point number.
Note
In expressions, you must type a vector in double angle brackets (<< >>).
For example, type <<3,0,5>> for a vector having 3, 0, and 5 as its left,
middle, and right component.
Expressions
find the attribute name and examine its data format.
Floating point
Boolean
Integer
A floating point attribute shows a value that includes a decimal point. Most
numerical attributes in Maya are floating point.
A Boolean attribute has a checkbox or other user interface item for turning it
on or off.
An integer attribute has no decimal point. Integer attributes are rare in
Maya.
The data type of an attribute limits what type of value you can enter for the
attribute in the Attribute Editor and in expressions. For example, because a
directional lights Depth Map Filter Size attribute is an integer, you cannot
enter a decimal point in its text entry box or assign it a decimal quantity in
an expression.
For a floating point attribute, you can omit the decimal point. The Attribute
Editor automatically inserts a decimal point in the attributes text field after
you press the Enter key. For example, if you type 3 for a floating point entry,
the Attribute Editor replaces 3 with 3.0000.
Expressions
with ModifyAdd Attribute, you do not define their data type either.
You can assign a value to any attribute. If the attribute is dynamic or custom,
though, you must add the attribute to the object before you can assign it a
value in an expression.
Become familiar with the purpose of an attribute by working with it in the
Attribute Editor, Channel Box, or other parts of Maya before assigning it a
value in an expression. Its best to know the behavior you can expect from
the attribute in case you write your expression incorrectly.
Note
For rigid bodies, you can read but not write the velocity, angularVelocity,
and force attributes.
Examples
Cone.scaleY = 5.3;
This assigns 5.3 to the floating point scaleY attribute of Cone.
Ball.translateY = time;
This assigns the value of time to the floating point translateY attribute of
Ball.
Ball.scaleX = Ball.scaleY = Ball.scaleZ = 2;
This assigns 2 to the floating point scaleX, scaleY, and scaleZ attributes of
Ball. As the example shows, you can use an assignment operator several
times in a statement to set multiple attributes to the same value.
Variables
A variable is a symbolic name that stands for a constant or changing value.
There are two types of variables, predefined and custom.
Maya creates and maintains predefined variables. Custom variables are
variables you can create to store data in an expression.
Keep in mind that attributes, not variables, set object and component
behavior in Maya. You can use variables to as temporary storage for
working with the attributes.
The most common data type of variables is floating point. Integer data types
are rarely used. Booleans are commonly used in attributes, but not allowed
in variables. Vector variables are useful in expressions for particle shape
attributes.
Expressions
Animators with programming experience sometimes use string variables.
Quote marks (" ") are required with strings. See String usage on page 90
for details.
For a custom variable you create in an expression, you must declare the data
type as described in Custom variables on page 59.
Predefined variables
Maya maintains values in two predefined variables as an animation plays:
Your expressions can read, but not set, the value of time and frame. These
variables are floating point values that are useful for animating an attribute
as an animation plays.
The time updates as an animation plays. It contains the elapsed number of
seconds from the first frame to the current frame. The value increases with
the increasing frame number.
At the default animation playback rate of 24 frames per second, time has
these values, rounded to four decimal places:
0 0
1 0.0417
2 0.0833
3 0.125
24 1.0
240 10.0
frame
time = ---------------
rate
For example, if the frame rate is 24 frames/second, and the animation is at
frame 1, the elapsed time is 1 divided by 24, or 0.0417. At frame 6, the
elapsed time is 6 divided by 24, which equals 0.25.
If the frame rate is 30 frames/second and the animation is at frame 1, the
elapsed time is 1 divided by 30, which equals 0.0333. At frame 6, elapsed
time is 6 divided by 30, which equals 0.2.
Examples
Ball.translateY = time/2;
This sets the Balls Y translation equal to the value of time divided by 2 as
the animation plays. This make the Ball move in a Y direction as the
animation time increases.
Ball.scaleY = frame/2;
This sets the Balls Y scale equal to the value of frame divided by 2 as the
animation plays. The Ball scales along its Y axis as the animation frame
number increases.
Custom variables
Expressions
You can declare and use variables to store a constant or changing value.
These work like their counterparts in programming languages and
spreadsheet programs.
Though programming languages use such variables abundantly, you might
not need to use them at all in many expressions.
Declaring variables
Each custom variable name must begin with a dollar sign character ($). After
the $, you can use alphabetical, numerical, and underscore characters. You
cannot include spaces in the names.
Variable names are type case sensitive. In other words, $temp is a different
variable name than $Temp.
Examples
float $object_height;
This declares $object_height as a floating point variable.
int $counter;
This declares $counter as an integer.
vector $top_velocity;
This declares $top_position as a vector variable.
Examples
float $counter = 5.3;
This declares a floating point variable named $counter and gives it an initial
value of 5.3.
$height = 6;
This declares a floating point variable named $height and gives it an initial
value of 6. This example shows you can skip declaring the variables data
type. When you assign a variable a value, Maya assumes the variable is
floating point unless you specify a different data type.
$pi = 3.1415927;
$twist = $pi;
These statements show you can assign the value of one variable to another
variable. The first statement assigns 3.1415927 to $pi. The second statement
assigns the contents of $pi, 3.1415927, to $twist.
Important
If you misspell an existing declared variable name and assign it a value, a
syntax error wont be generated for the undeclared variable. Because Maya
automatically provides a data type for an undeclared variable if its on the
left side of the assignment operator, the misspelled variable will be
interpreted as a newly added variable. Undeclared variables on the right
side of the assignment operator do generate error messages.
Check spellings of variables if your expression isnt working as expected.
In the following example, the misspelling in the final statement generates
an error but not the misspelling in the statement before it:
int $start;
int $end;
int $interrupt;
$starrrt = 1;
$end = $interrupppt;
Expressions
assigning values to vector variables. Such variables are useful for working
with particle shape node attributes.
Example
global float $counter;
You can thereafter set or read the value of this variable in any other
expression in the scene.
If you create a variable with the same name in two expressions, the two
variables are separate and unrelated. For example, suppose you create a
variable named $timer in two expressions. Assigning a value to one of the
$timer variables has no effect on the others value.
If you declare and initialize a global variable in a single statement, you can
initialize it to a numerical constant or string only.
Examples
global float $counter = 3;
This initializes $counter to 3.
global float $counter = time;
This causes an error because time is a variable.
If you declare and initialize a global variable in a single statement, the
statement executes only when Maya compiles the expression. Maya compiles
an expression when you click the Create or Edit button in the Expression
Editor, or when you open a scene containing a previously created
expression.
Example
global float $counter = 3;
print($counter+"\n");
$counter = 1000;
print($counter+"\n");
When Maya compiles the expression, it sets $counter to 3, prints 3, sets
$counter to 1000, then prints 1000.
During playback, each execution of the expression skips the first statement,
so $counter never receives the value 3. The expression prints 1000, sets
$counter to 1000 again, and prints 1000 again.
Constants
A constant is an unchanging number or variable.
Examples
Ball.translateY = 6.1.
This statement sets Balls translateY attribute to the constant number 6.1.
float $pi = 3.1415927;
Ball.rotateY = $pi;
These statements set the value of Balls rotateY attribute to the value of the
variable $pi. The variable $pi represents the constant 3.1415927.
Arithmetic operators
Expressions
operator (%) calculates the remainder of division.
Examples
Car.translateX = time / 2.0;
This moves the Car in an X direction as the time increases in the animation.
By dividing time by 2.0, you move the object half as fast as if you used time
alone.
Car.translateX = 7 % 3;
This assigns Car.translateX the value 1, the remainder of 7 divided by 3. The
number 7 divided by 3 equals 2 with a remainder of 1.
Car.translateX = 8.8 % 4.2;
This assigns Car.translateX the value 0.4, the remainder of 8.8 divided by 4.2.
The number 8.8 divided by 4.2 equals 2 with a remainder of 0.4.
Car.translateX = 0.5 % 3;
This assigns Car.translateX the value 0.5, the remainder of 0.5 divided by 3.
The number 0.5 divided by 3 equals 0, with a remainder of 0.5.
Vectors
For operations between vector attributes and variables, the * operator
performs the dot product. The dot product multiplies corresponding
components of each vector, then adds the components to create a single
floating point number result.
For + and - operators, each component of one vector is operated on by its
counterpart component in the other vector.
For operations between a vector and an integer or floating point number,
each component of the vector is operated on by the integer or floating point
number.
Examples
Suppose youve initialized these vectors:
vector $A = <<1,2,3>>;
vector $B = <<2,3,4>>;
vector $C;
float $myfloat;
You then use the following statements (in different expressions, not in
sequential order):
$C = $A + $B;
This assigns $C the value << 3, 5, 7>>.
$C = $B - $A;
This assigns $C the value <<1, 1, 1>>.
$myfloat = $A * $B;
This assigns $myfloat the value (1*2) + (2*3) + (3*4), which equals 20.
Multiplying two vectors gives the dot product of the vectors.
$C = 3 * $A;
This assigns $C the value <<3, 6, 9>>. Each component of the vector is
multiplied by 3 to create a vector result.
Strings
For details on how to use the + operator with strings, see String usage on
page 90.
Note
Maya handles integer and Boolean attributes in an expression
mathematically as floating point numbers. After the expression executes,
Maya converts the floating point number to the proper data type.
If your expression does arithmetic on an integer or Boolean attribute and
you display the attributes contents in the Script Editor, youll see floating
point values. After the expression executes, Maya assigns an appropriate
integer or Boolean value to the attributes you set in the expression text
field.
Maya handles integer and Boolean variables within an expression
mathematically as integer and Boolean data types.
Relational operators
Youll often use relational operators to compare the value of variables and
attributes in conditional statements. See Conditional statements on page
69.
Expressions
Symbol Meaning Used with these data types
Examples
if (time > 10)
Sphere.translateX = 3;
When the animation time is greater than 10 seconds of play, the expression
sets the Spheres translateX attribute to 3. It stays fixed in this position
thereafter. See Conditional statements on page 69 for details on the if
condition in this and following examples.
if (Ball.scaleY == 3)
Cone.scaleY = 6;
If Balls scaleY attribute is equal to 3, Maya sets Cones scaleY attribute to 6.
Important
Be careful to type == rather than = for the equal to operator.
For example, suppose you type if (Ball.scaleY = 3) in the previous example.
Rather than test whether Ball.scaleY is equal to 3, the statement assigns 3 to
Ball.scaleY.
Maya evaluates the assignment statement Ball.scaleY = 3 as a true
condition, so it executes Cone.scaleY = 6. This statement doesnt cause an
error message, but it gives unintended results.
Vectors
If you use the == or != operators between two vector attributes or variables,
Maya compares the corresponding components of each vector. In contrast,
the >, >=, <, and <= operators compare the magnitude of two vectors.
Use this formula to calculate a vectors magnitude:
2 2 2
x +y +z
Examples
vector $A = <<1,2,3>>;
vector $B = <<1,2,3>>;
if ($A == $B)
Sphere.translateX = 3;
Example 2
if ((Ball.translateX < 5) || (Ball.translateY > 10))
Ball.scaleZ = time;
This sets Balls scaleZ attribute to the value of time in either of two
conditions: when Balls translateX attribute is less than 5 or greater than 10.
Operator precedence
The precedence of operators in expressions follows:
Highest () []
! ++ - -
* / % ^
+ -
< <= > >=
== !=
&&
||
Lowest = += -= *= /=
Examples
Ball.scaleY = 8 + 2 * 4;
This assigns Ball.scaleY the value 16.
Ball.scaleY = (8 + 2) * 4;
This assigns Ball.scaleY the value 40.
Ball.scaleY = 8 + 6 - 4;
This assigns Ball.scaleY the value 10. The + executes first because its further
to the left in the statement than the -.
Conditional statements
Conditional statements set one attribute or variable based on the condition
of another attribute or variable. For example, you might increase the scale of
a balloon after frame 48 plays.
The if and if-else statements are the most commonly used conditional
statements in expressions.
Youll often use relational and logical operators in conditional statements.
See page 65 and page 67 for details.
If you have programming experience, be aware you can use loop and flow
Expressions
control statements such as while and for. See Programming features on
page 75.
if statements
The if conditional statement has this format:
if ( condition )
statement;
If condition is true, statement executes.
Example
if (time > 3)
Ball.scaleY = 2;
This sets the scale of Balls scaleY attribute to 2 after the animation plays
three seconds.
if-else statements
The if-else conditional statement has the following format:
if ( condition )
statement1;
else
statement2;
If condition is true, statement1 executes. Otherwise statement2 executes.
If the animation time is less than 2 seconds, the expression sets Balloons
translateY attribute to 0, and sets its scaleY attribute to the value of time
multiplied by 0.6.
If animation time is greater than or equal to 2 seconds, the expression sets
Balloons translateY attribute to time minus 2, and sets its scaleY attribute to
1.
Important
You cannot set the same attribute in two different expressions. If you try to
do so, an error message results and your second expression has no effect.
else if statements
The else if statement works with the if-else conditional statement and has
this format:
if (condition1 )
statement1;
else if ( condition2 )
statement2;
If condition1 is true, statement1 executes and the else if statement after it is
skipped.
Expressions
If condition1 is false, the else if statement executes. If condition2 is true,
statement2 executes. If neither condition is true, neither statement executes.
You can add an else condition to the previous format as follows:
if (condition1 )
statement1;
else if ( condition2 )
statement2;
else
statement3;
If neither condition is true, statement3 executes.
Example
if (time < 3)
Ball.scaleY = 1;
else if ((time >= 3) && (time =< 6))
Ball.scaleY = 2;
else
Ball.scaleY = 3;
This sets Balls scaleY attribute to 1 if animation time is less than 3 seconds.
If animation time is between 3 and 6 seconds, scaleY is 2. Otherwise, when
time is greater than 6 seconds, scaleY is 3.
Note that you can add multiple else if statements and multiple statements
within braces ({ }) using this format:
if (condition1 )
{
statement;
statement;
}
else if ( condition2 )
{
statement;
statement;
}
else if ( condition3 )
{
statement;
statement;
}
else if ( condition4 )
{
statement;
statement;
}
else
{
statement;
statement;
}
Expressions
parentheses.
When you use { and } as opening and closing braces, make sure you use
them in matching pairs:
if (time > 3)
{
Ball.rotateZ = deg_to_rad(-6 * (floor(time));
Ball.rotateY = Ball.rotateZ * 3;
}
Enclose a vector in double angle brackets as in this example:
<<3,4,8>>
Spaces before and after the numbers and commas are optional.
Begin any variable you use with a dollar sign ($), and do not to use spaces or
special characters other than underscores in the name. Heres an acceptable
example:
float $my_Rotate;
$my_Rotate = 3.14;
Comments in expressions
Add comments to your expressions to explain the purpose of each statement
within. Youll appreciate this later if you need to modify the expression.
Maya ignores comments.
Programming features
The following topics describe programming features available in
expressions. Discussion is brief and assumes youre familiar with
programming. Most of the syntax features described work like their C
Expressions
counterparts.
Mayas integer data type has the same numerical range as ANSI Cs integer
data type, -2,147,483,648 to 2,147,483,648.
Mayas float data type has the same numerical range as ANSI Cs double
data type.
Other keywords
The return, proc, and matrix keywords are useful for writing MEL scripts,
not for expressions. Other keywords above are described throughout this
chapter.
Type keywords in lowercase letters exactly as shown. Do not name a custom
attribute with any of these keywords.
Important
Using a while, do, or for loop incorrectly might halt Maya. See Flow
control errors on page 88 for details.
while
A while loop has this format:
while ( condition )
{
statement;
statement;
...
}
Use condition to compare variable, attribute, or constant values. If condition is
Expressions
true, Maya executes each statement between braces. Maya then evaluates
condition again. If true, it executes each statement again. This cycle continues
until condition is false, whereupon execution resumes with the statement
after the loop.
Example
float $test = 0;
do
A do loop has this format:
do {
statement;
statement;
...
}
while (condition);
Here Maya executes each statement between braces, then evaluates condition.
The condition compares variable, attribute, or constant values. If condition is
true, each statement executes again. The loop terminates when condition is
false.
In contrast to a while loop, a do loop executes the statements in the loop at
least once. It tests the termination condition after the loop. A while loop tests
the termination condition before executing the statements in the loop.
Example
float $test = 0;
do {
print("$test equals: " +$test+"\n");
$test = $test + 1;
}
while ($test < 5);
for
A for loop has this format:
for (initialization; condition; change of condition)
{
statement;
statement;
...
}
A for loop evaluates the termination condition before executing each
statement. The condition compares variable, attribute, or constant values.
Example
float $i;
Expressions
{
print("$i equals: " +$i+"\n");
}
This expression displays the following lines in the Script Editor:
$i equals: 0
$i equals: 1
$i equals: 2
$i equals: 3
$i equals: 4
break
The break instruction exits a loop from any point within its body, bypassing
the normal termination at the loops beginning or end. Expression execution
resumes at the next statement after the loop. You can use a break instruction
with a while, do, or for loop.
Example
float $f = 0;
while( $f < 10 )
{
print("$f equals: "+$f+"\n");
if ( $f > 5 )
break;
$f = $f + 1;
}
This expression displays the following lines in the Script Editor:
$f equals: 0
$f equals: 1
$f equals: 2
$f equals: 3
$f equals: 4
$f equals: 5
$f equals: 6
Suppose the example didnt have this statement:
if ($f > 5)
break;
The loop would execute ten times and display the numbers 0 through 9.
The break statement terminates the loop after $f is greater than 5. So the
expression displays only numbers 0 through 6.
continue
The continue instruction works inside loops. It forces the next iteration of the
loop to occur, skipping any statements between itself and the loops test
condition. The condition compares variable, attribute, or constant values.
Example
float $f = 0;
Expressions
$f equals: 7
$f equals: 8
$f equals: 9
Suppose the example didnt have this statement:
if( $f > 5 )
continue;
The loop would display got here after each line of $f equals: n. Maya ignores
the continue instruction until $f increases to a value greater than 5.
When $f becomes 6 or greater, the continue instruction executes and skips
the remaining statement in the loop, so got here isnt printed.
for-in
The for-in loop is a specialized for loop that simplifies manipulation of all
elements of an array. A for-in loop with an array element variable lets you
omit the initialization, condition, and change of condition components of a for
loop.
Example
string $carType[3] = {"Porsche", "Ferrari", "Fiesta"};
string $car;
for ($car in $carType)
{
print("I want a new ");
print($car + ".\n");
}
The expression displays this in the Script Editor:
I want a new Porsche.
I want a new Ferrari.
I want a new Fiesta.
The loop executes three times, once for each array element in $carType.
The first loop execution copies array element $carType[0] into $car, then
prints, I want a new Porsche. Array element $carType[0] is Porsche.
The second loop execution copies $carType[1] into $car, then prints the
second line shown. The third execution copies $carType[2] into $car, then
prints the third line shown.
When the for-in statement finishes reading all array elements, the loop
terminates.
switch
A switch instruction executes one of several groups of statements based on a
control value. The control value can be a variable value or an attribute other
than an array (per particle) attribute. The format follows:
switch (control-value)
{
case value1:
statement;
statement;
...
break;
case value2:
statement;
statement;
...
break;
case value3:
statement;
statement;
...
break;
...
default:
statement;
Expressions
statement;
...
break;
}
The switch executes with a variable control-value. If the variable contents
match value1, value2, or another value in the switch, the statements under the
associated case statement execute. The control-value can be an int, float,
string, or vector.
Be careful if you use a float control-value. Because of the way floating point
arithmetic rounds numerals, a case value might fail to match a control-value
as you expect.
A break statement within a switch causes execution to skip subsequent case
statement groups within the switch instruction.
Expressions
Note that you can make more than one case statement execute the same
statements:
int $argo = rand(4);
switch ($argo)
{
case 0:
case 1:
print("Food\n"); // Runs if $argo is 0 or 1
case 2:
case 3:
print("Fight\n");// Runs if $argo is 2 or 3
break;
}
This works like the preceding expression, except that a match of 0 or 1
displays Food and Fight, and a match of 2 or 3 displays Fight.
Example
You can use the default keyword to make a block of statements execute when
none of the case values match the control value label. Generally, you put this
label after all the case statements, though you can put it anywhere in the
switch statement.
If the switch has no default label and none of the case values match the
control value, the switch does nothing.
vector $mgb = <<1,1,0>>;
switch ($mgb)
{
case <<0,1,1>>:
print("Who?\n");// Runs if $mgb is <<0,1,1>>
break;
case <<1,0,1>>:
print("What?\n");//Runs if $mgb is <<1,0,1>>
break;
default:
print("Why?\n"); // Executes if $mgb is not
break; // <<0,1,1>> or <<1,0,1>>
}
The expression executes the default case, which displays the following line
in the Script Editor:
Why?
?: operator
The ?: operator lets you write a shorthand if-else statement to set an attribute
or variable in one statement. Because of its cryptic appearance, many
programming style experts suggest not using it.
Heres its format:
attribute = condition? statement1: statement2;
The condition compares variable, attribute, or constant values. If condition is
true, Maya evaluates statement1 and assigns its value to attribute. (You can
also assign the statements value to a variable.)
Maya evaluates either statement1 or statement2, never both.
You can optionally enclose statement1 and statement2 in parentheses to make
the expression easier to read.
Example
Balloon.scaleY = (time < 2) ? time / 2: time * 2;
This statement sets Balloons scaleY attribute to time divided by 2 if time is
less than 2, and time multiplied by 2 if time is greater than or equal to 2. This
causes the scaleY attribute to increase slower for the first two seconds than
after two seconds.
This is the same as the following if-else statement:
if (time < 2)
Balloon.scaleY = time / 2;
else
Balloon.scaleY = time * 2;
Use this format because its easier to read.
Important
If you use an integer value as statement1 and a floating point value as
statement2, the ?: operator truncates the floating point value of statement2 to
an integer.
In the expression Balloon.scaleY = (time < 2) ? 0: time;, for example, 0 is an
integer, and time is a floating point value. When time is 2 seconds or more,
Maya sets Balloons scaleY attribute to the integer value of time.
Expressions
Because Maya sets scaleY to the integer value of time (without the decimal
part), scaleY jumps in one-second increments at time 2, 3, 4, and so on.
If you have problems using the ?: operator, use an if-else statement instead.
! operator
You can use the not logical operator (!) with integer, float, and vector data
types.
For vector values, ! is true only when the vector magnitude is 0. A vectors
magnitude is the value resulting from this equation:
2 2 2
x +y +z
Examples
if (!$count)
Ball.scaleY = 2;
The !$count condition is true only if $count is 0. If true, Ball.scaleY is set to 2.
vector $myvector = <<0,0,0>>;
if (!$myvector)
Ball.scaleY = 2;
Because the magnitude of $myvector is 0, the !$myvector condition is true
and Ball.scaleY is set to 2.
Example 1
Suppose you create an object named Balloon and decide to use a while loop
to increase its Y scaling after three seconds of animation play.
while (time > 3)
Balloon.scaleY = time;
Though you might think this expression sets Balloons scaleY attribute to the
increasing value of time after the animation time exceeds 3 seconds, it
actually halts Maya operation as soon as time exceeds 3. At that moment, the
while condition is true, so the while loop statement Balloon.scaleY = time
executes repeatedly and endlessly.
Even though a statement sets an attribute within an expression, Maya
updates the attribute only after the expression finishes executing. Because
the expression never finishes executing, Maya halts.
Unless you change Balloon.scaleY within the while loop to a value less than
or equal to 3, the statement executes infinitely.
To get the desired result without halting Maya, use this expression:
if (time > 3)
Balloon.scaleY = time;
Example 2
Suppose you create objects named Cone and Ball, then use a while statement
to link the Balls translateY attribute to the Cones translateY attribute:
while (Cone.translateY > 0)
Ball.translateY = Cone.translateY;
At first glance, the expression seems to set Balls translateY position to the
value of the Cones translateY position whenever Cones translateY is greater
than 0.
In fact, the expression halts Maya as soon as you translate the Cone to a Y
position greater than 0. At that moment, the while condition is true, so the
while loop statement Ball.translateY = Cone.translateY executes endlessly.
Nothing you do in the user interface can change the Cones translateY
position. It stays at translateY value of 0.
Unless you change Cone.translateY within the while loop to a value less
than or equal to 0, the statement executes infinitely.
To get the desired result without halting Maya, use this expression:
Expressions
if (Cone.translateY > 0)
Ball.translateY = Cone.translateY;
Example
float $x = cosd(90);
if ($x == 0)
print("This equals 0.\n");
else
print("This doesnt equal 0.\n");
String usage
A string is a sequence of alphabetical, numerical, and special characters. You
can display strings in the Script Editor, for example, to check the contents of
attributes or variables.
You can also create strings in the Expression Editor to execute MEL
commands in an expression. See Chapter 7 for details.
Guidelines for using strings follow:
Enclose a literal string with double quotes as in this example:
print("asteroid2");
This displays the following text:
asteroid2
You can use the + operator to concatenate strings as in this example:
print("Balls scaleY attribute equals: " + Ball.scaleY);
Expressions
vector $i = vector ("<<1,2,3>>");
You can execute a MEL command in an expression statement. See
Executing MEL commands in an expression in Chapter 7.
The following table shows the shorthand operators and the valid data types
for each. The shorthand operators work like their counterparts in C.
%= integer, float
Example
$counter += 1;
This adds 1 to $counter each time the statement executes.
Examples
float $eel = 32.3;
float $crab = $eel++; // $crab = 32.3; $eel = 33.3;
$crab = $eel--; // $crab = 33.3; $eel = 32.3;
$crab = --$eel; // $crab = 31.3; $eel = 31.3;
$crab = ++$eel; // $crab = 32.3; $eel = 32.3;
Important
To avoid unexpected results, do not use more than one shortcut increment
or decrement operator on the same variable in the same statement. The
evaluation order of the operators is unpredictable.
Arrays
You can create arrays of float, vector, integer, or string values. You can clear
an array using a clear function. You can find the size of an array with the
size function. See Array functions in Chapter 9 for details.
When you assign a value in an array, Maya reserves memory for all
elements less than that number. This means you can exceed the capacity of
your computer with a single array declaration. For example, do not use a
statement like this:
Expressions
$newarray[12312323123] = 1;
The second statement makes the array contain 1501 elements and assigns
element 1500 the value 3. The third statement expands the array to 2001
elements and assigns element 2000 the value 5.
The for loop stops executing after $i becomes equal to 10. Then the final
print statement displays the number of elements of the initialized array, 10.
The array increased in size as you assigned values to its elements.
Example
if (Monster.visibility == on)
Lance.scaleY = time / 3;
This causes Lances scaleY attribute to increase only if Monsters visibility
attribute is on. The on represents 1.
print(3 + on);
This displays 4 in the Script Editor. Again, on represents the value 1.
Expressions
syntax errors and logic errors. Syntax errors include mistakes in spelling,
incomplete attribute names, omitted semicolons, and other oversights that
prevent the expression from compiling and executing. For syntax errors,
Maya explains the error in a message to the Script Editor.
Logic errors are mistakes in your reasoning that cause unexpected animation
results. The syntax of your expression is valid, but errors in your logic
prevent Maya from doing what you intended. In the worst cases, Maya
might halt operation because your statements lock it into a permanent loop.
Because Maya cant detect logic errors, it cant display error messages. As
such, these errors are harder to find and require more analysis to solve. To
resolve logic errors, its often helpful to display the contents of relevant
attributes and variables. See Displaying attribute and variable contents in
Chapter 7.
Youll often need to scroll or increase the size of the Script Editor to see an
entire message.
When the Script Editor displays a syntax error, the response area of the
Command Line displays the same error with a red background.
Before clicking the Create or Edit button to create an expression, you might
want to select EditClear History in the Script Editor to remove previous
messages in the window. This makes it easier to see when a new error
message appears.
Expressions
set driven key
constraint
motion path
another expression
any other direct connection
More than one attribute name matches. Must use unique path
name: Ball.tx.
You used an object.attribute name that exists in two or more parent objects.
Two objects in a scene can have the same object name if they have different
parent objects.
For example, a scene might have a child of GroupA named Ball.tx and a
different child of GroupB named Ball.tx. If you write a statement such as
Ball.tx = time;, Maya wont know which Ball.tx to set.
To eliminate the error in this example, you must enter the full pathname of
the attribute as GroupA|Ball.tx. The pipe symbol (|) specifies that the object
to its left is the parent of the object on the right.
Cannot set 'time' or 'frame'
You can read the value of the predefined time and frame variables, but you
cannot set them.
Attributes must be of float, integer, or boolean types:
Ball.worldMatrix
You tried to set or read the value of an attribute that was a string or matrix
type. For instance, you might have tried to use an attribute named translate
rather than translateX, translateY, or translateZ attribute.
In the error message above, worldMatrix is an attribute that exists for
transforms, but you cant use it. Its for Mayas internal use.
Cannot divide by zero
You tried to divide by an attribute or variable that equals 0. This typically
happens in an expression statement that divides by an objects translateX,
translateY, or translateZ attribute when the Snap to grids button is on and
you drag the object to past the X-, Y- or Z-axis. When Snap to grids is on, the
translateX, translateY, or translateZ attribute becomes exactly equal to 0 at
the point where you drag the object across the axis.
To prevent this error, turn Snap to grids off. With snapping off, the attribute
is unlikely to become exactly 0 as you drag across the axis.
Note
If you compile an expression for a particle shape node and see the same
error message once for each particle in the object, its likely that some
attribute name, variable, or function is undefined or misspelled.
The Expression Editor offers convenient techniques for editing the text of
expressions. There are filters that help you search for expressions you
previously created, as well as techniques for entering and modifying the text
of an expression.
Expressions
Editing an expression in the text field on page 105
Editing an expression with a text editor on page 106
Creating a new expression on page 111
Deleting an expression on page 112
Using attribute names in expressions on page 112
Finding expressions
After youve created an expression, you might decide later to alter it to
create a different animation result. To edit an expression, you display it in
the Expression Editor. The following sections describe how to find and
display an expression for editing.
List of expressions
Note
For a particle shape node, you can create a creation expression, a runtime
expression, or both. Both expressions are listed under a single namethe
name of the particle shape node. You cant name or rename such
expressions.
To find such expressions, look for the particle shape nodes name in the
Expressions list.
Click the appropriate Runtime or Creation checkbox to display the desired
expression.
Object name
Objects attributes
4 For an object other than a particle shape node, click the name of the attribute
Expressions
controlled by the expression.
If youve forgotten the name of the attribute controlled by the expression,
choose Attribute FilterConnected to Expressions. The Attributes list
displays only the attributes controlled by expressions for the selected object.
Click each attribute in the Attributes list until you see the desired expression
in the expression text field.
You cant write a different expression for each attribute of a particle shape as
you can for other types of objects. Because you can write only one creation
expression and one runtime expression per particle shape, you dont need to
select an attribute from the Expression Editors Attributes list. See
Understanding particle expressions on page 148 for details on particle
expressions.
Note
The Attributes list shows only unlocked, keyable attributes. You can
choose whether an attribute is keyable or locked with ViewObject
EditorsChannel Control.
To write an expression for any nonkeyable attribute not shown in the list,
enter object.attribute name in the Selected Obj & Attr text box.
Example
Suppose youve written an expression that controls the rotateZ attribute of a
spotlight transform node named Searchlight. Do this to find the expression:
1 Choose Select FilterBy Object/Attribute name.
2 Select Object FilterTransforms.
Note that you dont select Object FilterLights in this example. The rotateZ
attribute is an attribute of a lights transform node, not of the light object
itself.
3 Choose Attribute FilterConnected to Expressions.
4 Select the object Searchlight from the Objects list.
Expressions list
Expressions
Using the Objects and Attributes list
The objects listed in the Objects list depend on which entry youve selected
from the Object Filter menu. If you select Object FilterLights, for
instance, all lights in the scene appear in the list.
The appropriate attributes of the object selected in the Objects list appear in
the Attributes list. For example, if spotLightShape1 is selected in the Objects
list, the attributes of spotLightShape1 appear in the list.
When searching for an expression to edit, you can click an object and
attribute from this list to find and display an expression that affects the
chosen attribute. You can edit the displayed expression in the expression text
field.
For a particle shape node, you dont need to select an attribute from the
Attributes list. You can create only one creation expression and one runtime
expression per particle shape node. The same expression appears for each
attribute.
When you create a new expression, you can click an object from this list to
choose the default object to which the expression applies.
When you select the default object in the Expression Editor, you can skip
omit the object name and period thats part of a full attribute name (see
Omitting an object name in expressions on page 115.)
Important
If you close the Expression Editor window without successfully compiling
an expression with the Create or Edit button, Maya discards any editing
changes youve made to the expression.
Expressions
Deleting and copying text
To delete text:
1 Drag the mouse to select the text.
2 Press your keyboards Backspace key to delete it.
Important
To erase an expression and make sure its previous contents no longer
control an attribute, click the Edit button after clicking the Clear button.
There is no file on disk you can edit independently of the Expression Editor.
When you use the text editor through the Expression Editor, youre working
with a temporary file thats linked to the expression stored in the scene. You
can, however, read an independent text file containing expression text into
the temporary file.
If you save an expression without specifying a filename, Maya reads the
saved expression and stores it with the scene. Youll see it dimmed in the
expression text field while youre working with the text editor.
When you close the text editor, the expression text field entry no longer is
dim. The text expression field becomes active after you close the text editor.
If you quit the text editor without saving the expression, Maya does nothing.
Because the expression hasnt changed, Mayas copy of the expression
doesnt need to change either.
Tip
You can use a text editor to save an expression to a filename in the
directory of your choice. This gives you a way to archive an expression you
want to use in a different scene.
Expressions
By default, you can start one of these editors from the Editor menu in the
Expressions Editor:
jot
vi
vim
xemacs
To run a different editor, see Using an editor not listed in the Editor menu
on page 109.
The editors title bar shows a filename thats temporarily created while you
work on the expression. When you write or save the file, its contents are
copied to the Maya scene containing the expression.
The expression text field is inactive while the text editor is open. You can
optionally close the Expression Editor window.
If you single-click the name of an object, attribute, or expression, the text
editor doesnt appear. You can single-click to browse the contents in the
expression text field without opening a text editor.
If you double-click an attribute thats already been assigned a value in an
expression, the expression that controls that attribute appears in the text
editor. For nonparticle expressions, you can assign to any attribute in the
scene, not just to the double-clicked attribute. In fact, you dont even need to
work with the double-clicked attribute at all.
If you double-click an attribute that has not yet been assigned a value, the
text editor appears with no contents. If you double-click that attribute again,
a new instance of the editor appears. After you assign a value to an attribute
in an expression, you can start the editor only once for the attribute.
3 Create or edit the expression with the editor.
4 Save the file.
5 Confirm that the Expression Editor detected no syntax errors.
6 Quit the editor.
Note
If youve created a UNIX command alias for jot, vi, vim, or xemacs, the
Expression Editor tries to launch this command. If the arguments provided
in the command alias are unusable by the Expression Editor, the editor
might operate unexpectedly or fail to launch.
Avoid using an alias to customize your editors operation settings. Do the
steps in Changing an editors operation settings on page 110.
Expressions
make the WINEDITOR setting display the editor in a shell.
2 Log out and log into your user account.
3 Restart Maya.
4 Choose Other from the Editor pull-down menu.
5 Double-click an object name, expression name, or attribute name from the
Selection list.
The editor appears.
6 Create or edit the expression with the editor.
7 Save the file.
8 Confirm that the Expression Editor detected no syntax errors.
9 Quit the editor.
Important
If youve specified a text editor through OptionsUI Preferences or with
the Expression Editors Editor menu, starting the Expression Editor from
the Channel Box or Attribute Editor displays the text editor instead of the
Expression Editor.
Expressions
Note the text editor appears when you click the New Expression button.
When you create the expression, the Expression Editor associates the object
name with the expression. This means you can narrow your search for the
expression using the objects name in addition to the expression name.
You do not need to select an attribute in the Attributes list. You can associate
the expression with an object only.
For a particle shape node, you dont need to select an attribute, as you can
create only one creation expression and one runtime expression per particle
shape. For nonparticle shape objects, you can create one expression per
attribute.
Deleting an expression
If you want to stop an expression from controlling attributes, you can delete
the expression.
To delete an expression:
1 Display it in the Expression Editor.
2 Click the Delete button.
Example
In place of this:
Ball.translateY = time;
you can type this:
Ball.ty = time;
Each attribute has at least one acceptable abbreviation. Here are some
commonly used attribute name abbreviations for several types of object
transform nodes:
translateX tx
translateY ty
translateZ tz
Expressions
rotateX rx
rotateY ry
rotateZ rz
scaleX sx
scaleY sy
scaleZ sz
visibility v
Common English equivalents for the long attribute names appear in the
Channel Box by default. These names are different than the names you must
use in the expression text field.
If you use the long attribute name, use the name that appears in the
Attributes list of the Expression Editor. Do not use the common English
language equivalents displayed in the Channel Box.
3 From the Channels menu at the top of the Channel Box, select
Channel NamesShort.
The abbreviated attribute names replace the common English attribute
names in the Channel Box.
Note
After you click Create or Edit to compile an expression, Maya converts all
attribute abbreviations in the expression to the full attribute name.
Example
Suppose youve selected Ball as the Default Object.
In place of this:
Ball.translateY = time;
you can type this:
Expressions
translateY = time;
Maya interprets translateY as belonging to Ball, the object listed in the
Default Object text box of the Expression Editor.
Example
Suppose youve selected Ball as the Default Object.
In place of this:
Ball.translateY = time;
you can type this:
ty = time;
Maya interprets ty as being the translateY attribute of Ball, the object listed
in the Default Object text box of the Expression Editor.
Attributes of other objects must be spelled out with the full object and
attribute name.
Expressions
goal and springs. As its points move
below the floor, an expression
assigns them a goal weight of 0.
The cube appears to melt as it
passes through the floor.
Rob Tesdahl
Example
Suppose youve given a NURBS sphere named Planet a circular, orbiting
motion in the XY plane with this expression:
Planet.tx = sin(time);
Planet.ty = cos(time);
Expressions
Planet orbits the origin at a radius of 1 unit.
In the following steps, youll create a custom attribute named distance to
increase the radius of Planets orbit over time.
Note
The small balls in the preceding figure show the circular path of Planet.
Theyre in the figure only to help you visualize the motion. They arent
part of the animation or expression.
3 In the Add Attribute window, enter distance in the Attribute Name text box.
4 Make sure Make attribute keyable is on.
5 Set Data Type to Float, and Attribute Type to Scalar.
6 Set Minimum to 1, Maximum to 10, and Default to 4.
Minimum and Maximum set the lowest and highest values you can enter
for the attribute in the Attribute Editor or Channel Box.
Default sets the default value displayed for the attribute.
An expression isnt bound by the Minimum and Maximum values. The
attribute receives whatever value you assign it in the expression.
The expression can read the Default value or any other value you set in the
Attribute Editor or Channel Box.
7 Click Add to add the attribute, then close the Add Attribute window.
The distance attribute appears in the Attributes list of the Expression Editor
for Planet. You can now set or read the value of the attribute in any
expression.
8 Edit the expression to this:
Planet.tx = distance * sin(time);
Planet.ty = distance * cos(time);
Multiplying the sin(time) and the cos(time) by the distance attribute makes
Planet circle the origin at a distance specified by the value of the distance
attribute. See Chapter 9 for details on the sin and cos functions.
Expressions
Because you gave the distance attribute a default value of 4 when you added
it to Planet, playing the animation makes Planet circle the origin at a distance
of 4 grid units from the origin.
You can make the expression control the distance attribute over time.
9 Edit the expression to this:
distance = time;
Planet.tx = distance * sin(time);
Planet.ty = distance * cos(time);
By setting distance to the value of time, Planets orbiting distance increases
as playback time increases. Planet moves in a steady outward spiral as the
animation plays.
Tip
If an expression controls an attribute and you want to control it with
keyframes instead, delete all statements that assign values to the attribute,
then click the Edit button. Use the Channel Box to reset the attributes
value to an initial value, then set keyframes as desired.
If keyframes control an attribute and you want to control it with an
expression instead, click the attributes text box in the Channel Box, then
choose ChannelsDelete Selected. Assign values to the attribute name in
an expression as desired.
Reproducing randomness
If you execute the rand, sphrand, and gauss functions repeatedly in an
expression, Maya returns a sequence of random numbers. (See Random
number functions on page 239 for details on these functions.) Each time you
rewind and play your animation, the sequence of random numbers is
different. Often, youll want to generate a sequence of random numbers that
repeats each time your animation plays.
For instance, suppose you use the rand function to assign a random radius
to each particle in a stream of emitted particles rendered as Spheres. By
default, Maya gives the particles a different sequence of random radius
values each time your animation plays.
Expressions
To create the same radius values each time the animation plays, you can use
the seed function in an expression before the rand, sphrand, or gauss
functions execute. Theres no need to execute the seed function more than
once per animation unless you need to generate several different repeating
sequences of random numbers as your animation plays.
Important
When you set a seed value in an expression or MEL script, the seed value
affects the rand, sphrand, and gauss functions in other expressions and
MEL scripts. Such functions are affected by this seed value in all scenes
you open subsequently in the current work session.
This seed value is unrelated to the Seed option available through
SettingsDynamics Controller in the Dynamics menus. The seed function
therefore doesnt affect randomness created with dynamics.
Example
Suppose you use the rand function to position several marbles at random
translateX positions in your scene at frame 1:
if (frame == 1)
{
marble1.tx = rand(-10,10);
marble2.tx = rand(-10,10);
marble3.tx = rand(-10,10);
marble4.tx = rand(-10,10);
}
The rand(-10,10) returns a random number between -10 and 10 each time it
executes. When you rewind the animation to frame 1, Maya might assign
these values to the translateX attributes of the marbles:
Attribute Value
marble1.tx 2.922
marble2.tx 5.963
marble3.tx -4.819
marble4.tx 7.186
The next time you rewind the animation to frame 1, each marbles translateX
attribute receives a different random value. Maya might assign these values:
Attribute Value
marble1.tx -3.972
marble2.tx 9.108
marble3.tx -7.244
marble4.tx -3.065
You might prefer the marbles translateX values to stay the same when you
rewind, for instance, so you can composite the marbles correctly among a
Expressions
foggy backdrop.
You can use the seed function to keep the sequence of random values
returned by the rand function consistent when you rewind the animation.
if (frame == 1)
{
seed(10);
marble1.tx = rand(-10,10);
marble2.tx = rand(-10,10);
marble3.tx = rand(-10,10);
marble4.tx = rand(-10,10);
}
By setting the seed value to an arbitrary number, for instance, 10, the
subsequent executions of the rand function return a repeating sequence of
random numbers.
When you rewind the animation the first time, Maya might assign these
values to the translateX attributes of the marbles:
Attribute Value
marble1.tx 8.020
marble2.tx -2.973
marble3.tx -7.709
marble4.tx 0.741
Each time you rewind the animation thereafter, Maya assigns these same
values to the translateX attributes of the marbles. The marbles dont move.
Each time a statement sets the seed value to 10, the subsequent executions of
the rand function return numbers from the sequence starting at the
beginning number. In other words, resetting the seed value to 10 restarts the
random number generation process to the first value in the sequence.
Suppose you alter the expression to this:
if (frame == 1)
{
seed(10);
}
marble1.tx = rand(-10,10);
marble2.tx = rand(-10,10);
marble3.tx = rand(-10,10);
marble4.tx = rand(-10,10);
When you rewind the animation to frame 1, the expression sets the seed to
10. Maya assigns values to the marbles translateX attributes as in the
previous expression.
Because the expression doesnt set the seed value in frames other than frame
1, playing the animation causes the rand function to return a new, yet
repeating, sequence of random numbers each frame. If you play the
animation several times, the translateX values will constantly change during
animation, but the sequence of values will be identical each time you play
the animation.
You can assign the seed a different value to generate a different sequence of
returned values. See seed on page 246 for details.
Expressions
Example
Suppose youve selected degrees from the Angular menu in the Units
folder. You then write this expression for an object named Ball:
Ball.rotateZ = 10;
Maya reads the 10 as being 10 degrees, then converts the value to the
appropriate number of radians to make the assignment to Balls rotateZ
attribute. The conversion happens automatically. From your standpoint,
Maya is simply rotating Ball 10 degrees.
In nonparticle expressions, these automatic conversions affect Maya
performance. Because the expression executes slower, Maya slows when you
play, rewind, or otherwise change the animation time. Saving, opening, and
other file operations on the scene containing the expression are also slower.
To boost Maya performance, you can turn off conversion to internal units. If
you do so, you must convert units in expression statements.
Example
Suppose, in the Units folder, youve set Linear units to millimeters and
Angular units to degrees. You then write the following expression:
Ball.translateX = 5;
Ball.rotateZ = 10;
All causes Maya to read 5 as millimeters and 10 as degrees.
None causes Maya to read 5 as centimeters and 10 as radians.
Angular causes Maya to read 5 as centimeters and 10 as degrees.
Examples
Suppose, in the Units folder, youve set Linear units to millimeters and
Angular units to degrees.
In the Expression Editor you set the Convert Units option to None and enter
this expression:
Ball.translateX = 5;
Ball.rotateZ = 10;
None causes Maya to read 5 as centimeters and 10 as radians, which is not
the result youre seeking.
To assign 5 millimeters to Balls translateX attribute, you must convert 5 to
the appropriate number of centimeters. To assign 10 degrees to Balls rotateZ
attribute, you must convert 10 to the appropriate number of radians.
The following statements do this:
Ball.translateX = 5.0 / 10.0;
Ball.rotateZ = 10.0 / 57.3;
There are 10 millimeters per centimeter. In other words, a millimeter is a
centimeter divided by 10. So 5 millimeters equals 5 centimeters divided by
10. You therefore use the operation 5.0 / 10.0.
Important
Expressions
When you divide floating point attributes or variables, enter the floating
point value 5.0 for an even number such as 5. This ensures that the division
works as expected. For more details, see the note in Using mixed data
types with arithmetic operators on page 145.
There are 57.3 degrees per radian. In other words, a degree is a radian
divided by 57.3. So 10 degrees equals 10 radians divided by 57.3. You
therefore use the value 10.0 / 57.3.
If you need a more precise conversion to radians, divide a degree by
57.29578 instead of 57.3. You can instead use the deg_to_rad function as
follows:
Ball.rotateZ = deg_to_rad(10.0);
The deg_to_rad function converts 10.0 degrees to a precise radian
equivalent. See deg_to_rad on page 234 for details.
Turning off unit conversion affects only expressions. It doesnt affect other
Maya commands, options, or displays. For instance, the preceding example
expression assigns centimeters to translateX and radians to rotateZ. The
Channel Box still displays values for these attributes in millimeters and
degrees. It displays values in whatever units you choose in the Units folder
of the General Preferences window.
Note that you cant turn off unit conversion for particle shape node
expressions. Maya handles unit conversion differently for such expressions
with little impact on performance.
Example
global float $BallHeight = 5;
print($BallHeight+"\n");
nurbsSphere1.tx = rand(1);
print(nurbsSphere1.tx+"\n");
The first statement declares and assigns a value to the variable $BallHeight,
which is not an attribute. The next statement prints the $BallHeight but
assigns no value to an attribute.
The next statement assigns an attribute a value, but the value is generated by
the random number function rand. This function doesnt read an attribute
value. For details on the rand function, see rand on page 243.
The last statement reads and prints the value of an attribute, but doesnt
assign a value to an attribute.
None of these actions causes the expression to execute when Always
Evaluate is off.
Always Evaluate affects only the expression youre creating or editing. You
can turn it on for one expression and off for another.
Expressions
For most animations, expressions execute regardless of whether Always
Evaluate is on. If in doubt, leave it on.
The attribute doesnt return to the value it had before the expression set it.
To return the attribute to its original value, use the Channel Box or Attribute
Editor to set the attribute.
Disconnecting an attribute
If you disconnect an attribute from an expression, the expression no longer
reads or set its value. You might want to disconnect an attribute, for
example, so you can keyframe the attribute rather than control it with an
expression.
These actions disconnect an attribute from an expression:
Delete from the scene an object with an attribute that exists in the
expression.
Use the WindowGeneral EditorsConnection Editor to disconnect the
attribute from the expression.
Use the MEL disconnectAttr command.
Use the MEL choice command.
Tip
The MEL choice command lets you control an attribute alternately with two
or more techniques in different frames. For example, you can keyframe an
attribute for frames 1-48, control it with an expression for frames 48-96, and
control it with a motion path for subsequent frames.
Example
Suppose your scene has two objects, Ball and Cone, and youve written this
expression:
Ball.translateX = Cone.translateX;
Ball.translateY = Cone.translateY;
Ball.translateZ = Cone.translateZ;
Expressions
Ball.translateZ the value 0.
Note that if you disconnect an attribute from an expression but the attribute
still exists in the scene, the attribute keeps its value from the last time the
expression executed and set its value.
Example
Suppose youve written these statements among others:
Ball.translateX = Cone.translateX;
Ball.translateY = Cone.translateY;
Ball.translateZ = Cone.translateZ;
If you delete Ball from the scene, Ball.translateX, Ball.translateY, and
Ball.translateZ attributes no longer exist. The expression can no longer
assign Cones translateX, translateY, and translateZ values to the
corresponding Ball attributes.
Note
If an expression assigns values to the attributes of only one object, deleting
the object deletes the expression also. If your expression assigns values to
attributes of several object attributes, deleting all those objects deletes the
expression.
To avoid deleting the expression in the preceding example, you would
need have some statement that sets an attribute of an object other than the
deleted Ball. For example, you might include this statement:
Cone.visibility = 1;
Example 1
Suppose you have these statements among others in an expression named
HorseController:
WhiteHorse.translateX = Car.translateX;
BlackHorse.translateX = Car.translateX;
BrownHorse.translateX = Car.translateX;
Deleting the Car and reloading the expression shows this:
WhiteHorse.translateX = .I[0];
BlackHorse.translateX = .I[0];
Expressions
BrownHorse.translateX = .I[0];
.I[0] is the symbolic placeholder for what was the Car.translateX attribute.
You can connect a different attribute to this placeholder to assign its contents
to the translateX attributes of WhiteHorse, BlackHorse, and BrownHorse.
Suppose you want to control these attributes with the translateX attribute of
an object named Cow. You can enter the following MEL command at the
Command Line:
connectAttr Cow.tx HorseController.input[0]
This command connects the attribute Cow.tx to the expressions input[0].
The expression is named HorseController. The input[0] is abbreviated as .I[0]
in the expression. You can see the spelled-out input name input[0] in the
GraphUp and Downstream Connections display of the Hypergraph.
Reloading the expression shows the new attribute connection:
WhiteHorse.translateX = Cow.translateX;
BlackHorse.translateX = Cow.translateX;
BrownHorse.translateX = Cow.translateX;
Example 2
You can also reconnect an expressions output with the connectAttr
command. Suppose you have these statements among others in an
expression named HorseController:
WhiteHorse.translateX = Car.translateX;
BlackHorse.translateX = Car.translateX;
BrownHorse.translateX = Car.translateX;
Deleting the BrownHorse object and reloading the expression displays this:
WhiteHorse.translateX = Car.translateX;
BlackHorse.translateX = Car.translateX;
.O[2] = Car.translateX;
.O[2] is the symbolic placeholder for what was the BrownHorse.translateX
attribute. It received the placeholder .O[2] because its the third output from
the expression. (The first and second outputs from the expression are .O[0]
and .O[1] .) You can connect a different object attribute to this placeholder to
control it with the value in Car.translateX, as shown in the third statement.
Suppose you want to control the attribute of a new object named
RedHorse.translateX with the Car.translateX value. You can enter the
following MEL command in the Command Line:
connectAttr HorseController.output[2] RedHorse.tx
This command connects the HorseController expressions output[2] to the
attribute RedHorse.tx. The output[2] is abbreviated .O[2] in the expression.
Reloading the expression shows the new attribute connection:
WhiteHorse.translateX = Cow.translateX;
BlackHorse.translateX = Cow.translateX;
RedHorse.translateX = Cow.translateX;
Renaming an object
If you rename an object whose attributes were used in an expression, the
Expression Editor continues to read or set the attributes. Maya doesnt
disconnect the attribute from the expression. The Expression Editor converts
to the new name of the object the next time you click the Reload button in
the Expression Editor.
Note
When you reload an expression, the Expression Editor converts any short
attribute names to their long attribute name equivalents. For example, if
you originally type the attribute name Ball.ty, reloading the expression
renames it as Ball.translateY.
Expressions
You can execute MEL commands in an expression with several techniques:
MEL command alone in a statement
MEL command within left-hand single quote marks
MEL command used as an argument to an eval function
MEL procedure call to a procedure in a MEL script
The following topics explain the techniques. See Using MEL for details on
MEL.
Example
select -cl;
This example shows the use of a MEL command alone. The statement
executes exactly as it would in the Script Editor, except no command output
appears in the Script Editor.
Example
string $a[];
$a = ls -lights;
print($a);
The first statement defines an array named $a. The second statement
executes the MEL command within quotes, then assigns the commands
output to array $a. The third statement displays the contents of $a to the
Script Editor as follows:
ambientLightShape1
directionalLightShape1
Example
string $mycommand = "sphere";
eval($mycommand+" -r 5");
The first statement assigns the string sphere to the variable $mycommand.
The second statement appends -r 5 to sphere and executes the complete
command sphere -r 5. This creates a sphere with a radius of 5 grid units.
See eval on page 259 for more details.
Example
Suppose, in your Maya scripts directory, youve created a MEL script file
named randspot.mel with the following contents:
global proc string randspot()
{
Expressions
string $mycommand;
if (rand(2) < 1)
$mycommand = "particle -p "+ sphrand(10);
else
$mycommand = "sphere -p "+ sphrand(10);
return $mycommand;
}
Further suppose youve created this expression:
string $randcommand = randspot();
eval($randcommand);
When you rewind or play a frame in the animation, the expression executes.
The first expression statement executes the randspot procedure in the
randspot.mel script file. In the randspot procedure, the rand(2) part of the if-
else statement generates a random floating point value between 0 and 2,
then compares its value to 1. For details on the rand function, see rand on
page 243.
If the rand(2) function returns a value less than 1, the if statement assigns a
MEL command string such as particle -p -1.356 5.983 8.458 to $mycommand.
The + sphrand(10) part of the statement appends to sphere -p the three floating
point components of a randomly generated vector.
Though sphrand(10) returns a vector, Maya converts the vector to a string
upon assigning it to the string $mycommand. For details on the sphrand
function, see sphrand on page 244.
The converted string contains no double angle brackets or commas, but does
contain a space character between the floating point components. A space
between the floating point components is required syntax for the MEL
particle command as used above.
If the rand(2) function returns a value greater than 1, $mycommand receives
a MEL command string such as sphere -p 4.926 -2.589 1.274.
The procedure finishes executing and passes the value of $mycommand
back to the expressions calling procedure randspot( ). This assigns the
command string to the variable $randcommand.
The eval function executes the command string in $randcommand. For
example, if the statement executes particle -p -1.356 5.983 8.458, it creates a
particle with coordinates <<1.356, 5.983, 8.458>>.
The expression executes each frame and creates a new particle or sphere at a
random location within a spherical radius of 10 units from the origin.
For example, a scene might have a child of GroupA named Ball.tx and a
different child of GroupB named Ball.tx. If you write this statement:
Ball.tx = time;
Maya generates an error because it doesnt know which Ball.tx to set.
To eliminate the error, you must enter the pathname of the attribute as in
this example:
GroupA|Ball.tx = time;
The | symbol between GroupA and Ball.tx indicates that the object to the left
of the symbol is the parent of the object to its right. Use no spaces before or
after the | symbol.
Important
Always examine the Script Editor for error messages after you edit an
expression and click the Create button. If you alter a previously successful
Expressions
expression and a syntax error occurs, Maya executes the previous
successful expression when you play the animation. This might lead you to
believe your editing changes took effect.
Example
Ball.tx = $distance;
$distance = time;
Assume for this example youve set the starting frame of the animation to
frame 0.
The first statement sets Ball.tx to the variable $distance. The second
statement sets $distance to the value of time.
When you play the animation, Ball moves along the X-axis with the increase
in time. Balls X-axis position is 4 grid units, for example, when animation
time equals 4 seconds.
When you rewind the animation, Balls position along the X-axis doesnt
return to 0 as you might assume. The previous execution of the expression at
time equals 4 set the $distance variable to 4. So rewinding sets Ball.tx to 4,
then sets the value of $distance to 0, the value of time upon rewinding.
If you rewind again, Balls position along the X-axis returns to 0 as desired.
Because the previous execution of the expression upon rewinding set the
$distance to 0, the expression now correctly sets Ball.tx to 0.
To fix this problem, reverse the order of the statements and compile the
expression:
$distance = time;
Ball.tx = $distance;
After you play and rewind the expression, the first statement executes and
assigns the time to $distance. The next statement assigns Ball.tx the value of
$distance, which the first statement set to the value of time. Because
$distance is set to 0 as the first statement after rewinding, Ball returns to the
desired translateX position.
Increment operations
If you increment an attribute or variable during animation, you might be
confused by its behavior.
Example
Ball.ty = 0;
Ball.ty = Ball.ty + 1;
Balls translateY position stays at 1 unit along the Y-axis. Balls translateY
position doesnt increase by 1 each frame as the animation plays.
Example
Ball.ty = Ball.ty + 1;
Balls translateY position increases by 1 each frame as you play the
animation. When you rewind the animation, translateY increases by 1 again.
When you play the animation again, the translateY position increases by 1
each frame. If you rewind the animation or drag the current time indicator,
the translateY position continues to move up the Y-axis. The attribute never
returns to its original position.
To return Ball to a starting position each time you rewind, you must
initialize the attribute to a starting value. For example, you could use the
following expression:
Ball.ty = Ball.ty + 1;
if (frame == 1)
Ball.translateY = 0;
This returns Ball to a Y position of 0 when you rewind to frame 1. When you
drag the current time indicator, though, Ball doesnt return to its Y position
of 0.
The if statement resets the value of translateY to 0 only when frame 1 plays.
Frame 1 is the default frame that plays when you rewind an animation. You
would need to use a different frame number in the if statement if youve set
your animation to start at a different frame.
Expressions
type as necessary and doesnt report a syntax error.
The following topics describe the conversions that occur in such instances.
Understanding these details might help you troubleshoot unexpected
attribute and variable values.
Unless you have programming experience, dont intentionally convert data
types. You might be confused by unexpected attribute and variable values.
2 2 2
x +y +z
Example
Ball.scaleY = <<1,2,0>>;
Maya assigns the floating point scaleY attribute the converted vector:
2 2 2
1 +2 +0 = 5 = 2.236
Example
Ball.scaleY = 1;
Maya assigns the value 1 to Ball.scaleY.
Example
int $pi = 3.14;
Maya assigns the integer variable $pi the value 3.
int $temp = <<1,2,0>>;
Maya assigns the integer variable $temp this vector value:
2 2 2
1 +2 +0 = 5 = 2.236 2
It deletes the decimal component .2360607. The $temp variable receives the
truncated value 2.
Example
vector $speed = 1.34;
Because $speed is a vector, Maya assigns it <<1.34,1.34,1.34>>.
Example
Expressions
Suppose you multiply a vector variable named $velocity by a floating point
number 0.5 as follows:
$race = $velocity * 0.5;
If $velocity is <<2,3,0>> when the preceding expression executes, the $race
variable is assigned the resulting vector value <<1,1.5,0>>.
Important
When Maya does arithmetic operations on literal constants and variables
without a declared data type, it guesses the data type based on the values
present.
In the statement Ball.scaleY = 1/3;, for example, Maya treats 1 and 3 as
integers because they have no decimal points. The expression divides
integer 1 by integer 3. The integer result is 0 with a remainder of 1. Maya
discards the remainder.
Because Ball.scaleY is a floating point attribute, Maya converts the integer 0
result to floating point 0 (which is the same value), then assigns it to
Ball.scaleY.
To get the intended result of 1/3, you must type Ball.scaleY = 1.0/3.0;
Maya treats 1.0 and 3.0 as floating point numbers because they have
decimal points. The number 1.0 divided by 3.0 results in 0.33333333333.
Particle expressions are more complex than other types of expressions. For
example, you can write an expression to control all particles in an object the
same way, or you can control each particle differently.
Execution of expressions differs for particles than for other types of objects.
To become proficient with particle expressions takes more study than for
other expressions, but the resulting effects are worth the effort. This chapter
guides you through the intricacies of working with particle expressions.
Expressions
The particles are displayed as
Spheres render type.
Claude Macri
This chapter has the following topics:
Understanding particle expressions on page 148
Understanding creation expression execution on page 149
Writing creation expressions on page 150
Understanding runtime expression execution on page 152
Writing runtime expressions on page 153
Working with particle attributes on page 159
Assigning to vectors and vector arrays on page 193
List of particle shape attributes on page 196
These buttons let you write two types of expressions: creation and runtime.
You can use both types for any attribute of a particle shape node.
Though the details of execution are subtle, a creation expression generally
executes when you rewind an animation or when a particle is emitted. A
runtime expression typically executes for each frame other than the rewind
frame or the frame in which a particle is emitted. By default, either type of
expression executes once for each particle in the object.
Creation and runtime expressions dont execute at the same time. The age of
each particle in the object determines whether a runtime expression or
creation expression executes. Execution details are in Understanding
creation expression execution on page 149 and Understanding runtime
expression execution on page 152.
The Default Object, Always Evaluate, and Convert Units options become
dim when you select a particle shape node, and you cant use them.
Default Object is dim because a particle shape nodes attributes can be
controlled by only one creation expression and one runtime expression. The
particle shape node is always the default object when its the selected object.
Always Evaluate is dim for particle shape node expressions because it has
no effect on particle shape node expressions. See How often an expression
executes in Chapter 7 for details on the checkbox.
Convert Units is not selectable because you cant alter how Maya handles
unit conversions for particle shape node expressions. See Speeding
expression execution on page 127 for details on how Maya converts units
for other types of expressions.
Important
You cant write a different expression for each particle shape attribute as
you can for other types of objects. Because you can write only one creation
expression per particle shape, you dont need to select an attribute from the
Expression Editors Attributes list.
Expressions
You might also notice that all expressions in your scene are compiled and
executed each time you open the scene. This occurs for architectural reasons
and is unimportant to your work with expressions.
Particles created with the Particle Tool have an age of 0 on and before the
Start Frame. With the default animation frame range and Start Frame,
rewinding an animation to frame 1 returns such particles to age 0.
If you set the Time Sliders start frame higher than the dynamics Start
Frame, be aware that rewinding the animation might cause the age of
particles to be greater than 0. If this occurs, the creation rule for the particles
wont execute.
Tip
You can set options in the Attribute Editor to display the age of an objects
particles in the workspace. Set the particle shapes Render Type to
Numeric, click Add Attributes For Current Render Type, and enter age in
the Attribute Name box. The age appears next to each particle.
You can also examine the age of an objects particles by entering
print(age+\n) in a particle expression. See print on page 261.
A creation expression is also useful for initializing an attributes value for the
first frame before a runtime expression takes control of the attribute value in
subsequent frames. See Writing runtime expressions on page 153 for an
example of the interaction between a runtime and creation expression.
Example
Suppose youve used the Particle Tool to place a collection of particles in the
workspace. You then create the following creation expression to control their
velocity:
particleShape1.velocity = <<0,1,0>>;
Expressions
All the particles move in a Y-axis direction at one grid unit per second as the
animation plays.
Important
To use an expression to control particle attributes, make sure the selected
object in the Expression Editor is a particle shape node, not the transform
node of the particle object.
If a particle objects transform node is selected rather than the particle
shape node, move the mouse pointer to the workspace and press your
keyboards down arrow. This selects the particle shape node.
Important
There are no creation expressions for nodes other than particle shape
nodes. Such objects have only one type of expression. (Its similar to a
runtime expression.)
For a particle shape node, you can write only one runtime expression for
all its attributes. You dont need to select an attribute from the Attributes
list. You can create only one runtime expression per particle shape.
Example
Suppose youve created a grid of particles, then create this runtime
expression for its velocity attribute:
particleShape1.velocity = <<0,1,0>>;
The expression moves the grid of particles up at 1 grid unit per second as the
animation plays.
Expressions
Note
To make the illustrations of particles easier to see in this and other
chapters, we show them as small, shaded spheres rather than points.
With the default frame rate of 24 frames/second, the particles move 1/24 of
a grid unit each frame. With the default oversampling level of 1, the runtime
expression executes once per frame. Maya calculates the runtime expression
once for each particle of an object.
Because the expression sets the velocity to <<0,1,0>> each frame, the
expression executes redundantly. This expression would therefore be more
appropriate for a creation expression. However, either type of expression has
the same effect in this example.
Example
Suppose youve created a grid of particles, and your animations starting
frame number is 0. You create this runtime expression for its velocity
attribute:
particleShape1.velocity = <<0,time,0>>;
The expression increases the Y component of velocity with the increasing
value of time as the animation plays. This makes all particles in the grid rise
with increasing velocity as the time increases. An increasing velocity is the
same as acceleration.
You need to use the statement in a runtime expression rather than a creation
expression, because youre increasing a value in the assignment each frame.
Using the statement in a creation expression would instead set the velocity
to a constant value <<0,0,0>>, because time equals 0 when the creation
expression executes for the particle grid.
Example
The previous examples gave all particles the same value for the velocity
attribute. You can instead give each particle a different value for an attribute.
Suppose youve created a grid of 121 particles.
Expressions
Suppose further you create this runtime expression for its acceleration
attribute:
particleShape1.acceleration = sphrand(2);
The expression executes once for each of the 121 particles each time the
runtime expression executes.
The sphrand(2) function provides a vector whose randomly selected
components reside within an imaginary sphere centered at the origin and
with a radius of 2. Each particle receives a different vector value. For details
on the sphrand function, see sphrand in Chapter 9.
Because each particle receives a different random vector for its acceleration
each frame, the particles accelerate individually in a constantly changing
direction and rate as the scene plays. This gives the acceleration abrupt
changes in direction.
Important
To give particles a constant acceleration, assign the acceleration attribute a
constant value in a runtime expression rather than in a creation expression.
Maya simulates the physics of acceleration. It initializes acceleration to
<<0,0,0>> before each frame, or if the oversample level is greater than 1,
before each timestep.
If the oversample level is 2, there are 2 timesteps per frame. If the
oversample level is 3, there are 3 timesteps per frame, and so on.
Example
Suppose youve set your animations starting frame to 0, and youve used
the Particle Tool to place a single particle at the origin:
Expressions
Each subsequent frame moves the particle upward at a rate set by the
incrementing value of time.
When you stop and rewind the animation, the particle moves back to the
origin, the particles original position when you created it with the Particle
Tool. When you created the particle, Maya stored its original position in an
internally maintained initial state attribute named position0. For details, see
Understanding initial state attributes on page 162.
Because the attribute has no creation expression controlling its value, Maya
sets the attribute to its initial state position0 value of <<0,0,0>>.
To prevent the particle from jumping back to the origin after rewinding, you
can write a creation expression thats the same as the runtime expression:
particleShape1.position = <<3,time,0>>;
When you rewind the animation, the particle moves to position
<<3,time,0>>. Because time is 0 at frame 0, the particle starts at position
<<3,0,0>> when you rewind the animation. In the second and following
frames, it moves upward synchronized with the increasing value of time.
Though this example showed how to initialize the position attribute with a
creation expression, you could have gotten almost the same result by saving
the objects current attribute values for initial state usage:
When you rewind the animation, Maya positions the object at the initial state
setting of its position attribute. This setting is <<3, 0.0417, 0>> because you
selected Set for Current while the position was equal to <<3, 0.0417, 0>>.
Expressions
You also use expressions to control dynamic and custom attributes you add
to a particle shape node. See Attributes in Chapter 5 for details on the
differences between static, dynamic, and custom attributes. See Assigning
to a custom attribute on page 169 for details on working with custom
attributes.
When you add a dynamic attribute to an object, the attribute names appear
in the Expression Editors Attributes list.
Note
See List of particle shape attributes on page 196 for attributes you can
use with particle objects.
The most common way to create dynamic per object or per particle attributes
for a particle shape is by clicking one of the following buttons in the Add
Dynamic Attributes section of the Attribute Editor:
For example, if you click the Opacity button, a window appears and lets you
choose whether to add the opacity characteristic as a per object attribute or a
per particle attribute.
If you choose per particle, the Attributes list of the Expression Editor
displays a new attribute for the selected particle shape node: opacityPP. If
you choose per object, an opacity attribute is displayed instead.
For attributes other than lifespan, if you add both a per particle attribute and
a per object attribute for a characteristic, the per particle attribute takes
precedence. For instance, if you add opacity and opacityPP, the opacityPP
attribute controls the opacity of the particles of the specified object.
When you click Lifespan and add both a per particle and per object
attribute, Maya adds an additional attribute named useLifspanPP that lets
you choose whether lifespanPP or lifespan controls the characteristic.
By default, the Attribute Editor setting of useLifespanPP is on, so the
Expressions
lifespanPP attribute control the characteristic. If you turn useLifespanPP off
in the Attribute Editor, lifespan controls the characteristic.
If you click the Goal button in the Add Dynamic Attributes section of the
Attribute Editor, Maya adds a per object attribute and a per particle
attribute. The attributes are named goal and goalPP. Neither attribute has
precedence. Maya multiplies the value of the per object goal attribute by the
per particle goalPP attribute to create the final goal effect for each particle.
Important
You can use per particle attributes only in particle expressions. You can use
per object attributes in particle or nonparticle expressions.
If you use a runtime expression to read or write a per object attribute of a
particle object with many particles, you can speed up expression execution
by reading or writing the attribute in a nonparticle expression.
Nonparticle expressions execute only once per object. Particle expressions
execute once for each particle in the object. Because reading or writing a
per object attribute more than once per frame is redundant, you can save
processing time by working with them in nonparticle expressions.
When you use the Add Attribute window to add a custom per particle
(array) attribute to a particle shape, you must choose whether you want to
add it with Add Initial State Attribute on or off. If you choose on, Maya
creates a corresponding initial state attribute for the added attribute.
If you choose off, Maya doesnt create a corresponding initial state attribute
for the added attribute. Without this corresponding attribute, you cant save
a particle objects current attribute values for initial state usage. You must
write a creation expression if you decide to initialize the custom attributes
value upon rewinding the animation.
Note
A per particle attribute is called an array attribute in the Add Attribute
window. The two terms have the same meaning. See Assigning to a
custom attribute on page 169 for details.
You can see whether a custom attribute was added with Add Initial State
Attribute on or off by using the MEL listAttributes command. (See the online
MEL documentation for details.)
You might want to read the value of an initial state attribute in an
expression, for instance, to use its original (rewind) value for some
calculation. If you assign a value to an initial state attribute. Maya will
overwrite the value if you save the attribute value for initial state usage.
Expressions
When you add a custom attribute to a particle shape, do not end the name
with a 0 character. Youll subvert Mayas naming scheme for the initial state
attribute associated with an attribute.
For any attribute, if you dont initialize its value with a creation expression
or save its value for initial state usage, Maya gives the attribute a default
value at the animations first frame. It typically assigns the attribute the
value 0 or <<0,0,0>>, as appropriate for the data type. In other cases, for
instance, opacityPP and opacity, Maya assigns the attribute a default value
of 1.
If you know youre going to write a creation expression for a custom
attribute, you can set Add Initial State Attribute off when you add the
attribute. Otherwise, set Add Initial State Attribute on whenever you add a
custom attribute.
When a creation expression assigns a value to an attribute, the value
overrides the attributes initial state value for all particles whose age is 0.
The following steps show how to assign a different lifespanPP value for each
of the particles to make them disappear as the scene plays.
Because lifespanPP is a per particle attribute and the objects particle shape
node is selected in the Expression Editor, the expression does an execution
loop of both statements once for each particle in the object.
Because the expression is a creation expression, it executes after the
expression compiles. It also executes when you rewind the animation after
playing it.
For each of the particles, the first statement assigns the lifespanPP attribute a
random floating point number between 0 and 5. The rand function returns a
different random number each time it executes, so each particle has a
different lifespanPP value between 0 and 5. For details on the rand function,
see chapter 9, Functions.
The second statement displays Hello in the Script Editor, once for each
particle.
The creation expression gives each particle a random lifespanPP of less than
5 seconds. The particles disappear from the scene at random times between 0
and 5 seconds of scene play. (Maya gives particles created with the Particle
tool an age of 0 in the first frame of the animation.)
Expressions
Particles remaining after
three seconds, with creation
expression for lifespanPP.
When you rewind the animation, the particles reappear in the scene. Playing
the scene again makes them disappear at random times within 5 seconds.
Its important that you use a creation expression for this effect. If you were
to use a runtime expression, the particles would disappear more quickly as
the animation plays, and Hello would appear 100 times each frame. The
reason for this is subtle:
In each frame, a runtime expression would assign a different random value
between 0 and 5 seconds to the lifespanPP of each particle. The expression
would likely assign one or more of the particles a lifespanPP near 0.
Meanwhile, the age of each particle increases from 0 at the first frame of
play.
Maya checks the age of each particle every frame. If the age is greater than
the lifespanPP value, Maya removes the particle.
Because the expression would reassign new random lifespanPP values to
each remaining particle in each frame, the new assignments would likely
give a few particles a lifespanPP thats less than their current age value.
Maya deletes such particles. This causes the objects particles to disappear
quickly from the scene.
The following steps show how to give the particles a single lifespan. All
particles disappear at the same time when you play the scene.
Expressions
2 In the Add Dynamic Attributes section of the Attribute Editor, click the
Lifespan button.
A window appears that prompts you to choose whether to add the attribute
per object or per particle.
3 Select Add Per Object Attribute, then click the Add Attribute button.
This adds the lifespan attribute to the particle shape node for Bubbles.
4 In the Expression Editor, turn on Creation.
5 Create this creation expression:
BubblesShape1.lifespan = 1.33;
print("Hello\n");
Because this is a creation expression, it executes after the expression
compiles. It also executes when you rewind the animation after playing it.
For each of the 100 particles, the first statement assigns the lifespan attribute
the value 1.33. The second statement displays Hello in the Script Editor once
for each particle.
6 Play the animation.
Because all particles have a lifespan of 1.33, they disappear from the scene
after 1.33 seconds of animation play.
When you rewind the animation, the particles reappear in the scene. Playing
the scene again makes them disappear again after 1.33 seconds.
Expressions
The new attribute appears under the Dynamic Attributes section of the
Attribute Editor.
Example
Suppose youve created a 100-particle object named sunspot, and you add to
its particle shape node a vector per object attribute named glow. You assign
the glow attribute a vector value in a creation expression as follows:
sunspotShape1.glow = <<3,0,0>>;
print(sunspotShape1.glow + "\n");
When you rewind the animation, the glow attribute of sunspotShape1
receives the value <<3,0,0>>. The print statement displays the values in the
Script Editor.
Example
Suppose you add a vector per particle attribute named heat to the 100-
particle sunspot shape node. You can give each particle a different value as
in this creation expression:
Expressions
float $randomNumber = rand(1);
sunspotShape1.heat = <<$randomNumber,0,0>>;
print(sunspotShape1.heat + "\n");
When you rewind the animation, the expression loops through 100
executions, once for each particle.
The first statement sets the $randomNumber variable to a random number
between 0 and 1. The next statement assigns a vector to the heat attribute of
a single particle. The left component of the vector assigned to heat is a
different random number each time the statement executes. The middle and
right components are always 0.
One particle might have the value <<0.57, 0, 0>>, another <<0.32, 0, 0>>,
another <<0.98, 0, 0>>, and so on.
The print statement displays the values in the Script Editor.
Note
If you add a custom vector attribute to an object, Maya displays the
attribute in the Attribute Editor, but you cant enter its value there. You
must enter a value for it in an expression or with the Component Editor
available from the Attribute Editor.
Example
Suppose your scene contains an object named ThreePts made of three
particles and an object named TwoPts made of two particles.
The three particles in ThreePts are at these positions:
-5 0 0
-4 0 0
-3 0 0
The two particles in TwoPts are at these positions:
5 0 0
6 0 0
Expressions
Suppose you write the preceding runtime expression instead with
ThreePtsShape1 selected in the Object Selection list.
Again, the expression repositions the three particles to the position of the
two particles. Because you selected ThreePtsShape1 in the Object Selection
list, the expression executes once for each of its three particles.
When you play the scene, the runtime expression executes. The first particle
of ThreePts moves to the position of the first particle of TwoPts. The second
particle of ThreePts moves to the position of the second particle of TwoPts.
Expressions
Unless you have a solid grasp of physics, avoid setting a combination of the
position, velocity, and acceleration attributes.
To give a smooth, random motion to particles with a runtime expression, use
a random number function such as sphrand to assign random numbers to
the particle shapes acceleration attribute. A change in acceleration always
gives smooth motion no matter how abruptly its value changes.
To give a jittery random motion to particles with a runtime expression, use a
random number function such as sphrand to assign random numbers to the
particle shapes velocity or position attributes.
See Random number functions on page 239 for details on how to use
random number functions.
If an expression and a dynamic field control an objects position, velocity, or
acceleration, Maya calculates the expressions effect first, then adds the
fields effect.
Example
Suppose a particle drops under the influence of a gravity field with default
gravity options. Gravity accelerates the particle at 9.8 units per second per
second down the Y-axis. In other words, the default acceleration of gravity is
<<0,-9.8,0>>.
Suppose further you write the following runtime expression for the particle:
velocity = velocity + <<1,0,0>>;
As each frame plays, Maya first calculates the particles velocity from the
expression statement. The velocity increases 1 unit per second in an X-axis
direction. Maya then adds the gravitational acceleration to the velocity.
Maya uses the combined result to compute the particles position.
Of course, you wont see this calculation process. The frame displays the
particle in the appropriate position after all computation.
Note that the expression adds the constant <<1,0,0>> to the particles
velocity each frame as the animation plays. This makes the particle move
with increasing velocity in an X direction as the time increases. An
increasing velocity is the same as acceleration.
Example
Suppose you write the following runtime expression for a five-particle object
unaffected by gravity:
acceleration = acceleration + <<0,1,0>>;
Rather than adding <<0,1,0>> to the acceleration value each frame,
acceleration remains a constant <<0,1,0>> for each of the particles. This
happens because Maya initializes the value of acceleration to <<0,0,0>>
before each frame.
Suppose you connect the particle object to gravity with default settings. The
acceleration of the particle becomes <<0,1,0>> plus <<0,-9.8,0>>, which
equals <<0,-8.8,0>>. The acceleration assigned in the expression slows the
downward acceleration of the gravity.
Suppose you change the previous expression to this:
acceleration = acceleration + sphrand(3);
Because Maya sets acceleration to <<0,0,0>> before each frame, the
Expressions
statement has the same result as the following statement:
acceleration = sphrand(3);
As each frame plays, Maya first calculates each particles acceleration from
the expression statement. Each particle receives the result of the sphrand(3)
function.
The sphrand(3) function provides a vector whose randomly selected
components reside within a spherical region centered at the origin with
radius 3. Each particle receives a different vector value.
Finally, Maya adds gravitys acceleration to the expression acceleration
resulting from sphrand(3). The frame displays each particle in the resulting
position.
Because of the random values resulting from the expression, each particle
has an acceleration that differs slightly from gravity in direction and
magnitude. Because the sphrand(3) function executes for each particle each
frame, the acceleration of each particle varies each frame.
This example shows that you can take advantage of the additive effect of
fields and the acceleration attribute to create custom field effects.
Tip
You can turn off the effect of all fields on a particle shape node attribute by
setting its dynamicsWeight attribute to 0.
Example
Suppose youve used the Particle tool to create a randomly positioned
collection of particles named Bubbles. You can use a creation expression to
give the particles a constant color during animation play.
Expressions
3 Select Add Per Particle Attribute, then click the Add Attribute button.
This adds an rgbPP attribute to the particle shape node for Bubbles. Because
youre adding this attribute as a per particle attribute, you can give each
particle a different color.
4 Choose ShadingSmooth Shade All.
This step is necessary to make the correct particle color appear when you
assign the rgbPP attribute a value in an expression.
5 In the Expression Editor, select Bubbles particle shape node.
6 Turn on Creation in the Expression Editor.
Because youll give the particles a color that doesnt change during the
animation, you use a creation expression.
7 Enter this expression:
BubblesShape1.rgbPP = <<1,0,0>>;
When you click the Create button in the Expression Editor, Maya checks the
syntax of the expression. Assuming you made no typing errors, the
expression executes once for each of the 100 particles.
The expression colors all particles in the object red. The double angle
brackets << and >> enclose a vector that sets the red, green, and blue
components of the rgbPP attribute to 1, 0, and 0. In the RGB color scheme,
this gives the object a red color.
8 Play the animation.
Because the expression is a creation expression, it executes when you rewind
the animation. The particles remain red for entire animation because the red
color is never changed by a runtime expression.
Tip
See the online version of this documentation for colored illustrations.
The following steps show how to give the particles a randomly changing
color as the animation plays.
Because the creation expression executes when you rewind, the particles are
red.
5 Play the animation.
The runtime expression takes control of the rgbPP attribute. Because rgbPP
is a per particle attribute, the runtime expression executes for each particle in
the object each frame. For each particle, the expression assigns the rgbPP
attribute the output from the execution of the sphrand function with an
argument of 1.
The sphrand function assigns each particles rgbPP color a random vector.
The vector represents a random point in a spherical region of radius 1. The
left, middle, and right rgbPP color components have a value no less than -1
and no greater than 1. Values less than 0 are treated as 0.
The sphrand function returns a different random vector each execution. So
each particle has a different random rgbPP value, and therefore, a different
color. The color of each particle changes each frame.
Expressions
If you rendered the animation and played it back at 24 frames per second,
you would have trouble seeing the color of a particle in any instant because
the color changes so quickly.
You can slow the change of colors to create a flashing Christmas light effect.
The following steps make the particles change colors every second of
animation.
This expression uses the modulus operator (%) to control when the rgbPP
attribute of the particles receives a random color. The modulus operator
returns the remainder after division. For example, 24 divided by 24 returns
0, but 25 divided by 24 returns 1. (Dividing 25 by 24 equals 1 with a
remainder of 1.)
If the value of frame divided by 24 is equal to any number with a remainder
of 0, the assignment to BubblesShape1.rgbPP occurs. In other words, the
assignment occurs when frame equals 24, 48, 72, and so on. At an animation
rate of 24 frames/second, the assignment happens once each second.
Important
Avoid using the modulus operator with floating point values. Because of
number rounding in floating point division, you wont likely get a return
value of exactly 0 with the modulus operator. Instead use an integer value
when possible.
Note that you can change the red rewind color to random colors by
changing the creation expression to this:
BubblesShape1.rgbPP = sphrand(1);
This is the same expression as the runtime expression.
Example
Suppose youve created an emitter and added a per particle lifespanPP
attribute to it. The following creation expression gives the emitted particles a
lifespan of 2 seconds:
particleShape1.lifespanPP = 2;
Each particle disappears two seconds after its emitted.
Important
Avoid assigning a per particle attribute to another objects per particle
Expressions
attribute if the particles of either object die. As particles die, the order of
expression evaluation changes for the objects particles. This causes
unexpected results.
You can, though, assign from one attribute to another in the same object
with dying particles. The array indexes of the different attributes are in
synch with each other.
For example, dont write an expression like this:
emittedShape1.lifespanPP = 2;
emittedShape1.rgbPP = otherParticleShape2.rgbPP
The eventCount and eventTest are static attributes. A particle shape node
has them as soon as you create the particle object. Though they dont appear
in the Expression Editor, you can use their values in an expression. You
must first create the event attribute as described previously.
Example
Suppose youve created a five-particle object named Peas that falls with
gravity and collides with a plane.
You can make the particles turn red when the first particle hits the plane.
1 Select PeasShape1 in the Outliner or Hypergraph.
2 From the Dynamics menu bar, select SettingsParticle Collision Events.
Expressions
3 In the Particle Events window, click Create Event, then close the window.
This adds an event attribute to PeasShape1.
4 In the Add Dynamic Attributes section of the Attribute Editor, click Color.
The Particle Color window appears.
5 Select Add Per Particle Attribute, then click Add Attribute.
This adds a per particle attribute named rgbPP. This attribute controls the
red, green, and blue color scheme of each particle.
The particles turn black after you add the rgbPP attribute. Adding the rgbPP
attribute turns off the default coloring of the particles and gives them a value
of <<0,0,0>>.
6 Choose ShadingSmooth Shade All.
This step is necessary to make the correct particle color appear when you
assign the rgbPP attribute a value in an expression.
else if (event == 2)
rgbPP = <<0,1,0>>;
Tip
See the online version of this documentation for colored illustrations.
Note that the value of the event attribute reflects the collision count in the
frame after each collision. For example, if a particle collides with the plane in
frame 10, event is updated in frame 11.
When the other particles hit the plane for the first time, they also turn red
Expressions
after they collide.
A particle stays red until it collides with the plane for the second time, when
event equals 2. After a second collision, the particle turns green.
Note that Set for Current saves all attribute values, including position,
velocity, acceleration, and so on. In cases where you have several changing
attribute values during playback, Set for Current might save undesired
attribute values in addition to the desired ones. In such cases, use a creation
expression.
Expressions
2, and so on.
You can assign per particle attribute values to specific particles using the
particleId attribute.
Example
Suppose youve used the Particle tool to create a grid of eight particles
named ColorGrid. In the Attribute Editor, youve set the Render Type of the
particles to Spheres. Youve chosen ShadingSmooth Shade All to display
the particles with shading.
You can give the particles different colors based on their particleId.
Expressions
The expressions first statement assigns a red color to all particles whose
particleId is less than or equal to 2. The value <<1,0,0>> is red in the RGB
color scheme.
The second statement assigns a white color to all particles whose particleId
is greater than 2 and less than 6. The value <<1,1,1>> is white in the RGB
color scheme.
The third statement assigns a blue color to all particles that dont meet the
conditions in the prior two statements. In other words, all particles whose
particleId is greater than or equal to 6 become blue. The value <<0,0,1>> is
blue in the RGB color scheme.
The following steps show another common way to control an attribute based
on the particleId attribute.
To color half the particles red, and half the particles blue:
1 Enter the following runtime expression:
if ((particleId % 2) == 0)
rgbPP = <<1,0,0>>;
else rgbPP = <<0,0,1>>;
2 Play the scene.
The runtime expression executes each frame as the animation plays. Half the
particles are blue, half are red.
The first statement uses a modulus operator (%) to calculate the remainder
of dividing a particleId by 2. It then compares the remainder to 0. If the
remainder equals 0, the statement assigns the particle a red color. The value
<<1,0,0>> is red.
The second statement assigns a particle a blue color if the remainder of the
modulus operation doesnt equal 0. The value <<0,0,1>> is blue. For
example, dividing particleId 0 by 2 equals 0 with remainder 0. Because the
remainder is 0, the particle having particleId 0 receives a red color.
Dividing particleId 1 by 2 equals 0 with remainder 1. Because the remainder
is 1, the particle having particleId 1 receives a blue color.
Dividing particleId 2 by 2 equals 1 with remainder 0. With remainder 0, the
particle having particleId 1 receives a blue color. The expression executes for
each particle in the object.
The result is that even-numbered particleIds become red, odd numbered
particles become blue.
3 Rewind the animation.
The creation expression executes. The particles become red, white, and blue
as described for the previous expression.
4 Play the animation.
The runtime expression executes each frame. The particles are red and blue
as the animation plays.
Note to programmers
You cannot assign values to individual particles with the array index
notation commonly used in programming languages.
For example, suppose youve created an opacityPP attribute for an object
made of three particles. You cant assign values as in this example:
opacityPP[0] = 0.3;
opacityPP[1] = 0.5;
opacityPP[2] = 1;
Expressions
Assigning to a vector variable
You can assign a literal vector value or another vector variable to a vector
variable. Enclose a literal vector value in double angle brackets.
Examples
vector $top_velocity = <<2,2,5>>;
This assigns the vector $top_velocity the value <<2,2,5>>.
vector $temp;
vector $temp = $top_velocity;
This assigns the value of vector variable $top_velocity to the vector variable
$temp.
Format Meaning
Examples
float $temp;
vector $myvector = <<1,2,3>>;
float $temp = $myvector.z;
This assigns the right component of $myvector, 3, to the floating point
variable $temp.
Suppose you have a vector initialized as follows:
vector $myvector = <<1,2,3>>;
To replace the right component of $myvector, 3, with a new value such as 7,
use this technique to preserve the other two components:
$myvector = <<$myvector.x,$myvector.y,7>>;
This statement is incorrect:
$myvector.z = 3;
An error occurs. A statement can read, but not directly assign, a component
of a vector variable.
Example
Suppose you have 100-particle Cloud of randomly positioned particles.
CloudShape1.position = sphrand(1);
vector $pos = CloudShape1.position;
CloudShape1.rgbPP = <<0,$pos.y,0>>;
The three statements execute once for each particle in Cloud.
The first statement gives a particle a random position within a spherical
region of radius 1. The sphrand(1) function gives the X, Y, and Z position
components a value no less than -1 and no greater than 1.
The second statement assigns a particles position to a vector variable $pos.
The third statement assigns an RGB color to a particles rgbPP attribute.
The left, middle, and right vector components of CloudShape1.rgbPP
represent red, green, and blue components of the RGB color scheme. The
third statement therefore assigns 0 (no color) to the red and blue components
of a particles colorRGB. It gives a particles green component the value of its
Y coordinate position.
Because a value of 0 or less results in a 0 green value, a particle is black if its
below the XZ plane. If a particles Y coordinate position is above the XZ
plane, it has a green component varying from nearly 0 to a fully saturated
green.
Expressions
This colors the particles from black to green, depending on the position.
Increasingly green
Example
particleShape1.rgbPP = <<1,0,CloudShape1.position.z>>;
This causes an error. Maya interprets CloudShape1.position.z as being an
attribute named z of an object named CloudShape1.position.
You can get the intended result with these statements:
vector $temp = CloudShape1.position;
particleShape1.rgbPP = <<1,0,$temp.z>>;
The first statement reads all three components of vector attribute
CloudShape1.position and assigns it to the vector variable $temp. The
second statement reads the value of the right component of $temp, which
contains the right component of CloudShape1.position. It then assigns this
component to the right component of particleShape1.rgbPP.
Example
particleShape1.rgbPP.y = 1;
This also causes an error. You cant assign a value to a vector array attribute
component.
Expressions
colorGreen Sets green component of MultiStreak float
RGB color. Points
colorRed Sets red component of Sphere float
RGB color. Sprite
Streak
conserve Sets amount of float
(con) momentum conservation.
Expressions
applies to each particle in
the object.
radiusPP Sets radius size on a per yes Blobby Surface float array
particle basis. Cloud
Sphere
Expressions
selectedOnly Toggles display of id Numeric boolean
numbers for selected
particles.
Matt Baer
Expressions
For easy reference, this chapter groups functions by their purpose. For
example, all math functions are grouped in the same section.
Expressions
Other functions and 264
commands
Understanding functions
A function generates a value where it occurs in an expression statement. It
takes action based on parameters called arguments that you enclose in
parentheses next to the function name.
Example
Suppose you have an object named Star whose translateX attribute is set
with this expression statement:
Star.translateX = rand(10);
In this statement, the rand function has the argument 10. With this
argument, the function generates a randomly selected floating point number
between 0 and 10 each time the statement executes. For example, translateX
might be assigned 6.5409 the first time the statement executes, 3.2974 the
second time, 8.7389 the third time, and so on. This causes Star to jump to
random points from 0 to 10 units away from the X-axis as the scene plays.
Though functions can be more or less complicated than this example, they
all have at least one argument and generate one value. Note that a function
is part of an expression statement. They dont stand alone in an expression.
Many functions do mathematical operations. For example, the sin function
generates the sine of a specified angle. Though we often provide explanatory
figures and details, we assume youre familiar with the mathematical
purpose of such functions. For details on the math behind such functions,
see a more elementary reference.
Note that the following functions are important to learn if you want to go
beyond the basics of expression writing:
sin or sind
linstep
smoothstep
hermite
noise
dnoise
rand
sphrand
print
Function syntax
To help you quickly reference different functions, this chapter includes a
syntax format statement for each function. The format follows:
datatype function(datatype argument)
function is the name of the function.
datatype to the left of an argument indicates the data type of the argument.
argument is a parameter you type with the function.
datatype to the left of the function name indicates the data type returned
when the function executes.
Note that for either datatype, you dont type a value. The datatype tells you
the type of data you must enter or the data type returned by the executed
function.
The data types are in small type size for easy identification in the syntax
definitions.
Example 1
int abs(int number)
float abs(float number)
vector abs(vector number)
The function name is abs, which returns the absolute value of the number of
your choice. The absolute value of a number is the number without its
positive or negative sign.
This example shows the abs function has three formats. Each version
requires an argument with a different data type and returns a value with a
different data type.
The first version indicates that you can type an integer argument, and the
function returns an integer result. For example, abs(-3) returns 3.
The second version indicates that you can type a floating point argument,
and the function returns a floating point result. For instance, abs(-7.54)
Expressions
returns 7.54.
The third version indicates you can type a vector, and the function returns a
vector. For example abs(<<3, -6.3, -2>>) returns <<3, 6.3, 2>>.
Example 2
Many functions have only one format, for example, the deg_to_rad function:
float deg_to_rad( float degrees )
This function returns the radian equivalent of to a degree value. It expects a
floating point argument and returns a floating point number.
Note that Maya ignores spaces between components of functions. For
example, the functions in each of these expressions work the same:
rotateY = deg_to_rad (45);
rotateY = deg_to_rad(45);
rotateY = deg_to_rad( 45 );
Data types
In many cases, entering a data type other than the type expected by a
function causes an error and prevents the expression from executing. For
example, if you enter a vector argument where a floating point number is
expected, an error occurs.
For a function argument that expects a floating point number, however, you
can instead type an integera number without a decimal point. Maya
converts an integer to a floating point number in arithmetic operations.
If an error occurs when you create an expression, check that youre using the
appropriate data types for all arguments.
Notes
In this book, examples of floating point return values show no more than
three digits to the right of the decimal point. If you display the contents of
an attribute or variable in the Script Editor, youll see as many as 10 digits
to the right of the decimal point.
For instance, an example might show a return value as 3.539 rather than
the precise value 3.538654390. The examples round up such numbers for
ease of reading.
Note also that converting radians to degrees and vice versa results in
rounding errors. For example, converting a radian value might result in
89.99999996 degrees rather than 90.0 degrees.
Examples
Ball.scaleY = abs(-1);
This statement assigns Ball.scaleY the value returned by the abs(-1) function.
If you use a function in an expression statement and do not assign the
returned value to an attribute, the statement has no effect.
abs(-1);
Returns 1, but doesnt assign it to an attribute. This has the same result as
the following meaningless statement:
1;
In some function examples in this chapter, the functions purpose is easier to
understand in the context of an expression. In such cases, we show examples
of the function in an expression.
Limit functions
The limit functions are math functions that impose limits on numbers.
abs
Returns the absolute value of number. The absolute value of an integer or
Expressions
floating point number is the number without its positive or negative sign.
The absolute value of a vector is a vector with components stripped of
negative signs.
int abs(int number)
float abs(float number)
vector abs(vector number)
number is the number for which you want the absolute value.
Examples
abs(-1)
Returns the value 1.
abs(1)
Returns the value 1.
abs(<<-1,-2.43,555>>)
Returns <<1, 2.43, 555>>.
abs(Ball.translateY)
If Ball.translateY contains -20, this returns 20.
ceil
Returns a number rounded to the smallest integer value greater than or
equal to a floating point number.
float ceil(float number)
number is the number you want to round.
Examples
ceil(2.344)
Returns 3.
ceil(3.0)
Returns 3.
ceil(Rock.scaleY)
If Rock.scaleY contains -2.82, this returns -2.
floor
Returns a number rounded to the largest integer less than or equal to a
floating point number.
float floor(float number)
number is the number you want to round.
Examples
floor(2.344)
Returns 2.
floor(3.0)
Returns 3.
floor(Head.height)
If Head.height is -2.8, this returns -3.
clamp
Returns a number within a range. You can use the clamp function to confine
an increasing, decreasing, or randomly changing number to a range of
values.
float clamp(float minnumber, float maxnumber, float parameter)
minnumber and maxnumber specify the range of the returned value.
parameter is an attribute or variable whose value you want to clamp within
the range.
If parameter is within the numerical range of minnumber and maxnumber, the
function returns the value of parameter.
If parameter is greater than the range, the function returns the maxnumber.
If parameter is less than the range, the function returns the minnumber.
Examples
clamp(4,6,22)
Expressions
Returns 6, because 22 is greater than 6, the maximum number of the range.
clamp(4,6,2)
Returns 4, because 2 is less than 4, the minimum number of the range.
clamp(4,6,5)
Returns 5, because its within the range.
Ball.scaleY = clamp(0,3,time);
Returns a value between 0 and 3 each time the expression executes.
When you rewind the animation to frame 1, the above expression executes
and Balls scaleY attribute receives the value of timea number slightly
above 0. The clamp function returns the value of time because time is within
the range 0 to 3.
When you play the animation, time increments slightly with each frame. The
expression executes with each frame and Balls scaleY attribute receives the
value of time until time exceeds 3. When time exceeds 3, the clamp function
returns the value 3.
min
Returns the lesser of two floating point numbers.
float min( float number, float number)
number is a number you want to compare.
Examples
min(7.2,-3.2)
Returns -3.2.
Desk.height = -2;
Lamp.height = 9;
$Mylight = min(Desk.height,Lamp.height);
Sets $Mylight to -2.
max
Returns the larger of two floating point numbers.
float max(float number, float number)
number is a number you want to compare.
Examples
max(7.2,-3.2)
Returns 7.2.
Desk.height = -2;
Lamp.height = 9;
$Mylight = max(Desk.height,Lamp.height);
Sets $Mylight to 9.
sign
Returns one of three values representing the sign of a number. Returns -1 if
the number is negative, 1 if positive, 0 if 0.
float sign( float number )
number is the number whose sign you want to determine.
Examples
sign(-9.63)
Returns -1.
sign(0)
Returns 0.
sign(10)
Returns 1.
sign(Ball.translateX)
If Ball.translateX is 5, this returns 1.
trunc
Returns the whole number part of a floating point number.
float trunc(float number)
number is the number you want to truncate.
Examples
trunc(2.344)
Expressions
Returns 2.
trunc(0.3)
Returns 0.
trunc(-2.82)
Returns -2.
trunc(time)
If time equals 3.1234, this returns 3.
Exponential functions
The following functions work with exponential values.
exp
Returns e raised to the power of a number, enumber. The predefined variable e
is the base of the natural logarithm, which is 2.718.
float exp(float number)
number is the exponent to which you want to raise e.
Examples
exp(1)
Returns 2.718, the value of e.
exp(2)
Returns 7.389, the value of e2.
log
Returns the natural logarithm of a number, logenumber. The natural
logarithm uses the constant e, which is 2.718.
float log(float number)
number is the positive number for which you want the natural logarithm.
Examples
log(10)
Returns 2.303.
log(2.718282845904)
Returns 1.000.
log10
Returns the log base 10 of a number.
float log10(float number)
number is the positive number for which you want the log base 10.
Examples
log10(100)
Returns 2.
log10(10)
Returns 1.
pow
Returns a base number raised to an exponent.
float pow(float base, float exponent )
base is the base number you want to raise to the exponent. A negative base
number with a decimal component causes an error message.
exponent is the exponent.
Examples
pow(2,3)
Returns 8.
pow(-2,3)
Expressions
Returns -8.
pow(2,-3)
Returns 0.125.
sqrt
Returns the square root of a positive number.
float sqrt(float number)
number is the positive number of which you want the square root.
A negative number displays an error message.
Examples
sqrt(16)
Returns 4.
sqrt($side)
If $side is 25, this returns 5.
Trigonometric functions
The following functions return trigonometric values. Each function has two
formats that let you choose the type of angular unit you work with: degrees
or radians. For example, the cos function expects an argument in radians,
while cosd expects an argument in degrees.
A radian equals 180 degrees divided by pi, or roughly 57.3 degrees. Note
that pi equals 3.1415927, which is also 180 degrees.
cos
Returns the cosine of an angle specified in radians.
float cos(float number)
number is the angle, in radians, whose cosine you want.
For any right triangle, the cosine of an angle is the following ratio:
adjacent B
cos = ------------------------------ = ----
hypotenuse C
Y Y
C
A
B
B X X
A
C
The cosine ratio depends only on the size of the angle and not on the size of
the triangle. This constant ratio is called the cosine of the measure of the
angle.
The cosine ratio is a value between -1 and 1.
With a steadily increasing or decreasing argument, the cos function returns
steadily increasing or decreasing values between 1 and -1. This is useful for
creating rhythmic, oscillating changes in attribute values.
The cos function works like the sin function except its return values are 90
degrees, or pi/2, out of phase.
See page 219 for ideas on how to use the cyclical characteristics of the sin
and cos functions.
Example 1
cos(1)
Returns 0.5403, the cosine of 1 radian.
Example 2
To animate the motion of Ball in a cosine wave pattern, use this expression:
Ball.translateX = time;
Ball.translateY = cos(Ball.translateX);
Expressions
Ball starts at the origin and moves in the X direction at a rate set by the
incrementing animation time. Its Y translation moves cyclically up and
down according to the return values of the cos function. The cos function
uses translateX, and therefore indirectly, time, as its argument.
As time increases from 0 to 6.283 seconds, the cos function returns values
that change in fine increments from 1 to -1 and back to 1. The value 6.283 is 2
times the value of pi.
As time increases beyond 6.283 seconds, the same cycle repeats for each span
of 6.283 seconds.
Ball.translateY = cos(Ball.translateX);
time = 6.283
(2 * pi seconds)
Ball.translateY = sin(Ball.translateX);
time = 6.283
(2 * pi seconds)
The cosine curve is 1.571 (pi/2) seconds ahead of (or behind) the sine curve,
and vice versa.
cosd
Returns the cosine of an angle specified in degrees.
float cosd(float number)
number is the angle, in degrees, whose cosine you want.
For more details on the cosd function, see the cos function in the preceding
topic. The cosd and cos functions do the same operation, but cosd requires
its argument in degree measurement units.
Example
cosd(45)
Returns 0.707, the cosine of 45 degrees.
sin
Returns the sine of an angle specified in radians.
float sin(float number)
number is the angle, in radians, whose sine you want.
For any right triangle, the sine of an angle is the following ratio:
opposite A
sin = ------------------------------ = ----
hypotenuse C
Y Y
C
A
B
B X X
Expressions
A
C
The sine ratio depends only on the size of the angle and not on the size of
the triangle. This constant ratio is called the sine of the measure of the angle.
The sine ratio is a value between -1 and 1.
With a steadily increasing or decreasing argument, the sin function returns
steadily increasing or decreasing values between -1 and 1. This is useful for
creating rhythmic, oscillating changes in attribute values.
Example 1
float $pi = 3.1415927;
sin($pi/2)
Returns 1, the sine of pi/2 radians.
Example 2
Ball.translateY = sin(Ball.translateX);
This statement sets Balls translateY attribute equal to the sine of its
translateX attribute. If you drag Ball along the X-axis, Balls translateY
position moves up and down in a cyclical pattern:
Example 3
To animate Ball to the path of the preceding example, use this expression:
Ball.translateX = time;
Ball.translateY = sin(Ball.translateX);
Ball starts at the origin and moves in the X direction at a rate set by the
incrementing animation time. Its Y translation moves cyclically up and
down according to the return values of the sin function. The sin function
uses translateX, and therefore indirectly, time, as its argument.
As time increases from 0 to 6.283 seconds, the sin function returns values
that change in fine increments from 0 to 1 to -1 to 0. The value 6.283 is 2
times the value of pi. The resulting motion resembles a horizontal S-shape:
time = 6.283
(2 * pi seconds)
As time increases beyond 6.283 seconds, the same S-shaped cycle repeats for
each span of 6.283 seconds.
Example 4
Expressions
This expression animates Ball with larger up and down swings:
Ball.translateX = time;
Ball.translateY = sin(Ball.translateX) * 2;
By multiplying sin(Ball.translateX) by a number greater than 1, you increase
the amplitude of the sine wave pattern. The amplitude is half the distance
between the minium and maximum values of the wave.
Amplitude
Example 5
This expression increases how often the sine wave completes a cycle:
Ball.translateX = time;
Ball.translateY = sin(Ball.translateX * 2);
By multiplying Ball.translateX by a number greater than 1, you increase the
frequency of the sine wave pattern. The frequency is how long it takes the
wave to make a complete cycle.
Frequency
Example 6
This expression offsets the wave pattern higher up the Y-axis:
Ball.translateX = time;
Ball.translateY = sin(Ball.translateX) + 2;
By adding 2 to sin(Ball.translateX), the wave pattern starts further up the Y-
axis. You can, of course, also subtract a number to offset the wave pattern
lower on the Y-axis.
Offset of 2
Example 7
The following expression sets a frequency multiplier, amplitude, and offset
of a sine pattern in a single statement:
Ball.translateX = time;
Ball.translateY = (sin(Ball.translateX * 2) * 2) + 2;
Expressions
The following diagram shows which values set the frequency multiplier,
amplitude, and offset.
Frequency multiplier
Amplitude
Offset
Ball.translateY = (sin(Ball.translateX * 2) * 2) + 2;
A general equation showing the factors you can use to create a sine wave
pattern follows:
sind
Returns the sine of an angle specified in degrees.
float sind(float number)
number is the angle, in degrees, whose sine you want.
For more details on how to use the sind function, see the sin function in the
preceding topic. The sind and sin functions do the same operation, but sind
requires its argument in degree measurement units.
Example
sind(90)
Returns 1, the sine of 90 degrees.
tan
Returns the tangent of an angle specified in radians.
float tan(float number)
number is the angle, in radians, whose tangent you want.
For any right triangle, the tangent of an acute angle is the following ratio:
opposite A
tan = ----------------------- = ---
adjacent B
Y Y
C
A
B
B X X
A
C
The ratio depends only on the size of the angle and not on the size of the
triangle. This constant ratio is called the tangent of the measure of the angle.
Example
tan(1)
Returns 1.557.
tand
Returns the tangent of an angle specified in degrees.
float tand(float number)
number is the angle, in degrees, whose tangent you want.
For more details on the tand function, see the tan function in the preceding
topic. The tand and tan functions do the same operation, but tand requires
its argument in degree measurement units.
Example
tand(45)
Returns roughly 1, the tangent of 45 degrees.
Expressions
acos
Returns the radian value of the arc cosine of a number. The arc cosine is the
angle whose cosine is the specified number. The returned value is from 0 to
pi.
float acos(float number)
number is the cosine of the angle, and must be from -1 to 1.
Example
acos(1)
Returns 0.
acos(-0.5)
Returns 2.0944 radians.
acosd
Returns the degree value of the arc cosine of a number. The arc cosine is the
angle whose cosine is the specified number. The returned value is from 0 to
180.
float acosd(float number)
number is the cosine of the angle, and must be from -1 to 1.
Example
acosd(1)
Returns 0 degrees.
acosd(-0.5)
Returns 120 degrees.
asin
Returns the radian value of the arc sine of a number. The arc sine is the angle
whose sine is the specified number. The returned value is from -pi/2 to pi/2.
float asin(float number)
number is the sine of the angle, and must be from -1 to 1.
Example
asin(0.5)
Returns 0.525 radians.
asind
Returns the degree value of the arc sine of a number. The arc sine is the
angle whose sine is the specified number. The returned value is from -90 to
90.
float asind(float number)
number is the sine of the angle, and must be from -1 to 1.
Example
asind(0.5))
Returns 30 degrees.
atan
Returns the radian value of the arc tangent of a number. The arc tangent is
the angle whose tangent is the specified number. The returned value is from
-pi/2 to pi/2.
float atan(float number)
number is the tangent of the angle and can be any value.
Example
atan(1)
Returns 0.785.
atand
Returns the degree value of the arc tangent of a number. The arc tangent is
the angle whose tangent is the specified number. The returned value is from
-90 to 90.
Expressions
float atand(float number)
number is the tangent of the angle and can be any value.
Example
atand(1)
Returns 45 degrees.
atan2
Returns the radian value of the arc tangent of specified X and Y coordinates.
The arc tangent is the angle from the X-axis to a line passing through the
origin and a point with coordinates X,Y. The returned angle is in radians,
from -pi to pi, excluding -pi.
float atan2(float Y, float X )
X is the X coordinate of the point.
Example
atan2(1,1)
Returns 0.785 radians.
atan2d
Returns the degree value of the arc tangent of specified X and Y coordinates.
The arc tangent is the angle from the X-axis to a line passing through the
origin and a point with coordinates X,Y. The returned angle is in degrees,
from -180 to 180, excluding -180.
float atan2d(float Y, float X )
X is the X coordinate of the point.
Y is the Y coordinate of the point.
Example
atan2d(1,1)
Returns 45 degrees.
hypot
Returns the magnitude of two-dimensional vector from the origin to a point
with coordinates X, Y.
Y hypot
(X,Y)
As shown in the preceding figure, the hypot function returns the radius of a
circle whose center is at one end of a right triangles hypotenuse and
perimeter is at the other end of the hypotenuse.
The following equation gives the magnitude of the vector:
2 2
x +y
Example
hypot(3,4)
Returns 5.
Vector functions
The following functions do operations with vectors. The functions take
vector arguments and return floating point numbers or vectors.
Expressions
angle
Returns the radian angle between two vectors.
Vector1
Angle
Vector2
Example
angle(<<2,-1,1>>,<<1,1,2>>)
Returns 1.0472 radians, which equals 60 degrees.
cross
Returns the cross product of two vectors.
For two vectors, the cross product returns the vector thats normal to the
plane defined by the two vectors.
Vector1
Vector2
Cross product
Example
cross(<<1,2,-2>>,<<3,0,1>>)
Returns <<2, -7, -6>>.
dot
Returns the floating point dot product of two vectors. The dot product takes
two vectors as arguments and returns a scalar value.
float dot(vector vector1, vector vector2)
If the dot product returns 0, the two vectors are perpendicular.
vector1 is one of the vectors.
vector2 is the other vector.
Example
dot(<<1,2,-2>>,<<3,0,1>>)
Returns 1. The dot product of this example is (1 * 3) + (2*0) + (-2*1), which
equals 1.
mag
Returns the magnitude of a vector. This is the length of the vector.
Y-axis
Expressions
Z
X <<X, Y, Z>>
X-axis
Z-axis
Magnitude
The mag function converts a vector into a floating point number using the
following formula.
2 2 2
x +y +z
Example
mag(<<7,8,9>>)
Returns 13.928.
2 2 2
7 + 8 + 9 = 13.928
rot
Returns a vector that represents the position of a point after its rotated a
specified number of radians about a specified axis. Rotation is counter-
clockwise as viewed downward from the axis end position.
Position of point
before rotation
Angle
Position of point
after rotation
Axis
Example 1
rot(<<3,3,0>>,<<1,0,0>>,0.5)
Returns <<3, 2.633, 1.438>>. This is a vector representing the position of
point <<3,3,0>> after rotating it 0.5 radians around the axis represented by
<<1,0,0>>.
Example 2
particleShape1.position = rot(position,<<0,1,0>>,0.1);
Suppose your scene has a single-particle object at position <<4,6,0>>, and
you wrote the above runtime expression for its particle shape node. When
you play the scene, the particle rotates in a circular pattern around the Y-axis
(the axis represented by <<0,1,0>>).
In each frame, the particles position rotates 0.1 radian, roughly 5.7 degrees.
Motion
Particle
Expressions
unit
Returns the unit vector corresponding to a vector.
The unit vector has the same direction as the specified vector, but with a
magnitude of 1.
vector unit( vector vector)
vector is the vector whose unit vector you want.
Example
unit(<<1,1,1>>)
Returns <<0.577, 0.577, 0.577>>.
Y
<<1, 1, 1>>
Conversion functions
The following functions convert color scheme values or angle
measurements.
deg_to_rad
Returns the radian equivalent of a degree value. One radian equals roughly
57.29578 degrees.
float deg_to_rad( float degrees )
degrees is the degree angle you want to convert to radians.
Example
deg_to_rad(90)
Returns 1.571, which is the same as pi/2.
rad_to_deg
Returns the degree equivalent of a radian value. One radian equals roughly
57.29578 degrees.
float rad_to_deg(float radians)
radians is the radian angle you want to convert to degrees.
Examples
rad_to_deg(1)
Returns 57.296.
float $pi = 3.1415927;
rad_to_deg($pi)
Returns 180.
hsv_to_rgb
Converts an HSV vector to an RGB vector.
vector hsv_to_rgb(vector hsv)
hsv is a vector representing the hue, saturation, and value components.
Example
hsv_to_rgb(<<1,0.5,0.6>>)
Returns <<0.6, 0.3, 0.3>>.
Tip
To see the relationship between HSV and RGB color components, enter the
Expressions
MEL command colorEditor at the Command Line. This displays the Color
Chooser window.
In the windows hexagonal color wheel, drag the pointer to a color of
interest. The edit boxes in the window list the colors values for hue,
saturation, and valueand their counterpart red, green, and blue values.
Note, however, that the Hue value in the Color Chooser has a range of 0 to
360, while the H component of an HSV vector has a corresponding
proportional range of 0 to 1.
When you launch the Color Chooser by entering colorEditor, its useful only
for learning about color. You cant use it to change the color of objects in
your scene.
rgb_to_hsv
Converts an RGB vector to an HSV vector.
Example
rgb_to_hsv(<<0.6,0.6, 0.6>>)
Returns <<0, 0, 0.6>>.
Array functions
The following functions work with integer, floating point, and vector arrays.
If you need more information, see a reference book on the C programming
language.
clear
Empties the arrays contents, freeing all memory reserved for the array.
After you clear an array, its size is 0. When you no longer need to use an
array, use the clear function to free memory.
int clear(array array)
array is the name of the array you want to clear.
The clear function returns 1 if the function succeeds, 0 if it fails. The return
value is not typically used in expressions.
Example
int $myInts[] = {1,2,3,4,5,6};
print("size of $myInts is: "+size($myInts)+"\n");
clear($myInts);
print("size of $myInts is: "+size($myInts)+"\n");
The third statement above clears the array $myInts.
The second and fourth statements display the following text in the Script
Editor:
size of $myInts is: 6
size of $myInts is: 0
size
Returns the number of elements in an array or the number of characters in a
string.
int size(array array)
int size(string string)
array is the name of the array whose size you want.
string is the string whose number of characters you want.
Example 1
string $s = "Hello";
$stringlen = size($s);
The size($s) function returns 5, then the statement assigns 5 to $stringlen.
Example 2
int $myInts[] = {1,2,3,4,5,6};
$numInts = size($myInts);
The size($myInts) function returns 6, then the statement assigns 6 to
$numInts.
Expressions
sort
Returns an array sorted in alphabetical or ascending numerical order. The
returned array has the same number and type of elements as the original
array.
array sort(array array)
Example 1
int $myInts[] = {3,6,1,4,2,5};
int $afterSorting[] = sort($myInts);
print("After sorting, the array contains:\n");
for ($i = 0; $i < 6; $i = $i + 1)
{
print($afterSorting[$i]+"\n");
}
The sort function sorts the elements of $myInts in ascending order. The
following appears in the Script Editor:
After sorting, the array contains:
1
2
3
4
5
6
Example 2
string $myName[] = {"Peewee","Michael","Kennedy"};
string $afterSorting[] = sort($myName);
print("After sorting, the array contains:\n");
for ($i = 0; $i < 3; $i = $i + 1)
{
print($afterSorting[$i]+"\n");
}
The sort function sorts the elements of $myName in alphabetical order. The
following appears in the Script Editor:
After sorting, the array contains:
Kennedy
Michael
Peewee
gauss
Returns a random floating point number or vector. The number returned
falls within a Gaussian (bell curve) distribution with mean value 0.
float gauss(float stdDev)
vector gauss(float XstdDev, float YstdDev)
vector gauss(vector stdDevVector)
stdDev specifies the value at which one standard deviation occurs along the
distribution. This gives a one-dimensional Gaussian distribution.
XstdDev and YstdDev specify the values for one standard deviation. This
gives a two-dimensional Gaussian distribution in the XY plane. The right
component of the vector returned is 0.
stdDevVector specifies the vector component values for one standard
deviation. This gives a three-dimensional distribution.
Expressions
To control the random values returned by this function, see seed on page
246.
Example
gauss(5)
Returns a random floating point value such as 0.239.
If you were to execute gauss(5) repeatedly and chart the values returned,
they would occur roughly with this frequency:
Mean
-5 0 5
Value returned
If you were to execute gauss(2) repeatedly, return values would occur with
this frequency:
Mean
-2 0 2
Value returned
noise
Returns a random number from -1 to 1 according to a Perlin noise field
generator.
float noise(float number)
float noise(float xnum, float ynum)
float noise(vector vector)
number specifies a number that generates a random number. This gives a
one-dimensional distribution of return values.
xnum and ynum specify numbers for generating a random number. This
gives a two-dimensional distribution of return values.
vector specifies a vector for generating a random number. This gives a three-
dimensional distribution of return values.
If you execute this function with the same argument value repeatedly, the
function returns the same random value each time it executes.
If you execute this function with an argument value that steadily increases
or decreases in fine increments over time, the function returns random
values that increase and decrease over time.
Example 1
Expressions
noise(time)
Returns a value between -1 and 1 each time the expression executes as an
animation plays. Because time increases in fine increments, the values
returned increase and decrease in smooth, yet random, patterns. If you were
to chart the values returned over a period of time, they might occur as in this
figure:
1
Return
value 0
-1
noise(time) as animation plays
Example 2
noise(frame)
Returns a value between -1 and 1 each time the expression executes as an
animation plays. Because frame increases in larger increments, the values
returned increase and decrease in rougher patterns. If you were to chart the
values returned over a period of time, they might occur as in this figure:
1
Return
value 0
-1
noise(frame) as animation plays
The value returned by noise(frame) and noise(time) is the same when frame
contains the same number as time. For example, when frame equals 10,
noise(frame) returns the same value that noise(time) returns when time is 10.
dnoise
Returns a vector with each component containing a random number from -1
to 1. It works like the noise function except it expects and returns a vector
argument. The returned vector represents the gradient of the noise field in
three dimensions.
vector dnoise(vector argument)
argument specifies a vector for generating a random number. This gives a
three-dimensional distribution of return values.
See the noise function for more details on dnoise operation.
Example
dnoise(<<10,20,-30>>)
Returns <<-0.185, 0.441, 0.686>>.
rand
Returns a random floating point number or vector within a range of your
choice.
float rand(float maxnumber)
float rand(float minnumber, float maxnumber)
vector rand(vector maxvector)
vector rand(vector minvector, vector maxvector)
maxnumber specifies the maximum number returned (in the first syntax
format listed above). The minimum number returned is 0. In other words,
the returned value will be a random number between 0 and maxnumber.
minnumber and maxnumber specify the minimum and maximum numbers
returned.
maxvector specifies the maximum value for each component of the vector
returned. The minimum value is 0. Each component returned is a different
random number.
minvector and maxvector specify the minimum and maximum value for each
component of the vector returned.
To control the random values returned by this function, see seed on page
Expressions
246.
Example 1
rand(5)
Returns a random floating point number between 0 and 5, for example,
3.539.
Example 2
rand(-1,1)
Returns a random floating point number between -1 and 1, for example,
0.452.
1
Return
value 0
-1
rand(1,-1) as animation plays
Example 3
rand(<<1,1,1>>)
Returns a random vector in which each component is between 0 and 1, for
example, <<0.532, 0.984, 0.399>>.
Example 4
rand(<<1,1,1>>,<<100,200,300>>)
Returns a random vector in which the left component is between 1 and 100,
the middle component is between 1 and 200, and the right component is
between 1 and 300. An example is <<81.234, 49.095, 166.048>>.
sphrand
Returns a random vector value that exists within a spherical or ellipsoidal
region of your choice. An ellipsoid is a sphere scaled along its X-, Y- or Z-
axes.
vector sphrand(float radius)
vector sphrand(vector vector)
radius is the radius of a sphere in which the returned vector exists.
vector is the radius of an ellipsoid along the X-, Y-, and Z-axis.
To control the random values returned by this function, see seed on page
246.
Example 1
sphrand(1)
Returns a vector whose randomly selected coordinates reside within an
imaginary sphere centered at the origin and with a radius of 1. An example
returned vector is <<0.444, -0.427, 0.764>>.
radius
Example 2
sphrand(<<2,1,1>>)
Returns a vector whose coordinates reside within an ellipsoid centered at the
origin and with a radius of 2 along the X-axis, 1 along the Y-axis, and 1 along
the Z-axis.
Expressions
Radius in Z
2
1
1 Radius in X
Outer bound of
returned value
Radius in Y
seed
Sets a seed value the gauss, rand, and sphrand functions use to generate
random numbers. If you assign a value to the seed then execute the gauss,
rand, or sphrand function repeatedly, an identical sequence of random
numbers is generated. For clarification, see the example below and
Reproducing randomness on page 123.
int seed(int number)
number sets an arbitrary number to be used as the seed value.
Example
Suppose you create a NURBS sphere named Ball then enter this expression:
Ball.translateX = rand(5);
Expressions
Frame Value
1 4.501
2 3.863
3 3.202
4 3.735
5 2.726
6 0.101
Each time you rewind and play the animation, translateX receives the same
sequence of random values.
For different seed values, the sequence of numbers returned will differ. You
cant predict the values in the number sequence based on the value of the
seed.
Frame Value
1 4.725
2 2.628
3 0.189
4 0.004
5 4.834
6 0.775
By changing the seed functions value, you change the sequence of random
numbers generated.
A common mistake while using the seed function follows:
seed(1);
Ball.translateX = rand(5);
When you rewind the animation, Balls translateX attribute receives the
value 4.501. When you play the animation, the translateX attribute receives
4.501 each time the expression executes.
Because you assign a value (1) to the seed before each execution of rand(5),
you initialize the random number sequence. The rand(5) function therefore
returns the first value of the number sequence each time it executes.
Important
When you set a seed value in an expression or MEL script, the seed value
affects the rand, sphrand, and gauss functions in other expressions and
MEL scripts. Such functions are affected by this seed value in all scenes
you open subsequently in the current work session.
Curve functions
The step functions let you make smooth, incrementing transitions between
values.
linstep
Returns a value from 0 to 1 that represents a parameters proportional
distance between a minimum and maximum value. This function lets you
increase an attribute such as opacity from 0 to 1 linearly over a time range.
float linstep(float start, float end, float parameter)
start and end specifies the minimum and maximum values.
parameter is the value you want to use to generate the proportional number.
If parameter is less than start, linstep returns 0.
If parameter is greater than end, linstep returns 1.
Example
Suppose youve used the Particle Tool to create a collection of particles
named Cloud:
Expressions
Suppose further youve added a dyamic per object opacity attribute to Cloud
(see Working with particle attributes in Chapter 8). You then write this
runtime expression for Clouds particle shape node:
CloudShape1.opacity = linstep(0,5,age);
Age Opacity
0.0417 0.0083
0.0833 0.0166
0.125 0.025
0.1667 0.0333
0.2083 0.0417
2.5 0.5
1.0 0.2
3.75 0.75
5 1
5.041 1
5.083 1
10 1
As the table shows, the opacity increases in linear increments for the first 5
seconds of the objects age. At the midpoint of the specified 0 to 5 second age
range, the opacity is 0.5. At 3/4 of the way between 0 and 5 seconds, the
opacity is 0.75. At 5 seconds of the objects age, opacity is 1. After 5 seconds,
the opacity stays at 1.
opacity
0 5
age (in seconds)
Expressions
1
opacity
0 5 10
age (in seconds)
opacity
0 5
age (in seconds)
smoothstep
Returns a value from 0 to 1 that represents a parameters proportional
distance between a minimum and maximum value. The smoothstep function
lets you increase an attribute such as opacity from 0 to 1 gradually, but
nonlinearly, over a time range.
The smoothstep function works like the linstep function, except it increases
values more quickly near the middle values between the minimum and
maximum value. The function uses hermite interpolation between minimum
and maximum values.
float smoothstep(float start, float end, float parameter)
start and end specifies the minimum and maximum values.
parameter is the value you want to use to generate the smoothstep number.
If parameter is less than start, linstep returns 0.
If parameter is greater than end, linstep returns 1.
parameter
smoothstep linstep
start end
Example
Suppose youve used the Particle Tool to create a collection of particles
named Cloud:
Expressions
Suppose also youve added a dynamic per object opacity attribute to Cloud
(see Working with particle attributes in Chapter 8). You then write this
runtime expression for Clouds particle shape node:
CloudShape1.opacity = smoothstep(0,5,age);
opacity
0 5
age (in seconds)
hermite
Returns values along a hermite curve. You can use the hermite function, for
instance, to move a particle objects position smoothly along a curve. As the
examples in the following pages show, you can create various curve shapes
by altering the arguments to the hermite function.
vector hermite(vector start, vector end, vector tan1, vector tan2, float parameter)
float hermite(float start, float end, float tan1, float tan2, float parameter)
start is the start point of the curve.
end is the end point of the curve.
tan1 is the tangent vector that guides the direction and shape of the curve as
it leaves the start point of the curve. The vectors position starts at the start
point of the curve.
tan2 is the tangent vector that guides the direction and shape of the curve as
it approaches the end point of the curve. The vectors position starts at the
end point of the curve.
parameter is an floating point value between 0 and 1, for example, the value
returned by a linstep function.
In the second format, the arguments and return values work in a single
dimension.
Example 1
Suppose you create an object named dust made of one particle at the origin.
To guide its motion along a short upward-bound curve for the first four
seconds of animation, you can write the following runtime expression:
dust.position = hermite(<<0,0,0>>,<<2,2,0>>,
<<3,0,0>>, <<0,3,0>>, linstep(0,4,time));
When you play the animation, the particle moves from the start point
<0,0,0> along a curve to the end point <2,2,0>. The tangent vector <3,0,0>
sets the curves direction and shape as it leaves the start point. The tangent
vector <0,3,0> sets the curves direction and shape as it approaches the end
point.
From zero to four seconds of animation play, the particle moves along the
curve as defined by the linstep function. (See page 249 for details on linstep.)
The function arguments and resulting path of the object follow:
Y
tan2 = <<0,3,0>>
Expressions
end = <<2,2,0>>
Objects path
Example 2
Suppose you change the third argument of the previous example expression
to <<6,0,0>>:
dust.position = hermite(<<0,0,0>>,<<2,2,0>>,
<<6,0,0>>, <<0,3,0>>, linstep(0,4,time));
The slope of the path curve steepens because of the longer tan1 vector:
Y tan2 = <<0,3,0>>
end = <<2,2,0>>
Objects path
X
start = <<0,0,0>> tan1 = <<6,0,0>>
Example 3
The following expression moves dust in an S pattern:
dust.position = hermite(<<0,0,0>>,<<2,0,0>>,
<<0,3,0>>, <<0,3,0>>, linstep(0,4,time));
The tan1 vector <<0,3,0>> sets the direction of the curve from the start point
to a positive Y direction. The tan2 vector <<0,3,0>> sets the direction of the
curve to a positive Y direction as it approaches the end point.
Values between the start and end point curves are interpolated to form an S
pattern.
Example 4
Suppose you change the fourth argument of the previous example
expression to <<0,-3,0>>:
dust.position = hermite(<<0,0,0>>,<<2,0,0>>,
<<0,3,0>>, <<0,-3,0>>, linstep(0,4,time));
The dust particle moves in a pattern resembling a half-circle:
tan1 = <<0,3,0>>
Expressions
tan2 = <<0,-3,0>>
The tan1 vector <<0,3,0>> sets the direction of the curve from the start point
to a positive Y direction. The tan2 vector <<0,-3,0>> sets the direction of the
curve to a negative Y direction as it approaches the end point.
Example 5
Suppose you change the third argument of the preceding example to
<<0,10,0>>:
dust.position = hermite(<<0,0,0>>,<<2,0,0>>,
<<0,10,0>>, <<0,-3,0>>, linstep(0,4,time));
Y
tan1 = <<0,10,0>>
tan2 = <<0,-3,0>>
Because of the longer tan1 vector, the slope of the path curve steepens as it
rises from the start point. Because the tan2 vector has a smaller Y magnitude
than the Y magnitude of the tan1 vector, the slope of the path curve is flatter
as it approaches the end point. The curves rise in the Y direction is greater
than the previous example because the magnitude of tan1s Y component is
larger (10 instead of 3).
General commands
The following functions do various actions in Maya.
eval
Executes a MEL command.
string eval(string command)
command is either a command string enclosed in quote marks or a string
variable containing a command.
The returned value contains command output returned by the commands
execution.
Example 1
eval("select -cl")
Executes the command select -cl, which deselects all objects in the scene.
Though the return value is not used in this example, it contains the
command output.
Example 2
string $cmd = "select -cl";
Expressions
eval($cmd);
The first statement assigns the command string select -cl to the string variable
$cmd. The second statement executes the contents of $cmd, which is the
command select -cl.
Example 3
string $mycommand = "sphere";
eval($mycommand+"-r 5");
The first statement assigns the string sphere to the variable $mycommand.
The second statement appends -r 5 to the string sphere and executes the
complete command sphere -r 5. This creates a sphere with a radius of 5 grid
units.
Example 4
string $a[];
$a = eval("ls -lights");
print($a);
The first statement defines an array of strings named $a. The second
statement executes the MEL command ls -lights, then assigns the commands
output to array $a. The third statement displays the contents of $a to the
Script Editor as follows:
ambientLightShape1
directionalLightShape1
Note that each line of command output appears on a new line. Each
command output line is an array element. Maya formats array output with
each array element on a new line.
Example 5
Suppose youve created a MEL script file named bunk.mel in your Maya
scripts directory and it contains this procedure:
global proc string bunk()
{
string $fog;
if (rand(2) < 1)
$fog = "particle";
else
$fog = "sphere";
return $fog;
}
Further suppose you create this expression:
string $name = bunk();
eval($name);
print($name);
The first expression statement executes the bunk() procedure in the
bunk.mel script file. In the bunk procedure, the if-else statement generates a
random floating point value between 0 and 2, then compares its value to 1.
If the value is less than 1, the statement assigns the MEL command string
particle to $fog. If the value is greater than 1, $fog receives the command
string sphere.
The procedure finishes executing and passes the value of $fog back to the
calling procedure, bunk() in the expression. This assigns the command string
to the variable $name.
The eval function executes the command string stored in the $name. For
example, the statement might execute particle, which creates a particle at the
origin of the workspace.
The fourth statement displays the contents of $name, for example, particle.
The expression executes each frame and creates a new particle or sphere.
print
Displays text in the Script Editor. You can use this function to display the
contents of attributes and variables. This is helpful for debugging an
expression.
print(string text)
print(vector number)
print(float number)
print(int number)
print(array number)
Expressions
text is either a string enclosed in quote marks or an attribute name or string
variable containing text.
number is a number without the quote marks. Numerical arguments display
as strings.
There is no returned value for this function.
Note the following display considerations.
You can format displayed text with standard C language escape characters.
For example, you can create a new line with \n or a tab character with
\t in the argument.
Displaying a floating point value shows the number with up to 10 digits to
the right of the decimal point, for example 0.3333333333.
Insignificant 0 digits are truncated from floating point numbers. For
example, floating point number 2.0 is displayed as 2.
int "3.14" 3
As shown in the last row of the table, if a variable is assigned a string that
starts with a nonnumerical character, Maya converts the string to 0.
For a nonparticle expression consisting of only print statements, Always
Evaluate must be on in the Expression Editor for the expression to execute.
Examples
print(time);
print("\n");
The first statement displays the value of time. The second statement displays
a new-line character after the value of time, so the time appears on a
separate line in the Script Editor.
float $f = 3.14159;
print($f);
Displays the floating point number 3.14159.
string $s = "Hello There";
print($s);
Displays the string Hello There.
vector $v;
$v = <<1.2,2.3,3.4>>;
print($v);
Displays the vector as 1.2 2.3 3.4.
string $a[];
$a = eval("ls -lights");
print($a+" are the lights in my scene.\n");
The print function causes an error message because you cannot use the +
Expressions
operator with a string array.
system
Passes a UNIX command to the shell where you launched Maya.
int system( string command)
command is either a command string enclosed in quote marks or a string
variable containing a command.
The returned value is the output resulting from the commands execution.
Example
string $cmdout;
$cmdout = system("date");
print($cmdout+"\n");
Executes the UNIX date command, which outputs your workstations date
and time to the $cmdout variable. The final statement displays the date in
the Script Editor.
pwd fwrite
source fread
trace filetest
warning
whatIs
degrees 29
converting to radians 129,
E executing
MEL commands in
234 e raised to power 214 expressions 137
deleting Edit button 22 MEL commands with eval
attribute names 131 function 259
editing expressions
expressions 112, 134 MEL procedures in
in text field 99, 105
text from expressions 105 expressions 139
else keyword 38 nonparticle expressions 118
depthSort 197
else-if statements 71 UNIX commands in
discarded remainders in data type
emitted particles expressions 263
conversions 146
age of 149 execution
disconnectAttr command 132
assigning lifespanPP for 183 slow expression 127
disconnecting an attribute 132 creation expression execution exp function 214
displaying and 149
exponential functions 214
attribute contents 123 working with 183
disconnected attributes 132 Expression Editor
English common names for
text 261 starting 13
attributes 114
variable contents 123 equal to (==) operator 36
dnoise function 242 errors
do loop 78 common expression 95
dollar sign ($) in variable comparing floats with the ==
names 59, 73 operator 89
dot function 231 from wrong data types in
dot product 231 functions 208
in flow control statements 88
dot product operator 64
logic 95
double angle brackets 53, 73,
message format of 95
180, 193
syntax 36, 73, 95
dynamic attributes 49
where they appear 96
adding to object 49, 50, 161
eval function 259
dynamic per object attribute
event 198
example assignment to
lifespan 167 event attribute 184
when collision count
dynamic per particle attribute
increases 187
example assignment to
lifespanPP 164 eventCount 198
dynamics eventCount attribute 184
changing start frame 149 eventTest 198
how often Maya eventTest attribute 184
evaluates 149, 152 examining two or more
Dynamics Controller 149, 152 expressions 106
dynamicsWeight 198
dynamicsWeight attribute 178
goalWeight 198
gravity field
jot text editor 107
M
accelerations effect on 177 mag function 231
K magnitude of a vector 67, 231
mass 199
H keyframes
eliminating expression to matrix data type 55
half-circle use 122 max function 212
creating motion with hermite keywords in expressions 76 maxCount 199
function 257 measurement units 127
hermite function 254 MEL commands 45, 46
HSV conversion to RGB 235 L executing with eval
hsv_to_rgb function 235 function 259
levelOfDetail 199 using alone in
hypot function 229
lifespan 198 statements 137
lifespan attribute 161 using with eval function 138
example assignment in using within single
I creation expression 167 quotes 138
if statements 32, 34, 69 Lifespan button 161 MEL procedures
lifespanPP 199 using in expressions 138
if-else abbreviation 86
lifespanPP attribute 161, 164 MEL scripts 46
if-else statements 38, 39, 70
assigning for emitted millimeters 128
incandescence 198
particles 183 min function 212
incandescencePP 198
limit functions 209 mixed data types
increment operations and
unexpected values 142 lineWidth 199 using with arithmetic
linking attributes 11, 15, 26 operators 145
inheritFactor 198
linstep function 249 modulus operator (%) 63, 182,
initial state attributes 158, 162,
comparison with 192
163
smoothstep 253 risk of using with floats 182
creation expression
execution 150 listAttributes MEL command 163 motion
naming convention 163 log base 10 214 creating jittery 175
saving values for 158 creating smooth, random 175
log function 214
input to expressions 135 multiCount 199
logic errors 95
integers 52, 57 multiRadius 199
logical operators 67
handling as floating point 65 && 67
internal conversion of units 127 || 67
isDynamic 198 long attribute names 114 N
looping errors 88 natural logarithm 214
new line characters in print
J statement 261
joining text in strings 262
velocity attribute
assigning with creation
expression 150
assigning with runtime
expression 153, 154
fields effect on 175
working with 175
vi text editor 107
vim text editor 107
visibleInReflections 201
visibleInRefractions 201
W
while loop 77
white space in expressions 74
WINEDITOR setting 109, 110
X
xemacs text editor 107
1
Development and create it using the same type of production
process most animation studios employ. It only
takes a little extra time to develop a good idea
This book is about animating characters in for a 3D project then it does to just sit down
Maya. One of the most amazing things about and start clicking away doing what the
Maya is that it allows you to create complicated computer wants to do instead of what you may
organic looking characters and animate them want to see as an end result of all those hours.
rather quickly. The challenge now seems to be The best design tool is a pencil which is where
coming up with fresh original characters and we will begin generating ideas. We have all
story ideas. As computers get faster and 3D seen animations that were technically perfect or
programs become easier to use, visual had great 3D characters but left us feeling like
storytelling skills become more valuable. the story was not really there and that a great
deal of time had been wasted. These next three
chapters of conceptual development will help
The first three chapters of this book will take
prevent that from happening with your 3D
you though a conceptual development process
projects.
that will help you become a better visual
storyteller, character designer and 3D animator.
The first step is learning how to generate story This book is arrange in a tutorial process.
ideas for fresh 3D characters and animations in We invite you to follow along to create your
Maya. The next chapter deals with 3D own award winning Maya animations based on
character design and how to create original the ideas presented in this book.
characters that will leap off the screen visually
and grab your audience emotionally. The third
chapter will introduce some basic visual Top 10 Reasons To
storytelling concepts including story boarding, Become A Visual Storytelling
camera shots, color maps, timing and creating Expert
an animatic. The goal of these first three
chapters is to help you think up solid short
stories that can be created by one person in 1) To get the job you want. Most people
Maya for use on demo reels, animation festivals will hire animators who understand how to
or to develop your own TV show or feature compose a shot and design a good character
film. You may also just want to improve your over people who are more technically oriented
ability to design and compose animated stories, and consider their artistic and conceptual skills
characters and shots. limited.
George Lucas thinks the next Star Wars is 2) To win an animation festival. And get
going to made on a desktop computer. Maya is the job you want because someone saw your
the type of the software that gives 3D artists the piece in the festival or maybe to pitch a TV
power to create their own TV shows and films. series based on your characters to the head of
What kinds of stories do you have to tell that Comedy Central who happened to be in the
might be considered the next Star Wars? audience and loved your animation.
2
RU.MAYA 99 MAYA Character Animation
6) Visual storytelling skills will become In order to become a better visual storyteller
mandatory in the very near future. and 3D animator you need to spend some time
Computers are getting faster and easier to use studying some other areas between your
everyday. Artistic skills are becoming more in renderings. If you want to be a really good 3D
demand in the animation field. Already person you should be taking classes, reading
traditional 2D animators are sought out to books and learning as much as you can about
animate and keyframe 3D characters. the following subjects:
Technical skills and knowing which button to
push will become less important in the future as
interfaces improve. You can teach an artist to Figure Drawing
use a computer but not always teach a computer
person to be an artist as quickly.
If you do not know how to draw really well
you will have a rough time as a professional
7) Huge content markets are opening up animator these days. You use to be able to get
for original animations. When video by not knowing how to draw but that is
streaming hits the internet with TV type speed changing fast. Draw as much as possible. Try
and quality there will be a big market for to fit in at least 9 hours a week of figure
original animated shorts and series. There are drawing off a nude model. Concentrate on
also lots of other new options such as the digital getting the energy of the pose quickly with
TV market, animations festivals and short gesture drawings. Check local art schools
commercial work. for life drawing classes and open studios. You
have to be able to draw to communicate your
ideas, storyboard and understand light,
8) It takes a long time to get good at visual
composition, color and values. Life drawing
storytelling so you should start now. Being a
also keeps your eye finely tuned to the nuances
good visual artist and animator is a life long
of how to really see things like shadows and
process that can never start too soon.
light. Most places you apply for animation jobs
3
MAYA Character Animation RU.MAYA 99
2D Animation
4
RU.MAYA 99 MAYA Character Animation
the process involved if you try to recreate a nice about how important dramatic lighting can be to
layout with pictures and professional type. This a 3D scene. Take a figure sculpture class with
will also makes the credit sequences of your clay to help make little models of 3D characters 1
animated projects look more professional. you may want to animate one day. The
Artists Way is great artistic survival book for
people embarking on creative careers and will
Sacred geometry will also help you design
also help you think of yourself more as an artist
sets and characters. A Beginners Guide To
if you feel weak in this area.
Constructing The Universe by Michael
Schneider is a great books to get you started in
this fascinating and useful subject. Photography
5
MAYA Character Animation RU.MAYA 99
will be developed in these first three chapters to The first step to showing off a really great 3D
give you an idea of the conceptual design animated character is coming up with a good
1 process for 3D animated projects. story that you can then mold into a deeply
satisfying emotional ride.
6
RU.MAYA 99 MAYA Character Animation
7
MAYA Character Animation RU.MAYA 99
This character would be good for mythic What other movies can you think of that
story full of legends and magic. follow this hero journey formula?
Read Joseph Campbells book Hero Of A 7) Software Capabilities - What does Maya
1000 Faces to get a better understanding of do that youve heard about or seen that you are
how to create really solid hero journeys. dying to try? Perhaps you just got the new
Another great book for hero stories is The cloth plug-in and suddenly want to do a
Writers Journey by Christopher Vogler. The futuristic fashion show. Every time you get a
basic story happens in these steps: new software capability brainstorm at least 50
different uses for it in your story lines. This
will force you to come up with ideas beyond
The Heros Journey the first few everyone thinks about. Try to do
1.1) Normal person in ordinary world with what your software does best. Maya is know
limited awareness of bigger problem. for character animation so you might not want
2.1) Call to adventure. Event occurs that to try to do a huge city getting washed away by
thrusts main character into uncommon situation a tidal wave in Maya for your first project.
requiring great amounts of courage. awareness Most animation houses use several different
of problem increases. software packages to get what each one does
3.1) A refusal of the call may occur that best for the job. Create a table like the one
8
RU.MAYA 99 MAYA Character Animation
9
MAYA Character Animation RU.MAYA 99
10
RU.MAYA 99 MAYA Character Animation
3D worthy.
11
MAYA Character Animation RU.MAYA 99
1000 gold cobras on head, sand for home to planet 2. your eyes get burned out by staring
12
RU.MAYA 99 MAYA Character Animation
something. descriptive.
13
MAYA Character Animation RU.MAYA 99
settings until you find one that makes the most who lives in a space station who wants to win
sense or sounds interesting. Add a motivation the futuristic Frisbee trick competition.
1 that would fit with the character and setting you
have already combined. Cross each one off as 9. It is a story about a red blood cell who
you use them so that you will not use them lives inside a human heart and wants to go to
again. beyond the edges of his known world.
Here is an example list of twenty taken from 10. It is a story about a biker bumblebee who
the previous brainstorming chart to give you an lives in a sub terrain world run by rats who
idea of the combination techniques. Do not wants to rob the ultimate honey bank.
worry about grammar or sentence structure -
just get the necessary information in the 11. It is a story about a shape shifting
sentence. You can also add or delete little twists humanoid alien who lives in an organic pirate
or details that will make the ideas hold together ship who wants to kidnap all earth woman and
better but try to stick as close to your original sell them to other planets.
list as possible. Do not worry about the
obstacles yet. 12. It is a story about spider with a human
head who lives in a swamp world who wants to
1. It is a story about a robot dog who lives rule the world.
futuristic factory run by robots with human
slaves who wants to hunt down an evil poacher. 13. It is a story about evil toy wookie doll
who lives on a space station and wants to kill
2. It is a story about an obese kung-fu warrior bad aliens invading the ships through the
who lives in a Hopi type village who wants to children.
get enlightened by going through intense
training. 14. It is a story about a sunflower opera
singer who lives inside a magical forest with
3. It is a story about 500 year old Chinese talking Redwood trees who wants to make the
woman who lives in a haunted castle who whole galaxy a peaceful place by singing her
wants to get rich by inventing new happy drug. beautiful songs.
4. It is a story about Mayan statue king who 15. It is a story about a race of people
lives on an alien planet made of fluffy clouds without ears or mouths who live in a sand
who wants to get the girl of his dreams. world who want to find another planet to live
on to survive.
5. It is a story about of a 3D avatar techno DJ
who lives in a metaverse internet world who 16. It is a story about lizard headed
wants to keep an evil virus from killing humanoids who live inside a huge beehive and
everything. want to fly the beehive back to their own planet
far away.
6. It is a story about alien octopus who eats
airplanes who lives in a city deep below the 17. It is a story about animated talking
ocean floor and wants to win a dance contest at constellations who live above a glass world
a galactic competition. who want to make everyone worship them as
gods.
7. It is a story about an Atlantis crystal
princess who lives in an ancient tomb who 18. It is a story about an alligator biped race
wants to get rid of half the worlds population. of drunks who live in an futuristic aquarium
who want to win the annual speed around the
8. It is a story about an ultimate Frisbee pig big tank species race.
14
RU.MAYA 99 MAYA Character Animation
19. It is a story about medusa headed woman 1. It is a story about a geometric style dog
made of dirt sin who lives in a ice crystal city who lives in a dog town and wants to break 1
who wants to learn to be psychic at a militant into the butcher shop.
institute.
2. It is a story about a ghost Great Dane who
20. It is a story about a snake headed 2 lives in a vast bone yard wonderland who
legged humanoid who lives inside the belly of a wants to win the ghost pet dog show.
great beast who wants to stop the bomb it just
swallowed from exploding. 3. It is a story about an Irish Setter movie
starlet dog that walks like a woman who lives
in a doggie amusement park and wants to be
Brainstorming Chart For queen.
Particular Themes
THREE ACT STRUCTURE
Not all of the ideas you come up with will
work well enough to develop into 3D Once you get the hang of creating story
animations. If you did a good list of 60 rows concept sentences you can then use them to
for each of the columns, you may only have generate three act structure animations. Start by
two or three good ideas at the end. If you feel choosing your favorite story concept sentence
you have only a very few good ideas try from the brain storming list you created.
limiting your brainstorming lists to themes that
interest you. Some example themes include: Keep adding to your brain storming lists and
alien worlds, gothic fantasies, medieval samurai making up new ones. Experiment with the
or dog stories. theme lists to help tailor the stories for specific
genres. The strange thing about ideas is that
The following chart is a brief example of the you always seem to have a lots of them until
dog stories theme: (format in script font same you really need one. Dedicate one drawing
as other chart) book to brain storming story concept lists,
sentences and three act structure points.
3D Characters 3D
WHAT IS THREE ACT
Settings Motivations
STRUCTURE?
Obstacles (2)
geometric stylized dog made out of primitives Once you have a basic idea you can put into
vast bone yard wonderland to be king/queen the story concept sentence it is easier to flesh
of the local dog park current top dog is out the meat of an animated story. The idea of
trying to kill you three act structure has been around since
your owner has abandoned you ancient oral story telling traditions. Greek
ghost pet Great Dane dog doggie playwrights founded the term and it is still used
amusement park to win the dog show you today in most of our modern stories. Three act
just broke out in a hot spot rash structure permeates almost every aspects of
the announcers voice hurts your ears commercial entertainment. TV shows, feature
Irish Setter movie starlet that walks like a films, animated shows, books, operas and plays
woman in heels big dog town with little dog all follow the three act formula.
houses to break into the butcher shop you
are trapped inside your own house There are lots of debates about the use of
Bulldog guard dog twice your size & mean three act structure among conceptual artists and
experimental abstract film makers. The danger
15
MAYA Character Animation RU.MAYA 99
of not using three act structure is that people are problems. Without this event there would be no
use to it, expect it and get a little frustrated and a story.
1 confused with your animation if you do not
give them a satisfactory story experience. It is a FIRST TURNING POINT: 55-65 seconds
big risk to embark on a story without three act - Fresh turn of action for a story. Plot twists.
structure, especially when utilizing something Surprise changes in story direction and
as expensive and time consuming as 3D motivation for the main character. Escalation of
animation. You should master three act obstacles with new and bigger obstacles
structure before diving into any sort of abstract introduced.
free form story lines or experimental ideas.
CLIMAX: 90 - 95 seconds - Point of the
Stories are broken into three parts called acts. greatest intensity. Your goal here is to get the
The first act is where the set up for the story audience sitting at the edge of their seats fully
occurs, main characters are introduced and the engaged in this moment of your story. This will
look and feel is established. In act two there is be the hardest plot point to successfully
build up of story tension with a lots of action, execute. If your audience is not emotionally
conflict, obstacles and difficult situation that the entrenched in your story they will not
main character must confront and overcome. experience a point of greatest intensity that feels
Act three ties the story up and resolves the satisfying. This build up of incredible tension
situations presented. also needs to be timed perfectly with the other
plot points. If you climax the story too early it
will leave the audience feeling flat at the end.
Shown above is a graphical representation of Most people fail to make their story climaxes
three act structure. The upward curve strong enough in general. This sequence is
represents the dramatic tension build up of the often the most important and expensive series
story resulting in the climax at the top of the of shots in a 3D animation or film with special
curve. The points of the curve represents FX.
timing of particular events or turning points in
the story line. Notice that act one and act three FINAL CONFRONTATION: 100 - 110
are the same length, each being about one seconds - Confrontation between two main
quarter of the story. Act two is twice as long characters that has been building up throughout
and comprises half of the story in the middle the story finally happens. Hero and villain
section. You can use these plot points to figure battle to the death, love interests have a point of
out the timing for when certain events should reckoning or groups of opposing characters
occur in your story. Most Hollywood screen meet head on and battle it out over a brewing
plays are 120 pages or minutes. We will be issue.
doing a two minute story for this example
which breaks down to 120 seconds to use the RESOLUTION: 105 - 120 seconds - Ties
same formula. If you were doing a four minute up loose ends of the story. Does the boy finally
animation just double the seconds for each part. get the girl after saving the world? Do the
Estimate for other lengths accordingly. characters live happily ever? How does going
through this experience change the characters
SET UP: 0 - 30 seconds - define a status or situations?
quo (What is normal?) Introduce a main
character, foreshadow subplots, introduce mood Let us now break up some popular films with
and setting. these plot points. The movies Titanic and Star
Wars will be used as examples since most
CATALYST: 25 - 30 seconds - This is a people have seen these movies. Three act
event that changes a status quo. Forces a structure for the movie Titanic is as follows:
character to act and introduces conflict or
16
RU.MAYA 99 MAYA Character Animation
SET UP: We meet Rose, a young wealthy reveals that she has had the diamond all long
woman, and Jack, a poor young artist as they and throws it over board. We also see how the
board the famous ship for its maiden voyage. sinking of this ship and the subsequent search 1
Subplot starts comparing rich vs. poor for the neckless has affected all the characters
passengers and how life aboard ship reflects lives.
this idea through accommodations, dining
experiences and entertainment. There is also a
main motivation on the part of the salvage Three act structure for the movie, Star Wars,
captain to find the lost diamond Rose was is as follows:
wearing when the ship sank. This allows
Cameron to go backwards and forwards in time SET UP: We meet the princess who gets
to let you discover the story and piece it captured by Darth Vader and get a taste of the
together at the same pace as the captain of the light and dark sides of this galactic war. We
salvage ship. Would you have cared as much then meet Luke on his an planet as a restless
about Rose and Jack if it would have been a young man ripe for an adventure.
linear story where it started with Rose and Jack
just getting on the boat? Ask yourself why they CATALYST: Luke decides to leave his
do things like this in films. We will talk more home and help Obi Wan get the plans to the
about this in Chapter two. rebel planet after his family is killed. If Luke
had decided not to go there would not have
CATALYST: Jack and Rose meet when been much of a story.
Rose tries to kill herself by jumping off the
edge of the ship. They start to fall in love. If FIRST TURNING POINT: They find out
Jack and Rose had never met there would not the rebel planet has been destroyed and
of been much of a story. You would not have discover that the princess is being held captive
cared who survived unless you were on the death star which is also a big new threat.
emotionally involved with one or two main
characters on a deeper level. FINAL CONFRONTATION: Obi won
fights Darth Vader to the death to settle a long
FIRST TURNING POINT: The ship hits dispute.
the iceberg. Jack and Rose then quickly
discover that they have two hours to figure out CLIMAX: Use the force Luke as Luke
how to survive and stay together. Fresh flies in for the final chance to destroy the death
direction for the story line. star and save the rebel planet.
CLIMAX: Jack yells to Rose This is it! as RESOLUTION: Luke returns to the
the ships bow is erect in the water ready to princess as a hero.
finally sink into the icy sea. Most expensive
shot in the film as the ship plunges into water Notice how in Star Wars the final
with people falling all over the place. The confrontation occurs before the climax. This
audience has been waiting for this event the happens occasionally so keep an eye on where
whole film. it may work to your advantage to make the
story stronger and the climax more powerful.
FINAL CONFRONTATION: Life boat full
of rich passengers argue about whether or not GOOD REASONS TO USE
to try to save people screaming in water. Wraps
up the subplot of class differences presented
THREE ACT STRUCTURE
throughout the movie.
1. Guarantees good solid story structure in a
RESOLUTION: Rose as a old woman proven formula that works.
17
MAYA Character Animation RU.MAYA 99
Now choose your favorite story concept RESOLUTION: Everyone on the internet
sentence from the list you have generated. Fill tuned into the broadcast feels good about new
in three act structure plot points for your idea as software and experiences the peak moment
demonstrated below in our example story induced frequency.
Media Man In The Net.
18
RU.MAYA 99 MAYA Character Animation
19
MAYA Character Animation RU.MAYA 99
prepares to upload the anti virus software. Vax wrong with security as Evil Virus comes up
breaks in and says two minutes to launch as behind him and starts to spin radiating these
1 MM loads in software. slimy tentacles that splash a rain swarm of virus
worms over across MM who immediately
This is rough design for The Core becomes infected. The Core sees this from the
character who is hooked into a machine that corner of her eye and starts to scream out in fear
generates emotions via 3D computer graphic as the virus heads towards her.
visuals.
16. We watch as crowds faces go from
happy to screaming scary as the core is attacked
9. We see the evil virus lord break out of the by evil virus lord. Vax is now trance locked on
glass cage and kill the scientist who made him the screen too and screaming.
then flee down the Metaverse streets heading
towards Cyberdome. 17. MM pulls himself up and inserts a
backup experimental AI anti virus dose into
10. The core during a routine test with the security system which starts to bring it back on
new anti virus software starts to jerk spastic ally line. Virus sees him and they fight it out with
telling MM something is wrong. MM checks core helping and the audience going through all
and says it is corrupted and that he does not the emotions at the same time from watching
understand since the Mole has always given the screen patterns generate.
him the best and most honorable code before.
MM also announces all security systems are off 18. MM defeats virus in some ingenious
line. way. Core and him profess love for each and
all of crowd goes into love mode watching
11. We see Evil virus waiting outside screen as MM and Core stare into each other s
Cyberdome gate as it suddenly flies open and eyes then turn off live emotion feed.
he passes through the security points easily
cloaked. 19. Crowd looks all loving as screen at party
goes to black and Vax snaps out of phase lock
12. Vax back at the party is trying to raise into his announcer role as everyone starts to
MM on his laptop while on stage in front of cheer enthusiastically.
thousands of people for the big live internet
launch. MM says something is wrong. Vax CREATING ROUGH
tells him to fix it fast and continue with launch
since nothing can stop it from happening at this
THUMBNAILS
point.
It is now time to test the visual potential of
13. Core comes back on-line after MM goes your story. If the story seems hard to draw into
to back up system. Core starts to broadcast individual scenes it may not be visual enough
new emotion frequency of sacred geometry and need some reworking. You are on the right
patterns onto party screen behind Vax at the track if you can immediately think up lots of
event. Vax is explaining how this new software Wow camera shots for the thumbnails.
will be like a drug to induce emotional states.
At this point, it is very useful to know how to
14. Cut to audience who is staring at screen draw. This first pass at thumbnails is just to get
and change from mildly interesting to radiantly a feel for the story and possible obvious camera
happy as we cut back and forth from core to
crowd and screen.
20
RU.MAYA 99 MAYA Character Animation
Some rough initial thumbnails for the 4. Do you have a solid three act structure
Media Man In The Net story. with pacing your plot points in the right place?
21
MAYA Character Animation RU.MAYA 99
22
RU.MAYA 99 MAYA Character Animation
product with a countdown to add timing tension wants a good software product launch. Virus
in back ground. Subtitles for Metaverse intro wants to kill Cyberdome systems.
so people immediately know where the story 1
takes place Metaverse 3D Internet Node 8. Is there a good reason to do your story in
2020. 3d?
3. Is it a clever and original idea? Its a 3D internet world so yes this makes
sense since all of the technology is headed this
This is the weakest point in this story. way and people would probably like to see
Sounds derivative of Reboot, Tron, Lawn what the internet may look like in 20 years.
Mower Man and other take offs. Hopefully the Adding the live footage of the techno party
sacred geometry and 3D internet mixed with people helps break up the visual styles and adds
live action will save the idea. Needs more feed a sense of realism too.
back from neutral third parties.
9. Get feedback and incorporate changes
4. Do you have solid three act structure with into your story lines.
the pacing your plot points in the right place?
Feedback from the guys was to make it
Three act structure seems to be working fine less cheesy and more edgy.
since we did plot points ahead of time and stuck
to pacing between events. Climax is very
tension filled with lots of high stake emotions COMMON 3D ANIMATED
from different places riding on the outcome.
Live feed, product launch, security down, virus
PLOT PITFALLS TO AVOID
attack, love interest threatened, death to main
characters threatened and audience fed into
emotions of violent struggle gone bad builds 1) Avoid A Linear Progression Of Events
tension visually with sacred geometry visuals
on screen too. Your story will sound flat and boring if
events just happen too casually or easily for the
characters. You need some unexpected twists
5. Do the main characters leap off the page and turns in your story that keeps the audience
visually, how strong appeal and originality? guessing as to what will happen next. Do not
make things too obvious or convenient for your
See Chapter 2 where the main characters get characters or the story will seem contrived and
a good work over. fake. This is the most common problem in 3D
animations conceived by people unfamiliar with
telling visual stories.
6. Does the story evoke a good range of
strong emotions in both characters and 2) Animals/Inanimate Objects In Human
audiences? World/Situations
Audience should key into every aspect of If you are doing a biker rat story do not put
emotion since the main story line is based on a your rats in a human biker bar. Put them in a
product that generates emotions visually. Nice sewer rat hole with settings that feel authentic to
range of emotions too. what rats would use to decorate a biker bar like
bottle cap stools and used tin can tables. Have
7. Are all the characters motivation clear? them talk about what rats are concerned about
like some new sticky foot trap or poison pellets
Yes, MM wants to win Cores heart. Vax that look like cheese.
23
MAYA Character Animation RU.MAYA 99
24
RU.MAYA 99 MAYA Character Animation
events are happening too fast to digest stiff sentences that some actors and characters
emotionally and huge gaps in the story seem to speak. Use a tape recorder and try to mimic the
be appear every few seconds. characters in your story with a friend talking out 1
the ideas that need to be communicated and
Try to take a small interesting piece of the sample dialogue tracks. Listening to it later you
script and make it strong enough to stand alone will most likely be able to tell which lines or
as a festival piece. This approach will give you phrases work and which ones are not spoken
more of an opportunity to fully develop the naturally. It is a good idea to tape record your
characters in more subtle ways and make the entire story much like a book on tape once you
story deeper with a good look and feel potential have the general idea to hear how it sounds and
that will reflect more of what you had in mind to hear if it is working. You will also be able to
for the original piece as a whole. get a sense of the timing from doing a tape
version of your story which we will discuss
Festivals are littered with animation type more in Chapter 3.
trailers that show lots of hard work on the
screen but leave audiences feeling dazed and
confused as to what the story is about which If you have followed all the steps in this
means no emotion and no points for chapter and incorporated all the feedback you
professional storytelling discretion. Better to should have a good sense of an idea for your
tell a short slow simple story full of emotions Maya 3D animation. You are now ready to
then a fast choppy confusing action packed concentrate on the character design and
trailer whirlwind no one will understand or development aspects of your rough story idea.
remember much about later. Remember that coming up with a good 3D idea
to animate takes practice and lots of creative
6) Fear of Dialogue thinking. It is challenging to create really good
short form 3D animations and you need to
The phrase lip sink can send some 3D patient with yourself as you learn how to tell
animators into a panic attack. This book will visual stories. The more 3D conceptual design
cover several techniques for making your 3D skills you begin master the more fun you will
characters talk easily and quickly. Use dialogue have creating amazing 3D animations using a
in your stories when appropriate. People glean powerful tool such as Maya.
a great deal of information about characters
from their voices and how they talk. Back in
the old days (a few years ago) it was much
harder to do character animation of any kind
and you did not see many talking 3D
characters. With programs like Maya you can
now realistically do dialogue and enrich your
story lines in the process. Audiences in general
respond better and identify more with
characters that talk. You do want to have your
characters talk all the time since you are doing
an animation , but a little dialogue goes a long
way in making your story stronger.
25
Chapter 2 Character Design
MAYA Character Animation RU.MAYA 99
Character Types
There are lots of different types of characters
that are well suited for 3D. Listed below is list
to get you started. Add to this list as you see
more and more 3D characters to give you a
broad selection of brainstorming types to think
of fresh approaches. Try designing the same
characters in different types such as a biped,
quadruped and wing creature. You may have
first thought that the character would be a biped
but see something coming out in the winged
creature with possibly four legs that may work
2
RU.MAYA 99 MAYA Character Animation
creature type of feel. really well you should try to get the basic
concept or energy of the character down on
Start With A Rough Sketch paper. These types of fast sketches are
commonly referred to as thumbnail drawings.
You should have a good idea of your story
by now which will help you create some rough
sketches for your character designs. This is
where being able to draw fast and accurately
comes in handy. Even if you cannot draw
3
MAYA Character Animation RU.MAYA 99
4
RU.MAYA 99 MAYA Character Animation
TV. set was of particular concern. Nathan who design must read clearly as a solid black shape
created the character over six years ago, wanted to ensure that the audience can pick the
it to have a 16:9 aspect ratio for film or HDTV character out of backgrounds and easily read
projections. I felt a horizontal rectangular head whatever motion the character is attempting.
would make the character seem less intelligent Strong silhouettes makes for good character
and harder to get audience identification with design.
because it was so anti-human. There was also 2
some concern that the character needed to be
updated from the old designs to add more visual
appeal. This is an example of where the story
line was generated from an existing character
design who did not have a solid script yet.
Some animators come up with a strong 3D
character they want to animate first and then
develop a story to showcase that character. We
experimented with more oval shapes for the
head and tried not to get stuck with any one
idea at this point. Quantity not quality is the
5
MAYA Character Animation RU.MAYA 99
characters.
6
RU.MAYA 99 MAYA Character Animation
biker gang appeal with hot tempers, brown about when they say things like an organic
colors, lots of barbaric weapons and big hair. Vorlon type ship or just to know what has
Vulcans may remind you of Czechoslovakian been done before so you do not duplicate
intellectuals who are reserved and wise from a common ideas. You can also borrow ideas
long rich history of civilization. The animators for shots that work really well. You may even
we know spend long hours debating these types start to recognize particular Maya based
of theme issues. If the creators of Star Trek dynamics or features! 2
went off and designed a bunch really cool
looking characters with no themes, the audience Developing Strong Visual
would not be able to get a handle on each
character and think the show was silly.
Themes
You may not agree with my generalizations A visual theme consists of any group of
of Star Trek species. That is OK. Please feel people or things that have specific styles
free to come up with classifications of your associated with them in regards to body shape,
own. The point is their ships, uniforms and architecture, clothing, skin type, jewelry, music,
character designs all match in general look and transportation, weapons, demeanor/attitude,
feel. You know when you are on a Starfleet colors, time periods or cultural history. You can
ship, even if you have never seen that particular tell whether or not a visual theme is a strong
ship before, by the design and colors as one in your own mind by seeing how many of
opposed to a Klingon battle cruiser. Visual these categories you can come up with specify
themes are particularly important for creating ideas for each one.
believable alien races that the audience can
7
MAYA Character Animation RU.MAYA 99
8
RU.MAYA 99 MAYA Character Animation
9
MAYA Character Animation RU.MAYA 99
10
RU.MAYA 99 MAYA Character Animation
scars, guns
For example, lets say you were going to use Visual Mood: tough, hard, criminal, rebel,
a Hell Angles Acid Rock Biker visual theme for free, dangerous, on the move, fun loving,
a gang of chickens you are animating. You Colors: Black, red, brown, chrome, midnight
already have the juxtaposition of chickens blue
being perceived as lacking courage so this
could be interesting if you are going to make 2
your chickens a very tough biker poultry gang.
Or you could go the other way and make your
chickens really rough and tough perhaps a gang
of renegade ex cock fighters. You could also
approach the mood or essence of your chicken
gang as being spineless wimpy chickens
dressed up as bikers getting all flustered every
time anything even slightly scary happened.
The point is each of these examples have very
specific moods attached to them which you
need to establish to decide which design path
and attitude you want your chicken gang to be.
You may also want to have two chicken biker
gangs with similar themes but completely
different moods to show contrast and build
conflict.Play with these ideas and see how
many versions you can come up with for each
character design.
Macho Chicken
Visual Theme: Hell Angles Acid Rock Biker
Visual Elements: Harleys, tattoos, leather Notice the different moods of these two
vest, beards, bandannas, dirty faces, sunglasses, chickens. Even though they have the same
flat biker butts, knives, rock t-shirts, beer cans, biker chicken visual theme one is very
macho while the other one is rather silly
11
MAYA Character Animation RU.MAYA 99
looking and softer. You should also being thinking what types of
existing visual elements can a I exaggerate
using 3D? Maybe your Biker chicken has an
animated tattoo that talks to him on his arm or
Creating Rough Sketches something else that would up the cool
animation angle.
2 With Visual Themes
Once you have a clear idea of your
Creating Character
characters basic shape and siloette you can Identification
combine it with your new visual theme ideas
into something original. You may change your What do you think people mean when they
character dramatically at this stage but try to use say I do not identify with your characters?
as many of the rough sketches you did earlier as Now this is important question so think about
guidelines if possible. for a moment. Character identification is how
well the audience relates emotionally to the
Do another full page of rough thumbnail characters in any story. I the audience does not
sketches incorporating your new visual theme relate or care about your characters they will
elements and mood. The elements will come not become involved in your story and not
out in the clothing, jewelry, facial features and enjoy it very much.
body builds. It is better to layer on as many of
your elements from your list as possible and Character identification is the one of the
scale back later then it is to keep it too bland or hardest thing to achieve when creating a 3D
simple at this point. The mood you have character. 2D animated characters get away
developed will come into play with the posture with a lot more since people are use to seeing
of the character, facial expressions and pose. them for last 80 or so years and they are so
Remember to keep the idea of strong siloette in stylized sometimes that the audience does not
mind while you design at this stage. care if they look real or not. 3D characters
generally have higher expectations. Studios
such as Industrial Light and Magic have trained
audiences to expect very high levels of design
and animation from the 3D world. I think this
will change in the coming years as audiences
learn to enjoy and forgive the more stylized
versions of 3D characters coming out more and
more each day. Most stylized 3D characters fall
flat against the traditional 2D characters unless
the design and animation are absolutely superb.
12
RU.MAYA 99 MAYA Character Animation
makes the audience see someone or a part of come off as contrived and flat to audiences
them selves in the character that is redeeming in since they have nothing familiar to latch onto
some way. Never make a character black or and understand the characters orintation from
white or all good or all evil, Make gray visually or emotionally.
characters with a mixture of good and bad traits
that reflect most people you know. Even really
good characters need to have some flaws and 2
even the most diabolical madman should have a
some reason alluded to as to what event in his
life mad him so mean. Add a love of something
sensitive like cats or a funny sense of humor to
really evil character to give the audience a
chance to care about them on some level.
13
MAYA Character Animation RU.MAYA 99
14
RU.MAYA 99 MAYA Character Animation
15
MAYA Character Animation RU.MAYA 99
16
RU.MAYA 99 MAYA Character Animation
17
MAYA Character Animation RU.MAYA 99
How would you animate your character This is Sloxan. She would have no
during this interview to show what it is about problem holding her own during a Barbara
visually? Pretend your character is famous in Walters interview. Full of personality and
some way that is connected with your energy.
animation idea and see what happens. You may
come up with unusual questions and interview
2 behaviors that you had not thought of when Adding An Actor To Your 3D
writing a straight character history answering
questions on paper. All great 3D characters
Character
should be able to hold their own in Barbara
Walters interview for 20 minutes on prime time. All 3D characters should have a movie star
If you feel your character is not that interesting type persona attached to them in some way to
enough then change it until it is. Study good help understand their essence more clearly.
TV interviews to see what makes a character or Even if you are suffering from fear of lip synch
person fascinating enough to watch for this and have opted not to have your character
long in an interview format. Pay particular speak you still need to attach an actors voice to
attention to the setting that the interview takes play your character. Pick well known voices
place in since it should be one familiar to from famous films. Try to stay away from the
characters everyday life. more obscure TV and foreign film actors unless
it is just for your own information.
18
RU.MAYA 99 MAYA Character Animation
like Robins work. cannot take your eyes off of her. This is hard to
define to some people who have not thought
Design Around An Actor about it much.
You may also want to design your characters Start to study actors in films and see what
makes some more interesting to watch then
facial features or body types to somehow
others. A great deal of screen presence has to 2
resemble the actor you have chosen for the
voice essence. This will make them easier for do with the energy of the actor. How do you
the audience to identify with and seem to fit translate this magical energy to your 3D
their personalities more. Choose actors that of character? Great animation and design are a
course would fit the history, visual theme and good start but you also need to be studying the
mood of your animation. little nuances that an actor like Jack Nickolson
does on screen with
When you hire voice actors to play the his eyes, eyebrows,
characters they will also appreciate being told mouth and
that his futuristic valley girl ape is played by a swaggering walk that
Courtney Love type voice rather then being makes him so electric.
told she sounds cute but rebellious which is Pick one actor a
hard to latch onto from an attitude perspective month and rent their
quickly. top four films. Write
down as you watch
each film what little
ticks they give to their
characters to make
them so appealing and
original.
Anatomy Considerations
For Animating
This character was designed around
Sigorney Weaver. It is made of flesh and One dangerous design pitfall for 3D is
bone but moves like an organic motorcyle. creating on paper characters that look great but
may be anatomically difficult or impossible to
animate well. Obvious problems such as short
Study Actors For Animation legs with really big feet are going to make that
walk cycle a very challenging set of keyframes.
Acting Tips Study anatomy books on animals and humans
to see how they are built to move. Take an
Actors spend a long time developing their anatomy class for artists to get a good solid
screen presence. One of the more challenging understanding of muscle and bone structure to
aspects of animating 3D characters is getting apply to your 3D characters.
them to the point where they hold a screen as
well as Elizabeth Taylor. When people say that
an actor has a great screen presence they mean
that when Liz walks into the picture frame you
19
MAYA Character Animation RU.MAYA 99
20
RU.MAYA 99 MAYA Character Animation
Design using
pictures of real
creatures for reference.
All of these bug ideas
were taken from actual
photographs of real 2
bugs zoomed way up.
This character was designed around Pee Take an acting class to learn how to act big
Wee Herman and looks great on paper but so that you can make your characters leap off
may be challenging to animate due to the the screen. Give your 3D characters some
knees joined at the spoke. activity to do during dialog that says something
about what is important to that character and
A great example of questionable 3D gives you a chance to show off your great
character design for animation is in the SCI-fi animation abilities. You could have your biker
movie The Arrival. The 3D alien in this film chicken fixing a delicate music box, building a
has these really funky inverted knees and the bomb or pulling the wings off of butterflies
center of gravity seems completely off as it runs during a conversation which will help the
around. The audience laughed during the audience get a better read for what this
screening I saw when this character started to character is about visually.
move in what was suppose to a very scary
chase scene. After that scene the alien seemed How would act out a
pretty unbelievable and the whole movie started walk cycle for this
to unravel quickly. Once you show people particular character? Get
something that looks a little off in a 3D element up and try to simulate the
they will get more picky with everything else motion across the room you
you try to make them believe. are sitting in. Its great to
have big floor to ceiling
mirrors in your animation
studio to test out motion
ideas.
21
MAYA Character Animation RU.MAYA 99
22
RU.MAYA 99 MAYA Character Animation
Love Interest
Main Character
Sidekick
23
MAYA Character Animation RU.MAYA 99
24
Chapter 3 Production Design &
Storyboarding
MAYA Character Animation RU.MAYA 99
Set Design
Here is where the evil virus lives before
Great 3D characters can be enhanced by well attacking Media Man. It has a retro
thought out set designs which reflect their futuristic Frankenstein visual theme.
essence and personality. Think about how
when you meet someone you feel you gain a Where Does Your 3D
greater knowledge about who that person is Character Sleep?
after seeing where they live. The types of
pictures people hang on their walls, whether or Try designing a rough bedroom or living
not they live in a dusty gray warehouse or a environment for each 3D character you develop
spacious Mediterranean villa overlooking a even if the audience will never see this
sculpture garden they created expands your particular location. By doing this you may gain
perception of who they are as people and what many visual clues about who the character is
is important to them. and possibly even how to animate it. If your
5000 year old Chinese woman lives in a cave
she may always be picking spider webs out of
her hair or perhaps bright light forces her to
shield her eyes during environmental changes
throughout the script. Remember the screen
power around all the subtle little actions and
nuances of a brilliant real life character actor.
How can you make your 3D creatures come
alive by having the set design interact as much
as possible with their personality and animated
movements?.
2
RU.MAYA 99 MAYA Character Animation
This is where the Core sleeps in the This character has a Mayan visual theme
Media Man story. She is weird into the 3D and fits nicely into the set using the same
net and has a techno retro future visual theme.
theme.
SideBar: The new Star Wars film Phantom
Study The Masters Menace has some incredible conceptual design
with regards to characters, sets and visual
Study existing films for set design tips. The themes. See if you can figure out the theme
Usual Suspects did some incredible character basis for each location and character theme.
development through set design. Ask yourself Example: Ja Ja has some Jamaican qualities
questions about every background detail like while the queen when dressed up looks similar
why is their a stuffed white ferret posed to to a Mongolian princess.
strike behind this actor? How does this make
me feel about him or change my feelings?
What would I think about this character if it Try to avoid stereotypical bedrooms, offices
were a beat up old stuffed Raggedy Anne Doll? or houses. This is 3D! Embrace it! For the first
Why are the walls brown wood paneling? Old time in history you now have the power to
Film Noir movies do lots with background set create anything you can imagine on a desktop
design and should be viewed for more ideas. computer! Defy physics, create new planets.
make an 800 foot tall solid golden temple or a
Audiences need things to look at in the miniature world inside a dirty shag carpet.
background that tell them more about what the Most stories have been told before in some
reality is like in these often strange and form - only the sets and characters change.
unfamiliar 3D worlds. Professional set
designers spend a great deal of time on each
and every detail for a big film.
3
MAYA Character Animation RU.MAYA 99
Try to think of lopping animations for each Has a clever and original angle such as
background to add movement and make the making a rat world biker bar out rat type found
place feel alive. Add old clocks ticking, clouds objects rather than making it look like Als Bar
moving through windows, weird birds flying down the street. Be true to your characters
off in the distance, spaceships or vehicles essence in some way. Study Bugs Life, Antz
3 dashing by, fans whirling, candles burning, and Toy Story to get a feel for what is clever. A
fountains, aquariums, flashing signs, TV good rule of thumb for doing animal or
monitors, strange creatures walking around or inanimate object animations is to use 50% their
pets breathing hard curled up on rug. Make a world and 50% human characteristics to help
list of possible looping animations that would the audience identify with the story and
fit each environment you plan to have in your characters. To do a 100% realistic ant hole
animation and use the ones that work best. Try would be a bit dry for an entertainment show
and keep it simple with modeling and texture and hard to tell which ant was which.
mapping especially if they are far away.
Develops your character and story in
deeper way by adding background visual
details that give us information about the world
they live in and what is important to them. An
alien living in a frilly lacy cocoon would be
perceived completely different from one
dwelling inside one made of sharp metal
knives.
4
RU.MAYA 99 MAYA Character Animation
Research For 3D Set Ideas Once you have researched your visual theme,
created strong 3D characters and sets you a
Keep a clip art file of set design ideas for ready to pull the visual look and feel for the
reference. A great place to get new ideas is the entire animation together. Gather all of your
100 year National Geographic CD-ROM set thumbnails, character designs, illustrations,
mentioned in Chapter One. You may be able to pictures and photographs and lay them out next
pull off a fresh 3D rock city design by looking to each other on a big floor or table. See if any
at a microscopic picture of granite or a hillside pieces do not look like they fit with the rest of
in Bangladesh. Try picking 5 pictures you the mood and theme you are developing.
think fit the mood and feel for your animation
and design five different rock cities based each If you have multiple sets of characters or
pictures form and shape. Make sure to include environments lay them out in separate areas and
your visual theme as strong as possible in each see if they still hold together in some way.
of the five designs. Pick the one that works best Begin weaving together ideas for your own
and try to exaggerate even more the visual parts camera shots.
that are working such as the curves in the rock
wall or the number of crevices, People like to Start to see the animation taking shape in
see things they have never seen before in 3D your mind. Make changes to any images or
and set design is great way to get more Wow characters that do not fit or feel weak visually.
shots. Experiment with mixing together different set
designs and photographs for fresh lighting or
Another fun exercise to get to know your 3D composition ideas. This is great time to try
characters is to try and design their work different combinations before you start locking
environments, neighborhoods, backyards, down the storyboards.
familiar landscapes, grocery store, gardens,
favorite restaurant or bar and vehicle. Hours
and hours of fun.
5
MAYA Character Animation RU.MAYA 99
1. One Thing At A Time - When 4. Comedic Timing - Funny stories are some
storyboarding your animation try to have only are the most difficult to execute successfully -
one thing at time happening or moving (not particularly in 3D. A great sense of comedic
including background loops). Some 3D timing is essential to pace gags and character
animators are tempted to move everything all at animations effectively. Study shows like
once and it usually comes off as a general lack Roadrunner. It would not be very funny if the
of cinematic elegance. Take your finger and coyote chased the roadrunner off a cliff and fell
follow the movement within the frame of to the bottom. But the shot is funny when the
movies like Citizen Kane or any movie that you coyote stops to pause in mid air before falling
like. Notice the timing of how each movement and looks down then at the audience with
occurs and the directional rhythm. Try to keep changing expressions as he realizes his
your 3D cameras locked down as much as impending situation. Comedic timing is
possible since this seems to be another overused something that may be more of a natural ability
aspect of 3D which make animated shots feel than something that can be completely learned.
very busy.
Be careful with funny animation ideas and
2. Time your shots according to your 3 test them thoroughly on friends and neutral
Act Structure Formula - The average length third parties first. There is a gag story type of
of a shot for most films or TV shows is about 4 animation which requires lots of little funny
seconds. Generally you never see shots over things that happen throughout the story building
10 seconds unless they are establishing shots or to a more and more absurd climax. Never
doing something special. If I know my set up is make an animated story that rests solely on one
suppose to take 30 seconds then I will plan on funny gag at the end as it will usually not be
having around 6 - 8 panels or shots. Use the enough to hold your audience throughout the
formula in Chapter One for three act Structure piece and has a high probability of bombing at
to figure out how long each part of your the end. Popular shows like The Simpsons
animation will be. have a great pace and feel for comedic timing
6
RU.MAYA 99 MAYA Character Animation
Cinematography
There are many different types of illustrators.
Some illustrators are great at drawing photo
realistically but hit a brick wall when it comes
to designing amazing camera shots. Any
illustrators doing storyboards for 3D
animations need to have a solid background in
cinematography and editing. Cinematography is
the art of filmaking particularly in regards to
framing camera shots and telling a powerful
visual story.
7
MAYA Character Animation RU.MAYA 99
The best way to learn about cinematography 6) Life drawing will help keep your eyes in
is to do the following: shape and aware of the subtitles of value,
shading, shadows, light, composition and color.
1) Take classes in film making, editing,
lighting and production design. 7) You may want to play with index cards
and Post-It (letterbox type size) notes to
2) Study great films and storyboard shot by experiment with different shot ideas and
shot sequences you find particularly appealing combinations of shots to change meaning. Add
or the entire film to get a feel for how it was put photographs and illustration into the mix and try
3 together. for a rough visual timeline from a look and feel
perspective to see how all the elements are
2) Make little movies with an inexpensive pulling together. Sketch any obvious great
DV video camera and edit on your computer camera shots you may see right off the bat. This
using programs like Adobe Premiere and After initial design process will make storyboarding
FX. This takes less time than building easier later.
everything in 3D and trying to develop your
skills around the constraints of a 3D computer 8) Refer to films in similar genres for shots
world. and blocking ideas. Suppose you are doing an
alien battle animation between two clans and it
Write little stories that might be re purposed seems a little flat. You may want to go rent
for a set of 3D characters later or based on an Braveheart and borrow some ideas in that
existing animation idea. Focus on creating film which created tension on the battlefield.
tension and emotion. Pay attention to making Change your weapons out for future primitive,
the dialogue sound natural and interesting while different battlefield landscape and any other
you and your friends act out the characters in designs themes that can give the battle the
exaggerated articulated gestures. Do not worry flavor of your particular animation. Time the
about props, sets or costumes. Use your camera shots in Braveheart and see where you
imagination and experiment with the essence of can chop off seconds or scenes and still
the storys emotional curve. Play with real preserve the excitement. Try to figure out what
lighting if you have time. Great way to spend Braveheart did to make the scene so successful
time while rendering. Good research too. and take it one step further. Rent several epic
battle movies and you may even see where the
3) Read books and magazines on film film makers borrowed from each other.
making and special FX to see how to handle
tricky shots, gather valuable tips and gain 9) Go to independent international film
awareness about specific 3D animation issues festivals and see 40 or so films in two weeks.
with regards to 2D elements and special FX. After each film write down the story line, 3 act
structure, storyboard best camera shots, cultural
4) Study photography and take lots of slant on story, what worked and what did not.
photographs. Shooting large amounts of black Try to see how you could take their plot and
and white is particularly useful to develop a ideas and make it into a 3D film or even a piece
good eye for composition and light and darks. of it for a short 3D film. You should do this in
Try to gain a greater understanding what the back of your mind as a fun 3D conceptual
ingredients make an interesting visual picture or exercise for every film or TV show you watch.
better yet a Wow shot.
Independent films have not been through the
5) Storyboard animated 3D films and Hollywood machine and have problems and
compare camera shots and techniques to successes that are easy to spot. The story lines
traditional cinematography. are often more experimental which is good to
8
RU.MAYA 99 MAYA Character Animation
study for ideas. For example the lighting in attention to how the continuity between the
independent films is sometimes off or the shots is working. Are there any visual gaps for
director finds a way to make things work on a how you get from shot to shot or confusion
small budget that would also save you time in when you pitch the story?
3D. Maybe its more scary to see the monster in
shadow throughout most of the film and keep 3) Visual road map for the team. Usually
the lights low. Cable stations are currently you will work with other people to get a 3D
featuring more international independent films animation done. Storyboards are about the only
for you to study if there are not festivals near really effective way to describe an animation so
where you live. everyone can understand it clearly.
3
Short films are of particular interest to a 3D 4) Getting feedback on a 3D animated story
animator attempting to make 3D shorts so keep idea is very difficult without having storyboards
an eye out for these too and use the same for people to look at as you take them through
evaluation process. Never borrow an idea your story. Without storyboards most peoples
outright always change it enough to make it eyes will merely glaze over after your first few
yours or combine it with another idea to make it descriptive sentences and have very little to say
fresh and original for 3D animation. after you are finished explaining everything.
With the physical boards in front of everyone
Storyboarding they can point to particular shots and make
comments or suggestions much easier. You
Storyboards are the visual blueprints of your yourself will also have a hard time trying to
3D animation. Once you start to build pieces of describe each shot without a visual guide to
your story on the computer you will be focused help keep you on track as you go through each
on just making the scene happen and should not shot.
be worrying about whether or not the shot is
going to work. Storyboards are the most useful 5) Production bibles are created from the
tool for any moving visual art form. Never storyboards which list each shot and what parts
touch a computer until you have a final set of need to be shot, built, painted or created to
storyboards to keep you on track. In the real make the scene work. Without a good set of
world this is not always the case but it is a goal storyboards you may have a hard time planning
you should shoot for if at all possible especially your production schedule.
when something as time consuming as 3D is
involved. 6) Client milestones usually include a set of
storyboards. You draw up the idea, they sign
off on each panel agreeing that this is the
Top 10 Reasons animation. Any changes are extra. Never do
Storyboards Are Essential To an animation for anyone without signing off on
Any 3D Animation a detailed set of storyboards. They are visual
contracts that protect both yourself and client
1) Cheaper and less time consuming to from misunderstandings and the need for big
make changes at the storyboard level than it is revisions later.
in the middle of a whirlwind 3D production.
7) The 3D world set up is easier to
2) To see if your story works. Never accomplish if you know your shots first. First
depend on whiz bang special FX or the you know where the camera is going to be
coolness of the 3D world to save your story. If which effects your lighting, texture mapping,
it does not work on paper it will not work after blocking and range of animation. Second, if
lots of hard work in 3D. Pay particular you know one of the characters is only going to
be shown in the distance you can do a more of
9
MAYA Character Animation RU.MAYA 99
10
RU.MAYA 99 MAYA Character Animation
Lighting
Lighting can make or break a 3D animation.
Good lighting looks expensive and dramatic.
7) Write dialogue beneath storyboard panels
Bad lighting looks cheap and amateurish. Light
to understand how the audio track will help tell
is a great storyteller in itself and can really help
the story. Keep dialogue to a minimum to
establish mood and emotion. Study the masters
avoid talking heads throughout animations.
of cinematic lighting. Read Painting With
Try to give the character some activity to do
Light by John Alton (UC Press). Practice
while speaking to make it seem more full. AS
lighting real objects at home with a variety of
talking head ostrich is not as entertaining a
light sources or a even a couple desks lamps.
talking ostrich carving pictures in a tree with his
beak.
Watch movies like Citizen Kane and just pay
attention to where the lights are and why each
8) Include shot numbers beside each panel to
scene is lit that particular way. Old black and
indicate order. Go from right to left not up and
white classic films did some amazing things
down.
with light that are worth checking out. There is
a whole section on lighting in Maya at the end
9) You should not need to explain under each
of the texture mapping chapter which has more
panel what is occurring unless it is confusing
good information to help you light scenes more
which may mean you need to fix the shot. This
realistically and dramatically. Keep dramatic
is an optional addition that some people use and
lightening in mind while planning your camera
can be a good idea if you are leaving your
shots and storyboards.
storyboards some place where you will not be
11
MAYA Character Animation RU.MAYA 99
Camera Shots
Use a variety of camera shots to add a
rhythm to your 3D animation. People who do
not realize how many types of great camera
shots there are to chose from usually use lots of 5. Reaction shot - Shot of characters
monotonous medium shots. Learn the names of reacting emotionally to something that just
these shots and what they mean since animators occurred. Look of utter disbelief on peoples
often refer to them during production and they faces when spaceships land on their street.
are refereed to in scripts. You can combine
shots to make more complicated ones just make
sure you always have a good reason before
moving your camera.
1: Aerial shot - A shot from above. Usually 6. Zoom - Moving shot where the focal
high up. Often used at the beginning and end length and field of view change over time.
of films to zoom in or out on location. Used to bridge shots.
12
RU.MAYA 99 MAYA Character Animation
9. Into view - The camera moves and reveals 13. Split screen - A frame with two shots
a new subject. occurring simultaneously often divided by a 3
line. Two people talking on the telephone is
common for a split screen. Screen can be split
diagonally, horizontally, vertically or with an
Alpha channel shape mask for interesting FX.
11. Insert - A close up shot of an object that 15. Freeze frame - Single frame repeated or
implies great importance like a lost key under a held to imply freezing of the action. Good for
table. funny take offs and freeze-frame endings.
12. Montage - A series of shots used to build 14. Slow motion (slo-mo) - Camera speed
moods or provide information. Typical ones increased above normal frame rate to give the
include passage of time shots with seasons impression of the action being slowed down.
changing around one tree fast or calendar pages
flipping. Try to use different angles of similar
shapes to create more dramatic montages.
13
MAYA Character Animation RU.MAYA 99
3
16. Super - Text or images superimposed
over the shot. Often used for credits, subtitles
or animated graphics.
14
RU.MAYA 99 MAYA Character Animation
3
25. Interior/Exterior - Script term used to
specify whether the location is inside or outside.
15
MAYA Character Animation RU.MAYA 99
3
Transitions From One Scene
33 Truck left/right - To Another
Horizontal movement of the
entire camera with a dolly 1. Cut - Abrupt change from one scene to
type device. another in the course of one frame.
16
RU.MAYA 99 MAYA Character Animation
5. Wipe - One scenes pushes another scene lets you hand build any transition that you can
of the screen either horizontally, vertically, imagine. Even simple circles with feathered
spiral or in any other manner. edges may work better than a horizontal wipe
depending on the composition of the shot
before and after. Try to match the basic shapes
for transitions like these but be careful not to
overuse them since they may draw too much
attention to the idea itself.
Creating An Interesting 3
6. Intercut - Two scenes occur
simultaneously to form one sequence cut Visual Rhythm
together which shows lines of actions where
parallels or contrasts are apparent. A good Go through your rough storyboards and try
example of this is in The Godfather at the end to use at least one of each of the shots, camera
where the family is in a church at the moves and transitions listed above to see if the
christening of new baby while the rest of the camera work becomes more visually
family is gunning down a rival Mafia clan at a interesting. There is a fine line between great
toll booth. This shows contrast in how extreme cinematography and going overboard with too
family life can be for this group. many interesting elements that become
distracting to the audience. Get a feel for this
balance by studying your favorite cinematic
films. The point is to mix up your shots so they
do not feel stale and boring. Try to make four
different camera shots for each shot and see
how the meaning changes simply by using
different shots. Pick the most emotionsl shot
from the four. In the following example the one
7. Match cut - Cut between two scenes
circled has the best composition to explain the
which have the same object, setting, or person
staging of the shot.
in same position. General Wow type shot if
you can work it in. May be used to show
passage of time or point out identity. An
example would be cutting from the shot of a Rule Of Thirds
ring on a girls finger to the same ring worn
around the neck of an old woman to show they Using the rule of thirds is a great help for
are the same person in a different time. composing basic shots. The idea behind this is
to break up the screen into thirds both
horizontally and vertically. You then place your
elements along the lines and center of interest at
one of the four points where the lines cross.
17
MAYA Character Animation RU.MAYA 99
Angles
3D animation can look very 2D if you do not
shot your scenes from good angles. Try to
avoid flat straight ahead shots. Most 3D
animators do this automatically when in 3D but
sometimes forget to draw their storyboards with
angles. The advantage of drawing with the
illusion of depth is that you will then know
where to put your camera in your 3D world Leading looks is another aspect of balance
before you build it and also whether or not the meaning that you have allowed for the
combination of angles you chose to use are compositional weight of the look. If you have a
working together visually. Pay attention to side view of a person looking to the left put this
films, TV and advertising to see how they use person on the right end of the frame to allow
camera angles to make you feel a certain way room for the look to occur. Objects such as TV
about the subject in the shot. The basic ideas sets, vehicles in motion and subjects with
behind camera angles and the impression given slanted compositions also need to have room
to the viewer are as follows: ahead of them for good balance.
18
RU.MAYA 99 MAYA Character Animation
Color effects balance since our eyes 3) Scan a painting using a palette you think
naturally go towards bright or white colors in fits the mood of your animation and has a
the frame. Keep this in mind as you compose limited color scheme. Use the eyedropper from
your color maps and shots. Try to arrange your Photoshop and pull colors off the painting for
frame so that the viewers eye goes to the your 3D animation palette range. Artists with
brightest area first. Brightness gives an object some good palettes to start with are Geiger,
extra weight in a composition. An object with Dali, Bosche and any old master.
greater mass may be used to balance out one
with brighter colors.
3
Creating A Color Palette For
Your 3D Animation
Color is another area that can make or break
your animation. Study color theory if you have
not before to get an idea of how deep this area
can go. You need to develop a limited palette of
color for your animation and stick to it
throughout the animation. This will also make
it much easier for you when you are texture
mapping late into the night and have to once
again choose a color for something.
19
MAYA Character Animation RU.MAYA 99
20
RU.MAYA 99 MAYA Character Animation
21
MAYA Character Animation RU.MAYA 99
Emotion Maps
game plan will help determine everything from
Add a line in your color maps for the lighting choices to music to character
emotion of the scene. This can get a great deal animation.
more complicated if you want to go a step
further and map emotions of each character, the Including The Principles Of
scene and what you want the audience to feel Animation
since these can all be slightly different.
Evoking emotion is the main goal in 3D The Disney 12 Principles of animation are
animation and having even a simple emotional good things to keep in mind when
22
RU.MAYA 99 MAYA Character Animation
storyboarding and planning your shots. Try to staging. Study Charlie Chaplin films. He also
use as many of the these as possible to keep believed that if an actor really knew his emotion
your animation more of an animation art form he could show it in silhouette.
rather than a technical execution without
personality or soul. Read The Illusion Of 4. Slow In Slow Out - Same as ease in ease
Life mentioned in Chapter One for a deeper out. Timing of the motion of the shots to
explanation of these ideas. change in-between keyframes to give more of a
realistic movement and spirited result.
1. Squash & Stretch - Fill a sack flour with
flour and drop it on the floor. The bottom 5. Arcs - Avoid mechanical precision in your
stretches out while the top squashes. Take this characters movement. Movements of most 3
same sack of flour and hurl it through the air in creatures follow circle paths. More arches
slow motion watching as the flour inside between positions rather than straight lines.
changes shape depending on velocity and Keep these in mind when setting keyframes for
impacts. A bouncing rubber ball changes shape characters. Straight in-betweens run the risk of
in much the same way when it hits the floor killing the essence of the action.
hard it flattens out. The most important thing is
to maintain the same mass. If on part gets 6. Secondary Action - An action that
bigger by being stretched another part gets accompanies the main action for added impact.
smaller by being squashed. If your 3D dragon is going to cry have it form a
tear in its eye them have his hand come up and
2. Anticipation - Planned sequence of actions wipe away the tear while he face gets sad and
from one event to the next. Proceed each major his lips start to quiver. If the dragon were to
action with one that introduces it to the just sit their with tears streaming down its face it
audience so that they do not become confused would not be as emotional..
or wonder what is it doing? Before your
alien reaches for a small critter to eat have him 7. Timing - This term in regards to the
first reach out his arm and look at the critter for Principles refer to the number of in-betweens to
a moment. time action with character animation draw
frame by frame. The fewer in-betweens the
3. Staging - Every visual detail in the frame faster and more abrupt the action.
needs to help convey the story line and
emotion. If you are doing a futuristic haunted 8. Exaggeration - Taking a normal set of
house you would use dark colors, shadowy actions and making them extreme without
creatures, howling sounds and other scary distortion but more of a hyper realistic
things. A bright flower bed would be out of exaggeration.
place.
23
MAYA Character Animation RU.MAYA 99
24
RU.MAYA 99 MAYA Character Animation
25
MAYA Character Animation RU.MAYA 99
understand the basic premise. After your pitch of your audience will have some confusion
you can answer questions. over the point later. Remember your goal is to
get feedback.
3) Encourage them to ask questions during
your pitch if it is a small group of less than three 4) Act out the characters voices and
people. Otherwise they may forget there movements if you feel comfortable doing this to
questions or suggestions if they have to wait involve the people hearing the pitch.
until the end. They may also not understand a
key point and be lost the rest of the story pitch. 5) Point at each panel as you tell the story to
Odds are if they are stuck on something the make sure everyone knows where you are
other people are too or at least some percentage visually. Draw one panel for each important
26
RU.MAYA 99 MAYA Character Animation
shot even if you have to copy one. Never point be three minutes in total length.
back and forth through your storyboards to
explain some aspect of the story. Go in a linear 7) Make sure your storyboards are easy
easy to understand order. enough for everyone to see from at least ten feet
away. Use clear lines and good contrasts
6) Try to tell your story in the same amount between lights and darks.
of time it would take to see it as an animation.
This will check timing and pace of story. You 8) Pay attention to when the people hearing
also know your story is too long if it takes you your story laugh, look concerned, or show any
ten minutes to pitch briskly and its suppose to emotion and mentally make a note of it to see if
27
MAYA Character Animation RU.MAYA 99
what you are trying to evoke is working. If the favorite parts? Did you like the main
people hearing you pitch your story seem really character? or any question from the Story
bored or confused you need to find out why Concept Criteria List in Chapter One which
and make major changes. should also ask your self before pitching the
story to anyone. Be honest with yourself and
9) Ask them questions after the pitch such as; be prepared to spend some time making the
Did you like the story? What would you do to story better. Most screenplays are rewritten
make it better? Anything you did not from scratch a bunch or times before making it
understand? What were your favorite and least into production. This is your visual script
28
RU.MAYA 99 MAYA Character Animation
which requires the same dedication to revisions. dialogue, and put them together in a program
like Adobe Premiere with the correct timing.
This will result in a sideshow type movie which
Sound will tell you how well the story is working on a
different visual level. It is surprisingly easy to
Sound is at least fifty percent of the tell how well a 3D animation is going to work
emotional impact of your 3D animation. Try from even a simple animatic. Plot problems
watching Star Wars with the sound off and see and timing issues should be readily apparent.
what you think. Good sound can sometimes Make the necessary changes after showing this
version to several groups of people again.
save bad animation. Bad sound can kill good 3
animation. Great sound and great animation are
magical. Make friends with professional sound Moving 2D Animatic
people or amateur audiophiles who work for
cheap. You will need some help doing a good Some animatics have layers of 2D elements
soundtrack for your animation if you have not that move around to show motion and test
done much sound editing before. Sound is one timing for movement. Usually a character will
job that animators should not feel they should slide around the screen or a background will
have to cover alone. It is too important and pan across. This type of motion requires
takes people who live and breath kilohertz and storyboards drawn in the shape of the pan to
decibels to do it justice. Many professional work correctly. If you have a shot where there
sound people enjoy doing soundtracks for is long horizontal pan across city street, you
animations to get exposure and do something would draw a long horizontal city street panel
different for a change. They will be more and animate it across the screen. You may also
inclined to help you out if they like the story want to draw characters or moving objects on
and feel it has potential to be successful. . different layers to animate around the screen to
test timing. You should make one of these to
You may want to do a rough sound track to test your 3D Story before deciding that the idea
animate to using programs such as Sound Edit, and timing are solid.
Deck or Pro Tools but try to find experienced
sound people to do the final cut. Proper sound Moving 3D Animatic
FX and background music will greatly enhance
the viewing pleasure of your 3D animations. Some final looking shots are still considered
animatics these days. 3D animatics use to
Animatics involve simple 3D primitives as place holders
for spaceship fleets traveling across the screen
After you have pitched the storyboards to at with a rough motion path to check timing and
least five different people, made changes based camera shots. They have become more
on their feedback and pitched it again until its realistic, modeled in detailed, texture mapped
as good as you can possible get it, then you are and lit in larger production houses since 3D is
ready to create an animatic. The word animatic getting faster and easier to do. It is still easier to
can mean many things these days. Disney plan out rough camera shots and make changes
starting doing them to test story ideas and than it is to experiment with heavy final type
character animation before final drawings were renders and make changes.
created.
Getting To The Final
Basic 2D Animatic Animatic Stage
The first step for a basic animatic is to scan Once you have a successful final animatic
your storyboards, do a rough audio track with
29
MAYA Character Animation RU.MAYA 99
30
Chapter 5. Modeling an Organic
Biped using primitive shapes
MAYA Character Animation RU.MAYA 99
2
RU.MAYA 99 MAYA Character Animation
hit the select button found at the bottom of the down, maybe not while modeling, but definitely
Attribute Editors window. In the channel box down the road when setting up deformations or
adjust the Center X, Y, and Z channels to align sculpting morph targets for facial animation.
this image plane with the next one you create When this geometry is complete, we will then
for the front view. attach arms and legs with the Fillet Blend tool.
- A. Alvarez
Stage 1.2Create the front image plane like
the side and go ahead and align them. One way Create a primitive NURBS sphere, note: use
to make a sort of reference chamber around a full sphere shape! Set its parameters to 16 x 4
your character is to align the imagery so the sections and spans to allow for enough
side view is still centered on the ZY axis but is geometry to begin with. Set the radius to match
pulled back down the negative X axis enough the waists profile in the side view.
to meet the far side of the front image plane.
Then move the front down the negative Z away Stage 2.1 To allow the use of symmetrical
from the camera just enough to meet the hull scaling from the front view a few steps
characters far right edge of the side view. This from now we must first create a full spherical
forms a sort of box around the character that object as opposed to the suggested half sphere.
gives you an interactive reference to your
progress towards the final goal of completing
Go to the side view then from the menus or
hotbox choose Modeling: Create Surface:
5
the biped model. Create Primitive: NURBS SPHERE. Dont edit
the settings in the create primitives settings
palette, but instead edit the model interactively
from the inputs for MakeNurbsSphere in the
Channel Box or from the attribute editor
window.
3
MAYA Character Animation RU.MAYA 99
MEL script that reset the center point of the hull view. A feature of Maya that makes this and
each time you selected one. many other common tasks more intuitive are
the new manipulators for modifying objects.
Stage 2.3Later after certain basic shaping When an object is selected, with a
steps have been completed the shape will be transformation tool, either translate, rotate or
bisected down the center between the eyes to scale, a manipulator appears which allows for
allow for an artisan modeling tool function intuitive freeform or axis constrained editing.
called multi-surface reflection editing to For objects or surfaces, this manipulator
happen. First to lighten the geometry and to appears at their Pivot Points, but for
prevent construction history build up delete the Components, the manipulator appears at the
history of the object. This is found in Edit: center of the selecting vertices or hulls. This
Delete by type: Delete History. allows for editing in the Perspective window
which was before only possible in orthographic
views. - A. Alvarez
4
RU.MAYA 99 MAYA Character Animation
of the isoparms hulls. This means that to be inch apart for the head and three inches for the
precise one must be very careful to remember to torso. Using the Insert Isoparm tool and the
pick it when moving the rest of the vertices in Move tool, in the side view, place the hulls
the region or else there will be some sort of (rows of vertices) so that the Move manipulator
spike of tearing that can occur. is centered horizontally with the corresponding
area of the drawing. Then switching to the
Scale Manipulator, scaling the hull to match the
design. An important note with the Scale Manip
is to constrain the scaling to the Z direction.
Not doing this will cause the selected vertices to
also scale across the YZ plane, which will cause
problems in mirror copying. Once the side view
has been filled out, the same process is done in
the front view. It is important for future ease of
manipulation to try and keep the hulls as
vertical and horizontal as possible;
waviness will make the wireframe very difficult
to read and edit later. Figure 3 shows the
various stages the model will go through while
5
Selecting and placing the hulls by executing these techniques. - A. Alvarez
translating or Z axis scaling them to fit from
the side view matching image plane for Continue to add horizontal isoparms from the
precision. side view until the geometry approaches the
details needed to form the torso and basic head
shapes silhouettes. Attempt to only add the most
essential isoparms at this time making sure to
edit them into place as you go along.
Step 4. The default primitive sphere we You must insert more horizontal isoparms
placed over the image plane was created with to achieve the profile of the biped.
(16) vertical and four horizontal spans. Step
four involves inserting enough horizontal
isoparms to match the drawing, without
including any areas of tight sudden changes in
curvature. If the entire figure were, for example,
six feet tall, you wouldnt want to get any
horizontal isoparms that are closer than one
5
MAYA Character Animation RU.MAYA 99
6
RU.MAYA 99 MAYA Character Animation
Stage 5.5 To save time when repeating this Deleting the right half.
step regularly during the up-res process write a
MEL script using the script editor windows
record of the last time you did the procedure to
help you.
5
(Detail of MEL script 5.5) Sidebar from
chapter 11.
7
MAYA Character Animation RU.MAYA 99
Section B. Detail and up-res the left side of the torso model and set the
display smoothness to low and the shading
the head mode to wire frame by hitting the 1 and 4
keys. Next hold down the RMB over the left
Overview side and choose isoparm. Click on an existing
vertical isoparm and drag the mouse up or
The eyes and mouth will require some down stopping where you wish to insert a new
practice to perfect. Adding more mesh one. A ghost like isoparm should follow your
resolution horizontally should be done with mouse until you release the RMB. This new
caution as the details span the length of the yellow curve is only a marker of where an
character. Vertical isoparms are safer to add as isoparm will appear when you are going to
their influence is more localized and does not insert one, and is not permanent until you do so.
tend to get in the way of the rest of the model as By holding the shift key you can click on a
much. curve you highlighted to un-select it or shift
drag an isoparm to have multiple markers for
new isoparms.
Step 6. With the basic shape finished, we
can begin adding details trying to first Stage 6.2 The next thing to do is to go to
5 concentrate on horizontal curvature. If a Modeling: Edit Surfaces: Insert Isoparameter
vertical isoparm is inserted while working on thus converting all of the yellow higlighted
the head, the new isoparm flows all the way potentials into usable, editable isoparameters.
down to the bottom of the pelvis. Thus by Now it is possible to add more details to the
beginning work horizontally, we can work our face and torso with artisan. Re mirror every
way gradually down the body. When we finally time to keep the seams together.
need to insert vertical isoparms, say to tuck the
edges of the nostrils, it is a good idea to look Stage 6.3 Keep in mind that too many
around the surface to see if the new isoparm isoparms near each other will often times result
could help shape another region as well. This in kinks or unwanted ripples. Try to space the
method keeps balance and fluidity of form horizontal isoparms as evenly as possible and
while working on the model. Figure 7 shows still be where you need them. Adding a blinn
the head geometry at the end of this phase, shader to the model helps to expose surface
having a mirror copy displayed as well. The shape irregularities.
final model of the eye was put in place prior to
doing any work in the eye region to act as a
reference for the lids. - A. Alvarez
8
RU.MAYA 99 MAYA Character Animation
9
MAYA Character Animation RU.MAYA 99
10
RU.MAYA 99 MAYA Character Animation
11
MAYA Character Animation RU.MAYA 99
12
RU.MAYA 99 MAYA Character Animation
13
MAYA Character Animation RU.MAYA 99
14
RU.MAYA 99 MAYA Character Animation
Create a cylinder and align it to the Adding extra isoparm details near the
image. ankle.
Step 12. Time to make a one piece leg and Step 13. Add resolution to the geometry to 5
foot out of the primitive. Use the hull editing match the image plane. Keep in mind not to go
and insert isoparm techniques as well as the overboard on mesh detail as much of it can be
Sculpt Surfaces Tool that were covered added in the texture mapping stage.
extensively earlier to go ahead and sculpt then
add resolution to look like the drawing. Begin Stage 13.1 Add vertical details when placing
by spreading the hulls to fit the side view. each new isoparm take time to edit it before
adding the next curve. By doing so the next
Stage 12.1 Cover the leg from the hip/pelvis curve that you insert will probably already be
region all the way to the toe of the foot. shaped somewhat like you need.
Stage 12.2 Use translate and scale and rotate Stage 13.2 Add horizontal details more
to massage the hulls into place. sparsely as they influence more of the
geometry.
Stage 12.3 Add extra detail near the ankle
and heel region by bunching up several hulls. Stage 13.3 Massage the added resolution into
This prepares this region to be stretched into the place using your favorite detailing methods. Be
foot as well. sure and place enough isoparms to allow for the
foot to be pulled out of the ankle area.
15
MAYA Character Animation RU.MAYA 99
16
RU.MAYA 99 MAYA Character Animation
17
MAYA Character Animation RU.MAYA 99
Step 18. Make a cuff at the wrist to simulate Step 20. The imported hand model will have
a skin-tight leotard style outfit and to give you to be adjusted to fit the humanoid upon being
an easier way to integrate the hand. If need be imported and there is a specific methodology
add a couple of isoparms. The Global Stitch that allows you to do so. Import the hand file by
tool if tweaked enough can also be used to going to File: Import. Locate and open the hand
integrate the hand. model that you have completed or the ready to
go file provided on the CD-ROM called
hand_done.mb in found in your chapter4/
project/hand directory.
Another strategy exists to save time setting
up body parts. It involves completely setting up
the hand a head of time. Once a skinned and
driven hand is ready (texture-mapped even)
import it and generally follow the same sort of
grouping and scaling procedures to retain the
construction history.
5 Stage 20.1 Import the hand model then
continue to examine the hypergraph and access
the changes and additions. Most of the
Tucking the cuff is one way to add the grouping has been performed ahead of time
hand. while organizing the hand file in Part I. They
were prepared according to a procedure
Step 19. It is time to prepare the file for designed to simplify the duplication process
integration with another file. Go into the hyper while still retaining the construction history.
graph and organize the geometry into a simple Using insert and the translate tool reset the
and easy to understand hierarchy that would oversized hands Hand_MOVEME group pivot
allow anyone not familiar to the file to to the base of the hand.
understand your database. This way you give
yourself good habits for workflow that will Stage 20.2 When translating and duplicating
guarantee to help organize your production highly complex models with dense interwoven
pipeline. construction history like the hand model you
must understand the nature of construction
history and how processes that retain active
history such as fillet blend work. If you do not
plan it out with a defined strategy your model
will often simply explode apart, suffering from
predictable anomalies such as double
transforms and history feedback loops.
18
RU.MAYA 99 MAYA Character Animation
19
MAYA Character Animation RU.MAYA 99
Make live is a convenient way to create Project the curve onto the torso.
curves on surface.
20
RU.MAYA 99 MAYA Character Animation
21
Chapter 6. Modeling an Organic
Dragon with NURBS
MAYA Character Animation RU.MAYA 99
2
RU.MAYA 99 MAYA Character Animation
Step 2. Creating a primitive cylinder is the Stage 3.1 Edit the hulls from the side view
foundation of the dragons body. by holding the RMB over the model and
choosing the hulls option.
Stage 2.1 Use the manipulator tool and click
on the NURBS cylinder inputs then translate Stage 3.2 Click on the end hull and use the
the top manipulator and snap it to the grid on translation tool to drag it to the edge of the
the Z axis. This lines up the cylinders hulls and Dragons tail.
the isoparameterization to prepare it for shaping
to the imageplane. Stage 3.3 Click on the other end and drag it
to the edge of the Dragons neck.
Stage 2.2 Edit the makeNurbsCylinder inputs
to add some isoparm details to 8 x 12 sections Stage 3.4 The edge hulls have a sort of
and spans. companion hull that sits right next to it and
needs to be brought along and kept relatively
Stage 2.3 After setting up the cylinders close and similarly oriented with regards to
parameters delete the construction history to tangency.
keep the model light. Go to Edit: Delete by
Type: Delete History. Stage 3.5 The rest of the hulls need to be
evenly distributed across the rest of the
Dragons body.
3
MAYA Character Animation RU.MAYA 99
Step 4. The neck needs special detail work so short, hmpph these analog constraints!) and
that the skin and muscle at the base of the neck work with the reference that you are given. Its
will have adequate geometry to use when doing okay because the author strayed slightly from
articulated movements for later when you apply the original wing design anyway.
deformation skeletons to it.
The original primitive cylinder was not Stage 5.1Insert more isoparms to add details
created with enough isoparms to flesh out the to the tail region.
outline, for a reason. When molding geometry it
is often better to use as few details as possible Stage 5.2Pinch the last isoparms hull to a
to get the general shape down. Then when the close by scaling it to zero after inserting enough
form has partially been constructed and you add detail around the tip to allow the it to close
more isoparm details to edit with they will be without creasing or deforming the rest of the tail
added generally where they are needed, usually area.
not requiring major tweaking and movement,
unlike step 2 where we had to massively stretch Stage 5.3Sculpt a nubby tip that could be
some very rough details. used as the base for the tail fan blades.
Stage 4.1 Set the display smoothness to 1 Stage 5.4Also keep in mind the musculature
and the shading mode to wireframe with the 4 required for a strong tail like this. The
key. This reduced detail view helps isolate the underlying bones in the tail are short and
existing parameterization and aids in the flexible and are more near the surface at the
6 selection of the correct isoparms to start from. base of the tail centering as it approaches the
tip. This kind of bone structure would produce
Stage 4.2 Insert isoparms vertically to add a crest or ridge on the top side of the tail
resolution to the dragons body geometry first in especially near the base where it attaches to the
the neck region. These are the ones that are like rear legs.
a necklace or collar. Hold down the RMB over
the beast and choose Isoparm from the marking Stage 5.5At this time we wont yet add the
menu. Then choose Modeling: Edit Surfaces: horizontal isoparms that run the length of the
Insert Isoparms. body, waiting until after we bisect the model in
half at step 7. This keeps the sides from having
Stage 4.3 Repeat this process to match the uneven parameterization and helps preserve the
image plane until you are sufficiently satisfied initial symmetricness that has been designed in
with the details. Try not to go off to much from the beginning.
adding resolution, just enough for what is
needed. Step 6. The Torso needs its hulls to be both
scaled in the X as well as the Y axis. Some
Step 5. Keep in mind adding and distributing extra isorparms will be needed to allow for the
enough isoparms to allow the tail to bend back attachment of the wing joints and the creation
to its original form. In general, 3D geometry of the nubby wing extensions that help facilitate
prefers to bend into place more than it prefers to this.
bend out of place.
Note that the author acknowledges that the Stage 6.1Fill out the central torso area and
optimal way to model from an orthographic begin adding detail by inserting more isoparms.
drawing is to have the shape prepared so it is The chest area has a lot of details that need to
stretched out to its extents, unlike the dragons added a bit at a time. The bird like ridge on the
orthographic side view that is provided. chest that many reptiles and avaians both share
However, for the sake of staying true to the can be seen embedded in the design.
artists intentions one must put up with the
illustrators creative quirks (the paper was too Stage 6.2The wing nubbies need
4
RU.MAYA 99 MAYA Character Animation
drumsticks as in turkey dinner, musculature model. Instead it causes huge problems when
that is required to flap wings such as these. As doing blend-shape targets if you want to
no real creature known to the author exists that repeatedly attach and re-attach the two sides,
is a quadruped and has two additional wings each time adding more isoparms as the process
we are forced to make up the anatomy and goes on. Of course there are workarounds such
structure from scratch and/or use zoological and as always leaving your pairs of symmetrical
mythical reference and blend them with some models un-attached until the very last file and
imagination. then having one step in the past always saved
and left untouched in case of edits that will
Stage 6.3Either way the geometry must inevitably be needed for something.
reflect some physics and anatomy thought so Instead of trying to add the details needed for
when the viewer is watching the beast come to the wing socket twice, once on each side of the
life they are not distracted by improbable beast, it is far more practical to use one of the
imagery. Be sure and keep these ideas in mind mirror methods. Keep in mind the reflection
when sculpting the specific details of the wing paint mode in artisan or just doing local area
muscles. tweaks that dont cause any of the CVs to
cross the zero point on the X axis. You can
Step 7. When adding isoparms horizontally always fix any X axis rebel CVs later by
and you wish your end result to be generally enabling grid snapping by holding down the X
symmetrical like most humanoids and many key and dragging the point towards zero on
beasts it is important to think of a few the X axis working grid. Doing these kinds of
principles. If you are adding an isoparm on
each side there is a very big chance that
fixes tends to waste too much time and is
avoidable with proper planning and
6
without using some sort of script for precision forethought.
the two sides will be a little off. This small
aberation can ripple through to create all sorts The next stages will cover how to split the
of strange anomalies and often annoying quirks body in two pieces and use artisan to mirror
preventing you from doing a trim correctly etc. paint the muscle details on the remaining half
In Alias Power Animator and Maya 2.0 one can and its new mirrored duplicate.
successfully split a symmetrical object in half,
delete the other half, edit the one either with an Stage 7.1 Set the selected body geometry to
instanced mirror duplicate or with a normal rough smoothness display with the 1 key and
mirrored duplicate and artisans multiple surface the shading mode to wireframe with the 4
reflection paint mode. key. Select the top and bottom polar isoparms
This form of modeling half of something is by holding down the RMB over the body then
nothing original and has been done this way for selecting the first one and shift selecting the
centuries of conventional sculpture. other. With the yellow iso-markers still
Symmetrical modeling saves the artist time and highlighted to Modeling: Edit Surfaces: Detach
to avoid the creation looking too uniform it is Surfaces
easy to add unique variations after the two
halves have been re-fused. Stage 7.2 Delete the right half because of an
Its at this stage that the 1.0 and 1.5 versions artisan bug anomaly that does not allow two
of Maya have their major weakness. Maya 1.x halves of the same object to be reflection
does not allow adequate re-seaming of both the painted predictably. Remember to be sure to
front and the back sides of the bisected shape. delete history and freeze transformations to
Instead when attaching surfaces you are forced reset the model.
to use the open/close surface command which
then adds an extra isoparm on either side of the Stage 7.3 Duplicate the left half and then
edge of the surfaces to be closed. It does so scale it to 1 on the X axis to mirror it over the
apparently to preserve the original form of the origin.
5
MAYA Character Animation RU.MAYA 99
Stage 7.4 Select both sides of the body Stage 8.3 Remove the construction history
geometry. Go to Modeling: Edit Surfaces: by deleting the history. Afterwards choose
Sculpt Surfaces Tool: Settings. Go to the stroke Modify: Freeze Transformations to reset the
tab and be sure that the settings for Reflection cylinders attributes to zero in its new origin.
painting and Multiple Surfaces are both on.
Step 9. The next step is to distribute the hulls
Stage 7.6 Edit and tweak artisans opacity, according to the reference image plane and then
brush size/shape, and max diplacement prefs to add resolution. The end goal will to have a
while sculpting the geometry. mostly one piece wing arm model that includes
the base all the way to the quasi-wing thumb
Stage 7.7 To add more isoparm details delete and the three nub like foundations for the wing
R_side, return to Stage 7.3. fingers.
introduced. We will create an armature of Stage 9.3 Translate it to the ankle region.
several sets of NURBS curves and then Scale, rotate and transform the hull and all that
perform a loft across them all to create the follow to your best depiction of a wing arm,
membrane that stretches between the bony keeping in mind musculature and bone
finger like wing tips. The wing arm and wing structure.
fingers are made of standard primitive cylinders
edited into place. Stage 9.4 Repeat with each hull until the
object generally resembles the wing arm. Use
Sub-Section B.1 Creating the arrow keys to pick-walk through the hulls
the meat and bones one at a time for easy editing. Make sure that
the top isoparm smoothly approaches the main
Step 8. Create a primitive cylinder as the bodys wing nubby attaching region.
starting place for the new wing arm. Placement
of a new primitive cylinder in the perspective Stage 9.5 When you have spread out all of
view will help facilitate correct alignment in the hulls it is time to insert more isoparms to up
XYZ space. the resolution. Set the shading style to
wireframe and the selected leg model to rough
Stage 8.1 Be sure to place the cylinder smoothness with the 4 and 1 keys RMB on
directly above the front the wing lump to insure the wing and choose isoparm.
that the isoparms will easily integrate with the
main body. Stage 9.6 Hold down the RMB and activate
isoparm mode. Click drag then shift click drag
Stage 8.2 Set the makeNurbsCylinder more ring like isoparms across the length of the
inputs to 8x8 and adjust the radius to generally wing arm. When satisfied choose Modeling:
match the reference picture of the wings arm Edit Surfaces: Insert Isoparms.
area loaded in the image plane.
Stage 9.7 Repeat hull editing technique until
6
RU.MAYA 99 MAYA Character Animation
7
MAYA Character Animation RU.MAYA 99
base finger and the middle one. Also put one Stage 14.1 Duplicate the curve before
directly by the middle wing finger. Two more projecting it because the actual curve that we
will go to the top (shorter) finger to form the will project needs to be deleted after the
upper mini wing area. projection and basic editing to preserve the
construction history list. If you dont then every
time you edit the curve that did the projection
the curve on surface would also change in the
same way, causing unwanted changes in the
wings surface.
8
RU.MAYA 99 MAYA Character Animation
9
MAYA Character Animation RU.MAYA 99
Step 16. Correction can be accomplished in In two views mode set surface display off
several ways. You can edit the the position of to allow easy editing of the wing curves.
the component curves or their CVs. You can
also edit the surfaces of the new membrane
geometry itself but thats the next step. Step 17. Smoothing the wing membrane
geometry itself, if it needs anything, is the last
Stage 16.1 Minor rotations, translations and step for modeling the wing. Use you favorite
scaling of the curves can result in significant method of editing tools. Keep in mind that the
change overall. Be very careful when doing so, wing is made of two sheets of geometry that are
and your finger near the Z key for undos. very close to each other, making certain, less
delicate tools difficult.
Stage 16.2 Try editing the curves
components CVs by highlighting the curve Stage 17.1 Artisan does have a preference for
then holding down the RMB and choosing detecting multiple surfaces that are nearly
CVs. This makes the curves components intersecting and editing them both similarly for
a consistent appearance. This would help the
10
RU.MAYA 99 MAYA Character Animation
two wing membrane pieces to not pull away Try using a lattice deformer to retain
from each other. It is important to be cautious volume and to keep the geometrys seams
when using artisan to not let one side of the together.
wing get too thick.
Section C. Modeling the
Stage 17.2 Various lattice types could be
used to retain the general volume of the wing
front legs and digits
membrane.
Stage 17.3 Of course there is always the old Both of the front and back limbs are
faithful point by point method which often constructed very similarly in the initial stages.
works quite well for minor detail work. Keep in mind when modeling that the fore
limbs are more like arms and rear legs are more
Stage 17.4 After the stage where you are like a horse or big cat. For stylistic reasons a
through smoothing you are urged to save as three finger front paw and two toed rear foot
and experiment a little by embellishing the has been decided upon.
geometry with skin wrinkles and other close up
details. Otherwise you can save that kind of Step 18. Create a primitive cylinder as the
work for the texture mapping pass where starting place for the new arm like front leg.
adding a bump and/or displacement maps will Placement of a new primitive cylinder in the
let you get much the same result with lighter perspective view will help facilitate correct
alignment in XYZ space.
geometry that is easier to set up. 6
Stage 18.1 Be sure to place the cylinder
directly beneath the front leg lump to insure that
the isoparms will easily integrate with the main
body.
11
MAYA Character Animation RU.MAYA 99
12
RU.MAYA 99 MAYA Character Animation
A perspective and side view of the arm Adjust the shoulder and arm to have a
progression. smooth flowing appearance as it transitions
to the torso.
13
MAYA Character Animation RU.MAYA 99
Select a knuckle isoparm on a duplicate Extend the neck to become the head, hull
arm, detach surface then delete the arm editing the new isoparms that have been
fragment to generate fingers and thumbs. inserted.
14
RU.MAYA 99 MAYA Character Animation
15
MAYA Character Animation RU.MAYA 99
16
RU.MAYA 99 MAYA Character Animation
Step 28. Shaping the top of the skull with Bisect then mirror duplicate the head to
artisans reflection tool and other detail adding allow reflective editing in artisan.
techniques.
17
MAYA Character Animation RU.MAYA 99
Use a lattice on the head for intresting Create a new primitive cone. After
effects. Try a lattice around both the CVs of creating the object edit its inputs to start it
the bottom of the head with the top of the off with enough geometry.
head in one lattice.
18
RU.MAYA 99 MAYA Character Animation
Section E. Shaping the rear one at a time for easy editing. Make sure that
the top isoparm smoothly approaches the main
legs, toes and spikes bodys leg attach region.
19
MAYA Character Animation RU.MAYA 99
based on how you are planning to view the introduced in the Part I steps 21 23 covering
creature in the camera shots. Super close ups the construction of the hand you can create a
will require fillet blends and normal distance curve on surface on the paw or foot to be used
shots can allow a lighter modeling method with as the foundation of the fillet blend.
out any trims or blends needed.
Stage 37.2 After creating the curve on
Step 36. Sculpting muscles and adding detail surface trim the curve on surface and create a
to the main body torso to aid in musculature fillet blend spanning the gap to blend the
integration is necessary to actualize a smooth geometries together.
and flowing body design.
Stage 37.3 Instead of fillet blends you can
Stage 36.1 Use artisans Sculpt Surfaces Tool also build a gradient ramp or gray scale image
to fluidly add muscle details to the leg. to make a transparency map that causes the
Remember to keep opacity and Max geometry to artful go transparent where the
displacement set low to avoid any extreme blend is to occur. However this technique is
changes, resulting in unwanted lumps. tricky and needs to have the model be finessed
for this effect, making sure that the surfaces
Stage 36.2 If necessary for the detail level have just enough overlap to achieve the effect.
that you wish to achieve go ahead and add
some extra horizontal isoparms (the ones Step 38. Integrating the leg to the body with
extending from toe to thigh). Return to Fillet blend or transparency mask.
6 sculpting with artisans brush set.
Stage 38.1 Much like the recommended step
Stage 36.3 Select the main body torso for Step 37 make a curve on surface to act as
models and begin to add some extra detail to the blend foundation.
the rear leg/rump region using artisans Sculpt
Surfaces Tool. Remember to activate the Stage 38.2 Continue to trim and blend the
reflection and multi-surface stroke options so pieces together.
you can paint on both halves at the same time.
Stage 38.3 Transparency maps can save
Stage 36.4 Verify that the geometry flows processing time and do offer lighter geometry
together visually going back and forth between but are a tricky way to work and should be
editing the main body and the leg with artisans given adequate time for experimentation.
brushes.
20
RU.MAYA 99 MAYA Character Animation
21
CHAPTER 7 - Character Animation
MAYA Character Animation RU.MAYA 99
2
RU.MAYA 99 MAYA Character Animation
your character. It is good to try and pre- approach the engine, raise his wrench, start
visualize your animation as much as possible pounding the engine with the wrench, then step
before executing anything on the computer. away from the engine somewhat ashamed for
Even if it is in your head, play it over and over breaking the engine. The animation just
in your mind and get a good sense of what the evolved section by section. The character
character needs to do. Try to be your walking toward the engine was finished before
character, challenge yourself to get out of your going onto animating the character raising the
seat and act out the animation of your character. wrench. The strength of this method is that the
Use a stopwatch and time yourself as you act animation doesnt look too pre-planned, the
out the actions for your character. This is really actions of the character are somewhat
important for the animator, physically getting improvised along the way. Keep in mind,
into the character and getting a feeling for the during the animation process, particular rules of
timing and how your character will need to animation were followed such as follow-
move from point A to point B. Dont be shy, through and timing.
you will find see some of the best animators One of the weaknesses of this method is also
jumping around like crazy people trying to that it is not pre-planned. In some cases, you
flush out the timing and movements for their can start animating, get half-way through the
characters. In addition animation and discover that the animation is not
After you have your animation idea down on working. It is essential that you have a clear
paper, you then need to determine how you will vision of what you are going to do. This
go about animating your 3D character. There method is probably best when you have a bit of
are numerous methods that an animator can use. animating experience.
Some methods lend themselves to specific
animation situations. In other situations you
may use a combination of methods to animate B. Pose to Pose
your character. There may be methods that you 7
may prefer over others. Over time you may
develop your own personal methods to
approaching the animation of 3D characters.
Lets take a look at several different methods
for animating 3D characters, well note the
strengths and weaknesses of each method.
Again, in some situations, you may use a
combination of methods.
A. Straight Ahead
Animating your character in a straight The Pose to Pose method is great for
ahead manner involves some improvisation characters who must be animated through a
and spontaneity by the animator. There may be series of very distinct poses. Each pose of the
a general idea of what your character may need character conveys an idea or action. Each pose
to do in the scene, but, in general you just start can be thought of as the traditional 2D
animating. You build up your animation section keypose. Once the poses are established, the
by section, starting at the beginning. In this animator must determine the speed/timing
example, we have a character animated straight between the poses and how the character
ahead. It was known at the onset that the moves from pose to pose.
character is supposed to fix the engine. The In this example, we have a lion jumping
animation started by having the character just through a flaming hoop, from one platform to
3
MAYA Character Animation RU.MAYA 99
4
RU.MAYA 99 MAYA Character Animation
entire animation.
One of the weaknesses of the pose to pose
method can be managing all of the keyframed
objects of your character. For instance, all four
feet, the back, the neck and head need to be
keyframed to hold the lion in each of its
keyposes. You will have to keep track of all of
these objects when adjusting poses and timing
between poses.
C. Rotoscoping
Rotoscoping is the process of matching the
movement of your 3D character to a sequence
of 2D images. For instance, shoot some video
6. Load the keyframeLion.mel script from of somebody throwing a ball, digitize the video
the AnimationScripts directory on the included into your computer (with any video capture
CDROM. Drag the script from the Script card), and save the digitized video as a
Editor to the Lion tab on your shelf. When sequence of image files or as a movie file.
executed (clicked), this script will keyframe all These files can then be loaded into the
of the necessary objects of the lion. Later on in background 3D views, where you can then
this chapter we will discuss how to automate pose your character using the background
the keyframing process with the MEL images as a reference. The following steps
language. demonstrate how to load a movie file into the
7. Set the time slider to frame 1. Click on perspective window to use for rotoscoping.
the lionPose1 icon, then click on the (ROTOSCOPING EXAMPLE THROWING
keyframeLion icon. You have just set the pose BASEBALL?) 7
for the lion and keyframed the position of the 1. Open the file pinRoto.mb.
lion at frame 1.
8. Set the time slider to frame 10. Click on
the lionPose2 icon, then click on the
keyframeLion icon.
9. Repeat these steps until you have all six
poses of the lion keyframed 10 frames apart.
You will end up with lionPose6 at frame 60.
10. Slide the time slider from 1 to 60. You
will see the lion going through its series of
poses.
From here you would start working on the
timing of the lion between the six poses. Open
the Lion.QT movie to view the lion animation
going through several passes of refinement.
The strong points of this method is that it is a 2. View->Select Camera. Open the Attribute
very intuitive and methodical approach. It Editor.
follows the traditional workflow of 2D 3. In the Attribute Editor under Environment
animation. You start with strong, easily go to Image Plane and click on the Create
identified character poses, then time between button. This creates a default Image Plane
those poses. The quality of your animation node for the selected camera.
relies heavily on how well the character poses
relay a message or idea to the audience. If one
of the poses is incorrect, it could throw off the
5
MAYA Character Animation RU.MAYA 99
4. In the File section of the Attribute Editor, You have now keyed the Frame Extension of
browse for the images bballRoto in the the Image Plane from frame 1 to 100. As you
animation directory on the CDROM. You can now update the time on the Time Slider, you
select any frame in the sequence to load it into will also see the image sequence in the Image
the image plane. Plane Update.
5. Set the time slider to frame one. You now need to match the view of the
6. In the Attribute Editor for the Image character with the images of the Image Plane.
Plane, click on the box next to Use Frame The Image Plane stays locked to the character,
Extension, this tells Maya that you are loading so wherever you move the camera, the Image
an image sequence into the Image Plane. When Plane will always stay locked right in front of
you click on Use Frame Extension you will see the view of the camera. You can tumble, pan,
the Frame Extension area underneath become zoom, translate or rotate the camera to line up
7 editable. Make sure that Frame Extension is set the Image Plane and character.
to 1, then over the word Frame Extension, right 8. Go to frame one in the Time Slider, move
mouse button click for a pop-up menu then go the camera to line up the Image Plane with the
to Set Key. camera. It wont be a perfect match because of
the proportion differences between the actor on
the Image Plane and our cartoony character.
Just try to get the angle correct and line up the
feet of the actor on the image plane with the
feet of the 3D character. You may also want to
zoom the camera in or out to get the size of the
actor on the Image Plane close to the size of the
3D character. After lining up the 3D character
you may want to either set a keyframe for the
camera or lock the camera attributes (Select the
camera, highlight the transform attributes
(translate and rotate) in the Channel Box, then
right mouse click in the Channel Box for the
pop menu to Lock Attributes.
7. Set the Time Slider to the end of the
animation, frame 100. Go back to the Attribute
Editor and set the Frame Extension to 100, then
set a keyframe for the Frame Extension at frame
100.
6
RU.MAYA 99 MAYA Character Animation
D. Layering
The process of animation can also be
approached in a layered approach. Layering
the different aspects of your animation can be
compared to painting or drawing. The general
idea/design is sketched in, then the fine detail is
This is your blocking pass. You will gradually added. The detail is added only after
rotoscope your character in many passes. You the basic framework has been established.
will start with roughly blocking in the poses of The same method can be used when
the character to match the Image Plane. Then animating a 3D character. You want to first
rewind back to frame 1, and fine tune the start with general, overall movements, then add
motion until it matches the Image Plane images detail later on. For example, if you wanted to
more exactly. It is a good idea to also start with animate a character walking from one end of
the main body parts first, like the feet and the room to the other to pick up an object on a
pelvis, then once you have blocked those to the table, you would start by first animating the feet
image plane, then go on to the arms, then back and pelvis of the character getting to the table
then neck and so on. Work with your before animating the arms and hands picking up
animation from general body parts (feet, pelvis,
7
MAYA Character Animation RU.MAYA 99
8
RU.MAYA 99 MAYA Character Animation
9
MAYA Character Animation RU.MAYA 99
Box.
7. Repeat the alternating movement of the
right and left feet while keeping the pelvis
centered for the rest of the time range. Set
keyframes for both feet and the pelvis at frames
10
RU.MAYA 99 MAYA Character Animation
9. Lift the feet off the ground at the middle the Time Slider, you will notice thin, red, tick
of each step. Select the rightFoot and set the marks. These represent keyframes for the
Time Slider to frame 10, this is the in-
between step for the right foot. Translate the
rightFoot on the Y axis so it is raised above the
ground. Highlight only the Translate Y channel
of the rightFoot in the Channel Box and Key
Selected in the Channel Box pop-up menu .
11
MAYA Character Animation RU.MAYA 99
12
RU.MAYA 99 MAYA Character Animation
the Y translate of the bipedRoot already. With 30 where the left foot lifts off of the ground and
Auto Key activated, anytime you change the shift the bipedRoot over the right leg .
value of the Y translate at a particular frame in
time, Maya will automatically insert a keyframe
at the current frame. Go to frame 10 and
translate the bipedRoot node up on the Y axis
until the knees are almost straightened. You
will see that Maya automatically added a
keyframe for the Y translate at frame 10.
12. Animate the side to side movement of
the pelvis (X Translate). Follow the same steps
above to animate the pelvis moving side to side
on the X axis. The pelvis area will move over 7
the leg that is planted on the ground. When that
leg begins to lift off the ground, the pelvis will
shift over the opposite leg as it is planting on
the ground. We have some keyframes already
on the X translate channel, lets delete them and There is no need to add a key for the pelvis
reanimate the X translate of the bipedRoot. in between the two feet. As the bipedRoot is
Select the bipedRoot selection handle, highlight animated on the X axis side to side it will pass
Translate X in the Channel Box. Hold down through the middle. Repeat the side to side
the right mouse button in the Channel Box and motion of the bipedRoot at frames 50, 70 and
go to Delete Selected. Make sure Auto 90. When you are finished be sure to click the
Key is still on and set a keyframe at frame 1 Key icon in the lower right corner of the
for the Translate X of the bipedRoot. This sets interface to turn Auto Key off.
an initial keyframe for Translate X, now each 13. Animate the Roll of the feet. Lets
time you change the Translate X of the take a look at animating the roll attribute we
bipedRoot from its initial keyframe, Maya will created for the feet from the previous chapter.
add a keyframe for you. Go to frame 10, where There will be three main positions of the foot
the right foot lifts off of the ground and shift the we will need to concern ourselves with when
bipedRoot over the left leg , a keyframe is animating the roll attribute. As the foot begins
added automatically at frame 10. Go to frame to lift off the ground, the heel will lift off of the
ground . As the foot begin s to land, the heel
13
MAYA Character Animation RU.MAYA 99
will come in contact with the ground first . c. Go to frame 20 and set the roll attribute to
-5 then set a keyframe.
Then as the foot comes to rest on the d. Go to frame 25 and set roll to 0 then set a
keyframe.
ground, it will lie flat on the ground . Repeat the animation of the foot roll for both
a. Select the rightFoot selection handle a set feet through the rest of the animation. Use
the Time Slider to frame 1. Auto Key to automate the keyframing
b. In the Channel Box, set the Roll process. We will further modify the the
attribute to 10 then keyframe the roll attribute.
14
RU.MAYA 99 MAYA Character Animation
15
MAYA Character Animation RU.MAYA 99
Scrub through the animation, you may still Scrub through the animation again. If there
notice sections where the pelvis may be slightly are sections of the animation where the pelvis
behind the right and left feet. You can also position may still be behind the feet, then you
translate keys in the Graph Editor to can also tranlate keyframes in the Graph
reposition or edit the timing of animated Editor to modify the position of the pelvis (59).
objects. (57)
c. Select the bipedRoot selection handle and 16. Animate the arms of the Character. All
open the Graph Editor. of the arm controls for our biped character are
d. Select the Translate Z channel for the centrally located on a locator named
bipedRoot in the Graph Editor. armControls directly positioned in front of
e. Select the blue Translate Z curve in the the character.
Graph. a. Select the locator directly in front of the
f. Hit the W key on the keyboard to go biped character.
into Translate mode. Hold down the shift b. In the Channel Box, select
key and in the Graph Editor drag vertically and LftShldrUpDown and Ctrl-select
watch the position of the pelvis update as you RtShldrUpDown. Set the values of these
drag. Holding down the shift key as you drag two attributes to -6.
constrains the movement of the curve c. Set LftShldrFwd to -8 and
vertically or horizontally depending upon the RtShldrFwd to 5. Go to the Channel Box
direction you drag the mouse. (58) and set keyframes for LftShldrFwd and
RtShldrFwd.
The arms will swing opposite from one
16
RU.MAYA 99 MAYA Character Animation
17
MAYA Character Animation RU.MAYA 99
18
RU.MAYA 99 MAYA Character Animation
19
MAYA Character Animation RU.MAYA 99
6. Select all of the keys with a value of 10 By creating these flatter areas for the foot
which represent the foot rolling forward from roll attribute, the foot remains flat on the ground
the ball to the toe . for a longer period of time. The areas where
the curve is steep, the foot roll will occur much
faster and more lifelike.
Motion Capture
Motion capture is another method for
animating your CG characters. This involves
recording three dimensional movement from an
object outside the computer and inputting that
data into your computer, then interacting with it
in 3D software like Maya. Motion capture is
most often used to capture human bodies, facial
expressions, objects, camera and light positions.
20
RU.MAYA 99 MAYA Character Animation
The process of capturing motion may involve difficult and time consuming to replicate
physically placing sensors on an actor, through traditional keyframing techniques.
having the actor perform movements while the Motion capture is very useful when there is a
computer records the three dimensional need for a lot of complex animation in a short
positions of the sensors. This three dimensional amount of time, the turnaround time from
data can then be transferred into 3D software captured motion to the CG character can be
programs like Maya onto skeleton joints or the very short.
transformation nodes of other objects. Some of the drawbacks to using motion
capture are the expenses of the equipment and
software needed to actually obtain the captured
motion. The cost of the motion capture
equipment, most of the time, can run into the
thousands of dollars. There are also many
technical considerations for getting the motion
capture onto your CG character correctly. This
includes calibrating the 3D space of the real-
world environment with the 3D environment in
the computer as well as calibrating the
proportions of the real-world actor to the CG
character. Motion capture can also be difficult
to use when there is a need for highly stylized
animation (i.e., cartoony). For instance, how
would you capture the motion of a squashing
Open the file and stretching, 20 foot tall, 12 legged dragon?
dancer.mb on the CD.
This file contains
captured motion from IV. ANIMATION RULES TO 7
a woman dancing. IMPROVE YOUR CHARACTER
Go to the Perspective ANIMATION
window and in the At the onset of any character animation
window panel go to Show->Surfaces to hide project, the animator must answer a few
the surfaces of the character (this will speed up questions about the animation they are
the playback of the animation on the skeleton). undertaking.
Make sure Show->Joints is on in the Remember, always, that you are animating to
Perspective panel. Hit the play button on the an audience. They may only see your
time slider to playback the animation. You will animation once, so you have to be sure that
see the skeleton joints rotating as the figure what you are animating is clear for the audience
dances through numerous complex movements. to understand. The following rules come from
This is a very good example of captured human the principles of animation from the book
movement. There are many subtle movements The Illusion of Life by Frank Thomas and
in the motion of the dancer that would be very Ollie Johnston. Using these principles will help
difficult and time-consuming for an animator to you to think about the way you are animating
accomplish by hand. your character and undoubtedly help you
Motion capture can be a very quick method improve your character animation skills.
for getting motion into your CG characters.
Some motion capture devices and software
allow you to get real-time interaction between A. Posing, Line of Action
your real-world actor and CG character. and Staging
Motion capture also picks up the most subtle This might be the most important rule for
nuances of movement that would be very ensuring that your character is communicating
21
MAYA Character Animation RU.MAYA 99
the proper message to the audience. The pose band, and the jump is releasing the rubber band.
of the character, a distinct line of action of the Anticipation also helps the animator prepare
characters movement and how the character is or set up the audience for what the character
appears in the frame of the camera must all is about to do. It would be somewhat
work together for an effective animation. confusing if your character just instantaneously
When posing the character, you need to jumped in the air without crouching down first.
make sure that the pose clearly communicates First, it would be an unnatural movement.
an idea. By just looking at how the character is Second, the action would happen so fast, that
posed, the audience should be able to the audience might get confused about what the
understand what the character is doing. If your character just did. The anticipation gives the
character is angry, a fist in the air, if your audience enough time to digest all of the
character is impatient, arms folded and tapping actions of the character.
its foot. A good method for making sure your You want to use anticipation with your
pose is working is to examine the form of your character so the audience has an idea of what
character in outline or silhouette. This the character is about to do. Also, use
allows you to focus on how the overall form of anticipation to help communicate to the
the characters pose is communicating while audience what the character might be thinking.
excluding distracting details. By looking at the This will help to convey to the audience ideas
silhouette of the character, the idea, mood or and actions that are about to happen.
attitude of the character should be obviously
clear. If the form is obscured or confusing, C. Offset/Breaking Joints/
there is a good chance that the audience may be
unclear about what the character is doing.
Flexibility
A simple way to view your character in When a force is applied to a link in a chain, it
silhouette is to render your character with a takes time for that force to go down the chain to
the subsequent links. The reaction to the force
7 black non-reflective surface against a white
background. Render a still image or a sequence is delayed down the chain. Think of a dogs
and ask yourself (or even somebody else!) if tail, the same rules apply. The muscles at the
you could clearly understand what the character base of the tail pull the tail back and forth. That
is doing in silhouette. force applied to the base of the tail is delayed
from the base up to the tip of the tail.
When posing your character, it is also With your CG character you can express this
important to visualize a line of action in your delayed reaction on skeleton joints by offsetting
character. An effective pose of a character in the timing of the rotation of joints down the
action will have a very strong and clear line chain. Keep in mind that the rotation of your
through its form. If the line of action is broken joints should not all occur exactly at the same
up in several directions, it may be a clue to a time. Even slight delays in timing can make the
weak pose for your character. Contrast lines of movement of your character look smoother and
action in your animation and characters to add more natural. Your character tends to look stiff
variety and rhythm to your scene. if there is no offset motion, especially in the
limbs.
B. Anticipation
Sir Isaac Newton said, For every action,
D. Follow Through/
there is an equal and opposite reaction. When Overshoot
a character jumps, it first crouches down, then Where you think of anticipation as helping
jumps. The crouching down motion is the you to communicate an action before it
anticipation for the jumping motion. happens, follow-through helps the animator to
Anticipation happens naturally in nature, the emphasize the motion as it finishes. This
crouching down is like pulling back a rubber involves taking the last positions of the
22
RU.MAYA 99 MAYA Character Animation
character at the end of a particular movement in an animation to achieve a reaction out of the
and extending them a bit further to overshoot audience.
the final position slightly. After the overshoot,
the character comes back to rest in the final H. Squash and Stretch
pose. Think of a baseball pitcher throwing a Living, breathing characters are not rigid
baseball. The pitcher winds up, unwinds, objects. Their bodies are made of flesh and
throws the ball, yet as the pitcher releases the change shape based on how forces are applied
ball his motion does not immediately stop. The to them. As their shape changes however, their
pitchers entire body continues to move through volume of mass stays the same. Ask yourself,
the throwing motion. What is the character made of? Is the
character rigid or stiff? Is your character
E. Arcs changing direction, accelerating, decelerating?
The motion of a jointed character appears in These factors will all have an effect on how the
arcing motions. Much like a pendulum on a shape of the character may change throughout
clock, swinging back and forth from its pivot the animation. The classic example of
point. The same thing happens on your understanding squash and stretch is a bouncing
character. Look at your own arm as it swings at rubber ball. By itself, the ball is a round
the shoulder joint forward and backward. Only spherical shape. When the ball slams against
a robot would move along rigid, straight lines. the hard floor, the force of the collision causes
Keep this in mind when animating your the shape of the ball to become oblong or
characters. Movement in straight lines will look squashed. When it rebounds off the floor it
unnatural and stiff. stretches from the force going in the other
direction.
F. Acceleration/ Squash and stretch is not the same as simply
scaling your character bigger or smaller. You
Deceleration have to make sure the volume of the character 7
In reality, nothing has instantaneous motion. is the same, it is the displacement of the volume
Objects accelerate into motion and decelerate which is the key to squash and stretch.
into no motion. When your character starts a Notice the shoe of this character when it hits the
particular movement, make sure there is some ground. As the shoe lands, the bottom of the
sort of acceleration/deceleration in and out of shoe spreads out from the impact with the
that movement. Ask yourself what the mass ground. The top of the shoe squishes down
and weight of your character is. Heavier and the volume is taken up out to the sides of
objects will have a tendency to take a longer the shoe.
amount of time to get into motion and longer to
stop their motion. Lighter objects will
accelerate faster and stop quicker.
I. Symmetry/Asymmetry
A common mistake when first animating a
character is that the characters movements are
G. Pacing/Contrasting symmetrical. You will hear animators refer to
Motion this as twinning. Avoid having limbs on
A series of actions all with the same each side of the character moving in the exact
intensity, speed and amount of movement will same direction at the exact same time, this tends
quickly become tedious and predictable. to look very unnatural. Again, a robot may
Look for ways to show contrast in your move this way, but not a living breathing CG
characters movement and attitudes. Your character! Try to vary the position of
character should not always be moving a appendages on both sides of your character
million miles per hour all the time. Some of the when posing. When posing your character,
best animators use motion inerspersed with consider torque, twist, contrapposto, line of
static or still motion at just the right moment action and the shifting of the characters weight
23
MAYA Character Animation RU.MAYA 99
J. Weight/Balance
Be aware of the weight and balance of your
character, this can truly make your character
appear as a living creature to the audience. Be
aware of what material your character is made
of. Is the character a 5 ton dinosaur or a 5
ounce lizard?
Notice how you stand for instance. You will
notice that you tend to shift your center of
gravity, your pelvis area, from one leg to
another or to both legs. Your center of gravity
7 shifts back and forth, maintaining balance.
Consider also when your character is
carrying something heavy. The body of your
character will need to alter its body posture and
center of gravity to balance the heavy load.
(pin carrying a bowling ball)
K. Storytelling
When animating your characters, keep in
mind that you are telling a story to your
audience. The actions and attitudes of your
characters need to aid the audience in following
the storyline. Also, even in the shortest
animations, think of the actions and motions of
your character as telling a small story or
conveying an idea. A character riding a bike
for instance, can tell a short story. How is the
character riding the bike? Slowly? Quickly?
Where is the character going? To work? To the
beach? Think of each animated shot as a short
story unto itself. Make sure the point of your
story is understandable, clear and entertaining Before we actually start animating our 3D
to watch for the viewer. character, lets look at a few ways we can make
our interaction with our character faster. As an
24
RU.MAYA 99 MAYA Character Animation
25
MAYA Character Animation RU.MAYA 99
C. Visibility
26
RU.MAYA 99 MAYA Character Animation
Another method of improving the speed of 3. Open the Layer Editor and hit the new
interaction which should not be overlooked is button. Name the layer hiResCharacter. Hit
the visibility of objects. Maya will not calculate the Transfer button in the Layer Editor to add
objects that are invisible. You can speed up the selected surfaces to this layer.
interaction with your character if you simply
hide items that you may not need to use at the
time. For instance, if your character has
hundreds of teeth, and you are animating a
walk cycle, hide the teeth so Maya will not
have to calculate them in the 3D views.
27
MAYA Character Animation RU.MAYA 99
28
RU.MAYA 99 MAYA Character Animation
29
MAYA Character Animation RU.MAYA 99
VI. CHARACTERS
INTERACTING WITH
ENVIRONMENT
Often times you may want your characters to
appear that they are interacting with the
30
RU.MAYA 99 MAYA Character Animation
A. Characters picking up
objects - Animating the
visibility on and off.
In some situations, your character may need
to pick up and interact with objects in the
scene. We will achieve this by having two
objects that we will animate the visibility of.
One of the objects will remain on the table
while the other will be parented to the wrist 4. With the duplicate can still active, shift-
joint of the charcters hand. At a particular select the wrist joint of the right arm. Go to
frame, the one object will become invisible Edit-> Parent to make the duplicate can a child
while the other becomes visible. of the wrist joint on the right arm.
1. Open file pinPickUpObject.mb. This file
contains a 150 frame animation of a character
picking a can off of a table. The character is
not actually picking up the object, but the
motion has been animated already for you. It is
best to approach your animation this way.
Animate the motion of the character first, then 7
animate the object being picked up, which is
what we will do here.
31
MAYA Character Animation RU.MAYA 99
32
RU.MAYA 99 MAYA Character Animation
B. Character interacting
with objects using Rigid Body
Dynamics - Pin Character
hitting cans off of table.
33
MAYA Character Animation RU.MAYA 99
cube cubeHand.
3. With the cube still selected go to Edit-
>Delete by Type->History. This gets rid of the
extra Construction History data for the cube
which we no longer need to use.
4. With the cube still selected, go to Bodies-
>Create Passive Rigid Body with the default
settings .
34
RU.MAYA 99 MAYA Character Animation
35
MAYA Character Animation RU.MAYA 99
9. Scrub through the animation once again 11. In dynamics, go to Solvers->Rigid Body
and determine at which frame will the Solver... . In the attribute Editor for the
characters left hand arrive right before hitting rigidSolver, change the Step Size to
the cans on the table. This should be at about .001. Playback the animation and this time
frame 20. Go to the Channel Box and where it you should see the hand colliding with the cans
says off on the Active attribute of the rigid on the table .
body Shape node, type 1 or on, then Key
Selected. This makes the cans switch form
passive to active at frame 20 .
36
RU.MAYA 99 MAYA Character Animation
37
MAYA Character Animation RU.MAYA 99
You have now gone through one way of 3. In the Channel Box for the selected items,
having your character interact with objects in select the channels you want to animate by
the scene through the use of animating the highlighting the name of the channel in the
passive/active status of Rigid Body objects. Channel Box. Shift click if there are more than
This method could be used in endless different one channels you want to key.
scenarios where your character needs to collide
and interact with objects in your scene.
38
RU.MAYA 99 MAYA Character Animation
39
MAYA Character Animation RU.MAYA 99
armControl nodes are Locators with attributes upperBodyControl and armControl nodes.
driving skeleton joints on the character. You can also select keyframes for individual
3. Open the Dope Sheet (Window- objects by selecting them horizontally across
>Animation Editors->Dope Sheet). You will from the name of the object. Shift select to
see the nodes you have selected appear in a list select keyframes from more than one object.
on the left side of the Dope Sheet. In the rest of 5. We will now use the scale tool to scale the
Dope Sheet you will see the grid of boxes whole walk cycle animation for our character.
which represent frames in the scene, and you Click on the Scale transform tool or hit the R
will see yellow or brown boxes filling some of key on the keyboard to scale the animation.
the frames. The yellow boxes are selected You will see a white border around all the keys
keyframes while the brown boxes are
unselected keyframes. Look at one of the
7 nodes on the object list on the left side and read
40
RU.MAYA 99 MAYA Character Animation
to complete.
In addition to scaling your animation you can
also translate your keys in the Dope Sheet by
using the Translate tool or by hitting the W
key on the keyboard. This allows you to
translate keys left or right to have the animation
happen sooner or later.
41
Character Setup
This tutorial goes through the steps to add animation controls to a previously modeled character.
The character in the scene below is wearing clothes made with Cloth and the scenery has been
created with Paint Effects.
The following topics are discussed:
n
Creating skeletons,
n
Using Smooth Skin to bind a model to a skeleton,
n
Adding IK chains for efficient character control, and
n
Combining custom attributes and Set Driven Key to automate character controls.
A Taste of Maya
An animated character
Character Setup Questions? visit www.aliaswavefront.com/tasteofmaya
Note: Before you start: This tutorial requires Maya scene files. If you havent installed the tutorial files go to the Try
Maya section of the Taste of Maya CDROM to install.
Starting Maya: You can start Maya by double-clicking the Maya 2.5 Evaluation icon on the desktop or from Start
Programs Maya 2.5 Evaluation Maya.
In Maya: Once the tutorial files have been installed you will need to set the current project in order to access the Maya
scene files. To set the current project from within Maya select File Project Set... and Navigate to the directory
where you installed the Maya scene files. Select the directory: Maya_tutorial_data and press OK.
BUILD A SKELETON
1 Open the file characterModel1.ma
3 In the side view build leg joints with Skeleton Joint Tool as shown below
n start at the hip and place a joint at the knee, ankle, heel, ball and toe of the leg. There should be five joints
in total.
n
When you have placed all five joints press enter to complete the leg.
Tip: Hold the x key when placing joints to snap to the grid.
Start joint
knee joint
ankle joint
ball joint
end joint
heel joint
2 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Character Setup
Note: To see your Maya display as pictured, press 6 to transfer to textured mode and Shading Shade Options X-
Ray.
4 In the front view move the leg over so that it matches the geometry of the right leg
n Press w to use the move tool.
n Click on the right arrow of the manipulator to constrain the movement to the x-axis.
n
Use the MMB to move the leg to fit in the geometry
n
If you want to change the joint display size select Display Joint Size and choose a different size
5 In the side view build the back with Skeleton Joint Tool as shown below
n Place the first joint slightly above the hip joint. There should be eight joints in total.
End joint
Start joint
6 In the top view build the right arm joints with Skeleton Joint Tool as shown below
n The arm is made up of five joints starting at the clavicle.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms A Taste of Maya 3
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Character Setup Questions? visit www.aliaswavefront.com/tasteofmaya
End joint
shoulder joint
8 Select the shoulder joint and rotate and scale it so that the bones are oriented correctly with the
arm
9 Select the right clavicle joint and shift select the joint at the base of the neck and Edit Parent
n The clavicle is the joint above the shoulder, closest to the spine.
4 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Character Setup
n To select a joint you can click LMB directly on the joint or you can click LMB drag across the bone below
it. For example to select the elbow joint you would click LMB drag across the forearm bone
11 Parent the right leg to the back skeleton by selecting the right hip joint followed by the joint at
the base of the back and Edit Parent
12 Create the left leg by selecting the right hip and Skeleton Mirror Joint
Do not select the feet surfaces at this step. They will be bound to the skeleton in a later step.
n Shift-select the root joint of the skeleton
The root joint is the joint at the base of the back that all of the other joints branch off from. When it is
selected and you move it all the other joints in the hierarchy will move as well.
n Select Skin Bind Skin Smooth Bind.
Tip: Use the z key to undo any joint rotations so the character is in the previous pose or use Skin Go to BInd Pose.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms A Taste of Maya 5
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Character Setup Questions? visit www.aliaswavefront.com/tasteofmaya
Start by selecting the toe joint and then shift selecting the ball joint, heel joint, ankle joint and then knee
joint.
Tip: This selection may be done easily in the Hypergraph or the Outliner.
n
Shift-select the right foot geometry
5 Skin Bind Skin Smooth Bind p, and set the following options:
Bind to: Selected Joints
Note: Because the feet are so big, this will keep them from getting skinned to joints that they shouldnt be associated with.
2 Activate the IK Handle tool with Skeleton IK Handle Tool p, and set the following options:
n
Current Solver: ikRPsolver
IK Handles give you control over the motion of several joints at once. IK Handles allow you to move one
object (the IK Handle) and have several other objects (joints) change position by rotating. This allows you
to animate a skeleton quickly as you only need to control one or two IK handles to get create lots of
motion.
3 Click on the right hip joint followed by the right ankle joint to add an IK chain to the right leg.
Press the y key to repeat for the left leg.
Pressing the y key puts Maya back into the tool that was used last. In this case pressing y is the same as
selecting Skeleton IK Handle Tool
6 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Character Setup
4 Repeat for the arms by pressing the y key and clicking on a shoulder followed by the
corresponding wrist.
Tip: It is a good idea to rename the IK handles to keep the scene organized. Select an IK handle and rename it by clicking
on the name at the top of the channel box.
Note: Undo any transformations with the z key after you are finished testing.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms A Taste of Maya 7
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Character Setup Questions? visit www.aliaswavefront.com/tasteofmaya
2 Select the right eye followed by the joint at the top of the head and Edit Parent
4 Activate the IK Spline Handle tool with Skeleton IK Spline Handle Tool, and click on the
stomach joint followed by the joint at the base of the neck
Note: You may test the IK Spline by selecting the IK handle and changing the value of the Twist attribute.
8 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Character Setup
Note: The IK Spline is controlled by a curve. When you create the IK Spline, the curve will be parented to the skeleton. If
you select the curve and press F8 to change to component mode, you can move the CVs of the curve to control the
back further. Remember to press F8 when finished testing to return to object mode.
2 Select the root joint and Display Object Components Selection Handles
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms A Taste of Maya 9
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Character Setup Questions? visit www.aliaswavefront.com/tasteofmaya
Note: Selection Handles have the highest priority for selecting geometry. This means it will always be easy to select the root
joint.
Note: An extra attribute has now been added to the root joint. You should see it in the channel box.
5 Open the Set Driven Key window with Animate Set Driven Key Set p
Set Driven Key is a type of key available in Maya that allows you to connect an attribute from one object
to an attribute of another object. For example you could have a sphere and a cone. The spheres translate Y
could drive the scale Y of the cone. When you move the sphere in a defined range of values in the Y axis
the scale Y of the cone would change accordingly. To use the Set Driven Key window you need to have a
driver and a driven object to load. Once they are loaded you modify attributes on both the driver and driven
and key them with the key button in the Set Driven Key window.
7 Select the joint at the base of the neck followed by the joint at the base of the head and press
Load Driven
n
Click drag on the two driven joints and then on rotateX and press Key
base of head
base of neck
10 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Character Setup
9 In the Set Driven Key window click on the Driver joint to activate it in the Channel Box and set
Head Turn to 10
If you click on the name of an object listed in the Set Driven Key window (either the driver or driven), it
will become the selected object and its attributes will show up in the Channel Box
10 In the Set Driven Key window click drag on the two driven joints to activate them and rotate them
about 30 degrees in X
You can use the rotate tool and constrain the rotation to the x-axis using the rotate manipulator or you can
type the value into the Channel Box.
12 In the Set Driven Key window click on the Driver joint to activate it in the Channel Box and set
the Head Turn attribute to -10
13 In the Set Driven Key window click drag on the two Driven joints to activate them and rotate
them about -30 degrees in X
Twisting the neck with Set Driven Key and a custom attribute
Note: You may test the setup by adjusting the Head Turn value between -10 and 10. To stop the arms from moving you may
keyframe the IK handles with s or turn Stickiness ON in the Attribute Editor under IK Handle Attributes.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms A Taste of Maya 11
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Character Setup Questions? visit www.aliaswavefront.com/tasteofmaya
12 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Character Setup
back
left_wrist
right_wrist
root
right_foot left_foot
Selection handles
n Only the following six nodes need to be animated: root, back, right_wrist, left_wrist, right_foot and left_foot.
n Keyframes can be set with s or with Animate Set Key
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms A Taste of Maya 13
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Character Setup Questions? visit www.aliaswavefront.com/tasteofmaya
n Animation curves can be adjusted with Window Animation Editors Graph Editor...
n When setting keys, start with the root and feet nodes to block out the animation
n
The finer animation of the arms, back and feet rolling should be secondary
n
You can get a real-time playback with Window Playblast
Note: There are other animation workflows covered in the Comic Book and Jellyfish tutorials.
CONCLUSION
You have now experienced how easy it is to prepare a character for animation in Maya. This includes the following
topics:
n
Creating joints and building skeletons,
n
Adding an IK chain to control arms and legs,
n
Using the IK Spline to the back for smooth and organic control,
n
Making custom attributes for finer control,
n
Set Driven Key to create relationships between nodes to simplify character control, and
n
Some basic animation concepts in Maya.
Character setup and animation can be very complex topics to cover. Alias|Wavefront offers a Character Animation
course that explores these topics in depth. For more information go to www.aliaswavefront.com (Express Link to
Training).
14 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Modeling a dragon using NurBs in Maya
Modeling A Dragon
Creating Image
Modeling Head
Creating Eyes
Modeling Torso
Modeling Gum
Modeling Leg(I)
Modeling Leg(II)
[Back]
This piece of article will show you step by step of how the dragon is created using
Maya. There are three type of modeling method in Maya, NURBS modeling,
Subdivision modeling and Polygon modeling, each of them have their advantages
and disadvantages. However we will build the dragon using patch NURBS surface
techniques. The tools that I use to model this dragon are Birail tools, NURBS
primitive, Fillet Blend Tools and etc.
In the first section, I will show you how the dragon is created by using Maya. Next
section, texturing the dragon will be shown. We need to paint the texture and
create bump map in PhotoShop, but before that, I will need Deep Paint 3D to create
reference line on how the texture will be distorted by NURBS. The detail will be
covered in the texturing section.
Before I start launching Maya, I will do some concept sketching on paper. This is
important, as it will be easier for me to visualise the object I have in mind later on. I
wanted to create a dragon between realistic and imaginative. I want it to look like a
T-Rex but with horn and larger forelimbs. Only the side orthographic is needed to
create the model. When I have done, I will scan in the sketch and save it as JPEG.
(Figure 1)
(Figure 1)
(Figure 2)
3.Now, I will translate the image plane further away from axis X origin, so as to avoid
any intersection with my model. From image Plane, Attribute, scroll down to
Placement Extras. Key in -5 in the first input field. (Figure 3)
(Figure 3)
(Figure 4)
3.Now, I will rebuild the curve that I'd drawn to uniform number of spans. First is to
ensure that uniform count of spans will form better surface. Secondly is to reduce
spans count of surface, since I don't want to have so many points to push and pull
around. Do not worry about the detail part, it can always been done by inserting
isoparm to the surface. Press F3 to toggle to Modeling menu. Select curves that
have been created. Go to Edit Curve, Rebuild Curve, options. Key in 10 for Number
of Spans. Click Rebuild. Rebuild next curve too.
4.From Status Line select Snap to Curve. (Figure 5)
(Figure 5)
5. With the snap to curve activated, then select EP Curve Tool. Hold down LMB
along first curve, you will notice that the first EP point is snapping on the curve.
Snap the end point to second curve then press enter. Create another curve at both
curve ends. I edit the last curve but leave third curve in the origin x-axis. Then I
rebuild these 2 curves to 4 spans curve. (Figure 6)
(Figure 6)
6.Turn off grid from Display, Grid. Now go to Surfaces, Birail-2 select 2 profile
curves and then select 2 rail curves.
7.After surface is formed, press 5 to turn on smooth shade, then press 3 to display
highest smoothness. Make sure you are in Components selection mode (Press F8 to
switch), hold down RMB to select Hull, and again select Control Vertex from hot box.
Keep pulling CV, using direction arrow to toggle point to point until you get
something similar to the picture shown. (Figure 7) When I feel I need more CV to
control certain part, just click on RMB, from the hotbox select isoparm. Click on any
isoparm and drag it to the area that you would like to add in more detail, then go to
Edit Surface, Insert Isoparm. After you have satisfy of what you have done, then
select the surface, go to Edit, Delete by Type, History to delete construction
history.
(Figure 7)
8. Now I will model the jaw using the same method as above to create 4 curves, but
only curve marked in red will be edited (pull the CV along X-axis). (Figure 8)
(Figure 8)
Rebuild curves, Birail-2 to form surface and then delete the history of the surface.
Lets see what we have now. (Figure 9)
(Figure 9)
9. Select both head and jaw, go to Edit, Duplicate, options set the first Scale input
field to -1, Number of Copies to 1, Geometry Type to Copy. Then press Duplicate
button.
10. Now we will start stitching the surface to create seamless model. Select both
head surfaces, go to Edit Surfaces, Stitch, Global Stitch, options. Set the following
setting and press Global Stitch. (Figure 10)
(Figure 10)
If there are gab between surfaces, just play around with difference Max Separation
value. The jaw surface was stitched with same method. With Global Stitch, there is
no need to select both surfaces isoparm and stitch edges. It help to save time when
you have a lot of surfaces to stitch!
Creating an Eye
11.We shall now create an eye for the dragon. Before we start, select all the
surfaces, then go to Display, Hide, Hide Selection. First, I created a NURBS sphere,
then translate and scale it to the position of an eyeball. When its done, select the
sphere and hold down RMB to invoke hotbox then go to Actions, Template the
eyeball.
12.Next use EP Curve Tool to draw a curve. Snap the start point to end point to
create a circle. After that, go to Edit Curves, Open/Close Curves to close the curve.
From there duplicate another 4 curves and scale them to 4 difference sizes. Before
you scale, go to Modify, Center Pivot. This will put pivot point of the circle to the
centre. After this is done, select the curves in order, then perform Loft from
Surfaces menu. Press 3 for hi-res display, then delete construction history of the
Lofted surface. And also dont forget to delete the 4 curves that we use to create
surface. (Figure 11)
(Figure 11)
13.Hold down RMB to select Hull, then select again Control Vertex from hotbox.
Keep on pulling CV, using key pads direction arrow to toggle from point to point
until you get something similar like picture shown (Figure 12). Make sure the eyelid
fit properly to the eyeball.
(Figure 12)
14.Then group them together and translate it above the head model. We are going
make a hole out of its head! (Figure 13)
(Figure 13)
15.Select the eyelid, RMB to select the edge isoparm. Go to Edit Curves, Duplicate
Surface Curves. This will create a curve circle base on the isoparm that you selected.
Then go to Modify, Center Pivot. Finally scale it slightly bigger then the eyelid's
surface. (Figure 14)
(Figure 14)
16.We will project this curve on to the head. Select both head surfaces and curve,
switch to side orthographic view. Go to Edit Surfaces, Project Curve On Surface,
Options. Project Along Active View should be selected. Then click on Project button.
This will project the curve on to the surfaces base on the active view; in this case I
want it to project from side orthographic so that it will project a similar circle on
both head surface. If its project from perspective view, you will get a strange and
awkward result of curve on surface. Now, lets take a look at figure 15, the one
that I have circle in red was to show the curve that projected on the head surfaces.
(Figure 15)
(Figure 15)
17.Select the surface then go to Edit Surfaces, Trim tool. The surface should have
transform into white wireframe (not show in Figure 16). (Figure 16)
(Figure 16)
Click on the surface that we want to retain, a yellow dot will appear when clicked
then press Enter to confirm the trim. Press 3 for hi-res display. Repeat the same
procedure for the other side of the head surface. (Figure 17) Delete curves that use
for projection when done.
(Figure 17)
18.I will create a fillet blend between the gab. Select isoparm of eyelid edge, and
then shift select Trim Edge of head surface with RMB. While both edges were
selected, go to Edit Surfaces, Surface Fillet, Freeform Fillet. Press 3 for hi-res
display. With construction history you can adjust the eyelids edge and the fillet
surface will follow. Once you are satisfy with the result, select the surface blend and
delete the construction history. (Figure 18)
(Figure 18)
Modeling Torso
19.Model the torso is easy, use the same method as I use to model the head. First I
use EP Curve Tool to create 4 curves on side orthographic. Each curve must
intersect with one another. Then I rebuild curves to the amount of span I want.
Always remember to keep less number of spans. You can always insert isoparm
when more detail is needed. I inserted some isoparm in the area where the neck
meet head, so as to create wrinkle below the neck. (Figure 19)
(Figure 19)
20.We can see there are an obvious seam where head joins the neck. (Figure 20)
Dont worry about the clear-cut of the seam, we will fix this with texture
transparency later when texture maps the dragon.
(Figure 20)
21.To use Texture transparency to blend in 2 surfaces, we need to create another
surface. We will using Loft to create 3 spans surfaces. Firstly select head model,
then click on Make Live icon, notice that the surface turn into green wireframe.
Select EP Curve Tool and draw a curve on the surface. Next Make Live the neck
surface and draw curve on it. (Figure 21)
(Figure 21)
Duplicate one of the curves by using Duplicate Surface Curves then place it in
between curves. Select curves in order, then perform Loft to create surface. (Figure
22)
(Figure 22)
(Figure 23)
23.Tooth is model with revolve technique. Turn on grid; Switch to side orthographic
view. Draw a curve on axis origin. Then go to Surfaces, Revolve. (Figure 24) For
future texturing, we will detach the model. The top part will be tooth and bottom
part will be gum. Select isoparm and go Edit Surfaces, Detach Surface. Then group
them together.
(Figure 24)
24.Use the tooth we just model, duplicate, rotate and scale it to difference sizes.
Place them to upper and lower gums. (Figure 25) When you have done, group the
gum and teeth together.
(Figure 25)
25.Now duplicate the tooth again and scale them to a larger size, pull the CVs to
make them into horn like shape and place them on the head as horns. Copy a few
more and mirror it to something similar as Figure 26. (Figure 26)
(Figure 26)
At last the head of the dragon was completed. Next we will build the dragon's leg.
we will build the dragon's leg.
l>
Modeling Legs(part I)
26.The leg is created from a cylinder. First, we create a NURBS cylinder, from
Channels box, click on Sections, hold down MMB and drag. Note that the number in
input field is changing. We will change the number of Sections and Spans to 30.
When it is done, translate it to the position we want. (Figure 27)
(Figure 27)
27. We will deform the cylinder into the shape of leg. Before that, select the
(Figure 28)
28.Select the box that surrounds the cylinder, hold down RMB and select Lattice
Point from hotbox. Press w to activate move tool, select the first row of lattice
points and tilt it into a position as figure 29 shown. (Figure 29)
(Figure 29)
29. This part will be fillet blend with torso in the future. Switch to side view, from
Shading, Shade Option, x-ray. This will make the cylinder become translucent so we
can pull points by referring to Image Plane. (Figure 30)
(Figure 30)
30.Continue to pull, push, scale and rotate lattice points until it form into a leg
shape. When you are satisfied with it, select the cylinder and delete the
construction history to confirm the shape. (Figure 31)
(Figure 31)
(Figure 32)
32.When it is done use the same method of creating fillet blend for the eyes to
create fillet blend for the leg and torso. (Figure 33)
(Figure 33)
33.We will use the same method to create fore limb for the dragon. (Figure 34)
(Figure 34)
34.Well, we still need toes and fingers to complete the dragon. The toe can be done
by using the same technique as horn and teeth, which is revolving from curve. You
can use CV pulling or Artisan to sculpt it into the shape you wants. (Figure 35)
(Figure 35)
35.Basically, the fingers are just the same model as toe. From the first toe I had
made, I duplicate it, scale it, rotate it and pull the CVs into the shape of finger and
place them on to their positions. Instead of fillet blend so many fingers and toes, I
decided to use texture transparency to blend the surface. This will help to save up a
lot of time. So what I do is to make sure the fingers is intersect properly on to the
palm. (Figure 36)
(Figure 36)
36.Finally, we have completed the entire model. We can now mirror it to form a
complete dragon. Do you still remember in the early part, we had mirrored the head
and jaw of dragon and stitched them together. We will now apply the same
technique to the body. Group all the part you want to mirror and name it as body.
Go to Window, Hypergraph to call up hypergraph window. Select the body group
from hypergraph and mirror it to form a complete model. The modeling of the
dragon is thus completed. (Figure 37)
(Figure 37)
(Figure 38)
Shift select the surfaces that u wish to assign to Blinn material, then point your mouse to Blinn in
working space, Left click on Blinn (don't let go, a menu will pop- up, select Assign Material to
Selected. (Figure 39)
(Figure 39)
3. Toggle to Rendering mode; create a Direction Light from light panel. Place it to light up
your model. Save your work.
4.1 Now, we going to convert NURBS to polygons for Deep Paint 3D.I will going to do it part
by part. First, I will do for left side head. Select the left side head, toggle to Modeling mode,
go to Display->NURBS components->Normal (shaded mode) to check the Surface Normal is
pointing out. Go to your perspective window, in the Shading panel->smooth Shade Selected
Item to view the result. If the "hair" pointing in, go to Edit Surface panel->Reverse Surface
Direction. This is to make sure that the polygons surface normal point to the correct
direction (Figure 40)
(Figure 40)
4.2 While the surface still selected, go to Polygons panel->NURBS to Polygon options. Set
number U & V to 24. Click Tessellate. Move up the polygons, Now you will have the
polygons Left Head and NURBS Left Head still remain. (Figure 41)
(Figure 41)
4.3 Go to your Window panel -> General editor ->Plug-in Manager, select obj. Export.mll to
loaded and auto load. Now, have your Lt_Head selected polygon, go to File->Export
Selection's options, pick the file type as OBJexport, then save it to obj directory under your
project directory or any directory that you like.
5.1 Ok, we are going to leave Maya for a while. Launch any paint package that you like to
import the Lt_Head. I will use Deep Paint 3D in this work. File -> open to the directory
contain Lt_Head. obj and you will see this Material import window. In the Object column,
your will find UV word, that's mean your polygons are prepared with UV, It's ready to paint!
(Figure 42)
(Figure 42)
5.2Click on the Material column's gray area to call up Set Material Size window, enter your
texture size. It's good to keep your master copy texture in higher resolution that u can scale it
down later according to your needs.
5.3 I prefer to work on bump map as a colour map in grey rather then paint the real bump on
the model. So I click on C (colour) in Material Channel, then click on colour in Add New
Channel. Select white as my colour and will get this. (Figure43)
(Figure43)
5.4 After painted (figure 44)
(figure 44)
click on export material to photoshop icon to further define the texture in photoshop. (Figure
45)
(Figure 45)
or save your image in 2D file format for Photoshop.
5.5 This is my final bump map for Lt_Head. (Figure 46) Save your work to popular file type
such as Targa in your texture directory.
(Figure 46)
5.6 From the bump texture, I used Photoshop's layering capability to create my colour map
(Figure 47)
(Figure 47)
as well as specular map. (Figure 48)
(Figure 48)
This texture can be reused to it mirrored or duplicated object without redraw your textures. It
perfectly matches to them. So you only need to do for left side head 's colour, bump and
specular and these are reusable for right side head. As well as one side of limb for map 2
side.
5.7 I repeat these steps from 4.1 to 5.6 for the rest of the surfaces that I wish to do 2D
mapping. (Figure 49)
(Figure 49)
5.8 As I proceed to the body, I found out that the creature's body in a piece is pretty hard to
control my mapping, so I decided to detach it and rename them into 3 different surfaces:
neck, torso and tail. Then stitched them back accordingly. (Figure 50)
(Figure 50)
5.9 I deleted all of the polygon geometry in Maya after I completed my 2D textures paint
because I going to use this textures map as UV map for my NURBS geometry. To delete all
polygons geometry, go to Edit panel ->Select All by Type -> Polygon Geometry then press
Backspace key to delete them. Now we remain all the NURBS as beginning stage.
press Backspace key to delete them. Now we remain all the NURBS as beginning stage.
(Figure52)
and you will bring up Create Render Node window.
3.As for colour maps; the Triple Shading Switch will allow the switching of three-channel
values (RGB). With this switch you can have a single shader control the general surface
attribute of many objects but different texture of each object. Click on Utilities tab ->Switch
Utilities->Triple Shading Switch. (Figure 53)
(Figure 53)
4. Open Outliner window, put it beside Triple Shading Switch1 Attribute Editor window,
select the renamed surface, MMB drag to inshape's column. (Figure 54)
(Figure 54)
5.Click on Lt_head's inTriple column, then click on Map Item on the above will bring up
Create Render Node window. Click on File under Texture's tab (figure 55)
(figure 55)
and will bring you to this window. (Figure 56)
@
load the texture from your textures directory and change the "File #" to" Lt_Head colour".
(Figure 56)
6.Go to your perspective window's press 6 to turn on Hardware Texturing. (Figure 57)
(Figure 57)
(Figure 58)
8.I will use the same way to map specular maps to the surfaces. Now, double click on the
Skin (Blinn) from the Hypershade window's working space to bring up its attribute window.
9.This time, I will click on Specular Colour's map button to add in Triple Shading Switch to
allow the Skin (Blinn)'s shader to control the general surface attribute of many objects but
different specular map of each object. (Figure 59)
(Figure 59)
You may want to take a look at Hypershader's workspace to view the connection between
them. Right click and hold on the Skin (Blinn) to bring up a pop-up menu, select Graph
Shader Network to view their render connection. (Figure 60)
(Figure 60)
To see how's the specular maps placed on the model, go to the Skin's Attribute Editor,
expend Hardware Texturing, select specular color. (Figure 61)
(Figure 61)
(Figure 62)
2. From the Bump 2d window, click on Bump Value's map button, Utilities Tab and Single
Shading Switch. (Figure 63)
(Figure 63)
3. Doing the same way as before to load In Shape and In Single. (Figure 64).
(Figure 64)
You may want to do a test render to view the result.
(figure 65)
Perform a test render using IPR render view. Select an area in IPR window, tune the bump
2d and fractral node to have interactive update of your rendering image. Colour and noise
were added using the drag and drop way. (figure 66)
(figure 66)
After I've done, I use the same way to create textures for nails and teeth. Check all the
geometry with texture map in Hardware Texturing mode. (Figure 66a)
(Figure 66a)
Fine Tuning with IPR
We are completed mapping the creature. The last thing to do is fine-tune the materials'
attribute that we assigned in early. IPR will do a great job in this aspect. But before that, you
need to setup some lights to light-up your character. (Figure 67)
(Figure 67)
I open up the attribute and adjust some value to see how they influent the model. After I
satisfy with the setting, I create a fill light, a back light and a bounce light to make the
character more interesting. Perform a final render (figure 69)
(figure 69)
E-mail : [email protected]
Maya expressions and dynamics is great. We can produce some cool special effects using maya.
Now we are going to reproduce some of the logo effect of the film "Matrix" using maya particles and
expressions.Now let us begin.
First we need to create all the 26 letters ,from "a" to "z". Creat----text, open the option ,set the text type to poly.
Type "abcd.......xyz" in the text box. Press "Create".
[Maya]
- Mel Scripts
- Forums
- Hardware Tests
- List Servers
- List Archive
- Game Archive
- Dev Archive
- Plugins
- Shaders
- Tools
- Tips & Tutorials
- Users Links
Now you have all the letters you want.Open the outline window, you can find that maya has create two groups.
One contains all the curve of the letters and another contains the 26 mesh objects. Delete the group contains all the
curve. Here we need only the group contains all the polygon letters.
Now we need to write a script to rename all the polygen letters to names that are easy for later use.use the script
below to rename all the letters. Of course you can rename them by hand. ( I am not sure the script is optimised,
maybe you can write one better, but this one really dose the work).
int $i;
string $t="abcdefghijklmnopqrstuvwxyz";
string $cmd="rename Trim_Char_";
for($i=1;$i<=26;$i++)
{string $temp;
$temp=eval("substring "+$t+" "+$i+" "+$i);
print($temp);
eval($cmd+$temp+"_1_1 "+"text"+$i);
};
file:///D|/TEMP/Maya Tutorials - Creating the logo effect from Matrix.htm (1 of 5) [24.6.2000 ?. 13:41:43]
Maya Tutorials - Creating the logo effect from Matrix
type the script in your script editor and execute it.Now your outline window should show this.
now select all the polygon letters and Center pivot, translate to abs(0,0,0), then freezetransform. Then hide all of
them.
Create a 10*20 nurbs plane. Select the plane and add a particle emitter to it.The emitter type is set to surface.
Rotate the plane 180 degrees along z axis. Set the speed of the emission to about 15. emitter rate to 0.2 .
file:///D|/TEMP/Maya Tutorials - Creating the logo effect from Matrix.htm (2 of 5) [24.6.2000 ?. 13:41:43]
Maya Tutorials - Creating the logo effect from Matrix
Next to make an particleinstancer.Select all the polygen letters in the outline window( note: dont select the group),
creat particle instancer.In the option window, turn on "Allow All data types".select the "objectindex" to the new
attribute "index".
file:///D|/TEMP/Maya Tutorials - Creating the logo effect from Matrix.htm (3 of 5) [24.6.2000 ?. 13:41:43]
Maya Tutorials - Creating the logo effect from Matrix
Now you will see all the particles in the scene turned int letter "a". we are going to add
an expressions to make each of the particles to instance one random letter.
Select particleshape1 and open the expression editor.Add the runtime expression
index=rand(1,26);
Play the animtion and you will find that each particles are now instancing a random letter and changes every
frame. It is now near the effect we want. But we still need to write some expressions to control the motion of each
particle.
Select particleshape1 and add one another array attribute "gate". It has not much meaning , just for used in the
expression. Add the runtime expressions below to the particleshape1.
particleShape1.index=rand(1,26);
vector $temp=particleShape1.worldVelocity;
if ($temp.y<=rand(-10,-5))
{ particleShape1.gate=1;};
if ($temp.y>=(-1))
{particleShape1.gate=0;};
if (particleShape1.gate==1){ particleShape1.acceleration=<<0,rand(20,25),0>>;
//print("aaaa");
};
if (particleShape1.gate==0) {
particleShape1.acceleration=<<0,rand(-25,-20),0>>;
//print("bbbb");
};
These expressions is to control the acceleration of each particles along the y axis. Play the animation and you can
now get a cool random acceleratoin effect for the particles;
Finally you need to position your camera and do render. I rendered the front camera. I think it looks good. When
done, you can use Maya fusion or some other software to add some motion blur or tail effects. Here is a picture of
my last effect.
file:///D|/TEMP/Maya Tutorials - Creating the logo effect from Matrix.htm (4 of 5) [24.6.2000 ?. 13:41:43]
Maya Tutorials - Creating the logo effect from Matrix
At last, you can change the expressions to get some other special effects. All is you imagine. Have Fun
Harley Zhao
Original Force Animation Studio
About Us Partners & Sponsors Terms & Conditions Advisory Board Contact Us Advertise
Produced by Will McCullough. Copyright 1999-2000 HIGHEND Network All rights reserved. All other marks are property of their respective owners.
file:///D|/TEMP/Maya Tutorials - Creating the logo effect from Matrix.htm (5 of 5) [24.6.2000 ?. 13:41:43]
Hypergraph
Hypergraph
Contents
Hypergraph
1 Hypergraph 5
Understanding the Hypergraph panel 6
Understanding scene hierarchy terminology 8
Using the scene hierarchy 10
Expanding scene hierarchy nodes 10
Displaying special nodes and connections 12
Shape, invisible, and underworld nodes 12
Expression, constraint, and deformer connections 14
Parenting objects 15
Rearranging scene hierarchy nodes 17
Changing a nodes relative position 18
Creating a free-form hierarchy 19
Displaying a background image with a scene hierarchy 20
Understanding the dependency graph 22
Using a dependency graph 23
Displaying render node connections 24
Displaying upstream and downstream connections 26
Dragging nodes into a dependency graph 29
Disconnecting nodes in a dependency graph 30
Connecting nodes in a dependency graph 32
Updating the layout of a dependency graph 40
Clearing the contents of a dependency graph 40
Returning to the scene hierarchy 40
Editing objects 41
Selecting objects 41
Adding and selecting an IK handle 42
Renaming an object 43
H ypergraph
The Hypergraph shows a graphical relationship between components of a
scene. You can display two kinds of graphs in the Hypergraph: the scene
hierarchy or dependency graph.
The scene hierarchy shows the ordered arrangement of objects, lights,
cameras, and other items that make up a scene. Its similar to the Outliner
but has more features and visual aids for working with the hierarchy of
scene components.
Heres an example scene hierarchy:
Menu bar
Tool bar
H ypergraph
or dependency graph.
The tool bar has icons for commonly used Hypergraph menu bar selections.
To see the selection that an icon represents, drag the mouse pointer over the
icon and look in the blue help box at the bottom of the Maya window. The
name of the selection appears there.
When you display the Hypergraph the first time, the scene hierarchy is
displayed. In subsequent displays of the Hypergraph, the scene hierarchy or
dependency graph appears, depending on which was displayed the
previous time you closed the window. Note that a scene hierarchy is also
referred to as a DAG, an abbreviation for directed acyclic graph.
If you display the scene hierarchy, invisible objects such as the perspective,
top, front, and side cameras do not appear in the graph by default. If you
display the scene hierarchy for a new, empty scene, youll see no graph.
In contrast, the Outliner shows the default cameras unless you choose not to
display them.
.
Note
Unless instructions in this chapter state otherwise, make all menu choices
from the Hypergraphs menu bar.
H ypergraph
Subnode Any node below another node in the hierarchy.
The subnodes of InnerSolarSystem are Sun, Mercury, Venus,
Earth, Moon, and Mars. The subnodes of Sun are Mercury,
Venus, Earth, Moon, and Mars. The subnode of Earth is
Moon. Moon and Mars have no subnode.
Branch All nodes along a path from a parent to child. A branch
from Sun to Moon includes Sun, Earth, and Moon.
Hierarchy The arrangement of all connected nodes that make up a
scene or object.
The scene hierarchy is made of all nodes in the figure. The
Earth hierarchy consists of Earth and Moon.
Transform node A node that contains an objects transformation attributes
values for its translate, rotation, scale, and so on. It also
holds information on parent-child relationships it has with
other nodes.
InnerSolarSystem, Sun, Moon, and all other boxes shown in
the example are transform nodes.
Shape node A shape node holds an objects geometry attributes or
attributes other than the objects transform node attributes.
Shape nodes do not appear in the scene hierarchy by
default. To display shape nodes, see Displaying special
nodes and connections on page 12.
The scene hierarchy and the dependency graph display animated nodes as
slanted boxes. If you animate a node with an expression, it displays a regular
rectangle rather than a slanted box. All other animation techniques display a
slanted box. Specifically, a slanted box indicates that the node has a param
curve connected to it.
H ypergraph
To expand a node:
1 Select the node.
If the node is not visible in the scene hierarchy, select it in the workspace or
Outliner.
2 Choose:
EditExpand to expand a node to one level below.
EditExpand All to expand all subnodes below a node.
EditShow Selected to display and expand a node not visible in the graph.
To collapse a node:
1 Select the node.
2 Choose EditCollapse.
Tips
To expand or collapse a node, double-click it.
To quickly select Hypergraph menus, click the right mouse button in
an empty part of the Hypergraph window.
To display context-sensitive Hypergraph menus, drag the mouse over
a node and click the right mouse button. These menus are also
available from the main Hypergraph menus, but they apply only to the
selected node.
For details on navigating the view of the graph, see Altering the view
of a graph on page 45.
H ypergraph
OptionsShowShape Nodes
OptionsShowInvisible Nodes
OptionsShowUnderworld Nodes
The graph displays invisible nodes with darker coloring.
Underworld nodes appear only if you also display shape nodes in the graph.
A dotted line in the scene hierarchy indicates a connection to an underworld
node. Connections to instanced objects are also indicated by dotted lines.
Note
Hypergraph option settings are saved with a scene file. The options are not
saved for Maya globally.
Example
Suppose you use PrimitivesCreate NURBSSphere from the Modeling
menu to create a sphere. Maya creates a transform node and a shape node.
The spheres shape node holds the mathematical description of the spheres
shape. The spheres transform node holds the spheres position, scaling,
rotation, and so on. The shape node is the child of the transform node.
If you select OptionsShowShape Nodes, the scene hierarchy shows
these nodes for the sphere:
Maya gives the nodes the default names shown in the preceding figure. The
nurbsSphere1 is the transform node, nurbsSphereShape1 is the shape node.
If you rename the transform node, for example, as Bubble, Maya renames
the shape node BubbleShape.
If you rename the shape node, Maya does not rename the transform node.
Maya doesnt transmit a childs attribute changes up to its parent.
Example
Suppose you use PrimitivesCreate NURBSSphere to create a sphere.
Maya creates a transform node and a sphere node. Suppose further you
select ModifyMake Live, then use the CurvesCV Curve Tool to draw a
curve on the surface of the sphere.
If you turn on the display of shape nodes and underworld nodes, the scene
hierarchy appears as follows:
Maya gives the nodes the default names shown. The nurbsSphere1 is the
transform node of the sphere, nurbsSphereShape1 is the shape node. The
curve1 and curveShape1 nodes are underworld nodes for the curve created
on the spheres surface.
When a curve-on-surface is hard to select in the workspace because of
crowding or complex geometry, you can select it easily in the scene
hierarchy with underworld nodes displayed.
Example
Suppose you create a NURBS sphere named Ball and a NURBS cone named
H ypergraph
Cone. You write an expression to assign the value of Balls translateY
attribute to Cones translateY attribute.
The expression links the two values. When you move Ball up or down in the
workspace (in a Y-axis direction), Cone moves up or down the same
amount.
If you select OptionsShowExpression Connections, the scene hierarchy
displays this:
Tip
You can change the color-coding of the connection lines and other
important entities by selecting OptionsCustomizeUI Colors from
Mayas main menu bar.
Parenting objects
You can make an object the child of a parent object. The child adopts some
or all attribute changes made to the parent.
For example, suppose you animate a planet to orbit the center of the
workspace. If you make a moon the child of the planet, it follows the motion
of the planet.
Though the moon is the child of the planet, you can also give the moon
motion thats independent of the planet. For example, you can make it orbit
the planet. If you later change the orbiting motion of the planet, the moon
continues to follow the planets motion, but stills retains its original orbiting
motion.
To control multiple objects with one node, you can also create an empty
group and make several objects its children. By grouping objects under one
node, you can move, shade, apply texture, and do many other actions to all
the objects by working with the group node.
Example
FrontTire
To parent an object:
In the scene hierarchy, use the middle mouse button to drag the child node
on the parent node.
If the parent node is not visible in the window, drag the child toward in the
direction of the parent. The graph view scrolls as you drag into the
Hypergraphs window border.
H ypergraph
A new node appears in the scene hierarchy named null1. This node is an
invisible, empty object.
2 Use the middle mouse button to drag an object node onto the null1 node.
The object becomes a child of the null1 node.
3 Repeat this step for other objects to be children of the group.
4 Rename the null1 node to something more meaningful.
For example, you might rename a group containing four flower petals as
flower. See Renaming an object on page 43.
The scene hierarchy displays the objects parented to the group node:
Example
Suppose youve created a scene containing several of the solar systems
planets, including earth. As you add each planet, the scene hierarchy puts a
node representing the planet in the graph.
Maya puts each new node in the graph to the right of existing nodes. The
location of the planet nodes in the graph might not represent the spatial
H ypergraph
relationship of the planets in the workspace, as in this example:
Here, earth sits further from mercury than mars. In the actual solar system
and in your workspace, this is not true.
To make the graph reflect the positioning of the earth in the workspace, use
Ctrl-middle mouse button to drag the earth on top of mars.
Maya positions the node to the right of venus and to the left of mars.
Thereafter, youll know where to look for earth in the scene hierarchy.
Important
Move as few nodes as necessary. When you drag a node to a new position
in the graph, you increase the scenes file size and the Maya processing
time needed to work with the scene.
When you move a parent node, Maya automatically moves its children
with it. Automatically moved children do not increase the file size and
processing time.
H ypergraph
capture an image of the characters skeleton in the workspace.
You can display the image in the background of a free-form hierarchy, then
position nodes and joints to match the character skeleton. This helps you
identify scene hierarchy components more quickly. An example follows:
The character skeleton exists behind the scene hierarchy. With this
arrangement, you can quickly find nodes, for example, that represents the
characters feet and ankles.
H ypergraph
shading group node or deformer operation node that appears in a
dependency graph never appears in a scene hierarchy.
A dependency graph node takes input data from one or more other nodes
and uses the input to create output data. When you create models, deform
objects, animate, process audio, and so on, dependency graph nodes work
with the data involved.
Though we refer to a dependency graph as a singular graph, be aware you
can display two or more independent graphs of connected nodes in the same
window. We refer to each independent graph also as a dependency graph.
Maya updates the dependency graph as you modify a scene.
Tip
As a new user of the Hypergraph, you might be unsure whether youre
looking at the scene hierarchy or a dependency graph. If you see arrows
between nodes, youre looking at a dependency graph. If Scene Hierarchy
under the Graph menu is dim, youre looking at the scene hierarchy.
Example
Suppose you create a NURBS sphere, then use the Multilister to create and
assign a Phong shading group to it. Next you use the Multilister to create a
2D checker texture and assign it to the Phong node.
H ypergraph
The following dependency graph appears when you choose
RenderingShow Shading Groups:
Connection lines
phong1.color
checker1.outColor
Mouse pointer
The white box next to an output node shows the nodes name and attribute
that provides the output. Each node name and attribute is separated by a
period, for example, checker1.outColor and phong1.color. In the preceding
figure, the outColor attribute of checker1 is output to the color attribute of
phong1.
In many cases, you must be familiar with Maya internal operation details to
understand the node and attribute names you see in the white boxes.
H ypergraph
To choose a shape node from the scene hierarchy, make sure
OptionsShowShape Nodes is on.
Tip
You can select an objects shape node in the scene hierarchy without
showing shape nodes. Select the objects transform node, put the mouse
pointer in the Maya or Hypergraph window, then press your keyboards
down arrow key.
Selecting a shape node with this technique is useful for scenes having
many nodes, where displaying all shape nodes in the scene hierarchy takes
up much panel space.
Press the up arrow key to return to the transform node.
Example
Suppose you create a wine glass surface by revolving a NURBS curve. The
following dependency graph appears when you select the revolved surfaces
shape node and choose GraphUp and Downstream Connections:
Note that the graph is shown with a vertical orientation to make the
illustration fit on this page. By default, a dependency graph has a horizontal
orientation. See Displaying a graph vertically or horizontally on page 53.
The connection lines between nodes show connection direction. The
connection line originates at a node that outputs data, and the line points to
a node receiving the data as input.
The example graph shows that a curve provides input to the revolve
operation node. The revolve operation generates a revolved shapethe wine
glass. The revolved shape is connected to initialShadingGroup, which sets
the default color of all geometric shapes created in Maya.
If you move your mouse pointer over a connection line, small white boxes
appear next to the input node and output node. The white box next to an
input node shows the nodes name and attribute that receives the input.
The white box next to an output node shows the nodes name and attribute
that provides the output. Each node name and attribute is separated by a
period.
In many cases, you must be familiar with Maya internal operation details to
understand the node and attribute names you see in the white boxes.
H ypergraph
Note that the dependency graph and scene hierarchy display animated
nodes as slanted boxes. If you animate a node with an expression, it displays
a regular rectangle rather than a slanted box. All other animation techniques
display a slanted box. Specifically, a slanted box indicates Ball has a param
curve connected to it.
Example
Suppose you keyframe the translateX attribute of a NURBS sphere named
Ball. If you select Balls transform node and display all upstream and
downstream connections, this graph appears:
The slanted box indicates Balls transform node has been animated. The
graph doesnt indicate which type of animation technique controls the
attribute.
To disconnect nodes:
1 Click the connection line representing the connection in the dependency
graph.
The connection line turns yellow to indicate its selected.
2 Press your keyboards Backspace key.
The connection line disappears, indicating youve disconnected the
connection.
To update the graphs layout to display the disconnected nodes more
appropriately, choose GraphLayout.
Example
Suppose you create a NURBS sphere named Ball. You then use the
Multilister to create a Phong E material with red color and assign the
resulting phongE1SG shading group node to Ball.
H ypergraph
The following dependency graph appears when you select
RenderingShow Shading Groups.
The graph shows that an attribute of the BallShape node (that represents
Balls geometry) is input to the phongE1SG shading group node. Ball gets its
color from the phongE1SG node.
To stop the phongE1SG node from setting Balls color, do these steps:
1 Click the connection line leading from BallShape to phongE1SG.
The connection line turns yellow to indicate its selected.
2 Press your keyboards Backspace key.
The connection line disappears, indicating youve disconnected the nodes.
The phongE1SG no longer controls Balls color.
Ball keeps its previous shading group attribute values. In other words, it
stays red and doesnt become the default gray. If you alter attributes of
phongE1SG, though, the changes are not passed to Ball.
You can reconnect BallShape to another shading group node to make it
control Balls shading. For example, you can use the middle mouse button to
drag BallShape onto initialShadingGroup.
Balls color becomes the default gray color set in the initialShadingGroup
node. Note that each geometric object you create is connected to the
initialShadingGroup node, by default, until you connect it to another
shading group.
Maya connects the default output attribute from the output node to the
default input attribute of the input node. Usually, the default input and
H ypergraph
output attributes are the attributes you would most likely want to connect.
If the attributes arent compatible, no connection occurs and the Connection
Editor appears instead.
Example
Suppose you create a NURBS sphere and cone named Ball and Cone. You
use the Multilister to create a Phong E material with red color, and a Blinn
material with blue color. You assign the resulting phongE1SG shading group
node to Ball, and the blinn1SG shading group to the Cone.
The Multilister displays the following contents:
The graph shows ConeShape connected to the blinn1SG shading group, and
BallShape connected to the phongE1SG shading group.
You can swap the colors of Ball and Cone by reversing their connections to
the shading groups.
To reverse connections:
1 Drag ConeShape onto phongE1SG.
This reconnects the default output attribute of the ConeShape node to the
default input attribute of the phongE1SG node. Cone becomes red.
2 Drag BallShape onto blinn1SG.
This reconnects the default output attribute of the ConeShape node to the
default input attribute of the phongE1SG node. Ball becomes blue.
Tip
H ypergraph
Choose RenderingCreate Render Node to create a new material, texture,
or light. You can then connect to the new node using the dependency
graph.
Example
Suppose you create a NURBS sphere named Ball. You then use the
Multilister to create a Phong E material with blue color and assign the
corresponding phongE1SG shading group node to Ball to color it blue.
Suppose further you create a black and white 2D checker texture, but you
havent assigned it to an object.
To replace Balls blue color with the checker texture, you must use the
middle mouse button to drag the texture node onto the shading group.
If you choose RenderingShow Shading Groups, youll see the shading
groups in the scene, but not the textures:
H ypergraph
To drag the checker1 texture onto the phongE1SG shading group, you need
to display them in the graph at the same time. Do the following steps:
1 While the checker1 node is displayed in the dependency graph, use the
middle mouse button to drag the phongE1SG shading group node from the
Multilister into the window.
The dependency graph for the phongE1SG node appears above the checker1
graph:
2 Use the middle mouse button to drag the checker1 node onto the
phongE1SG or PhongE1 node.
Ball shows a black and white checkerboard texture, rather than blue color.
Turn on ShadingSmooth Shade All and ShadingHardware Texturing
to display shading and textures of objects in your workspace.
H ypergraph
5 Move the mouse pointer over the connection line between checker1 and
phongE1.
White boxes appear next to the nodes. They show that the default output
outColor attribute of checker1 connects to the default input color attribute of
phongE1.
Because of this connection, the black and white checker1 texture provides
the material color for the phongE1 node and therefore the phongE1SG
shading group. An object connected to the phongE1SG shading group
receives the black and white checker1 texture.
Editing objects
H ypergraph
There are several ways to edit objects as youre examining the scene
hierarchy or dependency graph. You can:
select objects
add and select an IK handle
rename objects
hide objects
edit a selected nodes attributes
add a render node
Selecting objects
The scene hierarchy and dependency graph offer a convenient way to select
objects or other items in a scene. This is useful when items in the workspace
are crowded and overlapping.
To select an object:
1 Track and dolly the view to find the node that represents the object or
component.
For example, if your scene has an object named Ball, bring the node
representing Ball into view in the scene hierarchy.
2 Click the node to select it.
The node changes to yellow.
Click a node to
select the object
it represents.
To deselect an object:
Click an empty spot in the window.
To add an IK handle:
1 From Mayas Animation menu, choose SkeletonsIK Handle Tool.
2 In the scene hierarchy, select the top node of the joint chain.
3 Shift-select the bottom node of the joint chain.
Maya creates an end effector and IK handle for the joint chain.
IK handle icon
To select an IK handle:
Click the IK handle icon to the right of the end effector node.
The IK handle node (and icon) turn yellow to indicate youve selected it.
If you make the IK handle node the child of another node, its location might
be hard to find in the graph. The IK handle icon to the right of the end
effector at the bottom of the joint chain makes it easy to find.
Renaming an object
H ypergraph
You can rename an object or other item in the scene hierarchy or
dependency graph. You can give two nodes the same name, but only if each
has a different parent. An example follows:
RoadBike MountainBike
This is allowed.
Bike
Tire Tire
To rename an object:
1 Drag the mouse over the node representing the object.
2 Click the right mouse button and select Rename from the pop-up menu.
Text box
To hide an object:
1 Drag the mouse over the node representing the object.
2 Click the right mouse button and select Hide from the pop-up menu.
The object disappears from the workspace and from the scene hierarchy.
Invisible node
H ypergraph
After you select a node in the scene hierarchy or dependency graph, you can
edit its attributes:
Tip
When the dependency graph is displayed, you can launch the Attribute
Editor for a node by double-clicking it.
Note
If you dolly away from a graph, the text in node boxes becomes
abbreviated. An ellipses (...) appears to the right of the abbreviation.
To read the text, drag the mouse pointer over the box. The nodes name
appears in a pop-up box. The type of node appears in parenthesis next to
the node name.
For example, if you see Ball (transform) in a box, it means the box
represents the node named Ball, which is a transform node.
Dollying a region
You can dolly the view of a selected region by dragging a selection box.
To dolly a region:
1 Ctrl-Alt-drag a selection box from left to right around the region.
H ypergraph
Drag from
left to right.
The region in the selection box expands to the center of the Hypergraph
window:
In a large graph, the node names will be too small to read. Youll need to
dolly and track this view to read the names.
H ypergraph
Selected node
You can also select a node in the Maya workspace or from the Outliner.
2 Select ViewFrame Branch.
H ypergraph
If you turn this option on later, the graph displays all previously added and
deleted nodes.
Tip
You can ensure that a bookmarked view displays a node even after you
reposition, add, or delete nodes in the scene. To do so, select the node and
make sure its entire outline is visible in the view before creating the
bookmark.
If you select two or more nodes, the bookmarked view displays the first
node selected.
To bookmark a view:
1 Track and dolly the view as desired.
2 Select BookmarksCreate Bookmark.
The bookmarked view gets a default name, for example, hyperView1. The
name appears at the bottom of the Bookmarks menu.
H ypergraph
Select Bookmarks and the name of the bookmark at the bottom of the menu.
For example, select BookmarksMonsterHead.
If you prefer to look at a graph upright, you can change to a vertical layout.
cameras
default display of 7 free-form hierarchy 21, 22
centering creating 19
nodes in view 48
children 8, 15
G lights
dependency graph 24
nodes 8
animated 9, 29
graphs attribute names in
clearing display 40 dependency graph 26, 28
dollying view 46 M child 8, 15
collapsing 10
navigation techniques 45
rebuilding 54 materials connecting 32
tracking 46 dependency graph 24 containing param curves 9,
turning off updates 51 menu bar 7 29
viewing 46 menus displaying invisible 12
group nodes 16 displaying context displaying shape 12
sensitive 12 displaying underworld 12
Multilister dragging from Outliiner or
Multilister 29
H nodes visible in dependency
graph 26 dragging to reconnect 37
hidden objects 44 effect on graph of deleting and
adding 52
hierarchy
empty group 17
centering node in view 49 N expanding 10
horizontal layout of graph 28, 53
next view 51 group 16
Hypergraph 5, 6 input 26
menu bar 7 moving relative position of 18
tool bar 7 output 26
parent 8, 15
renaming 43
I selecting 41
shape 9
IK handle
showing invisible 11
adding 42
slanted boxes 9, 29
selecting 42
subnodes 9, 10
image transform 9
displaying as background 20
improving speed
Hypergraph 50
input nodes 26
O
invisible objects
nodes 12 displaying hidden 44
objects 44 editing 41
editing attributes of 45
hiding 44
L making invisible 44
selecting 41
layout output nodes 26
updating graph 40
P shading groups 26
changing selected 36
view
centering branch 49
param curves 9, 29 display example 24 centering node hierarchy 49
parents 8, 15 displaying in dependency centering nodes 48
breaking relationship 17 graph 24 changing transistion
creating 16 shape nodes 9 speed 50
displaying 12 dollying graph 46
previous view
slanted boxes 9, 29 history 51
returning to 51
next 51
speed of Hypergraph
returning to prior 51
improving 50
tracking graph 46
R subnodes 9, 10
rebuilding
graph 38, 54 T W
region
white boxes in dependency
dollying 46 textures
graph 26, 28
renaming displaying in dependency
node 43 graph 24
graph display example 37
tool bar 7
Y
S tracking yellow nodes 41
graph view 46
scene hierarchy 10 transform nodes 9
automatic layout 20
transition speed
creating free-form 19
changing 50
defined 5
displaying background
image 20
displaying special nodes and U
connections 12 underworld nodes
parenting 15 displaying 12
rearranging nodes 17
update options
terminology 8
setting graph 50
selected nodes
updating
framing in view 48
graph layout 40
selected region
upstream and downstream
dollying 46
connections 26
Index
selecting
IK handle 42
objects 41
V
vertical layout of graph 28, 53
Sets
2 Sets 5
How you can use sets 6
Understanding sets 7
Sets you create 8
Shading group sets created by Maya 9
Deformer and skin point sets created by Maya 11
Understanding edit modes 13
Creating, selecting, and removing sets 13
Creating a set 13
Selecting a set 15
Removing a set 16
Creating sets for easy object selection 16
Choosing set display formats 17
Editing set membership 22
Adding set members 22
Removing set members 24
Adding or removing deformer and skin point set members 25
Pruning deformer set membership 28
Moving skin points to a different set 28
Editing point weights 33
Painting point weights 37
Options for modifying point weight numbers 38
Selecting and keying point weight attributes 39
Altering the display of sets 40
Expanding and collapsing sets 40
Filtering sets from display 40
Displaying sets associated with selected objects 41
Sets
action. For instance, you can create a set of NURBS objects, then hide or
display them as a single entity.
When you create a layer, Maya creates a set that represents it. You can work
with sets rather than layer menu entries to quickly move members from one
layer to another. See Using Maya: Basics for details on layers.
When you add a field to vertices, CVs, or edit points, Maya creates a set
named after the field, for instance, uniformFieldShape1Set. The set members
are the vertices, CVs, or edit points to which you added the field. You can
add or remove the set members to alter the effect of the field. See Using
Maya: Dynamics for details on fields.
Understanding sets
Its easiest to learn about sets by examining the display of the Set Editor, the
main tool for working with sets. You can launch the Set Editor by selecting it
Sets
from the main menu or with other common techniques such as the Hotbox.
Menu bar
Tool bar
Sets
The menu bar has entries for working with sets, while the tool bar has icons
for commonly used menu bar selections. To see the menu selection an icon
represents, drag the pointer over the icon and look in the blue help box at
the bottom of the Maya window. The name of the menu selection appears
there.
The bottom part of the Set Editor has items for editing point weights. See
Editing point weights on page 33 for details.
Note
Unless instructions in this chapter state otherwise, make all menu choices
from the Set Editors menu bar.
Example
Suppose you create three NURBS spheres. You can put the spheres in a set
as follows:
1 Select the spheres in the workspace, Outliner, or elsewhere.
2 From the Set Editor, choose Edit Create Set.
The Set Editor displays the newly created set:
By default, Maya gives the set the name set1 or something similar. To use
your own name rather than the default, choose Edit Create Set-.
The Set Editor lists all sets in the scene. The initialShadingGroup and
initialParticleSE are default sets that exist in every scene. The following topic
gives more details on these sets.
3 Click the triangle next to the set to expand its contents.
If you dont see triangles in the Set Editor, turn on ModeEditing first.
Sets
operations on each of its members.
4 To select the objects in the set, but not the set itself, turn on ModeSelect
Contents.
5 Click the set name.
This selects the three spheres that are members of the set.
With the sphere members selected, you can do operations such as:
hide them from the workspace view
translate, rotate, and scale
start the Attribute Editor, so all three spheres are available for editing there
Subsequent topics provide more details on working with sets.
Example
Suppose you use the Multilister to create a Phong material. When you create
the node, Maya creates a set named phong1SG. This set represents the
Phong shading group.
Suppose further you use the Multilister to assign phong1SG to a geometric
object named nurbsSphere1. Maya moves the object from the
initialShadingGroup to the phong1SG set.
Member of
phong1SG
The object receives its surface shading from the options you set in the
Attribute Editor for the phong1SG node.
If you were to add a particle object to a scene, it would become part of the
initialParticleSE shading group set. This set has the same purpose as
initialShadingGroup, only it controls the default shading characteristics of
particles rather than geometry.
An object can be part of only one shading group setwhether
initialShadingGroup, the initialParticleSE, or one you create.
By looking at the members of the shading group sets, you can see which
objects are shaded by the shading groups youve added to your scene. To try
out various shaders on different objects, use the middle-mouse button to
drag objects from one shading group set to another.
For more details on working with shading group sets, see the Shading
Groups Editor documentation in Using Maya: Rendering. The Shading
Groups Editor is a set editor tailored to shading objects.
Sets
Deformer and skin point sets created by Maya
When you attach a deformer to an object, Maya creates a set from the
objects points. When you bind skin to a skeleton, Maya creates two or more
sets for the skin points attached to the joints. See Using Maya: Animation for
details on deformers and skin points.
Example
Suppose you create a NURBS cone, select several CVs, then choose
DeformationsCluster from the Animation menu to apply a cluster:
Apply cluster
to these points
Applying a cluster
creates a set
The set contains the points in the cone controlled by the cluster. In such sets,
you can alter deformations by adding and removing points or by editing
point weights of existing members.
For example, you can add corresponding points from a newly added cone in
the scene. The added points deform with the existing points as you translate,
rotate, or scale the cluster handle.
Mode Usage
Sets
mode.
If you list partitions rather than sets, Select Contents and Paint Percentages
are invalid modes. See the note in Creating, displaying, and removing
partitions on page 49.
Creating a set
You can create a set of geometric objects, CVs, vertices, polygonal facets, or
other items.
For example, after displaying the CVs of an object, use a selection box to
select the CVs.
If you dont select any objects, an empty set will be created in the next step.
You can add to an empty set later.
2 From Mayas main menu, choose EditSetsCreate Set.
or
From the Set Editor, choose EditCreate Set.
The set appears with a default name in the Set Editor.
Other options in the window let you add the set to a partition. See Adding
and moving sets to partitions on page 51 for details.
4 Click Apply.
The set appears with the chosen name in the Set Editor.
If a set or other item in the scene already has the specified name, the new set
name will be appended with a number. For example, entering top results in
Sets
top1, because top is the name of a camera that exists in every scene by
default.
To rename a set:
1 In the Set Editor, turn on ModeSelect.
2 Click the name of the set.
3 Change the sets name in the Channel Box, Attribute Editor, or elsewhere.
Selecting a set
You can select a set or the contents of a set. You must select a set to remove
or rename the set. You must select the contents of the set to apply an action
to each member of the set.
To select a set:
1 In the Set Editor, turn on ModeSelect.
2 Click the name of the set.
You can also select the set in the Outliner or Hypergraphs dependency
graph view.
To display sets in the Outliner so you can select them, turn off ShowDAG
Objects Only.
To display sets in the Hypergraphs dependency graph view, select the
object shape node associated with the set and choose GraphUp and
Downstream Connections.
Removing a set
You can remove a set or the contents of a set. Removing a set is useful for
removing set names youre no longer using.
To remove a set:
1 In the Set Editor, turn on ModeSelect.
2 Click the name of the set.
3 Check that only the set name is the selected object, for example, by
examining the Channel Box or Outliner.
Make sure no objects are selected in the workspace.
4 Press your keyboards Backspace key.
This removes the set, but not its contents.
Sets
Choosing set display formats
For sets of object components such as CVs and polygonal vertices, you can
display set contents in the Set Editor in these convenient formats:
Default listcomponents listed without additional headings for the objects
theyre part of
List by objectcomponents listed under the object theyre part of
For sets made of NURBS CVs, you can also list by object in a concise table.
The following example shows the differences between the display formats.
Example
Suppose you create a curve named TopCurve with four CVs, and a similar
curve named BottomCurve with four CVs.
2
0
TopCurve
1 3
1 3
BottomCurve
0
2
To display the CVs, select the curves, and from the main menu, choose
DisplayNURBS ComponentsCVs.
Internally, Maya numbers the CVs of each curve as 0, 1, 2, and 3 (but doesnt
display the numbers in the workspace).
Suppose you select CVs 2 and 3 of both curves, then create a set named
rightCVs. (See Creating, selecting, and removing sets on page 13 for
instructions on creating sets.) You might do this, for example, because you
want to adjust the shape of both lines identically with the corresponding
CVs.
2
0
1 3
1 3
This is the default listing of sets. Each set member has its name listed under
the set name. This is the most concise way to show sets and their members.
You dont need to understand Mayas identification scheme for set members.
For example, its not essential to know why Maya names certain members of
TopCurveShape as TopCurveShape.cv[2] and TopCurveShape.cv[3].
Youll typically work with set members by selecting the desired object or
point in the workspace, not by selecting its name in the Set Editor.
To list by object:
1 In the Set Editor, select OptionsList by Object.
The following set contents appear:
Sets
The set now shows two object headings, one for TopCurveShape and one for
BottomCurveShape. Note that the icons to the left of the object headings
appear only for sets made of CVs.
2 Expand each object heading by clicking the triangles.
The Set Editor displays the same information as for the default list, but with
a different format. The CV set members are grouped under a heading for the
object theyre part of.
There are four CVs in the set. Two CVs in the set are part of the object
TopCurveShape and two are part of the object BottomCurveShape.
Because the rightCVs set is made of NURBS CVs, you can also display set
members in a table format. The CV location in the table corresponds to their
physical location in the object.
Note
If you display a set of CVs of a NURBS surface such as a plane, youll see
the U and V parameters that identify each CV. An example follows:
Sets
V parameters U parameters
3
0
0 1 2 3
U parameters
V parameters
Tips
You can use standard Motif selection techniques in the Set Editor:
Use the middle mouse button to drag a member from one set to
another.
Use Ctrl-middle mouse button to copy a member from one set to
another.
Drag through several items to select them.
Shift-click to extend the selection through the item clicked.
Ctrl-click a member to add or remove it from existing selection. Note
that Ctrl-clicking to add a member to the selection deselects any item
in the workspace that isnt in the set.
Example
Suppose you put several CVs of a cone into a set name TopCVs.
Sets
You can add several more of the Cones CVs to TopCVs as follows:
1 Select the CVs you want to add to the set.
Selected CVs to be
added to the set.
Tip
To edit related CVs of a NURBS object, turn on Component/Hull selection,
then select a hull. To turn on Component/Hull selection, turn on these
icons in the Status Line:
Sets
instance, select the cluster handle. See the Basic Deformers part of Using
Maya: Animation for information on influence objects.
For a blend shape set, select the associated target or blendShape node.
For other types of sets, select the set in the Set Editor. See Selecting a set on
page 15 for details.
Maya highlights the set members in the workspace. For a deformer set, the
influence object is also highlighted, but is not the selected object.
Maya also lists the set name in the Help line as in the following example.
Highlighted members
3 To add to the set, Shift-click the points (or objects) you want to add.
To add points from a different object, you must select the points without the
Shift key first, then Shift-click the points again to add them to the set.You
can also Shift-drag a selection box around the points.
To remove from the set, Ctrl-click to select the points (or objects). You can
also Ctrl-drag a selection box around the points.
4 Click a different menu entry to quit the Edit Membership tool.
Note
If you bind skin to a skeleton and add a flexor, the Set Editor displays a set
name for the flexor. This type of set has sets embedded under it, as in this
example:
Sets
You cant edit the
points here.
The embedded sets joint2Set1 and joint1Set1 appear twice in the Set Editor.
You must edit the members where they arent embedded.
To quickly find the appropriate sets, select the embedded set names and
choose ListUpdate Now. To edit the weights of the members, display the
unembedded sets in table format with OptionsList by Object on.
Bookmark the embedded sets before doing Update Now if you want to
display them again later.
Note
Prune Membership removes deformer members whose position in the
current frame is the same as their undeformed position. Pruning might
ruin the deformer animation of the members that had not yet moved at the
time of pruning.
Because a typical blend shape operation has weights of 0 (unmoving
points) for some target shapes at any instant, pruning membership would
likely ruin the blend shape deformations. For this reason, there is no menu
entry for pruning the membership of blend shape deformers. You can do
this only with a MEL blendShape command. See the MEL documentation for
details.
If you unintentionally prune members, you can choose EditUndo to
undo pruning, or you can add the members to the set again.
Working with skin points in sets differs slightly from other deformer sets. To
prevent undesirable skin deformations as you bend joints, Maya prevents
skin points from being in two sets at the same time. When you put a member
of one set into another, Maya removes the member from its old set. See
Understanding partitions on page 47 for details.
Example
Suppose you create a skeleton made of three joints. Maya names the joints of
the skeleton joint1, joint2, and joint3 by default. You then use the IK Handle
Tool to add an IK handle to the skeletons joint chain. Finally, you create a
cylinder with 12 sections and 12 spans to be used as the skeletons skin, then
bind the cylinder to the skeleton.
Sets
joint1
joint1s bone
Skin joint2
joint2s bone
joint3
When you bind the skin to the skeleton, Maya creates two sets named
joint1Set1 and joint2Set1 (or something similar).
The joint1Set1 set includes the points for the skin attached to the bone
originating from joint1. The joint2Set1 set includes the points for the skin
attached to the bone originating from joint2. The Set Editor lists these set
names and their contents.
Because joint3 has no bone, it has no set of skin points.
The following steps show how to move skin points from one set to another
to alter skin deformation as a joint bends.
Members of joint1Set1
Sets
Members of joint2Set1
5 Use Shift-left mouse button to drag a selection box around joint1Set1s two
lowest (not selected) circles of points.
This moves the selected points from joint1Set1 to joint2Set1. The new set
members become highlighted in yellow in the workspace.
With the points attached to a different set, the skin deforms differently when
you transform the IK handle to bend the joint.
Because you moved skin points from joint1Set1 to joint2Set1, bending joint2
causes the skin to crease higher above the joint.
You can also remove points from a set with the Edit Membership Tool. With
the joint selected, Ctrl-click to remove the points. If you remove points from
a set, the skin points have no attachment to any bone.
The points wont deform when you transform the joints in the skeleton.
Youll need to add them to a skin point set to make the associated skin
deform appropriately.
The altered deformation in this example is, of course, excessivenot
something you would likely strive for in a character animation. The example
simply shows how to alter skin deformation by adjusting set membership.
As you work on your own characters, experiment by adding and removing
different points near the crease of the skin. Youll be able to create subtle
improvements in deformation. For details on using the Edit Membership
Tool, see Adding or removing deformer and skin point set members on
Sets
page 25.
Weight 0.5
Weight 1
Skin points also have weights. When you bind skin to a skeleton, Maya puts
the skin points in sets. The skin points have a default weight of 1.
You can edit the weight of skin points to control the extent to which skin
deforms when you bend a joint. Skin point weights affect the movement of
attached skin as follows:
1 Same as joint
0 None
Note that you can filter sets from the Set Editor to display only cluster and
skin point sets. See Filtering sets from display on page 40.
By default, skin point sets have the names joint2Set1, joint2Set1, and so on.
Sets
Selected points
The corresponding points in the Set Editor turn white to indicate theyre
selected.
7 Scroll the window as needed to see the point members.
The selected set members are highlighted in white in the Set Editor. Boxes to
the right of the members show the points having a weight of 1. The points
have a default weight of 1.
Note that you can select points by clicking members in the Set Editor rather
than in the workspace. If you click a member, the affected point and surface
geometry is highlighted in the workspace.
For NURBS objects, there isnt necessarily a one-to-one correlation between
set members and points visible in the workspace. For example, if you drag a
selection box around the top point of a cone, several members in the set light
up. This is because youve actually selected several points superimposed at
the top of the cone.
Because of the internal structure of NURBS geometry, points are often
superimposed around edges or end positions.
8 Enter the weight in the Edit box, or drag the thumbwheel.
The weight you enter applies to all selected points. The Set Editor shows the
new point weights in the boxes next to the points.
9 In the workspace, transform the clusters handle or skeletons IK handle to
see if your weight choices have the desired results.
10 Adjust the weights as needed.
See Options for modifying point weight numbers on page 38 for details on
options that help you enter weights for groups of points.
Tip
You can also assign weights to the points when you display sets with List
by Object turned on (in list or table format). The technique is the same as
the preceding steps. Selected set members in the Set Editor are highlighted
with a white background in each display format.
For complex clusters having many set members, its easiest to see all set
members with List by Object and table format selected. Table format is
available only for NURBS CV members.
Sets
You can set the weight for adjacent points in the Set Editor with a technique
thats similar to painting. The method is ideal for testing the affect of various
weights on different points.
You can paint point weights only when you display NURBS CV component
sets with List by Object in table format.
Note that the black table entries are unusable members of the set.
3 Choose ModePaint Percentages.
4 Enter a value in the Edit box of the Set Editor.
5 Drag through the desired boxes.
Each box you drag through receives the weight you entered in the Edit box.
6 Repeat the last two steps to paint other boxes with a different value.
See the following topic for options that help you enter weights for points.
Shift When on, the Set Editor adds the number in the Edit box to
the existing weight of the selected point. When you paint
weights, Ctrl-dragging subtracts the number in the Edit box
from the existing weight of the selected point.
(Reset) Resets the thumbwheel value.
When Absolute is on, clicking the Reset icon resets the
thumbwheel to the home value of the selected weight. The
home value is the value a weight has when you click the
weight or enter a new value in the Edit Box.
Suppose you click a weight that has a value of 0.25, then
drag the thumbwheel to change its value to 0.5. When you
click the Reset icon, the weight becomes its original value
0.25.
Sets
When Scale is on, clicking the Reset icon resets the
thumbwheel value to 1.
When Shift is on, clicking the Reset icon resets the
thumbwheel value to 0.
Note
If you display a lengthy set with List by Object in the list format, a scroll
bar appears to the left of set members. The scrolling area displays eight
members by default.
To display more members, choose OptionsObject List Length. Enter the
number in the Mini Scroll Bar Length window, then close the window.
All Regular Sets All sets other than those Maya creates
automatically.
All Deformer Sets Default and added sets for each type of
deformer. Turning this option off lets you
filter specific types of deformer sets listed
Sets
below the option in the Filters menu.
Joint Cluster Sets Skin point sets. (If you add a cluster flexor
to bound skin, Maya creates a set that
contains one or two embedded sets. The
embedded sets are existing skin point
sets. See the note on page 27.)
Example
Suppose youve applied clusters to several NURBS objects in your scene.
You want to edit the points of a cluster youve attached to a cylinder, but
you dont know which of the cluster sets is appropriate.
Sets
5 Expand the set to work on its members.
Tip
If the Set Editor displays a set you want to keep in view, turn off Auto
Update while the set is in view.
This displays all sets in the scene, including those in partitions. See
Understanding partitions on page 47.
To bookmark sets:
1 Display only the desired set or sets in the Set Editor.
For example, select a member of the set in the workspace, then choose
ListUpdate Now to display only the selected set.
2 Select BookmarksAdd Bookmark.
To return to a bookmark:
Sets
Select Bookmarks and the name of the bookmark from the menu.
Example
Suppose you create a bookmark named Eyeballs when the Set Editor
displays only two sets, LeftEye and RightEye.
Selecting BookmarksEyeballs displays the LeftEye and RightEye sets:
To delete a bookmark:
1 Select BookmarksBookmark Editor.
The Bookmarks window appears, showing all bookmarks youve added.
2 Click the name of the bookmark.
3 Select EditDelete Bookmark.
To rename a bookmark:
1 Select BookmarksBookmark Editor.
The Bookmarks window appears, showing all bookmarks youve added.
2 Click the name of the bookmark.
3 Select EditRename Bookmark.
A window appears and prompts for the bookmark name.
4 Enter the new name.
You can also rename a bookmark by selecting Bookmarksname-, where
name is the name of the bookmark. A prompt appears and lets you enter the
new name.
Note
If you create a bookmark in the Set Editor or Graph Editor, a bookmark
name appears among the set names when you display all sets in the Set
Editor. This is because a bookmark is actually a set.
If you expand a bookmark name, youll see the names of the bookmarked
sets embedded under it. The same sets appear in the Set Editor display
elsewhere, not embedded under the bookmark name.
You must work directly with the members of a set where they arent
embedded. To quickly display the appropriate unembedded set, select the
set name, and choose ListUpdate Now.
To edit the weights of the members, display the unembedded sets in table
format with OptionsList by Object on.
Understanding partitions
A partition is a collection of related sets. The sets in a partition can have no
overlapping members.
As you create shading groups, bind skin, and do a few other tasks, Maya
creates partitions. It does this to keep the sets separate where an operation
would be hindered by overlapping members. You can also create custom
partitions to keep your own sets separate.
Sets
by creating a partition and putting the sets in it.
Example
Suppose youre animating a cartoon characters nose as he smiles and
laughs. Youve added a cluster to several CVs for adjusting the nose as he
smiles and another cluster to different CVs for adjusting the nose as he
laughs.
Creating the two clusters creates a set for each group of CVs. Occasionally
you want to move CVs from one set to the other, to alter the deformations
that occur as you transform the clusters.
When you move the CVs from one set to the other set, they remain in the
first set. You might not want the CVs presence in the first set because they
add undesirable deformations as you transform the cluster.
To avoid this problem, you can create a partition and put both sets in it. The
partition prevents one set from having members of another set. When you
move the CVs from the first set to the second set, theyre automatically
removed from the first set.
You can also add a partition to prevent clusters from having overlapping
members when you add the cluster with DeformationsCluster-. See the
Basic Deformers part of Using Maya: Animation for details.
Because you can apply only one shading group per object or per polygonal
facet, the rendering partition ensures you cant accidentally render a single
object or polygonal facet with two shading groups.
If you bind skin to a skeleton, Maya also creates a partition. The partition
has the name joint1skinPartition or something similar. It contains all the skin
point sets in your scene. The partition prevents you from assigning skin
points to two different joints, which would result in undesirable skin
deformations when you manipulate a skeleton
If create a deformer with the Exclusive option, Maya creates a partition
named deformPartition by default. The partition contains all deformer point
sets in your scene. It prevents you from assigning points to two different
sets, which might result in undesirable deformations when you manipulate
the deformers.
Sets
Because Maya creates partitions for you when it makes sense to do so, youll
rarely need to create your own partitions. Still, if you find a situation where
you need create one, you can do so as described in the next topic.
To create a partition:
1 Make sure no objects or other items are selected.
2 Select any sets you want to put in the partition.
See Selecting a set on page 15 for details.
To display partitions:
1 From the Set Editor, choose ListPartitions.
The partitions appear in the Set Editor.
2 To see the sets a partition contains, turn on ModeEditing and expand the
partition.
You can move a set from one partition to another in this display mode, but
you cant move or edit set members. To return to the display of sets only,
choose ListSets. This displays all sets in the scene, including those in
partitions.
Sets
4 To add the set to a partition turn on Try to Add or Force to Add.
If the partition already has a set containing elements of the selected object,
when you select Try to Add, Maya doesnt add the member and instead
displays a warning message to the Script Editor.
If you select Force to Add, Maya adds the member to the set after removing
the member from the set its already part of.
5 After you turn on either option in the prior step, choose the name of the
partition from the Partition menu.
6 Click the Apply button.
Maya puts the set in the selected partition.
4 Select ListPartitions.
5 Select ModeEditing.
6 Click the destination partition to select it.
7 Select EditAdd Items.
Maya puts the set in the selected partition.
cluster1Set set 11 E
collapsing
all sets 40
Edit box 36
Edit Membership Tool 22, 25, 31
K
sets 9
keying
weight attribute values 39
L partitions
adding sets 51
Select Contents mode 13
Select mode 13
layerPartition 48 creating and naming 49 selected objects
layers default 48 displaying set members of 41
moving sets to 7 definition of 47 selecting
displaying 50 character sets 16
List/Table icon 20
moving sets 51 CVs in table format 20
listing by object 17, 19
removing 50 nonmembers in table
table format 20
points format 21
cluster 12 points in Set Editor 36
definition 25
M highlighting in Set Editor 35
set contents 9, 16
set without contents 14, 15
menu bar selecting in Set Editor 36 weight attributes 39
Set Editor 8 pruning selecting objects
Motif selection techniques 22 membership of deformer simplifying with sets 6
sets 28 selection techniques
moving
sets to another partition 51 Motif 22
skin point members 28, 30 Set Editor
R menu bar 8
removing starting 7
N deformer set members 25 tool bar icons 8
partitions 50 set members
NURBS CVs correlation with NURBS
set contents 16
superimposed in CVs 36
set members 24
workspace 36
removing points
with Edit Membership Tool 33
O renaming
bookmarks 46
object list renderPartition 48
changing scroll bar length 40 resetting
overlapping set members weights 39
preventing 47
S
P Scale option 38
Paint Percentages mode 13 scroll bar length
painting changing 40
point weights 37 Scroll Frames to Selection 44
scrolling
directly to selected
members 44
sets 9, 10
adding members 22
simplifying selection with 6
skin point 6, 11, 29
W
adding to Set Editor U and V parameter IDs 21 weights
display 43 user-created 5, 6 cluster point 33
altering display 40 shading groups editing 33
associated with skin points 25 sets Maya creates for 10 entering in Edit box 36
automatically created 5 Shift option 39 keying 39
blend shape 25 negative values 33
skin
cluster 6 painting values 37
altering location of
cluster1Set 11 selecting attributes 39
creasing 32
collapsing 9 set member 6
tuning deformation 28, 30
collapsing all 40 setting cluster or skin point 34
using sets with 6
creating and naming 14 skin point 34
skin points
creating with default name 13
default names of 35
CV member IDs 18
moving membership 28, 30
default listing 17, 19
set comparison with deformer
default naming of 8
sets 29
definition 5
sets 11, 25
deformer 6, 11, 25
weights 34
displaying all 43
displaying selected object starting
members 41 Set Editor 7
Editing mode 13, 18
embedded names 27, 46
expanding a sets contents 8 T
expanding all 40
table format
filtering types of 40
selecting nonmembers 21
indentation 9
set display in 17, 20
initialParticleSE 9, 11
listing by object 19 thumbwheel 39
listing by object in table triangle
format 17, 20 for expanding sets 8
member weights 6 Try to Add 51
Paint Percentages mode 13
preventing overlapping
members 47 U
removing contents only 16
removing members 24 U and V parameters
Index
3 Introducing Expressions 11
About expressions 12
Where you create expressions 13
4 Quick Start 15
Preparing for the examples 15
Creating a simple expression 17
Controlling multiple attributes of an object 23
Controlling attributes in two objects 28
Controlling attributes conditionally 32
Notes on the predefined time variable 43
5 Expression Syntax 45
Expressions and MEL 46
Elements of an expression 47
Attributes 49
Static attributes 49
Dynamic attributes 49
Custom attributes 50
Attribute names 51
Data types of attributes 51
Assigning a value to an attribute 55
Variables 56
Data types of variables 57
Predefined variables 57
Custom variables 59
Constants 62
Arithmetic, logic, and relational operators 63
Arithmetic operators 63
Relational operators 65
Logical operators 67
Operator precedence 68
Conditional statements 69
if statements 69
if-else statements 70
else if statements 71
General syntax rules 73
Comments in expressions 75
Programming features 75
Notes for C programmers 75
Expression language keywords 76
Flow control statements 77
Flow control errors 88
String usage 90
Shortcut assignment operators 91
Shortcut increment and decrement operators 92
Arrays 93
Boolean symbolic constants 95
Common expression errors 95
Error message format 95
Common error messages 97
6 Editing Expressions 99
Finding expressions 99
Finding by expression name 100
Finding by selected object 101
9 Functions 203
Understanding functions 205
Function syntax 206
Data types 208
Understanding function examples in this chapter 208
Limit functions 209
abs 209
ceil 210
floor 210
clamp 211
min 212
max 212
sign 212
trunc 213
Exponential functions 214
exp 214
log 214
log10 214
pow 215
sqrt 215
Trigonometric functions 216
cos 216
cosd 218
sin 219
sind 224
tan 224
tand 225
acos 225
acosd 226
asin 226
asind 226
atan 227
atand 227
atan2 227
atan2d 228
hypot 228
Vector functions 229
angle 229
cross 230
dot 231
mag 231
rot 232
unit 233
Conversion functions 234
deg_to_rad 234
rad_to_deg 234
hsv_to_rgb 235
rgb_to_hsv 235
Array functions 236
clear 236
size 237
sort 237
Random number functions 239
gauss 239
noise 241
dnoise 242
rand 243
sphrand 244
seed 246
Curve functions 249
linstep 249
smoothstep 252
hermite 254
General commands 259
eval 259
print 261
system 263
Other functions and commands 264
Expressions are instructions you type to control an object attribute over time.
An attribute is a characteristic of an object, for instance, X scale, Y translate,
visibility, and so on.
Though you can create an expression to animate attributes for any purpose,
theyre ideal for attributes that change incrementally, randomly, or
rhythmically over time.
Expressions
Eric Saindon
Expressions are also useful for linking attributes between different objects
where a change in one attribute alters the behavior of the other. For instance,
you can make the rotation of a tire dependent on the forward or backward
movement of a car.
This chapter has the following topics:
About expressions on page 12
Where you create expressions on page 13
About expressions
Expressions offer an alternative to difficult keyframing tasks. In keyframing,
you set the values of attributes at selected keyframes in the animation, and
Maya interpolates the action between the keyframes. With expressions, you
write a formula, then Maya performs the action as the animation plays.
Expressions are often as simple as a few words or lines. In the following
example expressions, note the variation in length and detail (rather than
their purpose).
Example
Ball.translateX = Cube.translateX + 4;
Example
if (frame == 1)
Cone.scaleY = 1;
else
{
Cone.scaleY = (0.25 + sin(time)) * 3;
print(Cone.scaleY + "\n");
}
Though many expressions look like math or a programming language, you
dont need to be a mathematician or programmer to learn how to use them.
If youre fond of programming, expressions offer unlimited animation
techniques that would challenge the skill of keyframing experts.
You can use an expression to animate any keyable, unlocked object attribute
for any frame range. You can also use an expression to control per particle or
per object attributes. Per particle attributes control each particle of an object
individually. Per object attributes control all particles of an object
collectively.
You cannot apply an expression to an attribute already animated with any of
these techniques:
keys
set driven key
constraint
motion path
another expression
any other direct connection
If you do so, youll see an error message in the Script Editor and the
Command Lines response area.
Though you cant control a single attribute with two of the preceding
techniques, you can control one attribute with keyframes, another with an
expression, another with a constraint, and so on.
Also, you can use a single expression to assign values to several attributes of
one or more objects.
Expressions
You cannot start the Expression Editor from every attribute text field in the
Channel Box and Attribute Editor. Use WindowExpression Editor if
necessary.
The expression text field expands as you type text, so you can write
expressions of unlimited length. You can also edit expressions with a text
editor such as jot by selecting it from the Editor pull-down menu above the
text field.
The easiest way to learn about expressions is to work through examples. For
this reason, we provide the following introductory lessons. Expressions that
control particle attributes are more complex than for other objects. For
examples, see Chapter 8, Particle Expressions.
Expressions
In this chapter, youll learn about the following topics:
Creating a simple expression on page 17
Controlling multiple attributes of an object on page 23
Controlling attributes in two objects on page 28
Controlling attributes conditionally on page 32
Notes on the predefined time variable on page 43
5 Enter 0 for the starting frame of the Time Slider and the Range Slider, and
enter 300 for the ending frame of the Time Slider and Range Slider.
Important
For the lessons to work correctly, you must enter 0 for the starting frame of
the Time Slider and Range Slider. Press your keyboards Enter key after
each entry. Rewind the animation to frame 0. After doing the lessons, read
Notes on the predefined time variable on page 43 for details on why the
lessons require the starting frame to be 0.
Specifying a range of 300 frames gives ample time to see the effects youll
create in the examples.
6 In the General Preferences window, click Save and Close.
7 At the top edge of the workspace, select ShadingSmooth Shade All to
display all objects you create in the scene with smooth shading.
This will enhance the look of the objects you create in the examples.
8 From the menu bar, choose WindowExpression Editor to display the
Expression Editor.
9 Make sure these default Expression Editor menu options are selected:
Select FilterBy Object/Attribute Name
Object FilterSelected Objects
Attribute FilterAll
Finding expressions in Chapter 6 gives details on these options.
Expressions
3 Select DisplayNURBS SmoothnessFine to set Balls display smoothness
to fine resolution.
Maya displays the object with extra polygons to make it look smoother in
the workspace. This doesnt affect the underlying models geometry. It alters
only its display.
Ball.scaleY = time + 1;
Enter the expression with the same upper and lowercase spelling shown.
Entries in the expression field are type case sensitive.
The semicolon (;) signifies the end of the expression statement. Each
statement in an expression must end with a semicolon. The only exception is
when the expression has a single statement.
An error message appears in the Script Editor and Command Lines
response area if the expression has incorrect syntax or typing mistakes.
Edit text the same way you edit other text fields in Maya.
0 0
1 0.0417
2 0.0833
Expressions
3 0.125
24 1.0
240 10.0
If you ever need to change the playback rate, you can do so by choosing
OptionsGeneral Preferences. Expand the General Preferences window,
display the Units folder, and choose the desired rate from the Time menu.
Regardless of what animation playback rate you choose, you can find the
time elapsed in the animation at any frame with this formula:
frame
time = ---------------
rate
For example, if the frame rate is 24 frames/second and the animation is at
frame 1, the elapsed time is 1 divided by 24, or 0.0417. At frame 6, the
elapsed time is 6 divided by 24, which equals 0.25.
0 0 1
1 0.0417 1.0417
2 0.0833 1.0833
3 0.125 1.125
24 1.0 2.0
Maya executes the expression each frame. This causes the object size to scale
along its Y-axis, stretching its height during playback.
The scaling is smooth because the geometry stretches in synch with the small
time increments of the animation playback.
Expressions
remembering the name of the expression
remembering the name of the object and attribute you controlled with the
expression
examining each expression in the scene thats controlled by an expression
In this example, youll find the expression ScaleBallHeight by its name. See
Chapter 6, Editing Expressions for details on the other methods.
2 Choose Select FilterBy Expression Name.
3 Click ScaleBallHeight in the Expressions list.
The expression appears in the expression text field.
Ball.scaleY = time + 1;
Summary
In this lesson, you learned how to:
name an expression and type it in the expression text field
Expressions
To prepare the scene:
1 From the Modeling menu, choose PrimitivesCreate NURBSSphere.
This creates a NURBS sphere with an X scale, Y scale, and Z scale of 1.
2 In the Channel Box or elsewhere, name the sphere Planet.
3 Select DisplayNURBS SmoothnessFine to set the Planets display
smoothness to fine resolution.
4 Display the Expression Editor and select Select FilterBy Object/Attribute
Name.
5 Rewind the animation to frame 0.
This names the expression so you can find it more easily later.
3 Enter these statements in the expression text field:
The expression has three statements. Each statement sets an attribute to the
value of the predefined variable time.
4 Click Create to compile the expression.
An error message appears in the Script Editor and Command Lines
response area if the expression has incorrect syntax.
Planet disappears because clicking Create also executes the expression at the
current frame after compiling. At frame 0, time is 0, so the value of the
scaleX, scaleY, and scaleZ attributes becomes 0. Planet has no size, so it
disappears.
Expressions
Planet.scaleX = time;
Planet.scaleY = Planet.scaleX;
Planet.scaleZ = Planet.scaleX;
2 Click Edit to compile the expression.
3 Play the animation.
The expression works the same as the previous one. The first statement sets
Planet.scaleX to the value of time.
The second statement sets Planet.scaleY to the value of Planet.scaleX.
Because youve set Planet.scaleX to the value of time, Planet.scaleY also has
the value of time. Youre simply transferring one attributes value to another.
The third statement also sets Planet.scaleZ to the value of the attribute
Planet.scaleX.
The next three statements assign the contents of $increment to the three scale
attributes of Planet. The scale attributes therefore receive the value of time
divided by 5 each frame. This makes the object increase uniformly in scale
slowly as the animation plays.
2 Click Edit.
3 Play the animation.
The result is the same as with the previous expression
4 Stop and rewind the animation.
You can make a change to the variable assignment in the second statement
without altering the other statements.
Expressions
Because you assigned time * 2 to the variable $increment, the expression sets
all three attributes to the value of time * 2 as the animation plays. This makes
the three scale attributes increase at a rate twice as fast as would occur if you
assigned them the value of time alone.
4 Stop and rewind the animation.
This concludes the example. Before starting the next example, delete the
scene and create a new scene.
Summary
In this lesson, you learned how to:
link multiple attributes of the same object with a single expression
use a variable you defined in an expression
modify a single assignment to an attribute without changing other
statements
To see an objects local rotation axes, select the object, then choose
DisplayObject ComponentsLocal Rotation Axes.
Each object rotates around its local X-axis by the degree value resulting from Expressions
time * 10. After 1 second, for example, the rotateX attribute of each object is
one degree times 10, or 10 degrees. After 2 seconds, its 2 degrees times 10,
or 20 degrees.
Maya works in degree angle units, by default. You can change the angular
units to radians by choosing OptionsGeneral Preferences and displaying
the Units folder.
With the animation playing at 24 frames per second, each objects rotateX
attribute has these values:
0 0 0
1 0.0417 0.417
2 0.0833 0.833
3 0.125 1.25
24 1.0 10
The values in this chapter are rounded to four significant digits. The actual
values might have many more digits.
To see the degree value of Can.rotateX at different frames, select Can,
display the Channel Box, and stop the animation at selected frames. The
Channel Box updates its values after you stop the animation.
To see the degree value of Cone.rotateX at different frames, select Cone
instead of Can. The Channel Box displays values for the selected object.
2 Stop and rewind the animation.
You can edit the expression to make Can rotate slower than Cone.
Expressions
statements are in a single expression. You dont need to edit two
expressions.
Before starting the next example, delete the scene and create a new scene.
Summary
In this lesson, you learned how to:
control rotateX attributes in two objects using the same expression
increase the rotation of each object in synch with animation time
rotate one object at half the speed of the other object
Important
When you compare the value of time to a number in an expression, Maya
interprets time as seconds rather than milliseconds, minutes, or any other
unit of time. In the example, Maya interprets 2 as 2 seconds.
The expression checks whether the value of time is less than two seconds. If
so, it does the assignment Balloon.scaleY = time. If time is not less than two
seconds, the assignment doesnt occur.
Notice the indentation of Balloon.scaleY = time under if (time < 2). Maya
ignores all indentation, extra spaces, and blank lines between statements. We
used the indentation to make the expression easier to read. You could have
also written the expression as follows:
if (time < 2) Balloon.scaleY = time;
This isnt as easy to read. Consistent, organized spacing is a good habit to
develop. This book shows examples of good spacing style.
4 Click Create to compile the expression.
Balloon flattens.
Expressions
The expression executes when you click the Create button. Because the
animation is at frame 0, animation time is 0. Because time is less than 2,
Maya sets Balloon.scaleY equal to the value of time, which equals 0.
A scaleY value of 0 flattens the object in the Y dimension.
5 Play the animation.
The flattened Balloons scale increases along its Y-axis. It inflates as the
animation plays.
0 0 0
1 0.0417 0.0417
2 0.0833 0.0833
3 0.125 0.125
24 1.0 1.0
47 1.96 1.9583
48 2.0 1.9583
49 2.04 1.9583
The if statements condition, (time < 2), is a comparison. The condition must
be surrounded by parentheses to isolate it from assignment that follows it.
Expressions
Balloon inflates for 2 seconds. After 2 seconds, Balloon stops inflating and its
position skips from a Y-axis position of 0 to 2. Youll eliminate the motion
skip in a later step.
The second if statement increases the translateY position of Balloon after the
animation time rises above two seconds. The >= symbols mean greater than
or equal to. Whenever time is greater than or equal to 2, the expression
assigns Balloons translateY the value of time. The translateY value therefore
increases for the rest of your animations playback range.
Notice that a semicolon ends each statement. Forgetting a semicolon after
each statement causes a syntax error, and the changes youve made to the
expression wont take effect.
Important
Always examine the Script Editor for error messages after you edit an
expression and click the Create button. If you alter a previously successful
expression and a syntax error occurs, Maya executes the previous
successful expression when you play the animation. This might make you
believe your editing changes took effect.
Balloon doesnt return to the origin because the expression doesnt assign
Balloon a starting point for the beginning of the animation.
5 To make Balloon return to the origin, change the expression to this:
if (time == 0)
Balloon.translateY = 0;
if (time < 2)
Balloon.scaleY = time;
if (time >= 2)
Balloon.translateY = time;
The new first statement sets Balloon.translateY to 0 whenever time equals 0.
The == symbols mean is equal to. In conditional statements, be careful to type
== rather than =. The = symbol means assign the value to.
Note that you can put the three statements in any order in this example.
When Maya plays each frame, it executes each statement in the expression in
the order listed. In this example, the statements work independently, so their
order doesnt matter.
We put the statements in the order of time execution because its easier to
see the logic of the expression. If you ever need to change the expression,
youll be able to grasp the expressions actions more quickly.
6 Click Edit.
7 Stop and rewind the animation again.
The flattened Balloon returns to its correct position at the origin.
Expressions
As mentioned before, Balloon skips from Y-axis position 0 to 2 after two
seconds of animation play. You can eliminate the skipping and make
Balloon rise smoothly from the origin.
Balloon inflates for 2 seconds, then rises slowly with time from its position at
the origin.
When time is greater than or equal to 2, the translateY position of Balloon
becomes 2 minus 2, which is 0. As time increases beyond 2 seconds, the
translateY position increases in the same increments that time increases.
if (time < 2)
Balloon.scaleY = time;
else
Balloon.translateY = time - 2;
2 Click Edit.
3 Play the animation.
The else keyword sets Balloon.translateY to time - 2 when (time < 2) is false.
In English terms, the combination of the if and else statements says, If time
is less than two seconds, set Balloon.scaleY to the value of time. Otherwise
(when time is greater than or equal to two seconds), set Balloon.translateY to
time minus two.
Expressions
To make the expression easier to read:
1 Change the expression to this:
if (time < 2)
{
Balloon.translateY = 0;
Balloon.scaleY = time;
}
else
Balloon.translateY = time - 2;
We removed this statement from the previous version of the expression:
if (time == 0)
Balloon.translateY = 0;
In its place, we put the statement Balloon.scaleY = time in a segment
enclosed by the braces { and }. Maya evaluates both the statements between
the braces if the condition (time < 2) is true.
2 Click Edit.
Expressions
To further refine Balloons appearance:
1 Change the expression to this:
if (time < 2)
{
Balloon.translateY = 0;
Balloon.scaleY = time * 0.6;
Balloon.scaleX = time * 0.5;
Balloon.scaleZ = time * 0.5;
}
else
Balloon.translateY = time - 2;
2 Click Edit.
Balloon disappears from view because its scale attributes are 0.
The scaleX, scaleY, and scaleZ attributes are 0 at frame 0 because time is 0.
Any number multiplied by 0 is 0.
3 Play the animation.
Summary
Using an expression is a combination of logic and experimentation. Problem
solving starts with breaking a task into smaller problems you can solve and
later refine.
In this lesson, you learned how to:
control an attribute conditionally with an if statement
use good spacing and indentation for expressions
use relational operators such as <, <=, and ==
use multiple if statements to control different conditions
use an if-else statement in place of multiple if statements to make an
expression easier to read and comprehend
refine an expression with a combination of analysis and experimentation
Expressions
value of Balls scaleY attribute to time + 1, which equals 0.0417 + 1, or 1.0417.
Because Balls scaleY attribute was 1 when you created it, rewinding the
animation sets scaleY to a value 0.0417 larger than its initial value.
This discrepancy means the Ball scaleY is larger than its scaleX and scaleZ
attributes in the first frame of the animation. Though the difference is not
substantial in this example, other cases might be more significant.
To start your animation at frame 1 and get the same result as the example,
you can subtract 0.0417 from the attribute:
Ball.scaleY = (time - 0.0417) + 1;
When you rewind the animation, the expression sets Balls scaleY value to
(0.0417 - 0.0417) + 1. This equals 1, its original scaleY value.
When you use the predefined time variable, be aware of the starting frame
number and the associated time value.
After doing the lessons in this chapter, remember to change your Time
Sliders starting frame, ending frame, and frame rate to the desired values
when you start other projects. To do this, select OptionsGeneral
Preferences and display the appropriate tabs in the General Preferences
window.
Expressions
rotation.
Tristan Ikuta
This chapter describes the following topics:
Expressions and MEL on page 46
Elements of an expression on page 47
Attributes on page 49
Variables on page 56
Constants on page 62
Arithmetic, logic, and relational operators on page 63
Operator precedence on page 68
Conditional statements on page 69
General syntax rules on page 73
Comments in expressions on page 75
Elements of an expression
An expression is made of one or more statements. Statements follow the
rules of algebra, so theyll seem familiar if youve studied math. Each
statement has several elements as in the following example:
Statement
Variable
Expressions
=. In the example, Ball.rotateZ receives the value of the
statement sin(time) + 6. (Ignore what this assignment does;
its for illustration only.) You can also use = to assign a value
to a variable.
Function A special word that you provide with an entry called an
argument. In this example, the argument is time. Based on
the value of the argument, Maya does a calculation for the
function and returns a new value or takes some other action.
In the example, the function sin(time) returns the sine of the
value of time, which evaluates to a number between -1 and
1.
Maya has many convenient built-in functions and
commands that do math calculations, conversions, and so
on. See Chapter 9 for details.
Example
Heres an expression with the fewest elements possible:
Value assigned
Ball.scaleY = 5;
Attributes
An attribute is a characteristic of an object or other item in a scene. There are
many ways to set attributes in Mayawith the Attribute Editor, Channel
Box, menu selections, and of course, expressions. You can set attributes to
control virtually anything in your animation.
There are three types of attributes you work with in Maya:
static
dynamic
custom
Static and dynamic attributes have a predefined purpose. They are standard
attributes Maya provides for objects and items that make up a scene. Custom
attributes are attributes you define for an object.
Static attributes
Static attributes are attributes an object has by default. They exist the
moment you create the object and throughout its lifetime.
For example, the transform node of a NURBS sphere has static attributes
scaleX, scaleY, scaleZ, rotateX, and so on. You can set the values of these
attributes with the Attribute Editor, Channel Box, expressions, and other
Expressions
techniques after you create the object.
Dynamic attributes
Dynamic attributes have predefined names and purposes, but Maya adds
them to an object in response to your user interface selections.
For example, suppose you create a particle object and display its particle
shape folder in the Attribute Editor. If you click one of the following buttons
in the Add Dynamic Attributes section of the Attribute Editor, Maya adds a
dynamic attribute to the node:
Clicking the General button lets you add a custom attribute (see the next
topic). Clicking any of the other buttons lets you add one or more dynamic
attributes with names that are the same or similar to the button name.
An object has no dynamic attributes unless your actions cause Maya to add
them to the object. By adding only required attributes, Maya runs faster.
When you add a dynamic attribute to an object, the attribute appears in the
Attribute editor for the selected object or node.
Note
Because soft body geometry is a particle shape node coupled with
geometry, a soft body has the same static and dynamic attributes as a
particle object.
Custom attributes
Custom attributes are attributes you optionally add from the New folder of
the Add Attribute window.
Attribute names
Static, dynamic, and custom attributes follow the same naming conventions
and represent the same types of data.
A full attribute name has this format:
object.attribute
where object is the name of the object node, and attribute is the name of the
attribute. A period (.) separates the name of the object and attribute.
You must spell the object and attribute name with uppercase and lowercase
letters as they appear in the Expression Editors Objects and Attributes lists.
Expressions
You cannot spell attribute names with the common English spellings shown
in the Attribute Editor or by default in the Channel Box.
See Using attribute names in expressions in Chapter 6 for more details.
Example
Ball.scaleY
Note
Scientists often refer to a vector as a quantity that specifies both a
magnitude and direction. In Maya, a vector is simply a related group of
three floating point numbers that set an attribute or variable.
Vector array data types are useful for animating position, velocity,
acceleration, color, and other particle attributes made of three components.
Float array attributes are useful for setting lifespan, opacity, and other
particle attributes that have a single number value.
Attributes having a vector array or float array data type are also called per
particle attributes. See Chapter 8 for details on working with particle
attributes.
If you have programming experience, note that for vector array data types,
Maya represents the specified attribute for each particle of the object with a
single element of an array. Each element is made of three floating point
numbers. In a float array, Maya represents the specified attribute for each
particle with a vector array element thats a floating point number.
Note
In expressions, you must type a vector in double angle brackets (<< >>).
For example, type <<3,0,5>> for a vector having 3, 0, and 5 as its left,
middle, and right component.
Expressions
find the attribute name and examine its data format.
Floating point
Boolean
Integer
A floating point attribute shows a value that includes a decimal point. Most
numerical attributes in Maya are floating point.
A Boolean attribute has a checkbox or other user interface item for turning it
on or off.
An integer attribute has no decimal point. Integer attributes are rare in
Maya.
The data type of an attribute limits what type of value you can enter for the
attribute in the Attribute Editor and in expressions. For example, because a
directional lights Depth Map Filter Size attribute is an integer, you cannot
enter a decimal point in its text entry box or assign it a decimal quantity in
an expression.
For a floating point attribute, you can omit the decimal point. The Attribute
Editor automatically inserts a decimal point in the attributes text field after
you press the Enter key. For example, if you type 3 for a floating point entry,
the Attribute Editor replaces 3 with 3.0000.
Expressions
with ModifyAdd Attribute, you do not define their data type either.
You can assign a value to any attribute. If the attribute is dynamic or custom,
though, you must add the attribute to the object before you can assign it a
value in an expression.
Become familiar with the purpose of an attribute by working with it in the
Attribute Editor, Channel Box, or other parts of Maya before assigning it a
value in an expression. Its best to know the behavior you can expect from
the attribute in case you write your expression incorrectly.
Note
For rigid bodies, you can read but not write the velocity, angularVelocity,
and force attributes.
Examples
Cone.scaleY = 5.3;
This assigns 5.3 to the floating point scaleY attribute of Cone.
Ball.translateY = time;
This assigns the value of time to the floating point translateY attribute of
Ball.
Ball.scaleX = Ball.scaleY = Ball.scaleZ = 2;
This assigns 2 to the floating point scaleX, scaleY, and scaleZ attributes of
Ball. As the example shows, you can use an assignment operator several
times in a statement to set multiple attributes to the same value.
Variables
A variable is a symbolic name that stands for a constant or changing value.
There are two types of variables, predefined and custom.
Maya creates and maintains predefined variables. Custom variables are
variables you can create to store data in an expression.
Keep in mind that attributes, not variables, set object and component
behavior in Maya. You can use variables to as temporary storage for
working with the attributes.
The most common data type of variables is floating point. Integer data types
are rarely used. Booleans are commonly used in attributes, but not allowed
in variables. Vector variables are useful in expressions for particle shape
attributes.
Expressions
Animators with programming experience sometimes use string variables.
Quote marks (" ") are required with strings. See String usage on page 90
for details.
For a custom variable you create in an expression, you must declare the data
type as described in Custom variables on page 59.
Predefined variables
Maya maintains values in two predefined variables as an animation plays:
Your expressions can read, but not set, the value of time and frame. These
variables are floating point values that are useful for animating an attribute
as an animation plays.
The time updates as an animation plays. It contains the elapsed number of
seconds from the first frame to the current frame. The value increases with
the increasing frame number.
At the default animation playback rate of 24 frames per second, time has
these values, rounded to four decimal places:
0 0
1 0.0417
2 0.0833
3 0.125
24 1.0
240 10.0
frame
time = ---------------
rate
For example, if the frame rate is 24 frames/second, and the animation is at
frame 1, the elapsed time is 1 divided by 24, or 0.0417. At frame 6, the
elapsed time is 6 divided by 24, which equals 0.25.
If the frame rate is 30 frames/second and the animation is at frame 1, the
elapsed time is 1 divided by 30, which equals 0.0333. At frame 6, elapsed
time is 6 divided by 30, which equals 0.2.
Examples
Ball.translateY = time/2;
This sets the Balls Y translation equal to the value of time divided by 2 as
the animation plays. This make the Ball move in a Y direction as the
animation time increases.
Ball.scaleY = frame/2;
This sets the Balls Y scale equal to the value of frame divided by 2 as the
animation plays. The Ball scales along its Y axis as the animation frame
number increases.
Custom variables
Expressions
You can declare and use variables to store a constant or changing value.
These work like their counterparts in programming languages and
spreadsheet programs.
Though programming languages use such variables abundantly, you might
not need to use them at all in many expressions.
Declaring variables
Each custom variable name must begin with a dollar sign character ($). After
the $, you can use alphabetical, numerical, and underscore characters. You
cannot include spaces in the names.
Variable names are type case sensitive. In other words, $temp is a different
variable name than $Temp.
Examples
float $object_height;
This declares $object_height as a floating point variable.
int $counter;
This declares $counter as an integer.
vector $top_velocity;
This declares $top_position as a vector variable.
Examples
float $counter = 5.3;
This declares a floating point variable named $counter and gives it an initial
value of 5.3.
$height = 6;
This declares a floating point variable named $height and gives it an initial
value of 6. This example shows you can skip declaring the variables data
type. When you assign a variable a value, Maya assumes the variable is
floating point unless you specify a different data type.
$pi = 3.1415927;
$twist = $pi;
These statements show you can assign the value of one variable to another
variable. The first statement assigns 3.1415927 to $pi. The second statement
assigns the contents of $pi, 3.1415927, to $twist.
Important
If you misspell an existing declared variable name and assign it a value, a
syntax error wont be generated for the undeclared variable. Because Maya
automatically provides a data type for an undeclared variable if its on the
left side of the assignment operator, the misspelled variable will be
interpreted as a newly added variable. Undeclared variables on the right
side of the assignment operator do generate error messages.
Check spellings of variables if your expression isnt working as expected.
In the following example, the misspelling in the final statement generates
an error but not the misspelling in the statement before it:
int $start;
int $end;
int $interrupt;
$starrrt = 1;
$end = $interrupppt;
Expressions
assigning values to vector variables. Such variables are useful for working
with particle shape node attributes.
Example
global float $counter;
You can thereafter set or read the value of this variable in any other
expression in the scene.
If you create a variable with the same name in two expressions, the two
variables are separate and unrelated. For example, suppose you create a
variable named $timer in two expressions. Assigning a value to one of the
$timer variables has no effect on the others value.
If you declare and initialize a global variable in a single statement, you can
initialize it to a numerical constant or string only.
Examples
global float $counter = 3;
This initializes $counter to 3.
global float $counter = time;
This causes an error because time is a variable.
If you declare and initialize a global variable in a single statement, the
statement executes only when Maya compiles the expression. Maya compiles
an expression when you click the Create or Edit button in the Expression
Editor, or when you open a scene containing a previously created
expression.
Example
global float $counter = 3;
print($counter+"\n");
$counter = 1000;
print($counter+"\n");
When Maya compiles the expression, it sets $counter to 3, prints 3, sets
$counter to 1000, then prints 1000.
During playback, each execution of the expression skips the first statement,
so $counter never receives the value 3. The expression prints 1000, sets
$counter to 1000 again, and prints 1000 again.
Constants
A constant is an unchanging number or variable.
Examples
Ball.translateY = 6.1.
This statement sets Balls translateY attribute to the constant number 6.1.
float $pi = 3.1415927;
Ball.rotateY = $pi;
These statements set the value of Balls rotateY attribute to the value of the
variable $pi. The variable $pi represents the constant 3.1415927.
Arithmetic operators
Expressions
operator (%) calculates the remainder of division.
Examples
Car.translateX = time / 2.0;
This moves the Car in an X direction as the time increases in the animation.
By dividing time by 2.0, you move the object half as fast as if you used time
alone.
Car.translateX = 7 % 3;
This assigns Car.translateX the value 1, the remainder of 7 divided by 3. The
number 7 divided by 3 equals 2 with a remainder of 1.
Car.translateX = 8.8 % 4.2;
This assigns Car.translateX the value 0.4, the remainder of 8.8 divided by 4.2.
The number 8.8 divided by 4.2 equals 2 with a remainder of 0.4.
Car.translateX = 0.5 % 3;
This assigns Car.translateX the value 0.5, the remainder of 0.5 divided by 3.
The number 0.5 divided by 3 equals 0, with a remainder of 0.5.
Vectors
For operations between vector attributes and variables, the * operator
performs the dot product. The dot product multiplies corresponding
components of each vector, then adds the components to create a single
floating point number result.
For + and - operators, each component of one vector is operated on by its
counterpart component in the other vector.
For operations between a vector and an integer or floating point number,
each component of the vector is operated on by the integer or floating point
number.
Examples
Suppose youve initialized these vectors:
vector $A = <<1,2,3>>;
vector $B = <<2,3,4>>;
vector $C;
float $myfloat;
You then use the following statements (in different expressions, not in
sequential order):
$C = $A + $B;
This assigns $C the value << 3, 5, 7>>.
$C = $B - $A;
This assigns $C the value <<1, 1, 1>>.
$myfloat = $A * $B;
This assigns $myfloat the value (1*2) + (2*3) + (3*4), which equals 20.
Multiplying two vectors gives the dot product of the vectors.
$C = 3 * $A;
This assigns $C the value <<3, 6, 9>>. Each component of the vector is
multiplied by 3 to create a vector result.
Strings
For details on how to use the + operator with strings, see String usage on
page 90.
Note
Maya handles integer and Boolean attributes in an expression
mathematically as floating point numbers. After the expression executes,
Maya converts the floating point number to the proper data type.
If your expression does arithmetic on an integer or Boolean attribute and
you display the attributes contents in the Script Editor, youll see floating
point values. After the expression executes, Maya assigns an appropriate
integer or Boolean value to the attributes you set in the expression text
field.
Maya handles integer and Boolean variables within an expression
mathematically as integer and Boolean data types.
Relational operators
Youll often use relational operators to compare the value of variables and
attributes in conditional statements. See Conditional statements on page
69.
Expressions
Symbol Meaning Used with these data types
Examples
if (time > 10)
Sphere.translateX = 3;
When the animation time is greater than 10 seconds of play, the expression
sets the Spheres translateX attribute to 3. It stays fixed in this position
thereafter. See Conditional statements on page 69 for details on the if
condition in this and following examples.
if (Ball.scaleY == 3)
Cone.scaleY = 6;
If Balls scaleY attribute is equal to 3, Maya sets Cones scaleY attribute to 6.
Important
Be careful to type == rather than = for the equal to operator.
For example, suppose you type if (Ball.scaleY = 3) in the previous example.
Rather than test whether Ball.scaleY is equal to 3, the statement assigns 3 to
Ball.scaleY.
Maya evaluates the assignment statement Ball.scaleY = 3 as a true
condition, so it executes Cone.scaleY = 6. This statement doesnt cause an
error message, but it gives unintended results.
Vectors
If you use the == or != operators between two vector attributes or variables,
Maya compares the corresponding components of each vector. In contrast,
the >, >=, <, and <= operators compare the magnitude of two vectors.
Use this formula to calculate a vectors magnitude:
2 2 2
x +y +z
Examples
vector $A = <<1,2,3>>;
vector $B = <<1,2,3>>;
if ($A == $B)
Sphere.translateX = 3;
2 2 2 2
0 +4 +0 = 4 = 4
2 2 2 2
1 +0 +0 = 1 = 1
Logical operators
You use logical operators with the relational operators described in the
Expressions
previous topic. Logical operators are often part of conditional statements.
See Conditional statements on page 69.
Symbol Meaning
|| or
&& and
Example 1
if ((time > 5) && (time < 10))
Ball.scaleZ = time;
This sets Balls scaleZ attribute to the value of time only when the animation
time is greater than 5 and less than 10 seconds.
Example 2
if ((Ball.translateX < 5) || (Ball.translateY > 10))
Ball.scaleZ = time;
This sets Balls scaleZ attribute to the value of time in either of two
conditions: when Balls translateX attribute is less than 5 or greater than 10.
Operator precedence
The precedence of operators in expressions follows:
Highest () []
! ++ - -
* / % ^
+ -
< <= > >=
== !=
&&
||
Lowest = += -= *= /=
Examples
Ball.scaleY = 8 + 2 * 4;
This assigns Ball.scaleY the value 16.
Ball.scaleY = (8 + 2) * 4;
This assigns Ball.scaleY the value 40.
Ball.scaleY = 8 + 6 - 4;
This assigns Ball.scaleY the value 10. The + executes first because its further
to the left in the statement than the -.
Conditional statements
Conditional statements set one attribute or variable based on the condition
of another attribute or variable. For example, you might increase the scale of
a balloon after frame 48 plays.
The if and if-else statements are the most commonly used conditional
statements in expressions.
Youll often use relational and logical operators in conditional statements.
See page 65 and page 67 for details.
If you have programming experience, be aware you can use loop and flow
Expressions
control statements such as while and for. See Programming features on
page 75.
if statements
The if conditional statement has this format:
if ( condition )
statement;
If condition is true, statement executes.
Example
if (time > 3)
Ball.scaleY = 2;
This sets the scale of Balls scaleY attribute to 2 after the animation plays
three seconds.
if-else statements
The if-else conditional statement has the following format:
if ( condition )
statement1;
else
statement2;
If condition is true, statement1 executes. Otherwise statement2 executes.
If the animation time is less than 2 seconds, the expression sets Balloons
translateY attribute to 0, and sets its scaleY attribute to the value of time
multiplied by 0.6.
If animation time is greater than or equal to 2 seconds, the expression sets
Balloons translateY attribute to time minus 2, and sets its scaleY attribute to
1.
Important
You cannot set the same attribute in two different expressions. If you try to
do so, an error message results and your second expression has no effect.
else if statements
The else if statement works with the if-else conditional statement and has
this format:
if (condition1 )
statement1;
else if ( condition2 )
statement2;
If condition1 is true, statement1 executes and the else if statement after it is
skipped.
Expressions
If condition1 is false, the else if statement executes. If condition2 is true,
statement2 executes. If neither condition is true, neither statement executes.
You can add an else condition to the previous format as follows:
if (condition1 )
statement1;
else if ( condition2 )
statement2;
else
statement3;
If neither condition is true, statement3 executes.
Example
if (time < 3)
Ball.scaleY = 1;
else if ((time >= 3) && (time =< 6))
Ball.scaleY = 2;
else
Ball.scaleY = 3;
This sets Balls scaleY attribute to 1 if animation time is less than 3 seconds.
If animation time is between 3 and 6 seconds, scaleY is 2. Otherwise, when
time is greater than 6 seconds, scaleY is 3.
Note that you can add multiple else if statements and multiple statements
within braces ({ }) using this format:
if (condition1 )
{
statement;
statement;
}
else if ( condition2 )
{
statement;
statement;
}
else if ( condition3 )
{
statement;
statement;
}
else if ( condition4 )
{
statement;
statement;
}
else
{
statement;
statement;
}
Expressions
parentheses.
When you use { and } as opening and closing braces, make sure you use
them in matching pairs:
if (time > 3)
{
Ball.rotateZ = deg_to_rad(-6 * (floor(time));
Ball.rotateY = Ball.rotateZ * 3;
}
Enclose a vector in double angle brackets as in this example:
<<3,4,8>>
Spaces before and after the numbers and commas are optional.
Begin any variable you use with a dollar sign ($), and do not to use spaces or
special characters other than underscores in the name. Heres an acceptable
example:
float $my_Rotate;
$my_Rotate = 3.14;
Comments in expressions
Add comments to your expressions to explain the purpose of each statement
within. Youll appreciate this later if you need to modify the expression.
Maya ignores comments.
Programming features
The following topics describe programming features available in
expressions. Discussion is brief and assumes youre familiar with
programming. Most of the syntax features described work like their C
Expressions
counterparts.
Mayas integer data type has the same numerical range as ANSI Cs integer
data type, -2,147,483,648 to 2,147,483,648.
Mayas float data type has the same numerical range as ANSI Cs double
data type.
Other keywords
The return, proc, and matrix keywords are useful for writing MEL scripts,
not for expressions. Other keywords above are described throughout this
chapter.
Type keywords in lowercase letters exactly as shown. Do not name a custom
attribute with any of these keywords.
Important
Using a while, do, or for loop incorrectly might halt Maya. See Flow
control errors on page 88 for details.
while
A while loop has this format:
while ( condition )
{
statement;
statement;
...
}
Use condition to compare variable, attribute, or constant values. If condition is
Expressions
true, Maya executes each statement between braces. Maya then evaluates
condition again. If true, it executes each statement again. This cycle continues
until condition is false, whereupon execution resumes with the statement
after the loop.
Example
float $test = 0;
do
A do loop has this format:
do {
statement;
statement;
...
}
while (condition);
Here Maya executes each statement between braces, then evaluates condition.
The condition compares variable, attribute, or constant values. If condition is
true, each statement executes again. The loop terminates when condition is
false.
In contrast to a while loop, a do loop executes the statements in the loop at
least once. It tests the termination condition after the loop. A while loop tests
the termination condition before executing the statements in the loop.
Example
float $test = 0;
do {
print("$test equals: " +$test+"\n");
$test = $test + 1;
}
while ($test < 5);
for
A for loop has this format:
for (initialization; condition; change of condition)
{
statement;
statement;
...
}
A for loop evaluates the termination condition before executing each
statement. The condition compares variable, attribute, or constant values.
Example
float $i;
Expressions
{
print("$i equals: " +$i+"\n");
}
This expression displays the following lines in the Script Editor:
$i equals: 0
$i equals: 1
$i equals: 2
$i equals: 3
$i equals: 4
break
The break instruction exits a loop from any point within its body, bypassing
the normal termination at the loops beginning or end. Expression execution
resumes at the next statement after the loop. You can use a break instruction
with a while, do, or for loop.
Example
float $f = 0;
while( $f < 10 )
{
print("$f equals: "+$f+"\n");
if ( $f > 5 )
break;
$f = $f + 1;
}
This expression displays the following lines in the Script Editor:
$f equals: 0
$f equals: 1
$f equals: 2
$f equals: 3
$f equals: 4
$f equals: 5
$f equals: 6
Suppose the example didnt have this statement:
if ($f > 5)
break;
The loop would execute ten times and display the numbers 0 through 9.
The break statement terminates the loop after $f is greater than 5. So the
expression displays only numbers 0 through 6.
continue
The continue instruction works inside loops. It forces the next iteration of the
loop to occur, skipping any statements between itself and the loops test
condition. The condition compares variable, attribute, or constant values.
Example
float $f = 0;
Expressions
$f equals: 7
$f equals: 8
$f equals: 9
Suppose the example didnt have this statement:
if( $f > 5 )
continue;
The loop would display got here after each line of $f equals: n. Maya ignores
the continue instruction until $f increases to a value greater than 5.
When $f becomes 6 or greater, the continue instruction executes and skips
the remaining statement in the loop, so got here isnt printed.
for-in
The for-in loop is a specialized for loop that simplifies manipulation of all
elements of an array. A for-in loop with an array element variable lets you
omit the initialization, condition, and change of condition components of a for
loop.
Example
string $carType[3] = {"Porsche", "Ferrari", "Fiesta"};
string $car;
for ($car in $carType)
{
print("I want a new ");
print($car + ".\n");
}
The expression displays this in the Script Editor:
I want a new Porsche.
I want a new Ferrari.
I want a new Fiesta.
The loop executes three times, once for each array element in $carType.
The first loop execution copies array element $carType[0] into $car, then
prints, I want a new Porsche. Array element $carType[0] is Porsche.
The second loop execution copies $carType[1] into $car, then prints the
second line shown. The third execution copies $carType[2] into $car, then
prints the third line shown.
When the for-in statement finishes reading all array elements, the loop
terminates.
switch
A switch instruction executes one of several groups of statements based on a
control value. The control value can be a variable value or an attribute other
than an array (per particle) attribute. The format follows:
switch (control-value)
{
case value1:
statement;
statement;
...
break;
case value2:
statement;
statement;
...
break;
case value3:
statement;
statement;
...
break;
...
default:
statement;
Expressions
statement;
...
break;
}
The switch executes with a variable control-value. If the variable contents
match value1, value2, or another value in the switch, the statements under the
associated case statement execute. The control-value can be an int, float,
string, or vector.
Be careful if you use a float control-value. Because of the way floating point
arithmetic rounds numerals, a case value might fail to match a control-value
as you expect.
A break statement within a switch causes execution to skip subsequent case
statement groups within the switch instruction.
Expressions
Note that you can make more than one case statement execute the same
statements:
int $argo = rand(4);
switch ($argo)
{
case 0:
case 1:
print("Food\n"); // Runs if $argo is 0 or 1
case 2:
case 3:
print("Fight\n");// Runs if $argo is 2 or 3
break;
}
This works like the preceding expression, except that a match of 0 or 1
displays Food and Fight, and a match of 2 or 3 displays Fight.
Example
You can use the default keyword to make a block of statements execute when
none of the case values match the control value label. Generally, you put this
label after all the case statements, though you can put it anywhere in the
switch statement.
If the switch has no default label and none of the case values match the
control value, the switch does nothing.
vector $mgb = <<1,1,0>>;
switch ($mgb)
{
case <<0,1,1>>:
print("Who?\n");// Runs if $mgb is <<0,1,1>>
break;
case <<1,0,1>>:
print("What?\n");//Runs if $mgb is <<1,0,1>>
break;
default:
print("Why?\n"); // Executes if $mgb is not
break; // <<0,1,1>> or <<1,0,1>>
}
The expression executes the default case, which displays the following line
in the Script Editor:
Why?
?: operator
The ?: operator lets you write a shorthand if-else statement to set an attribute
or variable in one statement. Because of its cryptic appearance, many
programming style experts suggest not using it.
Heres its format:
attribute = condition? statement1: statement2;
The condition compares variable, attribute, or constant values. If condition is
true, Maya evaluates statement1 and assigns its value to attribute. (You can
also assign the statements value to a variable.)
Maya evaluates either statement1 or statement2, never both.
You can optionally enclose statement1 and statement2 in parentheses to make
the expression easier to read.
Example
Balloon.scaleY = (time < 2) ? time / 2: time * 2;
This statement sets Balloons scaleY attribute to time divided by 2 if time is
less than 2, and time multiplied by 2 if time is greater than or equal to 2. This
causes the scaleY attribute to increase slower for the first two seconds than
after two seconds.
This is the same as the following if-else statement:
if (time < 2)
Balloon.scaleY = time / 2;
else
Balloon.scaleY = time * 2;
Use this format because its easier to read.
Important
If you use an integer value as statement1 and a floating point value as
statement2, the ?: operator truncates the floating point value of statement2 to
an integer.
In the expression Balloon.scaleY = (time < 2) ? 0: time;, for example, 0 is an
integer, and time is a floating point value. When time is 2 seconds or more,
Maya sets Balloons scaleY attribute to the integer value of time.
Expressions
Because Maya sets scaleY to the integer value of time (without the decimal
part), scaleY jumps in one-second increments at time 2, 3, 4, and so on.
If you have problems using the ?: operator, use an if-else statement instead.
! operator
You can use the not logical operator (!) with integer, float, and vector data
types.
For vector values, ! is true only when the vector magnitude is 0. A vectors
magnitude is the value resulting from this equation:
2 2 2
x +y +z
Examples
if (!$count)
Ball.scaleY = 2;
The !$count condition is true only if $count is 0. If true, Ball.scaleY is set to 2.
vector $myvector = <<0,0,0>>;
if (!$myvector)
Ball.scaleY = 2;
Because the magnitude of $myvector is 0, the !$myvector condition is true
and Ball.scaleY is set to 2.
Example 1
Suppose you create an object named Balloon and decide to use a while loop
to increase its Y scaling after three seconds of animation play.
while (time > 3)
Balloon.scaleY = time;
Though you might think this expression sets Balloons scaleY attribute to the
increasing value of time after the animation time exceeds 3 seconds, it
actually halts Maya operation as soon as time exceeds 3. At that moment, the
while condition is true, so the while loop statement Balloon.scaleY = time
executes repeatedly and endlessly.
Even though a statement sets an attribute within an expression, Maya
updates the attribute only after the expression finishes executing. Because
the expression never finishes executing, Maya halts.
Unless you change Balloon.scaleY within the while loop to a value less than
or equal to 3, the statement executes infinitely.
To get the desired result without halting Maya, use this expression:
if (time > 3)
Balloon.scaleY = time;
Example 2
Suppose you create objects named Cone and Ball, then use a while statement
to link the Balls translateY attribute to the Cones translateY attribute:
while (Cone.translateY > 0)
Ball.translateY = Cone.translateY;
At first glance, the expression seems to set Balls translateY position to the
value of the Cones translateY position whenever Cones translateY is greater
than 0.
In fact, the expression halts Maya as soon as you translate the Cone to a Y
position greater than 0. At that moment, the while condition is true, so the
while loop statement Ball.translateY = Cone.translateY executes endlessly.
Nothing you do in the user interface can change the Cones translateY
position. It stays at translateY value of 0.
Unless you change Cone.translateY within the while loop to a value less
than or equal to 0, the statement executes infinitely.
To get the desired result without halting Maya, use this expression:
Expressions
if (Cone.translateY > 0)
Ball.translateY = Cone.translateY;
Example
float $x = cosd(90);
if ($x == 0)
print("This equals 0.\n");
else
print("This doesnt equal 0.\n");
String usage
A string is a sequence of alphabetical, numerical, and special characters. You
can display strings in the Script Editor, for example, to check the contents of
attributes or variables.
You can also create strings in the Expression Editor to execute MEL
commands in an expression. See Chapter 7 for details.
Guidelines for using strings follow:
Enclose a literal string with double quotes as in this example:
print("asteroid2");
This displays the following text:
asteroid2
You can use the + operator to concatenate strings as in this example:
print("Balls scaleY attribute equals: " + Ball.scaleY);
Expressions
vector $i = vector ("<<1,2,3>>");
You can execute a MEL command in an expression statement. See
Executing MEL commands in an expression in Chapter 7.
The following table shows the shorthand operators and the valid data types
for each. The shorthand operators work like their counterparts in C.
%= integer, float
Example
$counter += 1;
This adds 1 to $counter each time the statement executes.
Examples
float $eel = 32.3;
float $crab = $eel++; // $crab = 32.3; $eel = 33.3;
$crab = $eel--; // $crab = 33.3; $eel = 32.3;
$crab = --$eel; // $crab = 31.3; $eel = 31.3;
$crab = ++$eel; // $crab = 32.3; $eel = 32.3;
Important
To avoid unexpected results, do not use more than one shortcut increment
or decrement operator on the same variable in the same statement. The
evaluation order of the operators is unpredictable.
Arrays
You can create arrays of float, vector, integer, or string values. You can clear
an array using a clear function. You can find the size of an array with the
size function. See Array functions in Chapter 9 for details.
When you assign a value in an array, Maya reserves memory for all
elements less than that number. This means you can exceed the capacity of
your computer with a single array declaration. For example, do not use a
statement like this:
Expressions
$newarray[12312323123] = 1;
The second statement makes the array contain 1501 elements and assigns
element 1500 the value 3. The third statement expands the array to 2001
elements and assigns element 2000 the value 5.
The for loop stops executing after $i becomes equal to 10. Then the final
print statement displays the number of elements of the initialized array, 10.
The array increased in size as you assigned values to its elements.
Example
if (Monster.visibility == on)
Lance.scaleY = time / 3;
This causes Lances scaleY attribute to increase only if Monsters visibility
attribute is on. The on represents 1.
print(3 + on);
This displays 4 in the Script Editor. Again, on represents the value 1.
Expressions
syntax errors and logic errors. Syntax errors include mistakes in spelling,
incomplete attribute names, omitted semicolons, and other oversights that
prevent the expression from compiling and executing. For syntax errors,
Maya explains the error in a message to the Script Editor.
Logic errors are mistakes in your reasoning that cause unexpected animation
results. The syntax of your expression is valid, but errors in your logic
prevent Maya from doing what you intended. In the worst cases, Maya
might halt operation because your statements lock it into a permanent loop.
Because Maya cant detect logic errors, it cant display error messages. As
such, these errors are harder to find and require more analysis to solve. To
resolve logic errors, its often helpful to display the contents of relevant
attributes and variables. See Displaying attribute and variable contents in
Chapter 7.
Youll often need to scroll or increase the size of the Script Editor to see an
entire message.
When the Script Editor displays a syntax error, the response area of the
Command Line displays the same error with a red background.
Before clicking the Create or Edit button to create an expression, you might
want to select EditClear History in the Script Editor to remove previous
messages in the window. This makes it easier to see when a new error
message appears.
Expressions
set driven key
constraint
motion path
another expression
any other direct connection
More than one attribute name matches. Must use unique path
name: Ball.tx.
You used an object.attribute name that exists in two or more parent objects.
Two objects in a scene can have the same object name if they have different
parent objects.
For example, a scene might have a child of GroupA named Ball.tx and a
different child of GroupB named Ball.tx. If you write a statement such as
Ball.tx = time;, Maya wont know which Ball.tx to set.
To eliminate the error in this example, you must enter the full pathname of
the attribute as GroupA|Ball.tx. The pipe symbol (|) specifies that the object
to its left is the parent of the object on the right.
Cannot set 'time' or 'frame'
You can read the value of the predefined time and frame variables, but you
cannot set them.
Attributes must be of float, integer, or boolean types:
Ball.worldMatrix
You tried to set or read the value of an attribute that was a string or matrix
type. For instance, you might have tried to use an attribute named translate
rather than translateX, translateY, or translateZ attribute.
In the error message above, worldMatrix is an attribute that exists for
transforms, but you cant use it. Its for Mayas internal use.
Cannot divide by zero
You tried to divide by an attribute or variable that equals 0. This typically
happens in an expression statement that divides by an objects translateX,
translateY, or translateZ attribute when the Snap to grids button is on and
you drag the object to past the X-, Y- or Z-axis. When Snap to grids is on, the
translateX, translateY, or translateZ attribute becomes exactly equal to 0 at
the point where you drag the object across the axis.
To prevent this error, turn Snap to grids off. With snapping off, the attribute
is unlikely to become exactly 0 as you drag across the axis.
Note
If you compile an expression for a particle shape node and see the same
error message once for each particle in the object, its likely that some
attribute name, variable, or function is undefined or misspelled.
The Expression Editor offers convenient techniques for editing the text of
expressions. There are filters that help you search for expressions you
previously created, as well as techniques for entering and modifying the text
of an expression.
Expressions
Editing an expression in the text field on page 105
Editing an expression with a text editor on page 106
Creating a new expression on page 111
Deleting an expression on page 112
Using attribute names in expressions on page 112
Finding expressions
After youve created an expression, you might decide later to alter it to
create a different animation result. To edit an expression, you display it in
the Expression Editor. The following sections describe how to find and
display an expression for editing.
List of expressions
Note
For a particle shape node, you can create a creation expression, a runtime
expression, or both. Both expressions are listed under a single namethe
name of the particle shape node. You cant name or rename such
expressions.
To find such expressions, look for the particle shape nodes name in the
Expressions list.
Click the appropriate Runtime or Creation checkbox to display the desired
expression.
Object name
Objects attributes
4 For an object other than a particle shape node, click the name of the attribute
Expressions
controlled by the expression.
If youve forgotten the name of the attribute controlled by the expression,
choose Attribute FilterConnected to Expressions. The Attributes list
displays only the attributes controlled by expressions for the selected object.
Click each attribute in the Attributes list until you see the desired expression
in the expression text field.
You cant write a different expression for each attribute of a particle shape as
you can for other types of objects. Because you can write only one creation
expression and one runtime expression per particle shape, you dont need to
select an attribute from the Expression Editors Attributes list. See
Understanding particle expressions on page 148 for details on particle
expressions.
Note
The Attributes list shows only unlocked, keyable attributes. You can
choose whether an attribute is keyable or locked with ViewObject
EditorsChannel Control.
To write an expression for any nonkeyable attribute not shown in the list,
enter object.attribute name in the Selected Obj & Attr text box.
Example
Suppose youve written an expression that controls the rotateZ attribute of a
spotlight transform node named Searchlight. Do this to find the expression:
1 Choose Select FilterBy Object/Attribute name.
2 Select Object FilterTransforms.
Note that you dont select Object FilterLights in this example. The rotateZ
attribute is an attribute of a lights transform node, not of the light object
itself.
3 Choose Attribute FilterConnected to Expressions.
4 Select the object Searchlight from the Objects list.
Expressions list
Expressions
Using the Objects and Attributes list
The objects listed in the Objects list depend on which entry youve selected
from the Object Filter menu. If you select Object FilterLights, for
instance, all lights in the scene appear in the list.
The appropriate attributes of the object selected in the Objects list appear in
the Attributes list. For example, if spotLightShape1 is selected in the Objects
list, the attributes of spotLightShape1 appear in the list.
When searching for an expression to edit, you can click an object and
attribute from this list to find and display an expression that affects the
chosen attribute. You can edit the displayed expression in the expression text
field.
For a particle shape node, you dont need to select an attribute from the
Attributes list. You can create only one creation expression and one runtime
expression per particle shape node. The same expression appears for each
attribute.
When you create a new expression, you can click an object from this list to
choose the default object to which the expression applies.
When you select the default object in the Expression Editor, you can skip
omit the object name and period thats part of a full attribute name (see
Omitting an object name in expressions on page 115.)
Important
If you close the Expression Editor window without successfully compiling
an expression with the Create or Edit button, Maya discards any editing
changes youve made to the expression.
Expressions
Deleting and copying text
To delete text:
1 Drag the mouse to select the text.
2 Press your keyboards Backspace key to delete it.
Important
To erase an expression and make sure its previous contents no longer
control an attribute, click the Edit button after clicking the Clear button.
There is no file on disk you can edit independently of the Expression Editor.
When you use the text editor through the Expression Editor, youre working
with a temporary file thats linked to the expression stored in the scene. You
can, however, read an independent text file containing expression text into
the temporary file.
If you save an expression without specifying a filename, Maya reads the
saved expression and stores it with the scene. Youll see it dimmed in the
expression text field while youre working with the text editor.
When you close the text editor, the expression text field entry no longer is
dim. The text expression field becomes active after you close the text editor.
If you quit the text editor without saving the expression, Maya does nothing.
Because the expression hasnt changed, Mayas copy of the expression
doesnt need to change either.
Tip
You can use a text editor to save an expression to a filename in the
directory of your choice. This gives you a way to archive an expression you
want to use in a different scene.
Expressions
By default, you can start one of these editors from the Editor menu in the
Expressions Editor:
jot
vi
vim
xemacs
To run a different editor, see Using an editor not listed in the Editor menu
on page 109.
The editors title bar shows a filename thats temporarily created while you
work on the expression. When you write or save the file, its contents are
copied to the Maya scene containing the expression.
The expression text field is inactive while the text editor is open. You can
optionally close the Expression Editor window.
If you single-click the name of an object, attribute, or expression, the text
editor doesnt appear. You can single-click to browse the contents in the
expression text field without opening a text editor.
If you double-click an attribute thats already been assigned a value in an
expression, the expression that controls that attribute appears in the text
editor. For nonparticle expressions, you can assign to any attribute in the
scene, not just to the double-clicked attribute. In fact, you dont even need to
work with the double-clicked attribute at all.
If you double-click an attribute that has not yet been assigned a value, the
text editor appears with no contents. If you double-click that attribute again,
a new instance of the editor appears. After you assign a value to an attribute
in an expression, you can start the editor only once for the attribute.
3 Create or edit the expression with the editor.
4 Save the file.
5 Confirm that the Expression Editor detected no syntax errors.
6 Quit the editor.
Note
If youve created a UNIX command alias for jot, vi, vim, or xemacs, the
Expression Editor tries to launch this command. If the arguments provided
in the command alias are unusable by the Expression Editor, the editor
might operate unexpectedly or fail to launch.
Avoid using an alias to customize your editors operation settings. Do the
steps in Changing an editors operation settings on page 110.
Expressions
make the WINEDITOR setting display the editor in a shell.
2 Log out and log into your user account.
3 Restart Maya.
4 Choose Other from the Editor pull-down menu.
5 Double-click an object name, expression name, or attribute name from the
Selection list.
The editor appears.
6 Create or edit the expression with the editor.
7 Save the file.
8 Confirm that the Expression Editor detected no syntax errors.
9 Quit the editor.
Important
If youve specified a text editor through OptionsUI Preferences or with
the Expression Editors Editor menu, starting the Expression Editor from
the Channel Box or Attribute Editor displays the text editor instead of the
Expression Editor.
Expressions
Note the text editor appears when you click the New Expression button.
When you create the expression, the Expression Editor associates the object
name with the expression. This means you can narrow your search for the
expression using the objects name in addition to the expression name.
You do not need to select an attribute in the Attributes list. You can associate
the expression with an object only.
For a particle shape node, you dont need to select an attribute, as you can
create only one creation expression and one runtime expression per particle
shape. For nonparticle shape objects, you can create one expression per
attribute.
Deleting an expression
If you want to stop an expression from controlling attributes, you can delete
the expression.
To delete an expression:
1 Display it in the Expression Editor.
2 Click the Delete button.
Example
In place of this:
Ball.translateY = time;
you can type this:
Ball.ty = time;
Each attribute has at least one acceptable abbreviation. Here are some
commonly used attribute name abbreviations for several types of object
transform nodes:
translateX tx
translateY ty
translateZ tz
Expressions
rotateX rx
rotateY ry
rotateZ rz
scaleX sx
scaleY sy
scaleZ sz
visibility v
Common English equivalents for the long attribute names appear in the
Channel Box by default. These names are different than the names you must
use in the expression text field.
If you use the long attribute name, use the name that appears in the
Attributes list of the Expression Editor. Do not use the common English
language equivalents displayed in the Channel Box.
3 From the Channels menu at the top of the Channel Box, select
Channel NamesShort.
The abbreviated attribute names replace the common English attribute
names in the Channel Box.
Note
After you click Create or Edit to compile an expression, Maya converts all
attribute abbreviations in the expression to the full attribute name.
Example
Suppose youve selected Ball as the Default Object.
In place of this:
Ball.translateY = time;
you can type this:
Expressions
translateY = time;
Maya interprets translateY as belonging to Ball, the object listed in the
Default Object text box of the Expression Editor.
Example
Suppose youve selected Ball as the Default Object.
In place of this:
Ball.translateY = time;
you can type this:
ty = time;
Maya interprets ty as being the translateY attribute of Ball, the object listed
in the Default Object text box of the Expression Editor.
Attributes of other objects must be spelled out with the full object and
attribute name.
Expressions
goal and springs. As its points move
below the floor, an expression
assigns them a goal weight of 0.
The cube appears to melt as it
passes through the floor.
Rob Tesdahl
Example
Suppose youve given a NURBS sphere named Planet a circular, orbiting
motion in the XY plane with this expression:
Planet.tx = sin(time);
Planet.ty = cos(time);
Expressions
Planet orbits the origin at a radius of 1 unit.
In the following steps, youll create a custom attribute named distance to
increase the radius of Planets orbit over time.
Note
The small balls in the preceding figure show the circular path of Planet.
Theyre in the figure only to help you visualize the motion. They arent
part of the animation or expression.
3 In the Add Attribute window, enter distance in the Attribute Name text box.
4 Make sure Make attribute keyable is on.
5 Set Data Type to Float, and Attribute Type to Scalar.
6 Set Minimum to 1, Maximum to 10, and Default to 4.
Minimum and Maximum set the lowest and highest values you can enter
for the attribute in the Attribute Editor or Channel Box.
Default sets the default value displayed for the attribute.
An expression isnt bound by the Minimum and Maximum values. The
attribute receives whatever value you assign it in the expression.
The expression can read the Default value or any other value you set in the
Attribute Editor or Channel Box.
7 Click Add to add the attribute, then close the Add Attribute window.
The distance attribute appears in the Attributes list of the Expression Editor
for Planet. You can now set or read the value of the attribute in any
expression.
8 Edit the expression to this:
Planet.tx = distance * sin(time);
Planet.ty = distance * cos(time);
Multiplying the sin(time) and the cos(time) by the distance attribute makes
Planet circle the origin at a distance specified by the value of the distance
attribute. See Chapter 9 for details on the sin and cos functions.
Expressions
Because you gave the distance attribute a default value of 4 when you added
it to Planet, playing the animation makes Planet circle the origin at a distance
of 4 grid units from the origin.
You can make the expression control the distance attribute over time.
9 Edit the expression to this:
distance = time;
Planet.tx = distance * sin(time);
Planet.ty = distance * cos(time);
By setting distance to the value of time, Planets orbiting distance increases
as playback time increases. Planet moves in a steady outward spiral as the
animation plays.
Tip
If an expression controls an attribute and you want to control it with
keyframes instead, delete all statements that assign values to the attribute,
then click the Edit button. Use the Channel Box to reset the attributes
value to an initial value, then set keyframes as desired.
If keyframes control an attribute and you want to control it with an
expression instead, click the attributes text box in the Channel Box, then
choose ChannelsDelete Selected. Assign values to the attribute name in
an expression as desired.
Reproducing randomness
If you execute the rand, sphrand, and gauss functions repeatedly in an
expression, Maya returns a sequence of random numbers. (See Random
number functions on page 239 for details on these functions.) Each time you
rewind and play your animation, the sequence of random numbers is
different. Often, youll want to generate a sequence of random numbers that
repeats each time your animation plays.
For instance, suppose you use the rand function to assign a random radius
to each particle in a stream of emitted particles rendered as Spheres. By
default, Maya gives the particles a different sequence of random radius
values each time your animation plays.
Expressions
To create the same radius values each time the animation plays, you can use
the seed function in an expression before the rand, sphrand, or gauss
functions execute. Theres no need to execute the seed function more than
once per animation unless you need to generate several different repeating
sequences of random numbers as your animation plays.
Important
When you set a seed value in an expression or MEL script, the seed value
affects the rand, sphrand, and gauss functions in other expressions and
MEL scripts. Such functions are affected by this seed value in all scenes
you open subsequently in the current work session.
This seed value is unrelated to the Seed option available through
SettingsDynamics Controller in the Dynamics menus. The seed function
therefore doesnt affect randomness created with dynamics.
Example
Suppose you use the rand function to position several marbles at random
translateX positions in your scene at frame 1:
if (frame == 1)
{
marble1.tx = rand(-10,10);
marble2.tx = rand(-10,10);
marble3.tx = rand(-10,10);
marble4.tx = rand(-10,10);
}
The rand(-10,10) returns a random number between -10 and 10 each time it
executes. When you rewind the animation to frame 1, Maya might assign
these values to the translateX attributes of the marbles:
Attribute Value
marble1.tx 2.922
marble2.tx 5.963
marble3.tx -4.819
marble4.tx 7.186
The next time you rewind the animation to frame 1, each marbles translateX
attribute receives a different random value. Maya might assign these values:
Attribute Value
marble1.tx -3.972
marble2.tx 9.108
marble3.tx -7.244
marble4.tx -3.065
You might prefer the marbles translateX values to stay the same when you
rewind, for instance, so you can composite the marbles correctly among a
Expressions
foggy backdrop.
You can use the seed function to keep the sequence of random values
returned by the rand function consistent when you rewind the animation.
if (frame == 1)
{
seed(10);
marble1.tx = rand(-10,10);
marble2.tx = rand(-10,10);
marble3.tx = rand(-10,10);
marble4.tx = rand(-10,10);
}
By setting the seed value to an arbitrary number, for instance, 10, the
subsequent executions of the rand function return a repeating sequence of
random numbers.
When you rewind the animation the first time, Maya might assign these
values to the translateX attributes of the marbles:
Attribute Value
marble1.tx 8.020
marble2.tx -2.973
marble3.tx -7.709
marble4.tx 0.741
Each time you rewind the animation thereafter, Maya assigns these same
values to the translateX attributes of the marbles. The marbles dont move.
Each time a statement sets the seed value to 10, the subsequent executions of
the rand function return numbers from the sequence starting at the
beginning number. In other words, resetting the seed value to 10 restarts the
random number generation process to the first value in the sequence.
Suppose you alter the expression to this:
if (frame == 1)
{
seed(10);
}
marble1.tx = rand(-10,10);
marble2.tx = rand(-10,10);
marble3.tx = rand(-10,10);
marble4.tx = rand(-10,10);
When you rewind the animation to frame 1, the expression sets the seed to
10. Maya assigns values to the marbles translateX attributes as in the
previous expression.
Because the expression doesnt set the seed value in frames other than frame
1, playing the animation causes the rand function to return a new, yet
repeating, sequence of random numbers each frame. If you play the
animation several times, the translateX values will constantly change during
animation, but the sequence of values will be identical each time you play
the animation.
You can assign the seed a different value to generate a different sequence of
returned values. See seed on page 246 for details.
Expressions
Example
Suppose youve selected degrees from the Angular menu in the Units
folder. You then write this expression for an object named Ball:
Ball.rotateZ = 10;
Maya reads the 10 as being 10 degrees, then converts the value to the
appropriate number of radians to make the assignment to Balls rotateZ
attribute. The conversion happens automatically. From your standpoint,
Maya is simply rotating Ball 10 degrees.
In nonparticle expressions, these automatic conversions affect Maya
performance. Because the expression executes slower, Maya slows when you
play, rewind, or otherwise change the animation time. Saving, opening, and
other file operations on the scene containing the expression are also slower.
To boost Maya performance, you can turn off conversion to internal units. If
you do so, you must convert units in expression statements.
Example
Suppose, in the Units folder, youve set Linear units to millimeters and
Angular units to degrees. You then write the following expression:
Ball.translateX = 5;
Ball.rotateZ = 10;
All causes Maya to read 5 as millimeters and 10 as degrees.
None causes Maya to read 5 as centimeters and 10 as radians.
Angular causes Maya to read 5 as centimeters and 10 as degrees.
Examples
Suppose, in the Units folder, youve set Linear units to millimeters and
Angular units to degrees.
In the Expression Editor you set the Convert Units option to None and enter
this expression:
Ball.translateX = 5;
Ball.rotateZ = 10;
None causes Maya to read 5 as centimeters and 10 as radians, which is not
the result youre seeking.
To assign 5 millimeters to Balls translateX attribute, you must convert 5 to
the appropriate number of centimeters. To assign 10 degrees to Balls rotateZ
attribute, you must convert 10 to the appropriate number of radians.
The following statements do this:
Ball.translateX = 5.0 / 10.0;
Ball.rotateZ = 10.0 / 57.3;
There are 10 millimeters per centimeter. In other words, a millimeter is a
centimeter divided by 10. So 5 millimeters equals 5 centimeters divided by
10. You therefore use the operation 5.0 / 10.0.
Important
Expressions
When you divide floating point attributes or variables, enter the floating
point value 5.0 for an even number such as 5. This ensures that the division
works as expected. For more details, see the note in Using mixed data
types with arithmetic operators on page 145.
There are 57.3 degrees per radian. In other words, a degree is a radian
divided by 57.3. So 10 degrees equals 10 radians divided by 57.3. You
therefore use the value 10.0 / 57.3.
If you need a more precise conversion to radians, divide a degree by
57.29578 instead of 57.3. You can instead use the deg_to_rad function as
follows:
Ball.rotateZ = deg_to_rad(10.0);
The deg_to_rad function converts 10.0 degrees to a precise radian
equivalent. See deg_to_rad on page 234 for details.
Turning off unit conversion affects only expressions. It doesnt affect other
Maya commands, options, or displays. For instance, the preceding example
expression assigns centimeters to translateX and radians to rotateZ. The
Channel Box still displays values for these attributes in millimeters and
degrees. It displays values in whatever units you choose in the Units folder
of the General Preferences window.
Note that you cant turn off unit conversion for particle shape node
expressions. Maya handles unit conversion differently for such expressions
with little impact on performance.
Example
global float $BallHeight = 5;
print($BallHeight+"\n");
nurbsSphere1.tx = rand(1);
print(nurbsSphere1.tx+"\n");
The first statement declares and assigns a value to the variable $BallHeight,
which is not an attribute. The next statement prints the $BallHeight but
assigns no value to an attribute.
The next statement assigns an attribute a value, but the value is generated by
the random number function rand. This function doesnt read an attribute
value. For details on the rand function, see rand on page 243.
The last statement reads and prints the value of an attribute, but doesnt
assign a value to an attribute.
None of these actions causes the expression to execute when Always
Evaluate is off.
Always Evaluate affects only the expression youre creating or editing. You
can turn it on for one expression and off for another.
Expressions
For most animations, expressions execute regardless of whether Always
Evaluate is on. If in doubt, leave it on.
The attribute doesnt return to the value it had before the expression set it.
To return the attribute to its original value, use the Channel Box or Attribute
Editor to set the attribute.
Disconnecting an attribute
If you disconnect an attribute from an expression, the expression no longer
reads or set its value. You might want to disconnect an attribute, for
example, so you can keyframe the attribute rather than control it with an
expression.
These actions disconnect an attribute from an expression:
Delete from the scene an object with an attribute that exists in the
expression.
Use the WindowGeneral EditorsConnection Editor to disconnect the
attribute from the expression.
Use the MEL disconnectAttr command.
Use the MEL choice command.
Tip
The MEL choice command lets you control an attribute alternately with two
or more techniques in different frames. For example, you can keyframe an
attribute for frames 1-48, control it with an expression for frames 48-96, and
control it with a motion path for subsequent frames.
Example
Suppose your scene has two objects, Ball and Cone, and youve written this
expression:
Ball.translateX = Cone.translateX;
Ball.translateY = Cone.translateY;
Ball.translateZ = Cone.translateZ;
Expressions
Ball.translateZ the value 0.
Note that if you disconnect an attribute from an expression but the attribute
still exists in the scene, the attribute keeps its value from the last time the
expression executed and set its value.
Example
Suppose youve written these statements among others:
Ball.translateX = Cone.translateX;
Ball.translateY = Cone.translateY;
Ball.translateZ = Cone.translateZ;
If you delete Ball from the scene, Ball.translateX, Ball.translateY, and
Ball.translateZ attributes no longer exist. The expression can no longer
assign Cones translateX, translateY, and translateZ values to the
corresponding Ball attributes.
Note
If an expression assigns values to the attributes of only one object, deleting
the object deletes the expression also. If your expression assigns values to
attributes of several object attributes, deleting all those objects deletes the
expression.
To avoid deleting the expression in the preceding example, you would
need have some statement that sets an attribute of an object other than the
deleted Ball. For example, you might include this statement:
Cone.visibility = 1;
Example 1
Suppose you have these statements among others in an expression named
HorseController:
WhiteHorse.translateX = Car.translateX;
BlackHorse.translateX = Car.translateX;
BrownHorse.translateX = Car.translateX;
Deleting the Car and reloading the expression shows this:
WhiteHorse.translateX = .I[0];
BlackHorse.translateX = .I[0];
Expressions
BrownHorse.translateX = .I[0];
.I[0] is the symbolic placeholder for what was the Car.translateX attribute.
You can connect a different attribute to this placeholder to assign its contents
to the translateX attributes of WhiteHorse, BlackHorse, and BrownHorse.
Suppose you want to control these attributes with the translateX attribute of
an object named Cow. You can enter the following MEL command at the
Command Line:
connectAttr Cow.tx HorseController.input[0]
This command connects the attribute Cow.tx to the expressions input[0].
The expression is named HorseController. The input[0] is abbreviated as .I[0]
in the expression. You can see the spelled-out input name input[0] in the
GraphUp and Downstream Connections display of the Hypergraph.
Reloading the expression shows the new attribute connection:
WhiteHorse.translateX = Cow.translateX;
BlackHorse.translateX = Cow.translateX;
BrownHorse.translateX = Cow.translateX;
Example 2
You can also reconnect an expressions output with the connectAttr
command. Suppose you have these statements among others in an
expression named HorseController:
WhiteHorse.translateX = Car.translateX;
BlackHorse.translateX = Car.translateX;
BrownHorse.translateX = Car.translateX;
Deleting the BrownHorse object and reloading the expression displays this:
WhiteHorse.translateX = Car.translateX;
BlackHorse.translateX = Car.translateX;
.O[2] = Car.translateX;
.O[2] is the symbolic placeholder for what was the BrownHorse.translateX
attribute. It received the placeholder .O[2] because its the third output from
the expression. (The first and second outputs from the expression are .O[0]
and .O[1] .) You can connect a different object attribute to this placeholder to
control it with the value in Car.translateX, as shown in the third statement.
Suppose you want to control the attribute of a new object named
RedHorse.translateX with the Car.translateX value. You can enter the
following MEL command in the Command Line:
connectAttr HorseController.output[2] RedHorse.tx
This command connects the HorseController expressions output[2] to the
attribute RedHorse.tx. The output[2] is abbreviated .O[2] in the expression.
Reloading the expression shows the new attribute connection:
WhiteHorse.translateX = Cow.translateX;
BlackHorse.translateX = Cow.translateX;
RedHorse.translateX = Cow.translateX;
Renaming an object
If you rename an object whose attributes were used in an expression, the
Expression Editor continues to read or set the attributes. Maya doesnt
disconnect the attribute from the expression. The Expression Editor converts
to the new name of the object the next time you click the Reload button in
the Expression Editor.
Note
When you reload an expression, the Expression Editor converts any short
attribute names to their long attribute name equivalents. For example, if
you originally type the attribute name Ball.ty, reloading the expression
renames it as Ball.translateY.
Expressions
You can execute MEL commands in an expression with several techniques:
MEL command alone in a statement
MEL command within left-hand single quote marks
MEL command used as an argument to an eval function
MEL procedure call to a procedure in a MEL script
The following topics explain the techniques. See Using MEL for details on
MEL.
Example
select -cl;
This example shows the use of a MEL command alone. The statement
executes exactly as it would in the Script Editor, except no command output
appears in the Script Editor.
Example
string $a[];
$a = ls -lights;
print($a);
The first statement defines an array named $a. The second statement
executes the MEL command within quotes, then assigns the commands
output to array $a. The third statement displays the contents of $a to the
Script Editor as follows:
ambientLightShape1
directionalLightShape1
Example
string $mycommand = "sphere";
eval($mycommand+" -r 5");
The first statement assigns the string sphere to the variable $mycommand.
The second statement appends -r 5 to sphere and executes the complete
command sphere -r 5. This creates a sphere with a radius of 5 grid units.
See eval on page 259 for more details.
Example
Suppose, in your Maya scripts directory, youve created a MEL script file
named randspot.mel with the following contents:
global proc string randspot()
{
Expressions
string $mycommand;
if (rand(2) < 1)
$mycommand = "particle -p "+ sphrand(10);
else
$mycommand = "sphere -p "+ sphrand(10);
return $mycommand;
}
Further suppose youve created this expression:
string $randcommand = randspot();
eval($randcommand);
When you rewind or play a frame in the animation, the expression executes.
The first expression statement executes the randspot procedure in the
randspot.mel script file. In the randspot procedure, the rand(2) part of the if-
else statement generates a random floating point value between 0 and 2,
then compares its value to 1. For details on the rand function, see rand on
page 243.
If the rand(2) function returns a value less than 1, the if statement assigns a
MEL command string such as particle -p -1.356 5.983 8.458 to $mycommand.
The + sphrand(10) part of the statement appends to sphere -p the three floating
point components of a randomly generated vector.
Though sphrand(10) returns a vector, Maya converts the vector to a string
upon assigning it to the string $mycommand. For details on the sphrand
function, see sphrand on page 244.
The converted string contains no double angle brackets or commas, but does
contain a space character between the floating point components. A space
between the floating point components is required syntax for the MEL
particle command as used above.
If the rand(2) function returns a value greater than 1, $mycommand receives
a MEL command string such as sphere -p 4.926 -2.589 1.274.
The procedure finishes executing and passes the value of $mycommand
back to the expressions calling procedure randspot( ). This assigns the
command string to the variable $randcommand.
The eval function executes the command string in $randcommand. For
example, if the statement executes particle -p -1.356 5.983 8.458, it creates a
particle with coordinates <<1.356, 5.983, 8.458>>.
The expression executes each frame and creates a new particle or sphere at a
random location within a spherical radius of 10 units from the origin.
For example, a scene might have a child of GroupA named Ball.tx and a
different child of GroupB named Ball.tx. If you write this statement:
Ball.tx = time;
Maya generates an error because it doesnt know which Ball.tx to set.
To eliminate the error, you must enter the pathname of the attribute as in
this example:
GroupA|Ball.tx = time;
The | symbol between GroupA and Ball.tx indicates that the object to the left
of the symbol is the parent of the object to its right. Use no spaces before or
after the | symbol.
Important
Always examine the Script Editor for error messages after you edit an
expression and click the Create button. If you alter a previously successful
Expressions
expression and a syntax error occurs, Maya executes the previous
successful expression when you play the animation. This might lead you to
believe your editing changes took effect.
Example
Ball.tx = $distance;
$distance = time;
Assume for this example youve set the starting frame of the animation to
frame 0.
The first statement sets Ball.tx to the variable $distance. The second
statement sets $distance to the value of time.
When you play the animation, Ball moves along the X-axis with the increase
in time. Balls X-axis position is 4 grid units, for example, when animation
time equals 4 seconds.
When you rewind the animation, Balls position along the X-axis doesnt
return to 0 as you might assume. The previous execution of the expression at
time equals 4 set the $distance variable to 4. So rewinding sets Ball.tx to 4,
then sets the value of $distance to 0, the value of time upon rewinding.
If you rewind again, Balls position along the X-axis returns to 0 as desired.
Because the previous execution of the expression upon rewinding set the
$distance to 0, the expression now correctly sets Ball.tx to 0.
To fix this problem, reverse the order of the statements and compile the
expression:
$distance = time;
Ball.tx = $distance;
After you play and rewind the expression, the first statement executes and
assigns the time to $distance. The next statement assigns Ball.tx the value of
$distance, which the first statement set to the value of time. Because
$distance is set to 0 as the first statement after rewinding, Ball returns to the
desired translateX position.
Increment operations
If you increment an attribute or variable during animation, you might be
confused by its behavior.
Example
Ball.ty = 0;
Ball.ty = Ball.ty + 1;
Balls translateY position stays at 1 unit along the Y-axis. Balls translateY
position doesnt increase by 1 each frame as the animation plays.
Example
Ball.ty = Ball.ty + 1;
Balls translateY position increases by 1 each frame as you play the
animation. When you rewind the animation, translateY increases by 1 again.
When you play the animation again, the translateY position increases by 1
each frame. If you rewind the animation or drag the current time indicator,
the translateY position continues to move up the Y-axis. The attribute never
returns to its original position.
To return Ball to a starting position each time you rewind, you must
initialize the attribute to a starting value. For example, you could use the
following expression:
Ball.ty = Ball.ty + 1;
if (frame == 1)
Ball.translateY = 0;
This returns Ball to a Y position of 0 when you rewind to frame 1. When you
drag the current time indicator, though, Ball doesnt return to its Y position
of 0.
The if statement resets the value of translateY to 0 only when frame 1 plays.
Frame 1 is the default frame that plays when you rewind an animation. You
would need to use a different frame number in the if statement if youve set
your animation to start at a different frame.
Expressions
type as necessary and doesnt report a syntax error.
The following topics describe the conversions that occur in such instances.
Understanding these details might help you troubleshoot unexpected
attribute and variable values.
Unless you have programming experience, dont intentionally convert data
types. You might be confused by unexpected attribute and variable values.
2 2 2
x +y +z
Example
Ball.scaleY = <<1,2,0>>;
Maya assigns the floating point scaleY attribute the converted vector:
2 2 2
1 +2 +0 = 5 = 2.236
Example
Ball.scaleY = 1;
Maya assigns the value 1 to Ball.scaleY.
Example
int $pi = 3.14;
Maya assigns the integer variable $pi the value 3.
int $temp = <<1,2,0>>;
Maya assigns the integer variable $temp this vector value:
2 2 2
1 +2 +0 = 5 = 2.236 2
It deletes the decimal component .2360607. The $temp variable receives the
truncated value 2.
Example
vector $speed = 1.34;
Because $speed is a vector, Maya assigns it <<1.34,1.34,1.34>>.
Example
Expressions
Suppose you multiply a vector variable named $velocity by a floating point
number 0.5 as follows:
$race = $velocity * 0.5;
If $velocity is <<2,3,0>> when the preceding expression executes, the $race
variable is assigned the resulting vector value <<1,1.5,0>>.
Important
When Maya does arithmetic operations on literal constants and variables
without a declared data type, it guesses the data type based on the values
present.
In the statement Ball.scaleY = 1/3;, for example, Maya treats 1 and 3 as
integers because they have no decimal points. The expression divides
integer 1 by integer 3. The integer result is 0 with a remainder of 1. Maya
discards the remainder.
Because Ball.scaleY is a floating point attribute, Maya converts the integer 0
result to floating point 0 (which is the same value), then assigns it to
Ball.scaleY.
To get the intended result of 1/3, you must type Ball.scaleY = 1.0/3.0;
Maya treats 1.0 and 3.0 as floating point numbers because they have
decimal points. The number 1.0 divided by 3.0 results in 0.33333333333.
Particle expressions are more complex than other types of expressions. For
example, you can write an expression to control all particles in an object the
same way, or you can control each particle differently.
Execution of expressions differs for particles than for other types of objects.
To become proficient with particle expressions takes more study than for
other expressions, but the resulting effects are worth the effort. This chapter
guides you through the intricacies of working with particle expressions.
Expressions
The particles are displayed as
Spheres render type.
Claude Macri
This chapter has the following topics:
Understanding particle expressions on page 148
Understanding creation expression execution on page 149
Writing creation expressions on page 150
Understanding runtime expression execution on page 152
Writing runtime expressions on page 153
Working with particle attributes on page 159
Assigning to vectors and vector arrays on page 193
List of particle shape attributes on page 196
These buttons let you write two types of expressions: creation and runtime.
You can use both types for any attribute of a particle shape node.
Though the details of execution are subtle, a creation expression generally
executes when you rewind an animation or when a particle is emitted. A
runtime expression typically executes for each frame other than the rewind
frame or the frame in which a particle is emitted. By default, either type of
expression executes once for each particle in the object.
Creation and runtime expressions dont execute at the same time. The age of
each particle in the object determines whether a runtime expression or
creation expression executes. Execution details are in Understanding
creation expression execution on page 149 and Understanding runtime
expression execution on page 152.
The Default Object, Always Evaluate, and Convert Units options become
dim when you select a particle shape node, and you cant use them.
Default Object is dim because a particle shape nodes attributes can be
controlled by only one creation expression and one runtime expression. The
particle shape node is always the default object when its the selected object.
Always Evaluate is dim for particle shape node expressions because it has
no effect on particle shape node expressions. See How often an expression
executes in Chapter 7 for details on the checkbox.
Convert Units is not selectable because you cant alter how Maya handles
unit conversions for particle shape node expressions. See Speeding
expression execution on page 127 for details on how Maya converts units
for other types of expressions.
Important
You cant write a different expression for each particle shape attribute as
you can for other types of objects. Because you can write only one creation
expression per particle shape, you dont need to select an attribute from the
Expression Editors Attributes list.
Expressions
You might also notice that all expressions in your scene are compiled and
executed each time you open the scene. This occurs for architectural reasons
and is unimportant to your work with expressions.
Particles created with the Particle Tool have an age of 0 on and before the
Start Frame. With the default animation frame range and Start Frame,
rewinding an animation to frame 1 returns such particles to age 0.
If you set the Time Sliders start frame higher than the dynamics Start
Frame, be aware that rewinding the animation might cause the age of
particles to be greater than 0. If this occurs, the creation rule for the particles
wont execute.
Tip
You can set options in the Attribute Editor to display the age of an objects
particles in the workspace. Set the particle shapes Render Type to
Numeric, click Add Attributes For Current Render Type, and enter age in
the Attribute Name box. The age appears next to each particle.
You can also examine the age of an objects particles by entering
print(age+\n) in a particle expression. See print on page 261.
A creation expression is also useful for initializing an attributes value for the
first frame before a runtime expression takes control of the attribute value in
subsequent frames. See Writing runtime expressions on page 153 for an
example of the interaction between a runtime and creation expression.
Example
Suppose youve used the Particle Tool to place a collection of particles in the
workspace. You then create the following creation expression to control their
velocity:
particleShape1.velocity = <<0,1,0>>;
Expressions
All the particles move in a Y-axis direction at one grid unit per second as the
animation plays.
Important
To use an expression to control particle attributes, make sure the selected
object in the Expression Editor is a particle shape node, not the transform
node of the particle object.
If a particle objects transform node is selected rather than the particle
shape node, move the mouse pointer to the workspace and press your
keyboards down arrow. This selects the particle shape node.
Important
There are no creation expressions for nodes other than particle shape
nodes. Such objects have only one type of expression. (Its similar to a
runtime expression.)
For a particle shape node, you can write only one runtime expression for
all its attributes. You dont need to select an attribute from the Attributes
list. You can create only one runtime expression per particle shape.
Example
Suppose youve created a grid of particles, then create this runtime
expression for its velocity attribute:
particleShape1.velocity = <<0,1,0>>;
The expression moves the grid of particles up at 1 grid unit per second as the
animation plays.
Expressions
Note
To make the illustrations of particles easier to see in this and other
chapters, we show them as small, shaded spheres rather than points.
With the default frame rate of 24 frames/second, the particles move 1/24 of
a grid unit each frame. With the default oversampling level of 1, the runtime
expression executes once per frame. Maya calculates the runtime expression
once for each particle of an object.
Because the expression sets the velocity to <<0,1,0>> each frame, the
expression executes redundantly. This expression would therefore be more
appropriate for a creation expression. However, either type of expression has
the same effect in this example.
Example
Suppose youve created a grid of particles, and your animations starting
frame number is 0. You create this runtime expression for its velocity
attribute:
particleShape1.velocity = <<0,time,0>>;
The expression increases the Y component of velocity with the increasing
value of time as the animation plays. This makes all particles in the grid rise
with increasing velocity as the time increases. An increasing velocity is the
same as acceleration.
You need to use the statement in a runtime expression rather than a creation
expression, because youre increasing a value in the assignment each frame.
Using the statement in a creation expression would instead set the velocity
to a constant value <<0,0,0>>, because time equals 0 when the creation
expression executes for the particle grid.
Example
The previous examples gave all particles the same value for the velocity
attribute. You can instead give each particle a different value for an attribute.
Suppose youve created a grid of 121 particles.
Expressions
Suppose further you create this runtime expression for its acceleration
attribute:
particleShape1.acceleration = sphrand(2);
The expression executes once for each of the 121 particles each time the
runtime expression executes.
The sphrand(2) function provides a vector whose randomly selected
components reside within an imaginary sphere centered at the origin and
with a radius of 2. Each particle receives a different vector value. For details
on the sphrand function, see sphrand in Chapter 9.
Because each particle receives a different random vector for its acceleration
each frame, the particles accelerate individually in a constantly changing
direction and rate as the scene plays. This gives the acceleration abrupt
changes in direction.
Important
To give particles a constant acceleration, assign the acceleration attribute a
constant value in a runtime expression rather than in a creation expression.
Maya simulates the physics of acceleration. It initializes acceleration to
<<0,0,0>> before each frame, or if the oversample level is greater than 1,
before each timestep.
If the oversample level is 2, there are 2 timesteps per frame. If the
oversample level is 3, there are 3 timesteps per frame, and so on.
Example
Suppose youve set your animations starting frame to 0, and youve used
the Particle Tool to place a single particle at the origin:
Expressions
Each subsequent frame moves the particle upward at a rate set by the
incrementing value of time.
When you stop and rewind the animation, the particle moves back to the
origin, the particles original position when you created it with the Particle
Tool. When you created the particle, Maya stored its original position in an
internally maintained initial state attribute named position0. For details, see
Understanding initial state attributes on page 162.
Because the attribute has no creation expression controlling its value, Maya
sets the attribute to its initial state position0 value of <<0,0,0>>.
To prevent the particle from jumping back to the origin after rewinding, you
can write a creation expression thats the same as the runtime expression:
particleShape1.position = <<3,time,0>>;
When you rewind the animation, the particle moves to position
<<3,time,0>>. Because time is 0 at frame 0, the particle starts at position
<<3,0,0>> when you rewind the animation. In the second and following
frames, it moves upward synchronized with the increasing value of time.
Though this example showed how to initialize the position attribute with a
creation expression, you could have gotten almost the same result by saving
the objects current attribute values for initial state usage:
When you rewind the animation, Maya positions the object at the initial state
setting of its position attribute. This setting is <<3, 0.0417, 0>> because you
selected Set for Current while the position was equal to <<3, 0.0417, 0>>.
Expressions
You also use expressions to control dynamic and custom attributes you add
to a particle shape node. See Attributes in Chapter 5 for details on the
differences between static, dynamic, and custom attributes. See Assigning
to a custom attribute on page 169 for details on working with custom
attributes.
When you add a dynamic attribute to an object, the attribute names appear
in the Expression Editors Attributes list.
Note
See List of particle shape attributes on page 196 for attributes you can
use with particle objects.
The most common way to create dynamic per object or per particle attributes
for a particle shape is by clicking one of the following buttons in the Add
Dynamic Attributes section of the Attribute Editor:
For example, if you click the Opacity button, a window appears and lets you
choose whether to add the opacity characteristic as a per object attribute or a
per particle attribute.
If you choose per particle, the Attributes list of the Expression Editor
displays a new attribute for the selected particle shape node: opacityPP. If
you choose per object, an opacity attribute is displayed instead.
For attributes other than lifespan, if you add both a per particle attribute and
a per object attribute for a characteristic, the per particle attribute takes
precedence. For instance, if you add opacity and opacityPP, the opacityPP
attribute controls the opacity of the particles of the specified object.
When you click Lifespan and add both a per particle and per object
attribute, Maya adds an additional attribute named useLifspanPP that lets
you choose whether lifespanPP or lifespan controls the characteristic.
By default, the Attribute Editor setting of useLifespanPP is on, so the
Expressions
lifespanPP attribute control the characteristic. If you turn useLifespanPP off
in the Attribute Editor, lifespan controls the characteristic.
If you click the Goal button in the Add Dynamic Attributes section of the
Attribute Editor, Maya adds a per object attribute and a per particle
attribute. The attributes are named goal and goalPP. Neither attribute has
precedence. Maya multiplies the value of the per object goal attribute by the
per particle goalPP attribute to create the final goal effect for each particle.
Important
You can use per particle attributes only in particle expressions. You can use
per object attributes in particle or nonparticle expressions.
If you use a runtime expression to read or write a per object attribute of a
particle object with many particles, you can speed up expression execution
by reading or writing the attribute in a nonparticle expression.
Nonparticle expressions execute only once per object. Particle expressions
execute once for each particle in the object. Because reading or writing a
per object attribute more than once per frame is redundant, you can save
processing time by working with them in nonparticle expressions.
When you use the Add Attribute window to add a custom per particle
(array) attribute to a particle shape, you must choose whether you want to
add it with Add Initial State Attribute on or off. If you choose on, Maya
creates a corresponding initial state attribute for the added attribute.
If you choose off, Maya doesnt create a corresponding initial state attribute
for the added attribute. Without this corresponding attribute, you cant save
a particle objects current attribute values for initial state usage. You must
write a creation expression if you decide to initialize the custom attributes
value upon rewinding the animation.
Note
A per particle attribute is called an array attribute in the Add Attribute
window. The two terms have the same meaning. See Assigning to a
custom attribute on page 169 for details.
You can see whether a custom attribute was added with Add Initial State
Attribute on or off by using the MEL listAttributes command. (See the online
MEL documentation for details.)
You might want to read the value of an initial state attribute in an
expression, for instance, to use its original (rewind) value for some
calculation. If you assign a value to an initial state attribute. Maya will
overwrite the value if you save the attribute value for initial state usage.
Expressions
When you add a custom attribute to a particle shape, do not end the name
with a 0 character. Youll subvert Mayas naming scheme for the initial state
attribute associated with an attribute.
For any attribute, if you dont initialize its value with a creation expression
or save its value for initial state usage, Maya gives the attribute a default
value at the animations first frame. It typically assigns the attribute the
value 0 or <<0,0,0>>, as appropriate for the data type. In other cases, for
instance, opacityPP and opacity, Maya assigns the attribute a default value
of 1.
If you know youre going to write a creation expression for a custom
attribute, you can set Add Initial State Attribute off when you add the
attribute. Otherwise, set Add Initial State Attribute on whenever you add a
custom attribute.
When a creation expression assigns a value to an attribute, the value
overrides the attributes initial state value for all particles whose age is 0.
The following steps show how to assign a different lifespanPP value for each
of the particles to make them disappear as the scene plays.
Because lifespanPP is a per particle attribute and the objects particle shape
node is selected in the Expression Editor, the expression does an execution
loop of both statements once for each particle in the object.
Because the expression is a creation expression, it executes after the
expression compiles. It also executes when you rewind the animation after
playing it.
For each of the particles, the first statement assigns the lifespanPP attribute a
random floating point number between 0 and 5. The rand function returns a
different random number each time it executes, so each particle has a
different lifespanPP value between 0 and 5. For details on the rand function,
see chapter 9, Functions.
The second statement displays Hello in the Script Editor, once for each
particle.
The creation expression gives each particle a random lifespanPP of less than
5 seconds. The particles disappear from the scene at random times between 0
and 5 seconds of scene play. (Maya gives particles created with the Particle
tool an age of 0 in the first frame of the animation.)
Expressions
Particles remaining after
three seconds, with creation
expression for lifespanPP.
When you rewind the animation, the particles reappear in the scene. Playing
the scene again makes them disappear at random times within 5 seconds.
Its important that you use a creation expression for this effect. If you were
to use a runtime expression, the particles would disappear more quickly as
the animation plays, and Hello would appear 100 times each frame. The
reason for this is subtle:
In each frame, a runtime expression would assign a different random value
between 0 and 5 seconds to the lifespanPP of each particle. The expression
would likely assign one or more of the particles a lifespanPP near 0.
Meanwhile, the age of each particle increases from 0 at the first frame of
play.
Maya checks the age of each particle every frame. If the age is greater than
the lifespanPP value, Maya removes the particle.
Because the expression would reassign new random lifespanPP values to
each remaining particle in each frame, the new assignments would likely
give a few particles a lifespanPP thats less than their current age value.
Maya deletes such particles. This causes the objects particles to disappear
quickly from the scene.
The following steps show how to give the particles a single lifespan. All
particles disappear at the same time when you play the scene.
Expressions
2 In the Add Dynamic Attributes section of the Attribute Editor, click the
Lifespan button.
A window appears that prompts you to choose whether to add the attribute
per object or per particle.
3 Select Add Per Object Attribute, then click the Add Attribute button.
This adds the lifespan attribute to the particle shape node for Bubbles.
4 In the Expression Editor, turn on Creation.
5 Create this creation expression:
BubblesShape1.lifespan = 1.33;
print("Hello\n");
Because this is a creation expression, it executes after the expression
compiles. It also executes when you rewind the animation after playing it.
For each of the 100 particles, the first statement assigns the lifespan attribute
the value 1.33. The second statement displays Hello in the Script Editor once
for each particle.
6 Play the animation.
Because all particles have a lifespan of 1.33, they disappear from the scene
after 1.33 seconds of animation play.
When you rewind the animation, the particles reappear in the scene. Playing
the scene again makes them disappear again after 1.33 seconds.
Expressions
The new attribute appears under the Dynamic Attributes section of the
Attribute Editor.
Example
Suppose youve created a 100-particle object named sunspot, and you add to
its particle shape node a vector per object attribute named glow. You assign
the glow attribute a vector value in a creation expression as follows:
sunspotShape1.glow = <<3,0,0>>;
print(sunspotShape1.glow + "\n");
When you rewind the animation, the glow attribute of sunspotShape1
receives the value <<3,0,0>>. The print statement displays the values in the
Script Editor.
Example
Suppose you add a vector per particle attribute named heat to the 100-
particle sunspot shape node. You can give each particle a different value as
in this creation expression:
Expressions
float $randomNumber = rand(1);
sunspotShape1.heat = <<$randomNumber,0,0>>;
print(sunspotShape1.heat + "\n");
When you rewind the animation, the expression loops through 100
executions, once for each particle.
The first statement sets the $randomNumber variable to a random number
between 0 and 1. The next statement assigns a vector to the heat attribute of
a single particle. The left component of the vector assigned to heat is a
different random number each time the statement executes. The middle and
right components are always 0.
One particle might have the value <<0.57, 0, 0>>, another <<0.32, 0, 0>>,
another <<0.98, 0, 0>>, and so on.
The print statement displays the values in the Script Editor.
Note
If you add a custom vector attribute to an object, Maya displays the
attribute in the Attribute Editor, but you cant enter its value there. You
must enter a value for it in an expression or with the Component Editor
available from the Attribute Editor.
Example
Suppose your scene contains an object named ThreePts made of three
particles and an object named TwoPts made of two particles.
The three particles in ThreePts are at these positions:
-5 0 0
-4 0 0
-3 0 0
The two particles in TwoPts are at these positions:
5 0 0
6 0 0
Expressions
Suppose you write the preceding runtime expression instead with
ThreePtsShape1 selected in the Object Selection list.
Again, the expression repositions the three particles to the position of the
two particles. Because you selected ThreePtsShape1 in the Object Selection
list, the expression executes once for each of its three particles.
When you play the scene, the runtime expression executes. The first particle
of ThreePts moves to the position of the first particle of TwoPts. The second
particle of ThreePts moves to the position of the second particle of TwoPts.
Expressions
Unless you have a solid grasp of physics, avoid setting a combination of the
position, velocity, and acceleration attributes.
To give a smooth, random motion to particles with a runtime expression, use
a random number function such as sphrand to assign random numbers to
the particle shapes acceleration attribute. A change in acceleration always
gives smooth motion no matter how abruptly its value changes.
To give a jittery random motion to particles with a runtime expression, use a
random number function such as sphrand to assign random numbers to the
particle shapes velocity or position attributes.
See Random number functions on page 239 for details on how to use
random number functions.
If an expression and a dynamic field control an objects position, velocity, or
acceleration, Maya calculates the expressions effect first, then adds the
fields effect.
Example
Suppose a particle drops under the influence of a gravity field with default
gravity options. Gravity accelerates the particle at 9.8 units per second per
second down the Y-axis. In other words, the default acceleration of gravity is
<<0,-9.8,0>>.
Suppose further you write the following runtime expression for the particle:
velocity = velocity + <<1,0,0>>;
As each frame plays, Maya first calculates the particles velocity from the
expression statement. The velocity increases 1 unit per second in an X-axis
direction. Maya then adds the gravitational acceleration to the velocity.
Maya uses the combined result to compute the particles position.
Of course, you wont see this calculation process. The frame displays the
particle in the appropriate position after all computation.
Note that the expression adds the constant <<1,0,0>> to the particles
velocity each frame as the animation plays. This makes the particle move
with increasing velocity in an X direction as the time increases. An
increasing velocity is the same as acceleration.
Example
Suppose you write the following runtime expression for a five-particle object
unaffected by gravity:
acceleration = acceleration + <<0,1,0>>;
Rather than adding <<0,1,0>> to the acceleration value each frame,
acceleration remains a constant <<0,1,0>> for each of the particles. This
happens because Maya initializes the value of acceleration to <<0,0,0>>
before each frame.
Suppose you connect the particle object to gravity with default settings. The
acceleration of the particle becomes <<0,1,0>> plus <<0,-9.8,0>>, which
equals <<0,-8.8,0>>. The acceleration assigned in the expression slows the
downward acceleration of the gravity.
Suppose you change the previous expression to this:
acceleration = acceleration + sphrand(3);
Because Maya sets acceleration to <<0,0,0>> before each frame, the
Expressions
statement has the same result as the following statement:
acceleration = sphrand(3);
As each frame plays, Maya first calculates each particles acceleration from
the expression statement. Each particle receives the result of the sphrand(3)
function.
The sphrand(3) function provides a vector whose randomly selected
components reside within a spherical region centered at the origin with
radius 3. Each particle receives a different vector value.
Finally, Maya adds gravitys acceleration to the expression acceleration
resulting from sphrand(3). The frame displays each particle in the resulting
position.
Because of the random values resulting from the expression, each particle
has an acceleration that differs slightly from gravity in direction and
magnitude. Because the sphrand(3) function executes for each particle each
frame, the acceleration of each particle varies each frame.
This example shows that you can take advantage of the additive effect of
fields and the acceleration attribute to create custom field effects.
Tip
You can turn off the effect of all fields on a particle shape node attribute by
setting its dynamicsWeight attribute to 0.
Example
Suppose youve used the Particle tool to create a randomly positioned
collection of particles named Bubbles. You can use a creation expression to
give the particles a constant color during animation play.
Expressions
3 Select Add Per Particle Attribute, then click the Add Attribute button.
This adds an rgbPP attribute to the particle shape node for Bubbles. Because
youre adding this attribute as a per particle attribute, you can give each
particle a different color.
4 Choose ShadingSmooth Shade All.
This step is necessary to make the correct particle color appear when you
assign the rgbPP attribute a value in an expression.
5 In the Expression Editor, select Bubbles particle shape node.
6 Turn on Creation in the Expression Editor.
Because youll give the particles a color that doesnt change during the
animation, you use a creation expression.
7 Enter this expression:
BubblesShape1.rgbPP = <<1,0,0>>;
When you click the Create button in the Expression Editor, Maya checks the
syntax of the expression. Assuming you made no typing errors, the
expression executes once for each of the 100 particles.
The expression colors all particles in the object red. The double angle
brackets << and >> enclose a vector that sets the red, green, and blue
components of the rgbPP attribute to 1, 0, and 0. In the RGB color scheme,
this gives the object a red color.
8 Play the animation.
Because the expression is a creation expression, it executes when you rewind
the animation. The particles remain red for entire animation because the red
color is never changed by a runtime expression.
Tip
See the online version of this documentation for colored illustrations.
The following steps show how to give the particles a randomly changing
color as the animation plays.
Because the creation expression executes when you rewind, the particles are
red.
5 Play the animation.
The runtime expression takes control of the rgbPP attribute. Because rgbPP
is a per particle attribute, the runtime expression executes for each particle in
the object each frame. For each particle, the expression assigns the rgbPP
attribute the output from the execution of the sphrand function with an
argument of 1.
The sphrand function assigns each particles rgbPP color a random vector.
The vector represents a random point in a spherical region of radius 1. The
left, middle, and right rgbPP color components have a value no less than -1
and no greater than 1. Values less than 0 are treated as 0.
The sphrand function returns a different random vector each execution. So
each particle has a different random rgbPP value, and therefore, a different
color. The color of each particle changes each frame.
Expressions
If you rendered the animation and played it back at 24 frames per second,
you would have trouble seeing the color of a particle in any instant because
the color changes so quickly.
You can slow the change of colors to create a flashing Christmas light effect.
The following steps make the particles change colors every second of
animation.
This expression uses the modulus operator (%) to control when the rgbPP
attribute of the particles receives a random color. The modulus operator
returns the remainder after division. For example, 24 divided by 24 returns
0, but 25 divided by 24 returns 1. (Dividing 25 by 24 equals 1 with a
remainder of 1.)
If the value of frame divided by 24 is equal to any number with a remainder
of 0, the assignment to BubblesShape1.rgbPP occurs. In other words, the
assignment occurs when frame equals 24, 48, 72, and so on. At an animation
rate of 24 frames/second, the assignment happens once each second.
Important
Avoid using the modulus operator with floating point values. Because of
number rounding in floating point division, you wont likely get a return
value of exactly 0 with the modulus operator. Instead use an integer value
when possible.
Note that you can change the red rewind color to random colors by
changing the creation expression to this:
BubblesShape1.rgbPP = sphrand(1);
This is the same expression as the runtime expression.
Example
Suppose youve created an emitter and added a per particle lifespanPP
attribute to it. The following creation expression gives the emitted particles a
lifespan of 2 seconds:
particleShape1.lifespanPP = 2;
Each particle disappears two seconds after its emitted.
Important
Avoid assigning a per particle attribute to another objects per particle
Expressions
attribute if the particles of either object die. As particles die, the order of
expression evaluation changes for the objects particles. This causes
unexpected results.
You can, though, assign from one attribute to another in the same object
with dying particles. The array indexes of the different attributes are in
synch with each other.
For example, dont write an expression like this:
emittedShape1.lifespanPP = 2;
emittedShape1.rgbPP = otherParticleShape2.rgbPP
The eventCount and eventTest are static attributes. A particle shape node
has them as soon as you create the particle object. Though they dont appear
in the Expression Editor, you can use their values in an expression. You
must first create the event attribute as described previously.
Example
Suppose youve created a five-particle object named Peas that falls with
gravity and collides with a plane.
You can make the particles turn red when the first particle hits the plane.
1 Select PeasShape1 in the Outliner or Hypergraph.
2 From the Dynamics menu bar, select SettingsParticle Collision Events.
Expressions
3 In the Particle Events window, click Create Event, then close the window.
This adds an event attribute to PeasShape1.
4 In the Add Dynamic Attributes section of the Attribute Editor, click Color.
The Particle Color window appears.
5 Select Add Per Particle Attribute, then click Add Attribute.
This adds a per particle attribute named rgbPP. This attribute controls the
red, green, and blue color scheme of each particle.
The particles turn black after you add the rgbPP attribute. Adding the rgbPP
attribute turns off the default coloring of the particles and gives them a value
of <<0,0,0>>.
6 Choose ShadingSmooth Shade All.
This step is necessary to make the correct particle color appear when you
assign the rgbPP attribute a value in an expression.
else if (event == 2)
rgbPP = <<0,1,0>>;
Tip
See the online version of this documentation for colored illustrations.
Note that the value of the event attribute reflects the collision count in the
frame after each collision. For example, if a particle collides with the plane in
frame 10, event is updated in frame 11.
When the other particles hit the plane for the first time, they also turn red
Expressions
after they collide.
A particle stays red until it collides with the plane for the second time, when
event equals 2. After a second collision, the particle turns green.
Note that Set for Current saves all attribute values, including position,
velocity, acceleration, and so on. In cases where you have several changing
attribute values during playback, Set for Current might save undesired
attribute values in addition to the desired ones. In such cases, use a creation
expression.
Expressions
2, and so on.
You can assign per particle attribute values to specific particles using the
particleId attribute.
Example
Suppose youve used the Particle tool to create a grid of eight particles
named ColorGrid. In the Attribute Editor, youve set the Render Type of the
particles to Spheres. Youve chosen ShadingSmooth Shade All to display
the particles with shading.
You can give the particles different colors based on their particleId.
Expressions
The expressions first statement assigns a red color to all particles whose
particleId is less than or equal to 2. The value <<1,0,0>> is red in the RGB
color scheme.
The second statement assigns a white color to all particles whose particleId
is greater than 2 and less than 6. The value <<1,1,1>> is white in the RGB
color scheme.
The third statement assigns a blue color to all particles that dont meet the
conditions in the prior two statements. In other words, all particles whose
particleId is greater than or equal to 6 become blue. The value <<0,0,1>> is
blue in the RGB color scheme.
The following steps show another common way to control an attribute based
on the particleId attribute.
To color half the particles red, and half the particles blue:
1 Enter the following runtime expression:
if ((particleId % 2) == 0)
rgbPP = <<1,0,0>>;
else rgbPP = <<0,0,1>>;
2 Play the scene.
The runtime expression executes each frame as the animation plays. Half the
particles are blue, half are red.
The first statement uses a modulus operator (%) to calculate the remainder
of dividing a particleId by 2. It then compares the remainder to 0. If the
remainder equals 0, the statement assigns the particle a red color. The value
<<1,0,0>> is red.
The second statement assigns a particle a blue color if the remainder of the
modulus operation doesnt equal 0. The value <<0,0,1>> is blue. For
example, dividing particleId 0 by 2 equals 0 with remainder 0. Because the
remainder is 0, the particle having particleId 0 receives a red color.
Dividing particleId 1 by 2 equals 0 with remainder 1. Because the remainder
is 1, the particle having particleId 1 receives a blue color.
Dividing particleId 2 by 2 equals 1 with remainder 0. With remainder 0, the
particle having particleId 1 receives a blue color. The expression executes for
each particle in the object.
The result is that even-numbered particleIds become red, odd numbered
particles become blue.
3 Rewind the animation.
The creation expression executes. The particles become red, white, and blue
as described for the previous expression.
4 Play the animation.
The runtime expression executes each frame. The particles are red and blue
as the animation plays.
Note to programmers
You cannot assign values to individual particles with the array index
notation commonly used in programming languages.
For example, suppose youve created an opacityPP attribute for an object
made of three particles. You cant assign values as in this example:
opacityPP[0] = 0.3;
opacityPP[1] = 0.5;
opacityPP[2] = 1;
Expressions
Assigning to a vector variable
You can assign a literal vector value or another vector variable to a vector
variable. Enclose a literal vector value in double angle brackets.
Examples
vector $top_velocity = <<2,2,5>>;
This assigns the vector $top_velocity the value <<2,2,5>>.
vector $temp;
vector $temp = $top_velocity;
This assigns the value of vector variable $top_velocity to the vector variable
$temp.
Format Meaning
Examples
float $temp;
vector $myvector = <<1,2,3>>;
float $temp = $myvector.z;
This assigns the right component of $myvector, 3, to the floating point
variable $temp.
Suppose you have a vector initialized as follows:
vector $myvector = <<1,2,3>>;
To replace the right component of $myvector, 3, with a new value such as 7,
use this technique to preserve the other two components:
$myvector = <<$myvector.x,$myvector.y,7>>;
This statement is incorrect:
$myvector.z = 3;
An error occurs. A statement can read, but not directly assign, a component
of a vector variable.
Example
Suppose you have 100-particle Cloud of randomly positioned particles.
CloudShape1.position = sphrand(1);
vector $pos = CloudShape1.position;
CloudShape1.rgbPP = <<0,$pos.y,0>>;
The three statements execute once for each particle in Cloud.
The first statement gives a particle a random position within a spherical
region of radius 1. The sphrand(1) function gives the X, Y, and Z position
components a value no less than -1 and no greater than 1.
The second statement assigns a particles position to a vector variable $pos.
The third statement assigns an RGB color to a particles rgbPP attribute.
The left, middle, and right vector components of CloudShape1.rgbPP
represent red, green, and blue components of the RGB color scheme. The
third statement therefore assigns 0 (no color) to the red and blue components
of a particles colorRGB. It gives a particles green component the value of its
Y coordinate position.
Because a value of 0 or less results in a 0 green value, a particle is black if its
below the XZ plane. If a particles Y coordinate position is above the XZ
plane, it has a green component varying from nearly 0 to a fully saturated
green.
Expressions
This colors the particles from black to green, depending on the position.
Increasingly green
Example
particleShape1.rgbPP = <<1,0,CloudShape1.position.z>>;
This causes an error. Maya interprets CloudShape1.position.z as being an
attribute named z of an object named CloudShape1.position.
You can get the intended result with these statements:
vector $temp = CloudShape1.position;
particleShape1.rgbPP = <<1,0,$temp.z>>;
The first statement reads all three components of vector attribute
CloudShape1.position and assigns it to the vector variable $temp. The
second statement reads the value of the right component of $temp, which
contains the right component of CloudShape1.position. It then assigns this
component to the right component of particleShape1.rgbPP.
Example
particleShape1.rgbPP.y = 1;
This also causes an error. You cant assign a value to a vector array attribute
component.
Expressions
colorGreen Sets green component of MultiStreak float
RGB color. Points
colorRed Sets red component of Sphere float
RGB color. Sprite
Streak
conserve Sets amount of float
(con) momentum conservation.
Expressions
applies to each particle in
the object.
radiusPP Sets radius size on a per yes Blobby Surface float array
particle basis. Cloud
Sphere
Expressions
selectedOnly Toggles display of id Numeric boolean
numbers for selected
particles.
Matt Baer
Expressions
For easy reference, this chapter groups functions by their purpose. For
example, all math functions are grouped in the same section.
Expressions
Other functions and 264
commands
Understanding functions
A function generates a value where it occurs in an expression statement. It
takes action based on parameters called arguments that you enclose in
parentheses next to the function name.
Example
Suppose you have an object named Star whose translateX attribute is set
with this expression statement:
Star.translateX = rand(10);
In this statement, the rand function has the argument 10. With this
argument, the function generates a randomly selected floating point number
between 0 and 10 each time the statement executes. For example, translateX
might be assigned 6.5409 the first time the statement executes, 3.2974 the
second time, 8.7389 the third time, and so on. This causes Star to jump to
random points from 0 to 10 units away from the X-axis as the scene plays.
Though functions can be more or less complicated than this example, they
all have at least one argument and generate one value. Note that a function
is part of an expression statement. They dont stand alone in an expression.
Many functions do mathematical operations. For example, the sin function
generates the sine of a specified angle. Though we often provide explanatory
figures and details, we assume youre familiar with the mathematical
purpose of such functions. For details on the math behind such functions,
see a more elementary reference.
Note that the following functions are important to learn if you want to go
beyond the basics of expression writing:
sin or sind
linstep
smoothstep
hermite
noise
dnoise
rand
sphrand
print
Function syntax
To help you quickly reference different functions, this chapter includes a
syntax format statement for each function. The format follows:
datatype function(datatype argument)
function is the name of the function.
datatype to the left of an argument indicates the data type of the argument.
argument is a parameter you type with the function.
datatype to the left of the function name indicates the data type returned
when the function executes.
Note that for either datatype, you dont type a value. The datatype tells you
the type of data you must enter or the data type returned by the executed
function.
The data types are in small type size for easy identification in the syntax
definitions.
Example 1
int abs(int number)
float abs(float number)
vector abs(vector number)
The function name is abs, which returns the absolute value of the number of
your choice. The absolute value of a number is the number without its
positive or negative sign.
This example shows the abs function has three formats. Each version
requires an argument with a different data type and returns a value with a
different data type.
The first version indicates that you can type an integer argument, and the
function returns an integer result. For example, abs(-3) returns 3.
The second version indicates that you can type a floating point argument,
and the function returns a floating point result. For instance, abs(-7.54)
Expressions
returns 7.54.
The third version indicates you can type a vector, and the function returns a
vector. For example abs(<<3, -6.3, -2>>) returns <<3, 6.3, 2>>.
Example 2
Many functions have only one format, for example, the deg_to_rad function:
float deg_to_rad( float degrees )
This function returns the radian equivalent of to a degree value. It expects a
floating point argument and returns a floating point number.
Note that Maya ignores spaces between components of functions. For
example, the functions in each of these expressions work the same:
rotateY = deg_to_rad (45);
rotateY = deg_to_rad(45);
rotateY = deg_to_rad( 45 );
Data types
In many cases, entering a data type other than the type expected by a
function causes an error and prevents the expression from executing. For
example, if you enter a vector argument where a floating point number is
expected, an error occurs.
For a function argument that expects a floating point number, however, you
can instead type an integera number without a decimal point. Maya
converts an integer to a floating point number in arithmetic operations.
If an error occurs when you create an expression, check that youre using the
appropriate data types for all arguments.
Notes
In this book, examples of floating point return values show no more than
three digits to the right of the decimal point. If you display the contents of
an attribute or variable in the Script Editor, youll see as many as 10 digits
to the right of the decimal point.
For instance, an example might show a return value as 3.539 rather than
the precise value 3.538654390. The examples round up such numbers for
ease of reading.
Note also that converting radians to degrees and vice versa results in
rounding errors. For example, converting a radian value might result in
89.99999996 degrees rather than 90.0 degrees.
Examples
Ball.scaleY = abs(-1);
This statement assigns Ball.scaleY the value returned by the abs(-1) function.
If you use a function in an expression statement and do not assign the
returned value to an attribute, the statement has no effect.
abs(-1);
Returns 1, but doesnt assign it to an attribute. This has the same result as
the following meaningless statement:
1;
In some function examples in this chapter, the functions purpose is easier to
understand in the context of an expression. In such cases, we show examples
of the function in an expression.
Limit functions
The limit functions are math functions that impose limits on numbers.
abs
Returns the absolute value of number. The absolute value of an integer or
Expressions
floating point number is the number without its positive or negative sign.
The absolute value of a vector is a vector with components stripped of
negative signs.
int abs(int number)
float abs(float number)
vector abs(vector number)
number is the number for which you want the absolute value.
Examples
abs(-1)
Returns the value 1.
abs(1)
Returns the value 1.
abs(<<-1,-2.43,555>>)
Returns <<1, 2.43, 555>>.
abs(Ball.translateY)
If Ball.translateY contains -20, this returns 20.
ceil
Returns a number rounded to the smallest integer value greater than or
equal to a floating point number.
float ceil(float number)
number is the number you want to round.
Examples
ceil(2.344)
Returns 3.
ceil(3.0)
Returns 3.
ceil(Rock.scaleY)
If Rock.scaleY contains -2.82, this returns -2.
floor
Returns a number rounded to the largest integer less than or equal to a
floating point number.
float floor(float number)
number is the number you want to round.
Examples
floor(2.344)
Returns 2.
floor(3.0)
Returns 3.
floor(Head.height)
If Head.height is -2.8, this returns -3.
clamp
Returns a number within a range. You can use the clamp function to confine
an increasing, decreasing, or randomly changing number to a range of
values.
float clamp(float minnumber, float maxnumber, float parameter)
minnumber and maxnumber specify the range of the returned value.
parameter is an attribute or variable whose value you want to clamp within
the range.
If parameter is within the numerical range of minnumber and maxnumber, the
function returns the value of parameter.
If parameter is greater than the range, the function returns the maxnumber.
If parameter is less than the range, the function returns the minnumber.
Examples
clamp(4,6,22)
Expressions
Returns 6, because 22 is greater than 6, the maximum number of the range.
clamp(4,6,2)
Returns 4, because 2 is less than 4, the minimum number of the range.
clamp(4,6,5)
Returns 5, because its within the range.
Ball.scaleY = clamp(0,3,time);
Returns a value between 0 and 3 each time the expression executes.
When you rewind the animation to frame 1, the above expression executes
and Balls scaleY attribute receives the value of timea number slightly
above 0. The clamp function returns the value of time because time is within
the range 0 to 3.
When you play the animation, time increments slightly with each frame. The
expression executes with each frame and Balls scaleY attribute receives the
value of time until time exceeds 3. When time exceeds 3, the clamp function
returns the value 3.
min
Returns the lesser of two floating point numbers.
float min( float number, float number)
number is a number you want to compare.
Examples
min(7.2,-3.2)
Returns -3.2.
Desk.height = -2;
Lamp.height = 9;
$Mylight = min(Desk.height,Lamp.height);
Sets $Mylight to -2.
max
Returns the larger of two floating point numbers.
float max(float number, float number)
number is a number you want to compare.
Examples
max(7.2,-3.2)
Returns 7.2.
Desk.height = -2;
Lamp.height = 9;
$Mylight = max(Desk.height,Lamp.height);
Sets $Mylight to 9.
sign
Returns one of three values representing the sign of a number. Returns -1 if
the number is negative, 1 if positive, 0 if 0.
float sign( float number )
number is the number whose sign you want to determine.
Examples
sign(-9.63)
Returns -1.
sign(0)
Returns 0.
sign(10)
Returns 1.
sign(Ball.translateX)
If Ball.translateX is 5, this returns 1.
trunc
Returns the whole number part of a floating point number.
float trunc(float number)
number is the number you want to truncate.
Examples
trunc(2.344)
Expressions
Returns 2.
trunc(0.3)
Returns 0.
trunc(-2.82)
Returns -2.
trunc(time)
If time equals 3.1234, this returns 3.
Exponential functions
The following functions work with exponential values.
exp
Returns e raised to the power of a number, enumber. The predefined variable e
is the base of the natural logarithm, which is 2.718.
float exp(float number)
number is the exponent to which you want to raise e.
Examples
exp(1)
Returns 2.718, the value of e.
exp(2)
Returns 7.389, the value of e2.
log
Returns the natural logarithm of a number, logenumber. The natural
logarithm uses the constant e, which is 2.718.
float log(float number)
number is the positive number for which you want the natural logarithm.
Examples
log(10)
Returns 2.303.
log(2.718282845904)
Returns 1.000.
log10
Returns the log base 10 of a number.
float log10(float number)
number is the positive number for which you want the log base 10.
Examples
log10(100)
Returns 2.
log10(10)
Returns 1.
pow
Returns a base number raised to an exponent.
float pow(float base, float exponent )
base is the base number you want to raise to the exponent. A negative base
number with a decimal component causes an error message.
exponent is the exponent.
Examples
pow(2,3)
Returns 8.
pow(-2,3)
Expressions
Returns -8.
pow(2,-3)
Returns 0.125.
sqrt
Returns the square root of a positive number.
float sqrt(float number)
number is the positive number of which you want the square root.
A negative number displays an error message.
Examples
sqrt(16)
Returns 4.
sqrt($side)
If $side is 25, this returns 5.
Trigonometric functions
The following functions return trigonometric values. Each function has two
formats that let you choose the type of angular unit you work with: degrees
or radians. For example, the cos function expects an argument in radians,
while cosd expects an argument in degrees.
A radian equals 180 degrees divided by pi, or roughly 57.3 degrees. Note
that pi equals 3.1415927, which is also 180 degrees.
cos
Returns the cosine of an angle specified in radians.
float cos(float number)
number is the angle, in radians, whose cosine you want.
For any right triangle, the cosine of an angle is the following ratio:
adjacent B
cos = ------------------------------ = ----
hypotenuse C
Y Y
C
A
B
B X X
A
C
The cosine ratio depends only on the size of the angle and not on the size of
the triangle. This constant ratio is called the cosine of the measure of the
angle.
The cosine ratio is a value between -1 and 1.
With a steadily increasing or decreasing argument, the cos function returns
steadily increasing or decreasing values between 1 and -1. This is useful for
creating rhythmic, oscillating changes in attribute values.
The cos function works like the sin function except its return values are 90
degrees, or pi/2, out of phase.
See page 219 for ideas on how to use the cyclical characteristics of the sin
and cos functions.
Example 1
cos(1)
Returns 0.5403, the cosine of 1 radian.
Example 2
To animate the motion of Ball in a cosine wave pattern, use this expression:
Ball.translateX = time;
Ball.translateY = cos(Ball.translateX);
Expressions
Ball starts at the origin and moves in the X direction at a rate set by the
incrementing animation time. Its Y translation moves cyclically up and
down according to the return values of the cos function. The cos function
uses translateX, and therefore indirectly, time, as its argument.
As time increases from 0 to 6.283 seconds, the cos function returns values
that change in fine increments from 1 to -1 and back to 1. The value 6.283 is 2
times the value of pi.
As time increases beyond 6.283 seconds, the same cycle repeats for each span
of 6.283 seconds.
Ball.translateY = cos(Ball.translateX);
time = 6.283
(2 * pi seconds)
Ball.translateY = sin(Ball.translateX);
time = 6.283
(2 * pi seconds)
The cosine curve is 1.571 (pi/2) seconds ahead of (or behind) the sine curve,
and vice versa.
cosd
Returns the cosine of an angle specified in degrees.
float cosd(float number)
number is the angle, in degrees, whose cosine you want.
For more details on the cosd function, see the cos function in the preceding
topic. The cosd and cos functions do the same operation, but cosd requires
its argument in degree measurement units.
Example
cosd(45)
Returns 0.707, the cosine of 45 degrees.
sin
Returns the sine of an angle specified in radians.
float sin(float number)
number is the angle, in radians, whose sine you want.
For any right triangle, the sine of an angle is the following ratio:
opposite A
sin = ------------------------------ = ----
hypotenuse C
Y Y
C
A
B
B X X
Expressions
A
C
The sine ratio depends only on the size of the angle and not on the size of
the triangle. This constant ratio is called the sine of the measure of the angle.
The sine ratio is a value between -1 and 1.
With a steadily increasing or decreasing argument, the sin function returns
steadily increasing or decreasing values between -1 and 1. This is useful for
creating rhythmic, oscillating changes in attribute values.
Example 1
float $pi = 3.1415927;
sin($pi/2)
Returns 1, the sine of pi/2 radians.
Example 2
Ball.translateY = sin(Ball.translateX);
This statement sets Balls translateY attribute equal to the sine of its
translateX attribute. If you drag Ball along the X-axis, Balls translateY
position moves up and down in a cyclical pattern:
Example 3
To animate Ball to the path of the preceding example, use this expression:
Ball.translateX = time;
Ball.translateY = sin(Ball.translateX);
Ball starts at the origin and moves in the X direction at a rate set by the
incrementing animation time. Its Y translation moves cyclically up and
down according to the return values of the sin function. The sin function
uses translateX, and therefore indirectly, time, as its argument.
As time increases from 0 to 6.283 seconds, the sin function returns values
that change in fine increments from 0 to 1 to -1 to 0. The value 6.283 is 2
times the value of pi. The resulting motion resembles a horizontal S-shape:
time = 6.283
(2 * pi seconds)
As time increases beyond 6.283 seconds, the same S-shaped cycle repeats for
each span of 6.283 seconds.
Example 4
Expressions
This expression animates Ball with larger up and down swings:
Ball.translateX = time;
Ball.translateY = sin(Ball.translateX) * 2;
By multiplying sin(Ball.translateX) by a number greater than 1, you increase
the amplitude of the sine wave pattern. The amplitude is half the distance
between the minium and maximum values of the wave.
Amplitude
Example 5
This expression increases how often the sine wave completes a cycle:
Ball.translateX = time;
Ball.translateY = sin(Ball.translateX * 2);
By multiplying Ball.translateX by a number greater than 1, you increase the
frequency of the sine wave pattern. The frequency is how long it takes the
wave to make a complete cycle.
Frequency
Example 6
This expression offsets the wave pattern higher up the Y-axis:
Ball.translateX = time;
Ball.translateY = sin(Ball.translateX) + 2;
By adding 2 to sin(Ball.translateX), the wave pattern starts further up the Y-
axis. You can, of course, also subtract a number to offset the wave pattern
lower on the Y-axis.
Offset of 2
Example 7
The following expression sets a frequency multiplier, amplitude, and offset
of a sine pattern in a single statement:
Ball.translateX = time;
Ball.translateY = (sin(Ball.translateX * 2) * 2) + 2;
Expressions
The following diagram shows which values set the frequency multiplier,
amplitude, and offset.
Frequency multiplier
Amplitude
Offset
Ball.translateY = (sin(Ball.translateX * 2) * 2) + 2;
A general equation showing the factors you can use to create a sine wave
pattern follows:
sind
Returns the sine of an angle specified in degrees.
float sind(float number)
number is the angle, in degrees, whose sine you want.
For more details on how to use the sind function, see the sin function in the
preceding topic. The sind and sin functions do the same operation, but sind
requires its argument in degree measurement units.
Example
sind(90)
Returns 1, the sine of 90 degrees.
tan
Returns the tangent of an angle specified in radians.
float tan(float number)
number is the angle, in radians, whose tangent you want.
For any right triangle, the tangent of an acute angle is the following ratio:
opposite A
tan = ----------------------- = ---
adjacent B
Y Y
C
A
B
B X X
A
C
The ratio depends only on the size of the angle and not on the size of the
triangle. This constant ratio is called the tangent of the measure of the angle.
Example
tan(1)
Returns 1.557.
tand
Returns the tangent of an angle specified in degrees.
float tand(float number)
number is the angle, in degrees, whose tangent you want.
For more details on the tand function, see the tan function in the preceding
topic. The tand and tan functions do the same operation, but tand requires
its argument in degree measurement units.
Example
tand(45)
Returns roughly 1, the tangent of 45 degrees.
Expressions
acos
Returns the radian value of the arc cosine of a number. The arc cosine is the
angle whose cosine is the specified number. The returned value is from 0 to
pi.
float acos(float number)
number is the cosine of the angle, and must be from -1 to 1.
Example
acos(1)
Returns 0.
acos(-0.5)
Returns 2.0944 radians.
acosd
Returns the degree value of the arc cosine of a number. The arc cosine is the
angle whose cosine is the specified number. The returned value is from 0 to
180.
float acosd(float number)
number is the cosine of the angle, and must be from -1 to 1.
Example
acosd(1)
Returns 0 degrees.
acosd(-0.5)
Returns 120 degrees.
asin
Returns the radian value of the arc sine of a number. The arc sine is the angle
whose sine is the specified number. The returned value is from -pi/2 to pi/2.
float asin(float number)
number is the sine of the angle, and must be from -1 to 1.
Example
asin(0.5)
Returns 0.525 radians.
asind
Returns the degree value of the arc sine of a number. The arc sine is the
angle whose sine is the specified number. The returned value is from -90 to
90.
float asind(float number)
number is the sine of the angle, and must be from -1 to 1.
Example
asind(0.5))
Returns 30 degrees.
atan
Returns the radian value of the arc tangent of a number. The arc tangent is
the angle whose tangent is the specified number. The returned value is from
-pi/2 to pi/2.
float atan(float number)
number is the tangent of the angle and can be any value.
Example
atan(1)
Returns 0.785.
atand
Returns the degree value of the arc tangent of a number. The arc tangent is
the angle whose tangent is the specified number. The returned value is from
-90 to 90.
Expressions
float atand(float number)
number is the tangent of the angle and can be any value.
Example
atand(1)
Returns 45 degrees.
atan2
Returns the radian value of the arc tangent of specified X and Y coordinates.
The arc tangent is the angle from the X-axis to a line passing through the
origin and a point with coordinates X,Y. The returned angle is in radians,
from -pi to pi, excluding -pi.
float atan2(float Y, float X )
X is the X coordinate of the point.
Example
atan2(1,1)
Returns 0.785 radians.
atan2d
Returns the degree value of the arc tangent of specified X and Y coordinates.
The arc tangent is the angle from the X-axis to a line passing through the
origin and a point with coordinates X,Y. The returned angle is in degrees,
from -180 to 180, excluding -180.
float atan2d(float Y, float X )
X is the X coordinate of the point.
Y is the Y coordinate of the point.
Example
atan2d(1,1)
Returns 45 degrees.
hypot
Returns the magnitude of two-dimensional vector from the origin to a point
with coordinates X, Y.
Y hypot
(X,Y)
As shown in the preceding figure, the hypot function returns the radius of a
circle whose center is at one end of a right triangles hypotenuse and
perimeter is at the other end of the hypotenuse.
The following equation gives the magnitude of the vector:
2 2
x +y
Example
hypot(3,4)
Returns 5.
Vector functions
The following functions do operations with vectors. The functions take
vector arguments and return floating point numbers or vectors.
Expressions
angle
Returns the radian angle between two vectors.
Vector1
Angle
Vector2
Example
angle(<<2,-1,1>>,<<1,1,2>>)
Returns 1.0472 radians, which equals 60 degrees.
cross
Returns the cross product of two vectors.
For two vectors, the cross product returns the vector thats normal to the
plane defined by the two vectors.
Vector1
Vector2
Cross product
Example
cross(<<1,2,-2>>,<<3,0,1>>)
Returns <<2, -7, -6>>.
dot
Returns the floating point dot product of two vectors. The dot product takes
two vectors as arguments and returns a scalar value.
float dot(vector vector1, vector vector2)
If the dot product returns 0, the two vectors are perpendicular.
vector1 is one of the vectors.
vector2 is the other vector.
Example
dot(<<1,2,-2>>,<<3,0,1>>)
Returns 1. The dot product of this example is (1 * 3) + (2*0) + (-2*1), which
equals 1.
mag
Returns the magnitude of a vector. This is the length of the vector.
Y-axis
Expressions
Z
X <<X, Y, Z>>
X-axis
Z-axis
Magnitude
The mag function converts a vector into a floating point number using the
following formula.
2 2 2
x +y +z
Example
mag(<<7,8,9>>)
Returns 13.928.
2 2 2
7 + 8 + 9 = 13.928
rot
Returns a vector that represents the position of a point after its rotated a
specified number of radians about a specified axis. Rotation is counter-
clockwise as viewed downward from the axis end position.
Position of point
before rotation
Angle
Position of point
after rotation
Axis
Example 1
rot(<<3,3,0>>,<<1,0,0>>,0.5)
Returns <<3, 2.633, 1.438>>. This is a vector representing the position of
point <<3,3,0>> after rotating it 0.5 radians around the axis represented by
<<1,0,0>>.
Example 2
particleShape1.position = rot(position,<<0,1,0>>,0.1);
Suppose your scene has a single-particle object at position <<4,6,0>>, and
you wrote the above runtime expression for its particle shape node. When
you play the scene, the particle rotates in a circular pattern around the Y-axis
(the axis represented by <<0,1,0>>).
In each frame, the particles position rotates 0.1 radian, roughly 5.7 degrees.
Motion
Particle
Expressions
unit
Returns the unit vector corresponding to a vector.
The unit vector has the same direction as the specified vector, but with a
magnitude of 1.
vector unit( vector vector)
vector is the vector whose unit vector you want.
Example
unit(<<1,1,1>>)
Returns <<0.577, 0.577, 0.577>>.
Y
<<1, 1, 1>>
Conversion functions
The following functions convert color scheme values or angle
measurements.
deg_to_rad
Returns the radian equivalent of a degree value. One radian equals roughly
57.29578 degrees.
float deg_to_rad( float degrees )
degrees is the degree angle you want to convert to radians.
Example
deg_to_rad(90)
Returns 1.571, which is the same as pi/2.
rad_to_deg
Returns the degree equivalent of a radian value. One radian equals roughly
57.29578 degrees.
float rad_to_deg(float radians)
radians is the radian angle you want to convert to degrees.
Examples
rad_to_deg(1)
Returns 57.296.
float $pi = 3.1415927;
rad_to_deg($pi)
Returns 180.
hsv_to_rgb
Converts an HSV vector to an RGB vector.
vector hsv_to_rgb(vector hsv)
hsv is a vector representing the hue, saturation, and value components.
Example
hsv_to_rgb(<<1,0.5,0.6>>)
Returns <<0.6, 0.3, 0.3>>.
Tip
To see the relationship between HSV and RGB color components, enter the
Expressions
MEL command colorEditor at the Command Line. This displays the Color
Chooser window.
In the windows hexagonal color wheel, drag the pointer to a color of
interest. The edit boxes in the window list the colors values for hue,
saturation, and valueand their counterpart red, green, and blue values.
Note, however, that the Hue value in the Color Chooser has a range of 0 to
360, while the H component of an HSV vector has a corresponding
proportional range of 0 to 1.
When you launch the Color Chooser by entering colorEditor, its useful only
for learning about color. You cant use it to change the color of objects in
your scene.
rgb_to_hsv
Converts an RGB vector to an HSV vector.
Example
rgb_to_hsv(<<0.6,0.6, 0.6>>)
Returns <<0, 0, 0.6>>.
Array functions
The following functions work with integer, floating point, and vector arrays.
If you need more information, see a reference book on the C programming
language.
clear
Empties the arrays contents, freeing all memory reserved for the array.
After you clear an array, its size is 0. When you no longer need to use an
array, use the clear function to free memory.
int clear(array array)
array is the name of the array you want to clear.
The clear function returns 1 if the function succeeds, 0 if it fails. The return
value is not typically used in expressions.
Example
int $myInts[] = {1,2,3,4,5,6};
print("size of $myInts is: "+size($myInts)+"\n");
clear($myInts);
print("size of $myInts is: "+size($myInts)+"\n");
The third statement above clears the array $myInts.
The second and fourth statements display the following text in the Script
Editor:
size of $myInts is: 6
size of $myInts is: 0
size
Returns the number of elements in an array or the number of characters in a
string.
int size(array array)
int size(string string)
array is the name of the array whose size you want.
string is the string whose number of characters you want.
Example 1
string $s = "Hello";
$stringlen = size($s);
The size($s) function returns 5, then the statement assigns 5 to $stringlen.
Example 2
int $myInts[] = {1,2,3,4,5,6};
$numInts = size($myInts);
The size($myInts) function returns 6, then the statement assigns 6 to
$numInts.
Expressions
sort
Returns an array sorted in alphabetical or ascending numerical order. The
returned array has the same number and type of elements as the original
array.
array sort(array array)
Example 1
int $myInts[] = {3,6,1,4,2,5};
int $afterSorting[] = sort($myInts);
print("After sorting, the array contains:\n");
for ($i = 0; $i < 6; $i = $i + 1)
{
print($afterSorting[$i]+"\n");
}
The sort function sorts the elements of $myInts in ascending order. The
following appears in the Script Editor:
After sorting, the array contains:
1
2
3
4
5
6
Example 2
string $myName[] = {"Peewee","Michael","Kennedy"};
string $afterSorting[] = sort($myName);
print("After sorting, the array contains:\n");
for ($i = 0; $i < 3; $i = $i + 1)
{
print($afterSorting[$i]+"\n");
}
The sort function sorts the elements of $myName in alphabetical order. The
following appears in the Script Editor:
After sorting, the array contains:
Kennedy
Michael
Peewee
gauss
Returns a random floating point number or vector. The number returned
falls within a Gaussian (bell curve) distribution with mean value 0.
float gauss(float stdDev)
vector gauss(float XstdDev, float YstdDev)
vector gauss(vector stdDevVector)
stdDev specifies the value at which one standard deviation occurs along the
distribution. This gives a one-dimensional Gaussian distribution.
XstdDev and YstdDev specify the values for one standard deviation. This
gives a two-dimensional Gaussian distribution in the XY plane. The right
component of the vector returned is 0.
stdDevVector specifies the vector component values for one standard
deviation. This gives a three-dimensional distribution.
Expressions
To control the random values returned by this function, see seed on page
246.
Example
gauss(5)
Returns a random floating point value such as 0.239.
If you were to execute gauss(5) repeatedly and chart the values returned,
they would occur roughly with this frequency:
Mean
-5 0 5
Value returned
If you were to execute gauss(2) repeatedly, return values would occur with
this frequency:
Mean
-2 0 2
Value returned
noise
Returns a random number from -1 to 1 according to a Perlin noise field
generator.
float noise(float number)
float noise(float xnum, float ynum)
float noise(vector vector)
number specifies a number that generates a random number. This gives a
one-dimensional distribution of return values.
xnum and ynum specify numbers for generating a random number. This
gives a two-dimensional distribution of return values.
vector specifies a vector for generating a random number. This gives a three-
dimensional distribution of return values.
If you execute this function with the same argument value repeatedly, the
function returns the same random value each time it executes.
If you execute this function with an argument value that steadily increases
or decreases in fine increments over time, the function returns random
values that increase and decrease over time.
Example 1
Expressions
noise(time)
Returns a value between -1 and 1 each time the expression executes as an
animation plays. Because time increases in fine increments, the values
returned increase and decrease in smooth, yet random, patterns. If you were
to chart the values returned over a period of time, they might occur as in this
figure:
1
Return
value 0
-1
noise(time) as animation plays
Example 2
noise(frame)
Returns a value between -1 and 1 each time the expression executes as an
animation plays. Because frame increases in larger increments, the values
returned increase and decrease in rougher patterns. If you were to chart the
values returned over a period of time, they might occur as in this figure:
1
Return
value 0
-1
noise(frame) as animation plays
The value returned by noise(frame) and noise(time) is the same when frame
contains the same number as time. For example, when frame equals 10,
noise(frame) returns the same value that noise(time) returns when time is 10.
dnoise
Returns a vector with each component containing a random number from -1
to 1. It works like the noise function except it expects and returns a vector
argument. The returned vector represents the gradient of the noise field in
three dimensions.
vector dnoise(vector argument)
argument specifies a vector for generating a random number. This gives a
three-dimensional distribution of return values.
See the noise function for more details on dnoise operation.
Example
dnoise(<<10,20,-30>>)
Returns <<-0.185, 0.441, 0.686>>.
rand
Returns a random floating point number or vector within a range of your
choice.
float rand(float maxnumber)
float rand(float minnumber, float maxnumber)
vector rand(vector maxvector)
vector rand(vector minvector, vector maxvector)
maxnumber specifies the maximum number returned (in the first syntax
format listed above). The minimum number returned is 0. In other words,
the returned value will be a random number between 0 and maxnumber.
minnumber and maxnumber specify the minimum and maximum numbers
returned.
maxvector specifies the maximum value for each component of the vector
returned. The minimum value is 0. Each component returned is a different
random number.
minvector and maxvector specify the minimum and maximum value for each
component of the vector returned.
To control the random values returned by this function, see seed on page
Expressions
246.
Example 1
rand(5)
Returns a random floating point number between 0 and 5, for example,
3.539.
Example 2
rand(-1,1)
Returns a random floating point number between -1 and 1, for example,
0.452.
1
Return
value 0
-1
rand(1,-1) as animation plays
Example 3
rand(<<1,1,1>>)
Returns a random vector in which each component is between 0 and 1, for
example, <<0.532, 0.984, 0.399>>.
Example 4
rand(<<1,1,1>>,<<100,200,300>>)
Returns a random vector in which the left component is between 1 and 100,
the middle component is between 1 and 200, and the right component is
between 1 and 300. An example is <<81.234, 49.095, 166.048>>.
sphrand
Returns a random vector value that exists within a spherical or ellipsoidal
region of your choice. An ellipsoid is a sphere scaled along its X-, Y- or Z-
axes.
vector sphrand(float radius)
vector sphrand(vector vector)
radius is the radius of a sphere in which the returned vector exists.
vector is the radius of an ellipsoid along the X-, Y-, and Z-axis.
To control the random values returned by this function, see seed on page
246.
Example 1
sphrand(1)
Returns a vector whose randomly selected coordinates reside within an
imaginary sphere centered at the origin and with a radius of 1. An example
returned vector is <<0.444, -0.427, 0.764>>.
radius
Example 2
sphrand(<<2,1,1>>)
Returns a vector whose coordinates reside within an ellipsoid centered at the
origin and with a radius of 2 along the X-axis, 1 along the Y-axis, and 1 along
the Z-axis.
Expressions
Radius in Z
2
1
1 Radius in X
Outer bound of
returned value
Radius in Y
seed
Sets a seed value the gauss, rand, and sphrand functions use to generate
random numbers. If you assign a value to the seed then execute the gauss,
rand, or sphrand function repeatedly, an identical sequence of random
numbers is generated. For clarification, see the example below and
Reproducing randomness on page 123.
int seed(int number)
number sets an arbitrary number to be used as the seed value.
Example
Suppose you create a NURBS sphere named Ball then enter this expression:
Ball.translateX = rand(5);
Expressions
Frame Value
1 4.501
2 3.863
3 3.202
4 3.735
5 2.726
6 0.101
Each time you rewind and play the animation, translateX receives the same
sequence of random values.
For different seed values, the sequence of numbers returned will differ. You
cant predict the values in the number sequence based on the value of the
seed.
Frame Value
1 4.725
2 2.628
3 0.189
4 0.004
5 4.834
6 0.775
By changing the seed functions value, you change the sequence of random
numbers generated.
A common mistake while using the seed function follows:
seed(1);
Ball.translateX = rand(5);
When you rewind the animation, Balls translateX attribute receives the
value 4.501. When you play the animation, the translateX attribute receives
4.501 each time the expression executes.
Because you assign a value (1) to the seed before each execution of rand(5),
you initialize the random number sequence. The rand(5) function therefore
returns the first value of the number sequence each time it executes.
Important
When you set a seed value in an expression or MEL script, the seed value
affects the rand, sphrand, and gauss functions in other expressions and
MEL scripts. Such functions are affected by this seed value in all scenes
you open subsequently in the current work session.
Curve functions
The step functions let you make smooth, incrementing transitions between
values.
linstep
Returns a value from 0 to 1 that represents a parameters proportional
distance between a minimum and maximum value. This function lets you
increase an attribute such as opacity from 0 to 1 linearly over a time range.
float linstep(float start, float end, float parameter)
start and end specifies the minimum and maximum values.
parameter is the value you want to use to generate the proportional number.
If parameter is less than start, linstep returns 0.
If parameter is greater than end, linstep returns 1.
Example
Suppose youve used the Particle Tool to create a collection of particles
named Cloud:
Expressions
Suppose further youve added a dyamic per object opacity attribute to Cloud
(see Working with particle attributes in Chapter 8). You then write this
runtime expression for Clouds particle shape node:
CloudShape1.opacity = linstep(0,5,age);
Age Opacity
0.0417 0.0083
0.0833 0.0166
0.125 0.025
0.1667 0.0333
0.2083 0.0417
2.5 0.5
1.0 0.2
3.75 0.75
5 1
5.041 1
5.083 1
10 1
As the table shows, the opacity increases in linear increments for the first 5
seconds of the objects age. At the midpoint of the specified 0 to 5 second age
range, the opacity is 0.5. At 3/4 of the way between 0 and 5 seconds, the
opacity is 0.75. At 5 seconds of the objects age, opacity is 1. After 5 seconds,
the opacity stays at 1.
opacity
0 5
age (in seconds)
Expressions
1
opacity
0 5 10
age (in seconds)
opacity
0 5
age (in seconds)
smoothstep
Returns a value from 0 to 1 that represents a parameters proportional
distance between a minimum and maximum value. The smoothstep function
lets you increase an attribute such as opacity from 0 to 1 gradually, but
nonlinearly, over a time range.
The smoothstep function works like the linstep function, except it increases
values more quickly near the middle values between the minimum and
maximum value. The function uses hermite interpolation between minimum
and maximum values.
float smoothstep(float start, float end, float parameter)
start and end specifies the minimum and maximum values.
parameter is the value you want to use to generate the smoothstep number.
If parameter is less than start, linstep returns 0.
If parameter is greater than end, linstep returns 1.
parameter
smoothstep linstep
start end
Example
Suppose youve used the Particle Tool to create a collection of particles
named Cloud:
Expressions
Suppose also youve added a dynamic per object opacity attribute to Cloud
(see Working with particle attributes in Chapter 8). You then write this
runtime expression for Clouds particle shape node:
CloudShape1.opacity = smoothstep(0,5,age);
opacity
0 5
age (in seconds)
hermite
Returns values along a hermite curve. You can use the hermite function, for
instance, to move a particle objects position smoothly along a curve. As the
examples in the following pages show, you can create various curve shapes
by altering the arguments to the hermite function.
vector hermite(vector start, vector end, vector tan1, vector tan2, float parameter)
float hermite(float start, float end, float tan1, float tan2, float parameter)
start is the start point of the curve.
end is the end point of the curve.
tan1 is the tangent vector that guides the direction and shape of the curve as
it leaves the start point of the curve. The vectors position starts at the start
point of the curve.
tan2 is the tangent vector that guides the direction and shape of the curve as
it approaches the end point of the curve. The vectors position starts at the
end point of the curve.
parameter is an floating point value between 0 and 1, for example, the value
returned by a linstep function.
In the second format, the arguments and return values work in a single
dimension.
Example 1
Suppose you create an object named dust made of one particle at the origin.
To guide its motion along a short upward-bound curve for the first four
seconds of animation, you can write the following runtime expression:
dust.position = hermite(<<0,0,0>>,<<2,2,0>>,
<<3,0,0>>, <<0,3,0>>, linstep(0,4,time));
When you play the animation, the particle moves from the start point
<0,0,0> along a curve to the end point <2,2,0>. The tangent vector <3,0,0>
sets the curves direction and shape as it leaves the start point. The tangent
vector <0,3,0> sets the curves direction and shape as it approaches the end
point.
From zero to four seconds of animation play, the particle moves along the
curve as defined by the linstep function. (See page 249 for details on linstep.)
The function arguments and resulting path of the object follow:
Y
tan2 = <<0,3,0>>
Expressions
end = <<2,2,0>>
Objects path
Example 2
Suppose you change the third argument of the previous example expression
to <<6,0,0>>:
dust.position = hermite(<<0,0,0>>,<<2,2,0>>,
<<6,0,0>>, <<0,3,0>>, linstep(0,4,time));
The slope of the path curve steepens because of the longer tan1 vector:
Y tan2 = <<0,3,0>>
end = <<2,2,0>>
Objects path
X
start = <<0,0,0>> tan1 = <<6,0,0>>
Example 3
The following expression moves dust in an S pattern:
dust.position = hermite(<<0,0,0>>,<<2,0,0>>,
<<0,3,0>>, <<0,3,0>>, linstep(0,4,time));
The tan1 vector <<0,3,0>> sets the direction of the curve from the start point
to a positive Y direction. The tan2 vector <<0,3,0>> sets the direction of the
curve to a positive Y direction as it approaches the end point.
Values between the start and end point curves are interpolated to form an S
pattern.
Example 4
Suppose you change the fourth argument of the previous example
expression to <<0,-3,0>>:
dust.position = hermite(<<0,0,0>>,<<2,0,0>>,
<<0,3,0>>, <<0,-3,0>>, linstep(0,4,time));
The dust particle moves in a pattern resembling a half-circle:
tan1 = <<0,3,0>>
Expressions
tan2 = <<0,-3,0>>
The tan1 vector <<0,3,0>> sets the direction of the curve from the start point
to a positive Y direction. The tan2 vector <<0,-3,0>> sets the direction of the
curve to a negative Y direction as it approaches the end point.
Example 5
Suppose you change the third argument of the preceding example to
<<0,10,0>>:
dust.position = hermite(<<0,0,0>>,<<2,0,0>>,
<<0,10,0>>, <<0,-3,0>>, linstep(0,4,time));
Y
tan1 = <<0,10,0>>
tan2 = <<0,-3,0>>
Because of the longer tan1 vector, the slope of the path curve steepens as it
rises from the start point. Because the tan2 vector has a smaller Y magnitude
than the Y magnitude of the tan1 vector, the slope of the path curve is flatter
as it approaches the end point. The curves rise in the Y direction is greater
than the previous example because the magnitude of tan1s Y component is
larger (10 instead of 3).
General commands
The following functions do various actions in Maya.
eval
Executes a MEL command.
string eval(string command)
command is either a command string enclosed in quote marks or a string
variable containing a command.
The returned value contains command output returned by the commands
execution.
Example 1
eval("select -cl")
Executes the command select -cl, which deselects all objects in the scene.
Though the return value is not used in this example, it contains the
command output.
Example 2
string $cmd = "select -cl";
Expressions
eval($cmd);
The first statement assigns the command string select -cl to the string variable
$cmd. The second statement executes the contents of $cmd, which is the
command select -cl.
Example 3
string $mycommand = "sphere";
eval($mycommand+"-r 5");
The first statement assigns the string sphere to the variable $mycommand.
The second statement appends -r 5 to the string sphere and executes the
complete command sphere -r 5. This creates a sphere with a radius of 5 grid
units.
Example 4
string $a[];
$a = eval("ls -lights");
print($a);
The first statement defines an array of strings named $a. The second
statement executes the MEL command ls -lights, then assigns the commands
output to array $a. The third statement displays the contents of $a to the
Script Editor as follows:
ambientLightShape1
directionalLightShape1
Note that each line of command output appears on a new line. Each
command output line is an array element. Maya formats array output with
each array element on a new line.
Example 5
Suppose youve created a MEL script file named bunk.mel in your Maya
scripts directory and it contains this procedure:
global proc string bunk()
{
string $fog;
if (rand(2) < 1)
$fog = "particle";
else
$fog = "sphere";
return $fog;
}
Further suppose you create this expression:
string $name = bunk();
eval($name);
print($name);
The first expression statement executes the bunk() procedure in the
bunk.mel script file. In the bunk procedure, the if-else statement generates a
random floating point value between 0 and 2, then compares its value to 1.
If the value is less than 1, the statement assigns the MEL command string
particle to $fog. If the value is greater than 1, $fog receives the command
string sphere.
The procedure finishes executing and passes the value of $fog back to the
calling procedure, bunk() in the expression. This assigns the command string
to the variable $name.
The eval function executes the command string stored in the $name. For
example, the statement might execute particle, which creates a particle at the
origin of the workspace.
The fourth statement displays the contents of $name, for example, particle.
The expression executes each frame and creates a new particle or sphere.
print
Displays text in the Script Editor. You can use this function to display the
contents of attributes and variables. This is helpful for debugging an
expression.
print(string text)
print(vector number)
print(float number)
print(int number)
print(array number)
Expressions
text is either a string enclosed in quote marks or an attribute name or string
variable containing text.
number is a number without the quote marks. Numerical arguments display
as strings.
There is no returned value for this function.
Note the following display considerations.
You can format displayed text with standard C language escape characters.
For example, you can create a new line with \n or a tab character with
\t in the argument.
Displaying a floating point value shows the number with up to 10 digits to
the right of the decimal point, for example 0.3333333333.
Insignificant 0 digits are truncated from floating point numbers. For
example, floating point number 2.0 is displayed as 2.
int "3.14" 3
As shown in the last row of the table, if a variable is assigned a string that
starts with a nonnumerical character, Maya converts the string to 0.
For a nonparticle expression consisting of only print statements, Always
Evaluate must be on in the Expression Editor for the expression to execute.
Examples
print(time);
print("\n");
The first statement displays the value of time. The second statement displays
a new-line character after the value of time, so the time appears on a
separate line in the Script Editor.
float $f = 3.14159;
print($f);
Displays the floating point number 3.14159.
string $s = "Hello There";
print($s);
Displays the string Hello There.
vector $v;
$v = <<1.2,2.3,3.4>>;
print($v);
Displays the vector as 1.2 2.3 3.4.
string $a[];
$a = eval("ls -lights");
print($a+" are the lights in my scene.\n");
The print function causes an error message because you cannot use the +
Expressions
operator with a string array.
system
Passes a UNIX command to the shell where you launched Maya.
int system( string command)
command is either a command string enclosed in quote marks or a string
variable containing a command.
The returned value is the output resulting from the commands execution.
Example
string $cmdout;
$cmdout = system("date");
print($cmdout+"\n");
Executes the UNIX date command, which outputs your workstations date
and time to the $cmdout variable. The final statement displays the date in
the Script Editor.
pwd fwrite
source fread
trace filetest
warning
whatIs
degrees 29
converting to radians 129,
E executing
MEL commands in
234 e raised to power 214 expressions 137
deleting Edit button 22 MEL commands with eval
attribute names 131 function 259
editing expressions
expressions 112, 134 MEL procedures in
in text field 99, 105
text from expressions 105 expressions 139
else keyword 38 nonparticle expressions 118
depthSort 197
else-if statements 71 UNIX commands in
discarded remainders in data type
emitted particles expressions 263
conversions 146
age of 149 execution
disconnectAttr command 132
assigning lifespanPP for 183 slow expression 127
disconnecting an attribute 132 creation expression execution exp function 214
displaying and 149
exponential functions 214
attribute contents 123 working with 183
disconnected attributes 132 Expression Editor
English common names for
text 261 starting 13
attributes 114
variable contents 123 equal to (==) operator 36
dnoise function 242 errors
do loop 78 common expression 95
dollar sign ($) in variable comparing floats with the ==
names 59, 73 operator 89
dot function 231 from wrong data types in
dot product 231 functions 208
in flow control statements 88
dot product operator 64
logic 95
double angle brackets 53, 73,
message format of 95
180, 193
syntax 36, 73, 95
dynamic attributes 49
where they appear 96
adding to object 49, 50, 161
eval function 259
dynamic per object attribute
event 198
example assignment to
lifespan 167 event attribute 184
when collision count
dynamic per particle attribute
increases 187
example assignment to
lifespanPP 164 eventCount 198
dynamics eventCount attribute 184
changing start frame 149 eventTest 198
how often Maya eventTest attribute 184
evaluates 149, 152 examining two or more
Dynamics Controller 149, 152 expressions 106
dynamicsWeight 198
dynamicsWeight attribute 178
goalWeight 198
gravity field
jot text editor 107
M
accelerations effect on 177 mag function 231
K magnitude of a vector 67, 231
mass 199
H keyframes
eliminating expression to matrix data type 55
half-circle use 122 max function 212
creating motion with hermite keywords in expressions 76 maxCount 199
function 257 measurement units 127
hermite function 254 MEL commands 45, 46
HSV conversion to RGB 235 L executing with eval
hsv_to_rgb function 235 function 259
levelOfDetail 199 using alone in
hypot function 229
lifespan 198 statements 137
lifespan attribute 161 using with eval function 138
example assignment in using within single
I creation expression 167 quotes 138
if statements 32, 34, 69 Lifespan button 161 MEL procedures
lifespanPP 199 using in expressions 138
if-else abbreviation 86
lifespanPP attribute 161, 164 MEL scripts 46
if-else statements 38, 39, 70
assigning for emitted millimeters 128
incandescence 198
particles 183 min function 212
incandescencePP 198
limit functions 209 mixed data types
increment operations and
unexpected values 142 lineWidth 199 using with arithmetic
linking attributes 11, 15, 26 operators 145
inheritFactor 198
linstep function 249 modulus operator (%) 63, 182,
initial state attributes 158, 162,
comparison with 192
163
smoothstep 253 risk of using with floats 182
creation expression
execution 150 listAttributes MEL command 163 motion
naming convention 163 log base 10 214 creating jittery 175
saving values for 158 creating smooth, random 175
log function 214
input to expressions 135 multiCount 199
logic errors 95
integers 52, 57 multiRadius 199
logical operators 67
handling as floating point 65 && 67
internal conversion of units 127 || 67
isDynamic 198 long attribute names 114 N
looping errors 88 natural logarithm 214
new line characters in print
J statement 261
joining text in strings 262
velocity attribute
assigning with creation
expression 150
assigning with runtime
expression 153, 154
fields effect on 175
working with 175
vi text editor 107
vim text editor 107
visibleInReflections 201
visibleInRefractions 201
W
while loop 77
white space in expressions 74
WINEDITOR setting 109, 110
X
xemacs text editor 107
Note: Before you start: This tutorial requires Maya scene files. If you havent installed the tutorial files go to the Try
Maya section of the Taste of Maya CDROM to install.
Starting Maya: You can start Maya by double-clicking the Maya 2.5 Evaluation icon on the desktop or from Start
Programs Maya 2.5 Evaluation Maya.
In Maya: Once the tutorial files have been installed you will need to set the current project in order to access the Maya
scene files. To set the current project from within Maya select File Project Set... and Navigate to the directory
where you installed the Maya scene files. Select the directory: Maya_tutorial_data and press OK.
2 Pop-up help
In Maya if you hold the mouse cursor over an icon in the user interface without moving it for a second a pop up
help will show up with the name of the tool you are over.
2 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Maya UI Tour
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 3
Maya UI Tour Questions? visit www.aliaswavefront.com/tasteofmaya
n Shelf: The Shelf UI is comprised of two sections. The Mini-Bar section on the far left-hand side and the user-
defined shelf or tabbed command storage sections on the right hand side.
The mini bar contains commonly used tools including Selection, Move, Rotate, Scale, the Show
Manipulator Tool, and the Currently Active Tool. The hotkeys for the items in the minibar from left to right
are Q,W, E, R,T, Y.
Maya shelves are user defined. They can be created for several purposes but mainly are used to store
commonly used organizations of commands. MEL (Maya Embedded Language) commands can be drag
and dropped to the shelf to create a shelf button. To use the shelf icons you just need to click on one of the
icons. For example if you click on the sphere icon in the shelf it will create a sphere.
n Feedback Line: The Feedback Line communicates information back to the user.
Depending on the manipulator or tool you are currently using, different information will be displayed in the
Feedback Line. If you are rotating the camera for example, this rotation will be displayed in degrees on the
Feedback Line.
n Layer Bar: The Layer Bar contains layer creation and display buttons.
Layers in Maya are a powerful method of organizing the display and collection of objects in your scene.
4 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Maya UI Tour
For example, in preparation for compositing, you could put all your background objects on one layer. Your
hero object could exist on its own layer while the foreground objects could make up yet another layer.
Layers are mutually exclusive, an object can only exist in one layer at a time. RMB clicking on the layer in
the layer bar displays a menu allowing you to control the contents and display characteristics of its
contents. Clicking the button at the far left of the Layer Bar creates a new layer.
n
Time Slider: The Time Slider contains the display and control of time playback, pause, rewind and some
keyframing functions.
From the Time Slider you can set the current frame as well as advance or retreat from the next keyframe
on the selected object.
The LMB can be used to LMB drag and scrub the current time. Shift + LMB drag selects a region of
time (highlighted in red) which can then be moved around the time slider, in effect moving keyframes
around as a group.
Pressing RMB in the main region of the time slider displays a menu with a list of choices. For example you
can Cut and Paste a selected region of keyframes back into the Time Slider or onto a different object
entirely.
n Range Slider: The Range Slider contains more UI used for controlling animation parameters.
You can establish the range of animation frames in the scene and, by growing or shrinking the range slider,
you can focus on certain regions of frames.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 5
Maya UI Tour Questions? visit www.aliaswavefront.com/tasteofmaya
On the right-hand side of the range slider are buttons to select the current Character, and toggle Auto
Keyframing. The button on the far right-hand side displays the General Preferences Animation
Preferences.
n
Command Line: MEL stands for Maya Embedded Language and is Mayas built in scripting language. The
Command Line contains a single line with which you can view and write MEL commands.
The left-hand portion of the command line is a text field where you can enter MEL commands. The right-
hand portion is a text field that displays the last printed line of MEL feedback visible in the Script Editor.
The far right-hand side contains a button to raise the Script Editor window.
n Help Line: The Help Line is very useful for new users as this line displays information about tools and
procedures that the user is presented with as you work in Maya.
As you drag your mouse over areas of the interface, information is displayed in the Help Line describing
the item. When you are working with a command or tool the Help Line prompts you for the next expected
action or present tips on using the current tool.
Popup Help is also available in Maya. Toggle Popup Help from the Help pull down menu.
6 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Maya UI Tour
Channel Box
The last two items in the Options list are Channel Box and Attribute Editor.
Since the Channel Box and Attribute Editor are similar in the information presented you will usually want
one or the other displayed at one time. It is very handy to quickly change between these two windows. Also
having them as part of the main Maya window is important to avoid cluttering the interface with floating
windows.
n Channel Box: The Channel Box is the work horse UI of Maya. This is where you will view and enter
information into Maya. Maya is about nodes and the attributes on these nodes. The Channel Box is a simple
lightweight UI for accessing and editing these attributes.
The top section of the Channel Box contains basic information about the selected object. These are the
attributes that control where the object in the scene is.
Below this section are the nodes related to this object. The Shape nodes which carry information about an
object beyond just its position, rotation and scale. For example the makeNurbCube shape node contains
information about width, length to height ratio, and Patches in U and V directions. These attributes are
editable and keyframable.
Also listed in the Channel Box are the input and output nodes related to the selected object. By selecting
these objects you can address these related objects.
Some Attribute fields in the Channel Box contain preset pulldown choice menus where applicable. LMB
on an attribute field to see if it also contains a pulldown choice menu.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 7
Maya UI Tour Questions? visit www.aliaswavefront.com/tasteofmaya
Note: In the Channel Box and the Attribute Editor you can use your RMB when the cursor is over attributes and you will
have access to a drop down menu specific to that attribute. RMB can be used in other areas as well. For example if you
create a sphere and place the cursor over it and RMB a marking menu will show up specific to that object
Attribute Editor
n Attribute Editor: The Attribute Editor is a more detailed version of the Channel Box. Whereas the Channel
Box is an abbreviated list of keyable attributes, the Attribute Editor is a listing of all attributes on the selected
node or object.
The Attribute Editor includes things like sliders, pulldown menus and drag and drop connections
functionality.
8 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Maya UI Tour
Objects in Maya have a top level node called a Transform node. This is the basic node used to control an
objects position, rotation, and scale. These attributes are known as the Transform Attributes.
Objects in Maya have a secondary node known as a Shape node. The shape node contains information
about an objects surface history, render properties, and display quality.
Other nodes like texture and material nodes are best edited using the Attribute Editor in conjunction with
the Hypershade/Visor windows.
The tabs located at the top of the Attribute Editor let you choose which node to edit. The items displayed in
the body of the Attribute Editor are the attributes associated with that node.
n
Preferences: Mayas preferences are broken up into several areas. General, UI, and Customizing:
General Preferences
General Preferences: The General Preferences is where the majority of Mayas preference settings are be
modified. These settings control general usability and functionality of commands. In the General Tab, for
example, you can establish how big your Undo Queue is. TIP: For now set your Undo Queue to Infinite.
In the Units Tab, for example you can set your frame rate and scene scale units. In the above image in the
top right corner you will see to buttons with arrows pointing left and right. They are used to scroll through
the tabs.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 9
Maya UI Tour Questions? visit www.aliaswavefront.com/tasteofmaya
UI Preferences: The UI Preferences allow you to set many of the options for how the UI will behave by
default or on start up of Maya. For example in the Windows Tab, you should set the Open Attribute
Editor to: In Main Maya Window so that the Attribute Editor will not be floating when you press the
hotkey Ctrl - a.
Customize UI: The Customize UI menu contains separate editors for customizing your interaction with
Maya:
Hotkeys...: The Hotkeys Editor is where you establish how commands are executed by short-cut key
stroke combinations.
Colors...: The Colors Editor is where you set or change the way objects and interface components are
colored.
Marking Menus...: The Marking Menus Editor is where you establish or customize the actions
associated with Marking Menus. Marking Menus are a handy UI concept pioneered by Alias|Wavefront
that display specialized menus at the location of your cursor.
To activate a marking menu you press a key while LMB dragging in the viewport. This action activates a
system of menus that you can navigate. For example press the w key and then m. A marking meny will
appear under the mouse which will allow you to change the move tool and the .
An example of marking menus exists by pressing the space bar to activate the hotbox. From in the hotbox
you can LMB drag in different zones to initiate different related sets of marking menus.
Shelves...: The Shelves Editor is where you customize your shelves. From this editor you can create,
reorganize and edit the contents of your shelves.
Panels...: The Panels Editor is also the Layout Editor. This editor lets you establish and edit the
windows and configuration of windows (panels) that are displayed in Maya.
Working efficiently in Maya will demand that you become comfortable with building layouts made of
groups of panels. By building layouts for certain tasks like rendering, modeling and animating you can
avoid having floating windows that get in your way.
A common method of accessing layouts is by building shelf buttons that activate certain layouts. The
Panels Editor is where you can build layouts and make shelf buttons to activate these layouts.
10 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Maya UI Tour
Common Menus
The first seven menus from the left are common to all the menu sets: File | Edit | Modify | Create | Display |
Window | Options. When the menuset is change, these seven menus do not change.
n
File: The File menu contains scene management menus and tools. Scene saving and import/export commands
are found here as are the project management commands and menus.
n
Edit: The Edit menu contain the common commands that you perform on objects in the course of editing
them. Duplicating, Deleting, Selecting, Parenting and Grouping are some of the commands presented here.
n
Modify: The Modify menu is a potpourri of commands and menus used to work with objects in a special
manner. Enabling and Disabling nodes, centering an objects pivot point, or enabling the Artisan tools are
examples of some of the tools found here.
n
Create: The Create menu is where you go to create curves, primitive objects, cameras and locators and text
objects.
n
Display: The Display menu contains commands that have to do with the display of objects and their
components as well as Interface components like the grid and axes.
n
Window: The Window menu is how you access the windows and editors in Maya.
n Options: The Options window as mentioned above is where you customize your Maya environment and set
your preferences for how Maya will handle different circumstances.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 11
Maya UI Tour Questions? visit www.aliaswavefront.com/tasteofmaya
Hotbox
Hotbox
By pressing and holding down the space bar you invoke the Hotbox. The Hotbox is a centralized heads-up display
for all the menus in Maya. The Hotbox contains marking menus and zones of interaction that can greatly increase your
productivity.
The Hotbox can take a while to get used to but it can also unlock a great amount of screen space by removing the need
for the main menus.
Using the Hotbox:
Press and hold the spacebar to invoke the Hotbox.
The Hotbox is divided into quadrants. In the above image you can see a big X that radiates out from teh
A|W in the centre. This defines the quadrants. To access a quadrant while holding the spacebar just move
the cursor into the quadrant (but not over a menu) and press the LMB:
North: LMB select the layout views marking menu
South: LMB select the editor windows marking menu
East: LMB select the UI components marking menu
West: LMB select the object and component mask marking menu
The Hotbox Controls menu located in the West quadrant of the Hotbox contains menus for setting Hotbox
properties. From this menu you can select how many menu sets are included in the Hotbox.
The Center A|W Hotbox button contains a marking menu for selecting camera views and the Hotbox
style.
12 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Maya UI Tour
Outliner Window
Outliner
There are two main methods of looking at the contents of a Maya scene file: the Outliner and the Hypergraph. The
Outliner displays the contents of your scene file in a listed format. The contents of the Outliner are presented as
nested groups if the items under this group are part of a hierarchy.
Using the Outliner:
Create a few objects by clicking on the sphere and cone icons in the shelf bar or open a scene file from one
of the other tutorials (File Open Scene...)
Open the Outliner from Window Outliner
Select an object with LMB click.
Re-order an object by MMB click drag (Line between other objects).
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 13
Maya UI Tour Questions? visit www.aliaswavefront.com/tasteofmaya
Hypergraph
The Hypergraph presents the contents of your scene in a different manner. The Hypergraph has two modes of
operation for looking at the contents of your scene in two different ways.
14 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Maya UI Tour
The second mode is the Upstream and Downstream Connections mode. This mode lets you see how the flow of
information is moving from one node to another through connected attributes. This can be thought of as similar to a
production line where each information travels between nodes, each with a specific task it performs on the
information before passing it along to the next node in the stream.
Hypershade / Visor
The Hypershade and Visor windows are used to build and manage textures and materials for establishing the rendered
look of your scene. Although these are listed as separate UI elements they are most often used together and appear as
a single UI component.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 15
Maya UI Tour Questions? visit www.aliaswavefront.com/tasteofmaya
16 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Maya UI Tour
Graph Editor
Graph Editor
The Graph Editor is where you manage the keyframe animation that you have created. The Graph Editor presents
keyframe animation in terms of curves called animCurves.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 17
Maya UI Tour Questions? visit www.aliaswavefront.com/tasteofmaya
Render Globals
General rendering settings are made in the Render Globals window. From the Render Globals window you can adjust
settings for the rendered image size or resolution, Anti-aliasing quality, Raytracing quality, Motion blur, and IPR
options among many others.
18 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Maya UI Tour
Render Globals
Using the Render Globals:
Open the Render Globals from Window Render Globals...
Set image naming syntax and padding from the Image File Output section.
Set render size or resolution aspect from the Resolution section. Lock Device Aspect Ratio should be on
for digital video work that requires non-square pixels. You can choose from the list of common
standard formats or create a custom resolution and aspect ratio.
Anti -aliasing Quality settings control how smoothly curved surfaces are rendered as well as filtering
quality of textures. There are presets available for varying degrees of quality or you can create your own
custom settings. These settings will have a large impact on render times vs. quality.
Raytracing can be turned on and off from this section. If you are Raytracing you can also control what
degree of Raytracing is performed. Reflections, refractions, and shadows can have separate sampling rates.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 19
Maya UI Tour Questions? visit www.aliaswavefront.com/tasteofmaya
Field Options is where field rendering settings are made. Field dominance and scanline ordering can be set
from this section.
Motion Blur is essential for realistic motion as our eyes and the camera see movement. Maya has 2 types
of motion blur:
2D motion blur is done as a post process and, for many circumstances, will create very realistic motion
blur effects. This is a much faster method of rendering motion blur. With the 2D blur being used you
have options for setting the blur length and blur sharpness.
3D motion blur involves much more computation as object positions are calculated and used to
establish the effect of blurring an object that is moving in 3 dimensions. If you have objects that are
crossing in front of other moving objects or a complex movement of the camera you may want to use
this method of motion blur.
Render Options section is where many special post processes are enabled and executed. Environment
Fog is established from this section as well as Gamma Correction and other general settings.
IPR Options are set from this section. IPR is Mayas Interactive Photorealistic Renderer. With IPR you
can edit your lighting and material assignment and settings very quickly. This section controls which parts
of IPR rendering takes place. Post process effects are toggled on and off.
Paint Effects Rendering Options section enables you to render the paint effects strokes separately from
the other elements in the scene. Very useful for compositing.
Render View
Render View
The Render View window is where you test render your scene. The Render View window is also where you use IPR,
Mayas Interactive Photo-realistic Renderer.
Using the Render View Window:
Open the Render View window from Window Rendering Editors Render View...
20 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Maya UI Tour
Quickly establish a wire frame Snapshot of what you will be rendering by selecting Render Snapshot
Current (In the Render View menu).
To render a region LMB drag a box around the area you want to render then select Render Render
Region (In the Render View menu).
To render the full image as the perspective camera sees things select Render Render
Current(persp).
To keep an image for comparison in the Render View windows buffer select File Keep Image in
Render View (In the Render View menu) or press the Keep Image button.
To save the image to your hard drive select File Save Image... (In the Render View menu).
To view separate components of the image select Display Mask Plane or Red Plane for example.
To use IPR first you must create a deep raster image by selecting IPR IPR Render Current (persp)
(In the Render View menu). Once the IPR image has been created you are prompted to select a region to
update. LMB drag a box to select a region to IPR render. Now as you update your materials or light
positions for example the region will update in a scrolling manner from bottom to top. Depending on your
system configuration this update can happen very quickly and interactively.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 21
Maya UI Tour Questions? visit www.aliaswavefront.com/tasteofmaya
Camera Hotkeys: The cameras and views in Maya are positioned and oriented by depressing the alt key in
conjunction with the LMB (Left Mouse Button) and MMB (Middle Mouse Button).
Orbit: alt + LMB
Zoom: alt + LMB + RMB
Pan: alt + MMB
Frame selected: press f
Frame all: press a
Display Hotkeys: The viewport has hotkeys that control display properties such as shaded and wireframe
modes:
Press 1, 2, or 3 keys for lowest to highest resolution display smoothness on selected NURBS objects.
Press 4 key for wireframe display
Press 5 for shaded display no textures
Press 6 for shaded display with textures
Press 7 for shaded display with textures and lights
Viewport menus: The camera viewport has its own set of menus that further control viewport display
properties and camera attributes.
View: Camera settings and bookmarking of camera views.
Shading: Various shading and display settings
Lighting: Lighting display settings
Show: Filtering for object type display
Panels: Shortcut to Panel and Layout settings as well as camera selection and creation.
n
Create a primitive object to view and move.
Create NURBS Primitive Torus
Press 1, 2, 3, 4, and 5 keys to see varying degrees of surfaces smoothness and shaded mode display.
22 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Maya UI Tour
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 23
Maya UI Tour Questions? visit www.aliaswavefront.com/tasteofmaya
Select the handles presented by the Show Manipulator Tool with your LMB. Drag these manips to get
a feel for what each one does.
As you move the manipulators notice the values change in the Channel Box. These values can be
keyframed and animated. (RMB in the attribute field and select key selected)
24 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Maya UI Tour
Note: To see these prompts make sure the Help Line is displayed.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 25
Maya UI Tour Questions? visit www.aliaswavefront.com/tasteofmaya
n Follow these directions and remove some of the CVs from the Lattices membership.
Note that the shape of deformation changes as these CVs are not participating in the deformation.
n Press q to quit the Edit Membership Tool
This is how a Tool based command in Maya will typically work. You enter a mode and you follow the directions
in the Help Line. In multiple choice tools you may be prompted to press the Enter key to validate a certain step
before moving to the next step of the tool.
CONCLUSION
This has been a brief exposure to the Maya user interface. The Maya on-line documentation is another place that you
should investigate for answers to user interface questions and coverage of the other windows, editors and UI
components omitted from this tutorial.
There are many options in Maya. These options are what make Maya a powerful and flexible application. As you get
comfortable with one area of Maya you will also find yourself getting comfortable with other areas of Maya due to the
continuity of usage and usability that is carried throughout the application.
Use the Help Line. By always displaying the Help Line and Pop Up Help you will have a prompt that explains what a
button is and how to proceed in a tool based command.
26 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed to the terms
and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Growing Grass Logo
Paint Effects is Mayas flexible system for interactively painting brush strokes and
particle effects on a 2D canvas or on 3D geometry. Preset brushes such as plants, hair,
fire, feathers, and others can be used to get amazing effects quickly.
This tutorial explains how to create a Maya logo out of growing grass. The focus is on
setting and animating the Paint Effects brush and strokes.
The following topics are discussed:
Brushes vs. Strokes
Assigning brushes to a stroke
Changing brush parameters
Loading brush settings into the template brush
A Taste of Maya
Making multiple strokes share a single brush
Animating the growth of the grass along the strokes
Using the same strokes with other brushes
Growing Grass Logo Questions? visit www.aliaswavefront.com/tasteofmaya
Note: Before you start: This tutorial requires Maya scene files. If you havent installed the tutorial files go to the
Try Maya section of the Taste of Maya CDROM to install.
Starting Maya: You can start Maya by double-clicking the Maya 2.5 Evaluation icon on the desktop or from
Start Programs Maya 2.5 Evaluation Maya.
In Maya: Once the tutorial files have been installed you will need to set the current project in order to access
the Maya scene files. To set the current project from within Maya select File Project Set... and
Navigate to the directory where you installed the Maya scene files. Select the directory: Maya_tutorial_data
and press OK.
Growing Grass
To create the animated grass, you will apply paint effects strokes to NURBS curves. Then, a preset brush
will be applied to all of the strokes and keyframes will be set to make the grass grow along the strokes.
Stroke: A curve attached to an underlying NURBS curve (or curves). The underlying NURBS curve
defines the shape and direction of the strokes painting path.
Brush: The attribute settings that define the appearance and behavior of a stroke.
Once you have the animation on the strokes, you can change the brush to anything you want (for
example, a neon, hair, or liquid style brush).
2 Load the settings of the supplied brush into the template brush
Since you are going to apply the same brush used on the M to the rest of the letters, you need to store
the settings of the animated grass brush used on the M for easy access.
Select stroke1 in the Outliner
Press F5 to enable the rendering menu set
Paint Effects Get Settings from Selected Stroke
This is like a copy/paste operation. Maya copies all the attributes from the stroke (including the
brush properties that belong to that stroke) and stores them in a template brush.
2 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Growing Grass Logo
5 Look at the Outliner and Attribute Editor to see what was built
Look in the Outliner to see the newly created strokes
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed A Taste of Maya 3
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Growing Grass Logo Questions? visit www.aliaswavefront.com/tasteofmaya
Outliner showing one paint effects stroke for each NURBS curve in the logo
Look in the Attribute Editor (Windows Attribute Editor) to see how the strokes and brushes are
related (look at the tabs at the top of the Attribute Editor)
The scene file mayagrass_withstrokes.ma has been set up to include the strokes and applied brushes
for you up to this point.
4 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Growing Grass Logo
Animate stroke lengths
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed A Taste of Maya 5
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Growing Grass Logo Questions? visit www.aliaswavefront.com/tasteofmaya
Animate stroke lengths
6 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Growing Grass Logo
Animate stroke lengths
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed A Taste of Maya 7
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Growing Grass Logo Questions? visit www.aliaswavefront.com/tasteofmaya
Animate stroke lengths
Y stem stroke
Max Clip: 0 at frame 1
Max Clip: 1 at frame 75
Y branch strokes
Max Clip: 0 at frame 74
Max Clip: 1 at frame 100
Pointed A stroke
Max Clip: 0 at frame 1
Max Clip: 1 at frame 100
5 Render a frame
Advance to frame 150
Window Rendering Editors Render View
Render Render Persp
8 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Growing Grass Logo
Animate stroke lengths
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed A Taste of Maya 9
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Growing Grass Logo Questions? visit www.aliaswavefront.com/tasteofmaya
Animate stroke lengths
Note: This copies the settings from the brush you selected into the brush that is applied to the strokes. However,
the name of the brush will still be called grassBlow1 unless you rename it in the Attribute Editor
Fire Brush in Paint Effects window with Stroke Refresh set to Render
Experiment with other attribute settings or other brush presets to get the look you want.
The scene mayaLogo_Fire.ma contains a finished version of the fire logo.
Tip: If the refresh is too slow, you can set stroke refresh to wireframe, or select all the strokes and lower the
displayPercent attribute in the Channel Box.
10 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya Growing Grass Logo
CONCLUSION
You have now worked through a typical Paint Effects session in Maya and have seen the interactiveness
and flexibility of this part of Maya. To recap, the following were the key topics in this tutorial:
Animating the growth of the grass along the strokes using Max Clip.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed A Taste of Maya 11
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
3D Tutorials : Maya
Maya Tutorials
3D Studio Max
Animation Master
Cinema 4D
General 3D
Lightwave
Maya
Poser
Rhino
Shockwave 3D
softimage
truespace
Classified Ads
3D Help Wanted
Chat
3D FAQ
3D Industry
3D Schools
3D Studios
3D Stores
Mail & Forums
Mags and EZines
News Groups
http://www.3dlinks.com/tutorials/maya/maya_tutorials.cfm?tutorial=head2 (1 of 10) [5/30/2002 8:05:34 PM]
3D Tutorials : Maya
Other Sites Step 1. Open Maya. Bring your Front and Side Image Planes by going to View-Camera Attribute
Reviews Editor... Scroll to Enviroment option and click Create. It will bring up the Image Plane Attributes option.
Render Farms Navigate your image. Do the same with Side view.
Spectrum
Wave Report
Modelers Commercial
Modelers Shareware
Web 3D
CAD 3D
Terrain Generation
Converters
Compositing
Image Processing
Multi-Media
Misc Tools
Lip Synch
3D Studio Max
Cinema 4D
Poser
Shockwave 3D
Strata
truespace
ZBrush
Commercial
Free
3D Animation
3D Programming
3D Studio MAX/Viz
After Effects
Bryce 3D
Carrara
CAD
Cinema4D
Director
Electric Image
Form-Z
General
Infini-d
Lighting Step 4. Select first and second Curves and go to Surfaces - Loft. Surface should appear. Press 3 and
then 5. Continue lofting Curves using key G on you keyboard (in Maya G repeats previous operation).
Lightwave
Mac
Maya
PhotoShop
Poser
Ray Dream
Renderman
Rhino
softimage
truespace
Web 3D
DirectX
Engines & ToolKits
OpenGL
Visual Basic
Java
Delphi
3D Scanners
Chips
Digital Video
General
Immersion
Motion Capture
Video Boards
Systems
Sensing
3DLinks Gallery
Gallery Links
Animation Gallery
Step 6. At this point, cut your head in half and make a mirror copy if you need to see a whole head.
3D Studio MAX Now select your model and go to Edit NURBS - Sculpt Surface Tool - . Sculpt your lips, eye area
Animation Master and nose. Pull and push CV's where it's needed.
AutoCAD
Bryce
Carrara
Cinema4D
Combustion
Lightwave
Maya
Misc 3D Tutorials
Poser
Povray
Ray Dream
Rhino
softimage
Strata
truespace
Contact Us
Advertise
Privacy Statement
Suggest A Link
Link to Us
Site Search
Wave Report
Spectrum
Step7. After you have something like the image below, you will need to build the eye area and ears.
Note that they are built separatly.
Step 8. We are done with NURBS. Now we need to convert NURBS to Polygons. Go to Modify -
Convert - NURBS to Polygons - . In the options menu, select Control Points. Do the same with the
eye area and ear.
Step 9. You will need to cut holes where your eyes and ears should be. After you have finished with
the holes, select all of the parts of your head and go to Polygons - Combine. Now you can connect
your parts by using Edit Polygons - Merge Multiple Edges or Edit Polygons - Merge Vertices. Don't
worry if your head looks funny. We will make it right.
Step 10. After you have connected all of your edges, mirror the half of the head and connect it. Then
Step 11. Now select your head, right mouse click and go to Display Level - 0. Right mouse click again
and select Face. Select all the faces and go to Subdiv Surfaces - Automatic Mapping. This way you
apply UV's to your model. After that, you can take your 3d Paint Tool and apply some guides to the
eyes, lips, etc.
Step 12. Build lashes and apply your texture to your model. This is how my model looked before I
rendered it and the next image is a texture, if it helps...
Note: Before you start: This tutorial requires Maya scene files. If you havent installed the tutorial files go to the Try
Maya section of the Taste of Maya CDROM to install.
Starting Maya: You can start Maya by double-clicking the Maya 2.5 Evaluation icon on the desktop or from Start
Programs Maya 2.5 Evaluation Maya.
In Maya: Once the tutorial files have been installed you will need to set the current project in order to access the
Maya scene files. To set the current project from within Maya select File Project Set... and Navigate to the
directory where you installed the Maya scene files. Select the directory: Maya_tutorial_data and press OK.
Rendering In Maya
Mayas rendering system is the culmination of research and development stemming from a rich history of
worldwide efforts. Creating visually pleasing imagery or photo realistic representation of 3D worlds is the
ultimate goal of the rendering process.
In Maya you have many options for creating this imagery. You have complete control over how detailed and
exacting the renderer will behave. If you want perfectly anti-aliased imagery and highly filtered textures you
have the power to do so. If you want a lighting environment that includes atmospheric elements and lighting
interplay with a virtually lensed camera, you can achieve this too.
Typically, tasks that involve creating finished or specific rendering requires an interactive process. That is, you
tweak, you test render, you tweak, you test render. Getting fast feedback to you as you tweak is the point of the
IPR side of the Maya renderer. Using IPR boosts productivity, speeding up this process of tweaking, to the point
where you will find yourself using it exclusively for many tasks.
2 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya IPR
Rendering Layout with Hypershade/Visor, Render View, Perspective Camera also note Attribute Editor inside the Main
Interface.
This layout can be accessed by a shelf button or hotkey. Once you have your base layouts in place with shelf
buttons you can quickly jump from one configuration to another without floating windows and without having
to constantly open the same windows from the pull down menus.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 3
IPR Questions? visit www.aliaswavefront.com/tasteofmaya
Note: If the Render View is scaled to a size other than the actual Render Globals resolution, the image may appear to be
aliased or jagged.
To render a region, LMB drag a box in the Render View window and select: Render Render Region
Render in this fashion when you are testing the look of raytraced rendered effects and other rendering
elements that are not viewable in IPR.
The Render View window is also where IPR is accessed.
IPR
Using IPR is similar to rendering in the Render View window with the addition of an extra step, creating the IPR
render file.
When you IPR Render, you create an image that contains more information then just the pixel color and matte
information. This is called a Deep Raster image. Deep Raster technology is the process of keeping track of the
information that went into creating the pixel color, including lighting, shadows and material definitions. When
you adjust a related node such as a light or material only the changed value is recomputed as opposed to the
entire chain or graph which is normally evaluated during a regular render. This greatly speeds up the rendering
process for editing. This enables the Interactive portion of the Interactive Photo-realistic Rendering system.
4 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya IPR
For most tasks that involve repeated tweaking and rendering, the IPR system steps in and speeds up the process.
There are some options that have not made it into IPR .... yet.
Raytraced shadows, refraction and reflections are not displayed in IPR.
Volumetric particle rendering attributes are not updated in IPR but surface shading can be tuned on a
stand in geometric object.
Displacement mapping, depth of field as well as 3D motion blur are not displayed in the IPR deep
raster based image.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 5
IPR Questions? visit www.aliaswavefront.com/tasteofmaya
Tip: You can stop a test render in the Render View window at any time by pressing the Escape key.
Learn to work quickly and load only the object layers that you are editing. Be conscious of the IPR tuning
options you have selected. If you are not working on shadows or glows, make sure these options are not
selected. You can control these options globally from the IPR section of the Render Globals window. Or from
the Render Views IPR pulldown menu.
Also work at the lowest resolution that gives you adequate feedback.
Pipes in Tunnel
Layers:
The elements used to compose pipeSystem.ma have been organized into layers. These layers can be made
visible by accessing the layer bar, Options Layer Bar. To toggle the visibility of each layer press the RMB
(Right Mouse Button) on the layer button, and select Visible.
Layers in pipeSystem.ma
Tunnel Layer: This layer is the base geometry for the tunnel system. It was constructed from NURBS
cylinders that were trimmed and trimmed again with a cube to make the lower shaft and a lofted
surface to make the overhead shaft.
6 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya IPR
Pipes Layer: This layer is the pipes that run through the tunnel.
Walkway Layer: This layer is composed of instanced geometry, objects that have been duplicated with
instancing option. With instanced geometry you can create a base object that when duplicated will act a
reference. Any edits made to this base object are mirrored in the instanced copies. The walkway has
been made very light, that is with as few objects as possible.
Light Layer: This scene is mostly composed using lights. Lights can give the objects volume and a sense
of weight. This layer contains the lights in the scene. There are point, directional and spot lights used to
create various lighting conditions.
IPR Example
The scene file you have been provided with is a typical setup. Your goal is to maneuver your camera around the
scene and frame up interesting angles and then render them. The objects have been textured and the lights have
been roughly setup. Feel free to experiment with the shaders and the lighting to create your own images.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 7
IPR Questions? visit www.aliaswavefront.com/tasteofmaya
8 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya IPR
Note: If your system does not allow you to tumble the scene quickly you should either restrict your viewing to wireframe
or hide some of the layers. When all layers are displayed in the shaded modes most systems without adequate
graphics memory will not tumble freely.
Render Quality
The pipeSystem.mb scene file has been set to render at a Preview Quality. When you test render this scene you
will see various artifacts such as edge aliasing and low resolution light fog shadows.
The scene file pipeSystemFinish.mb has had various Render Global settings and light attributes adjusted to
create a hi-resolution image that is representable of Production Quality. This file will take longer to test render
due to the higher texture sampling and edge anti-aliasing settings.
Display Accuracy
Display your rendered image at a 1 to 1 display resolution by pressing the 1:1 button in the Render View
window. If you are viewing a rendered image at a scale other than 1 to 1 you will see display artifacts from this
scaling. This can make an otherwise good looking image look aliased and chunky. This can be misleading.
Expanding the Render View window:
Make the Render View window active by LMB clicking in the window then press the SpaceBar to
expand this window to full view.
Press the 1:1 button to scale the image to actual rendered resolution.
Layout with Render View, Persp, Hypershade/Visor and Attribute Editor windows forming a Layout.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 9
IPR Questions? visit www.aliaswavefront.com/tasteofmaya
Note: If you want to delete a shelf item you can MMB drag it to the trash can icon on the right-hand side of the shelf bar.
Select the Edit Layouts tab in the Panels window
Select 3 Pane Left Split from the Configuration pulldown menu.
10 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya IPR
Render Optimization
Render Globals and Anti-Aliasing
Before you begin tuning with IPR you may want to review your Render Globals settings. Of most importance is
the level of Anti-Aliasing that is set in the Render Globals Anti-Aliasing section.
Window Render Globals...
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 11
IPR Questions? visit www.aliaswavefront.com/tasteofmaya
12 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya IPR
Render Resolution
When you are rendering in Render View or IPR you will want to work at the smallest resolution that will still
enable you to see what you are working on. In this scene file the resolution is set to 720x486 or Digital Video
CCIR601. But you can test render at other resolutions.
In the Render View window select Options Test Resolutions 50% Globals
This will select a test rendering resolution for Render View and IPR that is 1/2 the pixel resolution set in the
Render Globals Resolution setting. This is very adequate for working with most items in the pipeSystem.mb
scene.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 13
IPR Questions? visit www.aliaswavefront.com/tasteofmaya
Adjust the northSpot Intensity and the Dropoff to see how this affects the light fog.
14 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya IPR
In the Attribute Editor begin adjusting the attributes of the metalBumpPipe shader.
Adjust the Diffuse attribute
Note the effect the Eccentricity attribute has on the highlight. Work both the Specular Rolloff and
the Eccentricity together.
The Specular Color attribute is being controlled by a 3D texture.
In the HyperShade work area LMB select the bump3d node.
Adjust the Bump Depth attribute to make the bumps more defined or more subtle.
The metalBumpPipe also has a 3D Brownian procedural texture attached to it. This texture is connected to the
Bump Mapping attribute as well as the Specular Color attribute. This is a simple trick to get the Specular
highlight to follow the bump. By adjusting the metalPipeBrownian texture you are adjusting both bump and
specular properties at once.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 15
IPR Questions? visit www.aliaswavefront.com/tasteofmaya
Select the yellowWarningLight material for editing.
In the Hypershade/Visor window open the Materials directory by LMB clicking on the folder icon
under the Rendering section (not the Create section).
LMB select the yellowWarningLight material.
MMB drag the yellowWarningLight material from the Visor to the Hypershade work area.
Adjust the attributes on this Blinn material and note the updates in IPR.
Notice the interaction between the Specular Color and Glow intensity.
Note the role that the incandescence plays in the glow.
Try negative and positive values for the Eccentricity.
Adjust the Glow Intensity under the Special Effects section of the material.
Change the Color of the material.
These attributes are all inter-related and require tweaking to find the right combination. IPR makes this
possible. Imagine trying to juggle these attribute settings without interactive feedback.
16 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya IPR
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 17
IPR Questions? visit www.aliaswavefront.com/tasteofmaya
18 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya IPR
CONCLUSION
The fastest part of a renderer is how fast a user can make a decision about their scene. Regardless of the
horsepower available to do the final render waiting to see the results of a complex and interdependent shader or
lighting setup can be painful. By seeing the adjustment in real-time or close to real-time you will be making fewer
test renders especially, at the critical period when you are just getting started. This greatly increases your job turn
around and quality tests up-front.
Test rendering in Maya can be done by two methods:
1. Render into Render View your selected camera then test regions after each tweak. If you are testing Ray
Traced renderings you will use this method to see how reflections, raytraced shadows and refractions are
coming out. Use this method to test 3D motion blur.
2. Render an IPR deep raster file and get fast interactive update on each tweak. Use this method when you are
tweaking shaders, lights, depth map shadows, shader glow, lighting glows and optical fx like lens flare as well
as 2D motion blur.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 19
IPR Questions? visit www.aliaswavefront.com/tasteofmaya
Both of these methods have their strengths and weaknesses. But together they provide very accurate and fast
feedback on the final look of your scene.
20 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
The Jellyfish
This tutorial goes through the steps to model, texture, animate and add Paint Effects
tentacles.
The following topics are discussed:
Creating surfaces
Transforming objects and components
Basic texturing
Nonlinear deformers and keyframe animation
The Graph Editor for modifying animation curves
Adding tentacles with Paint Effectsto a jellyfish.
A Taste of Maya
Jellyfish
The Jellyfish Questions? visit www.aliaswavefront.com/tasteofmaya
Note: This final image was created by compositing the single jellyfish a number of times to populate the scene.
Note: Before you start: This tutorial requires Maya scene files. If you havent installed the tutorial files go to the
Try Maya section of the Taste of Maya CDROM to install.
Starting Maya: You can start Maya by double-clicking the Maya 2.5 Evaluation icon on the desktop or from
Start Programs Maya 2.5 Evaluation Maya.
In Maya: Once the tutorial files have been installed you will need to set the current project in order to access
the Maya scene files. To set the current project from within Maya select File Project Set... and
Navigate to the directory where you installed the Maya scene files. Select the directory: Maya_tutorial_data
and press OK.
2 In the front window, use Create CV curve tool to draw a NURBS curve as shown
Press F3 to access the Model menu sets.
To draw a curve start clicking with the left mouse button to place CVs.
A CV is a control vertice and is used to control the shape of the curve. You will need to place a
minimum of four CVs before you will see the curve. You can use the x key to snap the CVs to
the grid. You can also use the y key to undo any mistakes.
End of curve
2 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya
Note: The first two CVs and the last two CVs of the curve should lie directly on the Y axis. If they do not, the
jellyfish will have a hole in the top and bottom when you revolve in the following step. If you snap the first
and last two CVs to the grid like in the picture the CVs will lie directly on the Y axis.
3 Select the curve and create a surface using the revolve tool
Press q to change into select mode or click on the Select Tool icon
Select Surfaces Revolve
5 Move and Scale the torus to fit inside the Jellyfish body
The hotkeys for Move and Scale are w and e respectively.
If you press w you will see a manipulator at the centre of the torus that has arrows pointing along
the x, y and z axis. Use these manipulators to move the torus. If you press the e key the
manipulator changes from arrows to boxes. These boxes control the scale of the torus. If you click
on an arrow or box then the move or scale will be constrained to that axis. Notice that if you click
directly on an arrow or box that it turns yellow. If you click on the box at the center of the
manipulator then you can move or scale the object in all axis at once.
In the Channel Box, increase the sections to 16
In the Channel Box click on the name makeNurbTorus1 under INPUTS. You will see more
attributes that are available. Click on the number beside Sections and enter 16.
You may also lower the Height Ratio to get a better fit
Click on the number beside Height Ratio and change the value to adjust the thickness of the torus
6 In the top view press F8 to change to component mode and select the CVs as shown
F8 toggles between object and component mode. If you watch the Status Line when you press F8
you will see it change from object to component mode. Component mode is similar to an edit
mode which allows you to tweak the shape of your object at a CV (or other component) level.
Hold the shift key down and select the same CVs as in the image below by clicking and holding
the LMB and dragging it over the CVs.
If you accidentally select some of the wrong CVs keep holding the shift key down and click drag
over them again. This will deselect them.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 3
The Jellyfish Questions? visit www.aliaswavefront.com/tasteofmaya
Note: You may need to increase the Scale of the torus to fit the jellyfish body.
4 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya
Note: To see the jellyfish in shaded mode press 5. To increase the smoothing, with the model selected, press 3. To
see the model in X-Ray mode use Shading Shade Options X-Ray.
9 Press F8 to return to object mode and select the body and the torus and Edit Group
Tip: The curve you revolved may be deleted by selecting it and pressing the Delete key.
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 5
The Jellyfish Questions? visit www.aliaswavefront.com/tasteofmaya
Note: The Blinn material can be located under Create Materials in the visor.
Double click on the new Blinn material to open the Attribute Editor.
In the attribute editor Click on the Color swatch to the right of the word color to open the Color
Chooser.
Change the color to blue and click Accept to close the Color Chooser
Increase the Transparency slider to about the mid range point
Note: Drag selecting across the jellyfish body will not select the jellyfish node at the top of the hierarchy. With the
body selected, press the Up Arrow key. This will walk up one node in the hierarchy. You can confirm this
by checking that the Channel Box now displays the jellyfish node.
6 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya
Note: If you do not see the nodes in the Hypergraph window, press a to frame all of the nodes in the window.
Note: You may need to set the range slider minimum value to 0 so that frame 0 is included in the time range.
Drag the timeslider to 10 and RMB Key Selected (with Translate Y selected in the Channel
Box)
Drag the timeslider to 30, Move the jellyfish up about 10 units and RMB Key Selected
Drag the timeslider to 40 and RMB Key Selected
The jellyfish Y Translate curve cycling with offset in the Graph Editor
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 7
The Jellyfish Questions? visit www.aliaswavefront.com/tasteofmaya
8 In Window Animation Editors Graph Editor, select the Factor and Curves Post Infinity
Cycle
6 Reset the template brush with Paint Effects Reset Template Brush
7 Paint Effects Template Brush Settings... and set the following Brush options:
Global Scale: 5
Tubes
Tubes: On
Creation (sub menu of Tubes)
Tubes Per Step: 1
Length Min: 1.5
Length Max: 2
Tube Width 1: 0.02
Tube Width 2: 0.01
Segments: 100
Elevation Min: 1
Elevation Max: 1
Behaviour Forces Gravity: 0.1
Momentum: 0
Length Flex: 0.45
8 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 9
The Jellyfish Questions? visit www.aliaswavefront.com/tasteofmaya
10 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Questions? visit www.aliaswavefront.com/tasteofmaya
9 Test the look of the jellyfish by pressing the Redraw Paint Effects View button that displays two
red arrows flowing in a circle.
CONCLUSION
You have now explored some simple modeling, textureing and animation using Maya. To recap, this
tutorial covered the following areas:
The following topics were discussed:
Creating surfaces
Basic texturing
Nonlinear deformers
Keyframe animation
January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
A Taste of Maya 11
The Jellyfish Questions? visit www.aliaswavefront.com/tasteofmaya
12 A Taste of Maya January 2000, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved. By using this tutorial, you have agreed
to the terms and conditions which can be found in the setup.exe file in the Install Tutorials folder of the Taste of Maya CD-ROM.
Maya Tutorials - Wrap Skinning for Bone/Muscle Driven Skin Deformation
In this tutorial you will learn how to use the alpha channel of your projected image to "stencil" your image over/under other images on your geometry with the use
of a layered shader.
first off build your self a nurbs sphere, make it look some thing like this:
Open up your MultiLister and create a BlinnSG (Make sure Shading group is ticked).
push the "interactive Placement" button Use "cylindrical" as the projection type turn off "wrap" in the Effects dropdown Use the supplied "Flames.iff" file turn the
default color to black Turn off "wrap U" and "wrap V" in the place2dTexture node. After you have got your "placeFlames3D" box in the right position, change the
texture Quality to High.
If you now look at your Shading group in the hypergraph you should have this.
(I recormend renaming your nodes so that it's easier to understand later on)
If you now go to your layered texture node and make another layer, you can't see it!!!
Next we have to tell maya to use the alpha channel of our picture to "over" the flames on to the layer below.
We want our "placeFlames3D" to put the alpha in the same place as the original flames, SO this is what we do!
In the HyperGraph select the "placeFlames3D" and middle-mouse drag it onto your "proj_Flames_A" node, this will bring up the connections editor. first select
World Inverse Matrix[0] then Placement Matrix .
This tells the "placeFlames3D" to put the alpha in the same place as the flame picture.
Select the "Proj_Flames" node and middle-mouse drag it onto the "proj_Flames_A" node this again will bring up the Connections Editor.
(this means that when you change the projection type in your "Proj_Flames" node it also changes it in your "Proj_Flames_A" node)
Select the "flames" node and middle-mouse drag it onto the "Proj_Flames_A" node. This again will bring up the Connections Editor.
(This takes the Alpha channel of the flame picture and places it in the red channel of our new alpha proj node).
Next select the "Proj_Flames_A" node and SHIFT middle-mouse drag it on to the "layeredTexture" node.
(This tells the layeredtexture node to use the red channel from the alpha node as an alpha channel for layer "0")
The-Real-Mrhell
About Us Partners & Sponsors Terms & Conditions Advisory Board Contact Us Advertise
Produced by Will McCullough. Copyright 1997-2001 HIGHEND Network All rights reserved. All other marks are property of their respective owners.
Graph Layout Toolkit Copyright 1992-1996 Tom Sawyer Software, Berkeley, California, All Rights
Reserved.
All other product names mentioned are trademarks or registered trademarks of their respective holders.
This document contains proprietary and condential information of Alias|Wavefront, a division of Silicon
Graphics Limited, and is protected by Federal copyright law. The contents of this document may not be
disclosed to third parties, translated, copied, or duplicated in any form, in whole or in part, without the
express written permission of Alias|Wavefront, a division of Silicon Graphics Limited.
The information contained in this document is subject to change without notice. Neither Alias|Wavefront, a
division of Silicon Graphics Limited, nor its employees shall be responsible for incidental or consequential
damages resulting from the use of this material or liable for technical or editorial omissions made herein.
Learning Maya 1
Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Index .............................................................47
2 Learning Maya
Introduction
Learning Maya Artisan
Maya Artisan is an add-on module to Maya 1.0 that uses an
intuitive paint and sculpt interface to let you work more
interactively with Maya.
The Artisan brush-based interface offers a more artistic
approach to certain modeling and animation tasks in Maya.
Workflows such as pushing and pulling CVs or setting
weights on a cluster are enhanced by Artisans ability to use
brush strokes. In this way, you can add realistic details to a
surface or soften the effect of a cluster deformer.
As you work through this book, you will quickly see how
Artisan speeds up these kinds of workflows while giving
Introduction
The Maya Artisan tools to show you where different weights have
been applied.
Maya Artisan includes four tools that each
add different levels of functionality to Maya.
All of these tools will be explored in the
Weight = 1.0
Learning Maya Artisan lessons.
Weight = 0.4
Introduction
The tools in Artisan have different options
that are found in the Tool Settings window.
Some of these settings are visually displayed
as part of the cursor icon that appears as you
paint on the surface. The icon shown below
uses icons to indicate the brush radius and
the maximum displacement. The icon also
Opacity = 1.0 Opacity = 0.5
clearly labels the tool operation as either push
or pull. Opacity settings
Brush stamp radius icon Tip: As you work through the lessons, you
will learn that it is best to use low
maximum displacement and opacity
settings so that you can build up your
brush strokes gradually.
Pull Push
Brush radius
Maximum displacement
Brush shape
You can also set the brush shape in Artisan.
This lets you determine how the brush paints
on the surface. Artisan includes eight brush
shapes for your to choose from.
Smooth
Introduction
The reference surface Installing tutorial files
As you sculpt with Artisan, each stroke is For some of the Learning Maya Artisan lessons,
placed in relation to the reference surface. As you will require scene files that contain
you push and pull the surface, you cannot surfaces for sculpting.
displace the reference surface beyond the
These files can be found in a directory named
maximum displacement value. You can
learningArtisan. You can access this directory
update the reference surface from time to
from the Discover Maya CD-ROM.
time if you want to build up brush strokes.
The reference surface can be set to How to copy the learningMaya directory
automatically update after each brush stroke.
Mount the Discover Maya CD-ROM
This means that you can build up your brush Follow the instructions on the CD
strokes beyond the set maximum for copying the learningArtisan
displacement. directory into your Maya projects
directory.
Strokes can Strokes can
only pull to build up with
Max displacement updated surface Conclusion
Now that you are familiar with the basic
Artisan tools and concepts, you can start
working with a real project.
Lesson One
lesson allows you to explore how you can use Artisan to work
creatively as you sculpt, smooth and erase. You will be surprised
how quickly you can sculpt several different facial poses.
Once you have sculpted the facial poses, you will use Maya
tools, such as blend shape and clusters, to animate the mask.
Then you will use Artisan to paint cluster weights.
In this lesson you will learn the following:
How to sculpt surfaces by painting with Artisan
How to use different brush operations
How to set different brush options
How to select CVs by painting
How to animate the facial poses using blend shape
How to paint graduated weight values on a cluster
Lesson 1
Setting up Artisan
Setting up Artisan
Go to the File menu and select
Project Set...
Maya Artisan is an add-on module to the base
Maya package. When you first load Maya, A window opens to show you a list
you must set it to recognize the Artisan of the current projects.
functionality.
Click on the learningArtisan
directory.
1 Launch Maya
Click on Set Project.
Double-click on the Maya icon.
Or Now you are working with this
project directory structure as you
Enter maya in a shell window. open and save your files.
2 Activate Maya Artisan 2 Open an existing scene
Select Options General
Select File Open Scene.
Preferences.
Click on the mask.mb file.
Click on the hidden tabs at the far
right and choose Packages from the
Click on Open.
list. A single surface appears. This is the
Under Load on Startup, set Maya starting point of a mask model that
Artisan to On. you will now develop in Artisan.
Click Save.
3 Relaunch Maya
Quit Maya and relaunch to make use of the
new settings.
Select File Quit.
Relaunch Maya.
Getting started
You will now use the learningArtisan project. Mask surface
See the introduction to find out how to copy
this directory into your maya/projects 3 Increase the surface smoothness
directory. Select the surface.
Lesson One
Alt + LMB to tumble;
Alt + MMB to track;
Alt + LMB & MMB to dolly.
You will be changing views
frequently while using Artisan as
you begin working around the
object in three dimensions. Tool Settings window
Set up a view where the mask
Click on the Reset Tool button to
surface is at the left side of the view make sure that you are starting with
panel to make room for the Tool Artisans default settings.
Settings window. Place the new window to the right
of the mask model.
Start sculpting the surface You will work with this window
You will now sculpt the surface of the mask open, until you are familiar with
by painting on it using the Artisan Sculpt how to use hotkeys.
Surfaces tool. At first, you will just test the
tools to get a feel for them. Later, you will 2 Paint on the surface
erase these brush strokes so that you can Move your cursor over the mask
Click-drag on the surface. You are Now it is easier to see the results of
now painting on the surface to your sculpting.
sculpt it.
You can either click-drag using a
mouse, or preferably, draw directly
with a stylus.
Click on the swatch next to Color
and set it to any color you like. This
lesson uses an orange color.
Under Specular Shading, click on
the color swatch next to Specular
Color and in the Color Chooser, set:
Value to 0.8.
Lesson One
Pulling the surface with several brush strokes
Paint along the surface to begin surface untouched until you decide to update
erasing the existing sculpt edits. it manually.
Dont erase all the edits.
1 Change the brush operation and radius
Under Operation, click on Pull.
Under Stamp Profile, change the
Radius(U) to 0.5.
Overlap
Tumble the view to see the strokes
from the side.
This time, the strokes do not
overlap.
The reference surface does not
update, therefore the strokes can
only displace to the Maximum
Lesson One
Displacement value as defined in the
Tool Settings window. You cannot
displace beyond that value until
you update the reference surface. Painting on updated reference layer
option.
Click on the Flood button.
This means that the harder you This is an alternative method for
press, the larger the radius of the changing the tool operation without
brush stroke. You can now set the using the Tool Settings window.
upper radius (Radius (U)) and lower
Paint from the top of the nose to the
radius (Radius (L)) sizes that will be tip. Use several strokes to build up
used by the stylus. the bridge of the nose and the
As you work through this lesson, nostril areas. You may need to
explore the various stylus settings tumble your view to complete these
to see how they can help you paint. strokes.
If you dont like any of your strokes,
3 Change your Stamp Profile settings
you can undo the action using the z
Click on the Sculpt tab.
key, or you can Erase back to the
Change the Radius(U) to 1.0. original surface. Artisan gives you
Change the Radius(L) to 0.25. this flexibility in order to let you
explore design alternatives.
This means that the lowest your
stroke will go is 0.25 and the largest
will be 1.0.
Change the Opacity to 0.2.
This means that each stroke will
only have 0.2 of the effect. This lets
you use softer strokes to build up a
shape.
Change your stamp setting to the
second icon, which has more
feathering at the brushs edge.
Sculpting the nose
This means that now you will pull By default, it is set to reflect around
Lesson One
out along the Z-axis instead of the U-axis.
normal to the surface.
Move your cursor over the surface.
Press the u key and select Pull from You can see that the reflection is
the Artisan marking menu. going the wrong way.
Paint the tip of the nose to pull it
out.
Reflecting in U
Click on V Isoparm for reflecting.
Pulling the tip of the nose along the Z-axis
2 Push the eye sockets in
7 Save your work Press the u key and select Push from
Reflected
stroke
Painted
stroke
Pulling out eyebrows
4 Flood smooth the surface Pulling out two lips
Press the u key and select Smooth
Change to a Smooth operation and erased not to the plain mask, but rather to
smooth the mouth brush strokes. the more detailed pose you have already
sculpted.
Lesson One
to Erase Srf.
Now, you can no longer erase to the
original surface. You should update
the Erase surface any time you are
pleased with how the surface looks.
Pushing in mouth
4 Add the upper lip detail Tip: Make sure that you save a backup of the
Press the u key and select Push from old surface in another file.
the Artisan marking menu.
Paint the area above the upper lip to Press the u key and select Erase
push it in. from the Artisan marking menu.
Paint the face to see if you can erase
any of the strokes. You wont be
able to.
The updated Erase surface means
that you cannot erase any more on
this surface until you start painting
again.
Duplicate.
Pushing in the upper lip
Move the new surface along the X-
5 Save your work axis until it is beside the original
surface.
Duplicate the face
You will now update the Erase surface then
duplicate the face. This lets you sculpt a
second face with a different facial pose. By
updating the Erase surface, any brush strokes
used to create the second facial pose can be
Selecting CVs
Another Maya Artisan tool is the Paint Select
CVs Tool. This tool lets you easily select a
region of CVs. You will select CVs using this
tool, then use the selection to mask out the
area of the face that you want to re-sculpt.
Unselect CVs.
Paint over the mouth area to
unselect a slightly larger area.
Activated CVs
Lesson One
Reversed selection Saved selection map
Surfaces Tool - .
Press the u key and select the Push
operation.
Click on the Mask tab.
Under CV Masking, set the
following:
Selected CVs to On;
Display CVs to Off.
Selection map export
This hides the selected CVs but uses
6 View the saved image them to mask the surface.
Scroll up to the Import Attribute Map Paint on the surface near the edge of
section. the mask. You will see that
Click on the Browse button. unaffected in the areas where they
are masked.
Click on mouthSelect then click on
the See Image button.
This is what your painted region
looks like as a map. You will reuse
this map later in the lesson.
Click on the Select tab. Other poses
In the Selection Type section, turn You can now create five more faces that each
Select CVs to On. have their own facial expressions, or poses. In
Click on the Map tab. the following diagram, you can see each of
the faces. For each pose, choose either the
In the Import Attribute Map section, eyes or the mouth for your edits. This works
click on the Browse button next to better with Blend Shape, since you can now
Map Name.
blend different eye and mouth poses together.
Lesson One
Select mouthSelect from the list and
When you are finished, name each surface
click Import.
using the names indicated on the diagram. By
Now, the CVs around the face are naming the surfaces, the Blend Shape controls
selected just like before. will be easier to read later.
3 Open the Blend Shape window Tip: If you want to exaggerate one of the
poses, you can set the blend shape value
Select Window Animation Editors
to more than 1.0.
Blend Shape...
You can now click-drag on the
various sliders to set up combined 4 Set a key for the first pose
versions of the target poses. Go to frame 1.
Lesson One
puff to 1.0;
squint to 0;
frown to 0. Pose at frame 20
1 Create a cluster
Click on the Display tab.
Select the neutral surface. In the Values section, make sure that
Color Feedback is On and then click
Select Deformations Cluster.
on the Use Set Color to turn it On.
This means that the cluster weights
will be displayed on the surface as a
color value. By default, the surface
Cluster is white (value of 1.0). You will now
handle paint other cluster values onto the
surface.
In the Operation section, make sure
Replace is set to On.
Paint on the bottom of the face to Weight = 0.5
set the value.
You will have to tumble around to
get all of the CVs on this part of the
surface.
Lesson One
As you paint them, they will pop
back to an unrotated position. They
will also turn black, which
represents a weight of 0. Painted cluster weights
Press the u key and select Smooth
from the marking menu.
Paint the kinked area of the surface
to smooth the deformation.
Scroll through the animation to see
if other frames show this kind of
kinking. You can then smooth the
cluster weights there, too.
Kinked
surface
Conclusion
If you like, you can now set up a set and some
textures just like the cover image of this
lesson. Use your knowledge of creating and
applying shading groups to complete the
scene.
Lesson One
You can now see how Maya Artisan can be
used to accomplish many tasks in Maya mor
easily than standard methods. You can push
and pull CVs, select CVs and paint cluster
weights as you model and animate your
models. It is important to note how Artisan
can be used to help you set up models for
animation.
In the next lesson, you will explore the use of
Artisan on a more complex head model.
Lesson Two
Lesson 2
Later, when you are working with Now you can paint on both sides of
the Artisan tools, you can see how the head even though it is built out
this hotkey works. of two separate surfaces.
Lesson Two
Click Save then Close. 2 Push in the cheeks
Press the u key and make sure that
These settings are now available
your operation is set to Push.
when you start working on the head
surfaces. Press the b key and click-drag to set
the Radius (U) to 0.3.
Sculpting facial details As you click-drag, you will notice
To start, you will paint some facial details the value changing. Release the
onto the two surfaces. In the last lesson, you mouse button when you reach the
were able to reflect paint on the same surface. desired value.
You will use a similar technique to reflect Press the n key and click-drag to set
paint across two surfaces. the Max Displacement to 0.35.
1 Paint on both the surfaces
Press the m key and click-drag to set
Go to the Modeling menu set.
the Opacity to 0.2.
Click-drag on the cheeks to push in
Select both of the head surfaces.
this area of the face.
Select Edit Surfaces Sculpt
Surfaces Tool - .
Click on the Display tab and set
Show Active Lines to Off.
Click on the Stroke tab and, under
Reflect Paint, set Reflection and
Multiple Surf to On.
Painting geometry
Another important tool in Artisan is the
Script Paint tool that lets you use a MEL
(Maya Embedded Language) script to add
functionality to Artisan. You will paint a
Lesson Two
you later paint multiple copies of
the cone onto the head, you do not
want to also make copies of the
history nodes.
Select Modify Freeze
Transformations.
This function lets you keep the
current shape of the cone while
returning its transform values back
Moved surface to default values.
2 Build a primitive cone 3 Rename and hide the cone
Select Primitives Create NURBS In the Channel box, rename the
Lesson Two
Painted geometry
Settings window.
Change the following settings:
U Grid Size to 50;
V Grid Size to 50.
Paint the back of the skull with the
spike cones.
Conclusion
In Maya Artisan, you can sculpt on multiple
surfaces. Using common edge detection, you are
able to paint over the seams separating the
surfaces so that they appear as if there is no
break.
The Script Paint tool offers another level of
functionality in Maya Artisan where a MEL
script can be used to offer new uses for the
Artisan brush stamps.
In the next lesson, you will explore another
MEL script that lets you paint goal weights on
a dynamic soft body object.
Lesson Three
Lesson 3
Initial set-up
Move the plane about 8 units above
the ground grid.
To start this lesson it is very important that you
place the softBodyPaint.mel script into your
maya/scripts directory. See your Maya Artisan
installation instructions for details.
Select the two outer CVs at the top
In the option window, set the
of the cape. following:
Move them forward along the X- Number of Spans U to 20;
axis. Number of Spans V to 10.
Click Rebuild then Close.
Lesson Three
2 Convert the map into an image
Since Artisan needs a file texture to map a
sculpting operation, you will convert the
procedural texture.
Scaled CVs In the Textures section of the
Multilister, click on the fractal1 map.
5 Rebuild the surface complexity In the view panel, Select the cape
To add more CVs to the surface so that surface.
Artisan can sculpt more easily, you will
need to rebuild the surface so that it has
In the Multilister, select Edit
more spans along the U and V directions. Convert Solid Texture.
Press F8 to return to object selection This creates a file texture in the
mode. Multilister that works with the cape
surface. The actual texture is saved
Select Edit Surfaces Rebuild in the sourceimages directory.
Surfaces - .
Lesson Three
Use Max Distance to On.
Move the turbulence icon up into
the center of the cape area. Moved air field
5 Add springs
To help the soft body spring back as it is
affected by the dynamic forces, you will
add springs.
Select the softObject.
Select Bodies Create Springs - .
Under Spring Methods, set the
following:
Set Min/Max to On;
Moved turbulence field
Max Distance to 1.
Under Spring Attributes, set:
Stiffness to 20.
Click on Create then Close. one at a time and apply the weights that way.
This creates a mesh that strings Maya Artisans Script Paint tool lets you use a
together the particles on the soft more intuitive method.
body. You can hide the springs
1 Set up the Script Paint tool
since they do not need to be visible
to be part of the simulation.
Go to frame 1.
Select the softObject.
Select Modify Script Paint Tool - .
Click on the Setup tab and in the
Tool Setup Cmd: field enter:
softBodyPaint goalPP
Press the Tab key to accept this
entry.
Click on the Display tab and under
Surface, turn Show Active Lines to
Springs Off.
Select Display Hide Hide
Return to the Script Paint tab and,
Selection. under Stamp Profile, set the
following:
By hiding the springs, you will
speed up the simulation. Value to 1.0.
Click on the Flood button.
6 Playback the simulation
Now the whole surface uses a goal
To see the effect of all these forces, you can weight of 1.0. This gives you a good
playback the scene to view the simulation. starting point.
Set your playback range from 1 to
200 frames. 2 Paint the cape with goal weights
Under Stamp Profile, set the
Playback the simulation.
following:
Not much is happening. The
particles only move a little as they Value to 0.3.
hang off of their original goal. A Paint the bottom of the cape.
constant goal weight of 0.5 is too This script lets you visualize the
limiting for this simulation. painting of the value by actually
painting a grayscale value onto the
Paint the goal weights surface.
To increase the action in the simulation, you
need to vary the goal weights across the soft
body. You could pick the soft body particles
Value = 1.0
Value = 1.0
Value = 0.7
Lesson Three
Animated soft body surface
Painted CV weights
Finishing touches
You can now continue to paint the surface to
get the animated look that you want. At the
A pulling 40 H
scaling 40
selection 20
air fields, see wind CVs, see control vertices (CVs) hardware shading 11, 40
animating 23 hide 24, 35, 42, 44
clusters 27 highlights 12
goal weights 46 D history, see construction history
key all 24 hotkeys 11, 18, 32
playback 26 deformations 23, 26 customizing 32
set key 24 Blend Shape 24 maximum displacement 33
soft body surfaces 46 clusters 26 opacity 33
surfaces 26 paint weights tool 26 upper brush radius 32
testing results 28 displacement
Attribute Editor 12 maximum displacement 5, 15
attributes display smoothness 10
I
shading groups 12 dollying views 11
duplicate 19, 22 input devices
dynamics 43 mouse 12
B goal weights 46 stylus 5, 12, 15, 16
soft body dynamics 42 tablet 5, 12, 15
Blend Shape 7, 23, 24 intersecting strokes 14
brush 11, 38
opacity 16 E
radius 5, 13, 16, 18, 22, 32 L
shape 6, 16 Erase surface 7, 19
size 13 erasing 6, 7, 13, 15, 16, 22 launching Artisan 10
stroke 12 launching Maya 10
brush-based interface 4 layers 14
F Learning Maya tutorials 7
C facial poses 19, 23
file management 10
M
clusters 26 opening files 10
animating 27 saving files 10 maps 42
cluster weights 26 flood 6, 16, 44, 46 marking menu 16
color feedback 26 flood erase 14, 15, 22 masking 4, 22
paint weights tool 26 fractal maps 41 CVs 21
rotating 26 freeze transformations 35 maximum displacement 5, 7, 32
smoothing weights 28 Maya Embedded Language
stamp profile 26 (MEL) 4, 34, 38, 46
color 13 G Maya F/X module 7, 39
cluster weights 26 MEL, see Maya Embedded
color feedback 26 geometry 34, 37 Language
use set color 26 geometry paint script 37 modeling 32
value 26 Geometry Paint Settings 36, 37 move 22, 35
common edge detection 38 goal weights 4, 42, 44, 45, 46 Multilister 41
construction history 35, 40 gravity 43
control vertices (CVs) 20 groups 32
goal weights 44
masking 21
48 Learning Maya
N R opacity 14, 16, 46
radius 5, 13, 14, 16, 18, 22
shape 16
naming surfaces 23 randomizing 43 upper brush radius 45
non-uniform rational b-splines reference surfaces 7, 14, 15 surfaces
(NURBS) 4, 35, 40 reflect paint 6, 31, 33, 36 animating 26
NURBS, see non-uniform rational reflection 17 complexity 41
b-splines rendering 12 displacement 5
rotate 26 duplicating 19
O Erase surface 19
S highlights 12
kinking 28
opacity 5, 32 moving 19
operations 6, 19 saving files 17 naming 23
erase 6, 13, 15, 22 scaling 35, 40 neutral surfaces 24
pull 5, 6, 13, 14, 34, 42 scenes 10 operations 13
push 5, 13, 33 script paint tool 4, 36, 38, 44, 46 pushing 12
replace 36 scripts, see Maya Embedded Lan- rebuild surfaces 41
smooth 6, 13, 46 guage (MEL) reference surfaces 7, 14, 15
overlap 14 sculpt surfaces tool 4, 42 reflection 17
sculpt variables sculpting 13
reference vectors 17 seams 34
P sculpting 11, 13 show active lines 36, 44
across seams 34 smoothing 4, 16, 28
paint select CVs tool 4, 20 facial details 15 smoothness 10
paint weights tool 4, 26 painting 12 tapering 40
painting 11, 12, 18 surface complexity 41 updating 7, 15
brushes 11 seams 31, 34 symmetry 6, 17
geometry 34, 36, 37 selection 20, 22
goal weights 45 component mode 40
masking 21 export attribute map 21 T
paint 12, 16 import attribute map 21, 23
reflection 6, 17 selection maps 21 testing results 28
sculpting 12 selection handles 32 textures
symmetry 17 selection masks 21, 22 convert solid texture 41
particles, see dynamics set key 24 file textures 41, 42
playback 26, 44 set pose 24 fractal maps 41
Playblast 28 shading groups 12 procedural textures 41
Plug-in Manager 35 attributes 12 Tool Settings window 5, 11
poses 23 materials 12 Display 12
set pose 24 specular shading 13 global selection 20
target poses 24 shapes Map 21
previews 28 base shapes 24 reset tool 20
primitives 40 target shapes 24 Sculpt 13, 16
cones 35 smooth 19 tracking views 11
projects smoothing 13, 16, 19 tumbling views 11, 27
set project 10 soft body dynamics 4, 42 turbulence 43
pulling 13, 14, 16, 18 spans 41
pushing 18 springs 43
stamp profile 38, 44
Learning Maya 49
Index
U
undo 6, 16, 22
user interface 5
V
views
changing views 11, 27
W
weights 7
smoothing 28
wind 43
windows
maximizing 37
minimizing 36
50 Learning Maya
Character
Animation
Contents
Character Animation
As a character animator using Maya, you can create the illusion of life. You
can animate virtually any character imaginable, no matter how realistic,
abstract, or surreal. The essence of character animation is timing and motion.
Maya offers the most sophisticated tools available for defining the timing
and motion of characters. Using Maya: Animation, Character Animation,
Animation
Character
describes how to use Mayas skeleton-based shape deformation tools to
animate articulated, hierarchical 3D characters with forward or inverse
kinematics techniques.
This chapter presents an overview of animating an articulated, hierarchical
3D character in Maya. Animating a character includes the following:
Modeling the character on page 168
Building, posing, and animating the skeleton on page 170
Skinning the skeleton on page 178
Using flexors on page 181
Animating the character on page 183
This chapter concludes with a summary of Mayas workflow for skeletal
character animation: Workflow summary on page 184.
For best results, create the geometry with limbs outstretched. This will make
building a skeleton much easier.
A geometry can be a non-uniform rational B-spline (NURBS) geometry or a
polygonal geometry. A geometry defines the shape of the characters surface.
Animation
Character
To create a geometry for a character, use the modeling tools in Mayas
Model menu. When you create the geometry, you should also define how
the character will look when rendered. For rendering, use the tools in
Mayas Render menu. Note that you can also use Mayas particle system to
define the characters features. To use the particle system, use the tools in
Mayas Dynamics menu.
Note
To use the animation tools this document describes, be sure you have
Mayas Animation menu selected.
The skeleton you build for a character need not exactly resemble what the
characters skeleton would be like in real life. You might create a skeleton for
a character that would lack one in real life. Depending on the effect you
want to create, you might even have the skeleton influence the geometry
from a location outside of the geometry.
A skeleton consists of joints connected by the bones of the joints.
Additionally, a skeleton can consist of special tools called inverse kinematics
(IK) handles. IK handles enable you to pose the character easily, and they
facilitate animation.
You could begin building a skeleton for a human character by creating some
legs.
Animation
Character
In this example, each leg consists of a simple series of joints connected by
bones. For clarity, these legs are shown without a geometry in the scene.
When you create a skeleton, you should have the geometry in your current
scene so you can be sure the skeleton fits the model properly.
When we think of a real skeleton, we tend to think first of the bones and
then of the joints that enable movement. When it comes to animating
movement, however, we must first focus on the joints and their hierarchical
relationships.
In Maya, the joints of a skeleton always exist in a hierarchy that defines how
they can move in relation to each other. Any two connected joints have a
hierarchical relationship for defining articulated actions. This relationship is
indicated by the bone that connects the two joints.
Joint
Bone
Joint
Note that the bone has a wedge shape. The joint at the thicker end of the
wedge is higher in the hierarchy than the joint at the thinner end. Whenever
the joint at the thicker end rotates, the bone and the joint at the thinner end
will have to move in an arc. But when the joint at the thinner end rotates, the
joint at the thicker end will not have to move. This is just like how a real
skeleton moves.
The joint at the thicker end is called the parent joint in relation to the joint at
the thinner end, which is called the child joint. We can think of the parent
joint as being above the child joint and the child below the parent.
Parent joint
Child joint
Parent joints
bone
As far as hierarchical movement is concerned, the bone that connects the two
joints is really part of the parent joint. A bone belongs to a parent joint,
which completely controls the bones movements.
Note that a joint can have more than one bone, each bone connecting the
parent joint to a different child joint.
Animation
Character
Any simple series of joints connected together by bones is called a joint chain.
The highest joint in the joint chains action hierarchy is called the parent joint
of the joint chain. The action of a joint chains parent joint affects everything
below it in the chain.
Parent joint of
joint chain
You can create very elaborate skeletons consisting of multiple joint chains
organized into a complex hierarchy.
A limb consists of one or more joint chains that branch off from one another
in a tree-like structure.
The highest joint in a skeletons hierarchy is called the root joint; when the
root joint moves or rotates, everything must move or rotate with it.
The order in which you create joints and their bones defines their action
hierarchy for rotation and movement. In the leg, the hip joint is the highest
joint in the action hierarchy. The hip joint was created first, then the knee
joint, and so on.
Animation
Character
You can limit how joints rotate so that you can easily put the character in
realistic poses. For example, you can limit how a knee joint can rotate so it
cant bend from side to side but only forward and back.
Setting and editing the characteristics of the knee joints will make the
animation of a walk cycle much easier. You can set each joints
characteristics as you create a skeleton and later tweak them as you pose and
animate the character.
Chapter 11, Building Skeletonsdescribes creating and editing joints and
bones. After youve created all the joints and bones that make up a skeleton
for your character, youll want to move the skeleton around and put it in
various poses.
In Maya, there are two basic ways to pose a joint chain: forward kinematics
and inverse kinematics.
With forward kinematics, when you pose a joint chain you have to specify
the rotations of each joint individually, starting from the parent joint on
down to all the joints below. This approach is excellent for creating detailed
arc motions.
With inverse kinematics, when you pose a joint chain all you have to do is
tell the lowest joint in the joint chains hierarchy where you want it to be,
and all the joints above it will rotate automatically. Inverse kinematics offers
a very intuitive way to pose a joint chain because it enables goal-directed
posing. When you reach for an object, you dont think about how you are
going to rotate your shoulder, your elbow, and so on. You just think about
where the object is that you want to reach, and your body automatically
does the rest. Thats how inverse kinematics works, too.
To pose a joint chain with inverse kinematics, you need to add some special
tools to a skeleton. These tools are called inverse kinematics (IK) handles. An IK
handle enables you to pose a joint chain intuitively.
An IK handle begins at a joint chains parent joint and can end at any joint
below the parent joint. For example, for each leg you could create an IK
handle that controls the joint chain beginning at the hip joint and ending at
the ankle joint.
Animation
Character
You can select the IK handle where it ends at the ankle joint and move the
chain with it in the same way that you would think about moving your own
ankle.
In addition to posing a skeleton, IK handles also play an important role in
the animation of the skeleton. The movement of a chain between the
keyframes of an animation is also automatically solved by the chains IK
handles.
IK handles figure out how to rotate and move all the joints in the chain for
you by using an inverse kinematics (IK) solver. An IK solver is the motor
intelligence behind an IK handle. Maya offers several different types of IK
solvers for different types of movement effects. For further control, you can
also specify the characteristics of the IK solvers themselves.
Youll want to create IK handles for all of a skeletons joint chains that you
want to pose. Chapter 12, Posing and Animating Skeletons describes how
to use IK handles and IK solvers.
You can pose and animate a skeleton, but such an animation would show
only the timing and motion of a character lacking form and shape. The next
step is to bind the characters model to the characters skeleton so that the
skeleton can control the models actions.
Animation
Character
Note that because skin points are bound to joints by means of deformation
tools called joint clusters, expert users sometimes call skin points joint cluster
points.
Once the skin is bound to the skeleton, exercise the character by putting it
into various poses. Its important to do this because you need to observe
how the skin acts in response to the skeletons actions.
Depending on the pose of the geometry and skeleton during binding, a few
of the skin points could join an inappropriate skin point set.
If so, you can easily move those skin points from one skin point set to
another.
Using flexors
You can animate skin deformation effects by using special deformation tools
called flexors. Flexors are high-level deformeration tools for use with skins
and skeletons. The effects of flexors can be driven by how you pose and
animate a skeleton.
Maya offers three types of flexors: lattice flexors, sculpt flexors, and cluster
flexors.
A lattice flexor influences skin around joints or the bones of joints. It can
smooth or wrinkle skin around joints, and provide muscle definition around
bones.
A sculpt flexor provides anatomically based deformations such as muscle
Animation
Character
bulges, knee caps, and elbow caps. A sculpt flexor can influence skin around
joints or the bones of joints.
A cluster flexor controls the points in a skin point set around a joint with
varying percentages of influence. It can provide very realistic smoothing
effects.
Lets look at a lattice flexor attached to a joint. With a lattice flexor, a joint
can directly influence skin points, changing the shape of the characters skin.
You can create a lattice flexor that will deform skin when the joint it is
attached to rotates. For example, you can create a flexor that wrinkles the
skin around an elbow as you bend a characters arm.
Similarly, a lattice flexor attached to a bone can influence the skin around a
bone. You can use lattice flexors attached to bones for animating muscle
definition.
Chapter 14, Using Flexors describes using flexors for skin deformation in
more detail.
Using Maya: Animation, Basic Deformers provides further information on
Mayas free form deformation tools. Unlike flexors, these deformation tools
need not work in conjunction with a skeleton. These tools include sculpt
deformers, wire deformers, lattice deformers, cluster deformers, and blend
shape deformers. Blend shape deformers, for example, are excellent tools for
facial animation.
The time you put into building a skeleton, binding the geometry, and
creating flexors is time well spent. The effort you put into these steps will
pay off when you animate the character.
Animation
Character
Animating the character
The more carefully you design and construct the character, the easier
animating the character will be. You can animate the character by
keyframing or by using motion capture data. For general information on
keyframing animations in Maya, refer to Using Maya: Animation,Keyframe.
For information on motion capture, see Using Maya, Animation,Motion
Capture.
In keyframing, you pose a character in key postures and set these postures
as keys. Maya then interpolates the actions between the keys for you,
playing the animation. For example, here is a frame from a walk cycle.
Workflow summary
Animating an articulated, hierarchical 3D character in Maya involves using
Mayas skeletal deformation tools: skeletons and flexors. After you create a
geometry for the character with Mayas modeling tools, you can build a
skeleton for the geometry and then bind the geometry to the skeleton. This
binding process is called skinning. Skinning the geometry to the skeleton
binds the models shape to the skeletons movement. The geometry has
become the skeletons skin, and the skins shape will deform as appropriate
when you pose and animate the skeleton. Skeletons can be posed and
animated with Mayas forward or inverse kinematics tools. Special inverse
kinematics tools include IK handles and IK solvers.
Animation
Character
Chapter 14, Using Flexors
After youve created a geometry for your character, the next step is to build
a skeleton for the geometry. In general, youll want to have the geometry in
the scene as you create the skeleton so can be sure the skeleton fits the
geometry. You could create a characters skeleton before you create the
geometry, but you may have to scale the geometry and adjust the skeleton
before you bind them together.
Animation
Character
This chapter describes how to build skeletons. Building skeletons includes
the following:
Understanding skeletons on page 188
Creating a joint chain or limb on page 192
Resizing joint display on page 195
Positioning joints on page 196
Inserting joints on page 197
Removing joints on page 198
Note
To use the tools for building skeletons, be sure you have Mayas
Animation menu selected.
Understanding skeletons
Skeletons are hierarchical, articulated structures for animating geometries.
Skeletons provide a basis for animating hierarchical actions in much the
same way that a human skeleton determines how the human body can
move.
When you build a skeleton, the grid can be quite useful for judging the size
and shape of the skeleton. You can position and rescale the grid to suit your
work. Also, use multiple camera views when building a skeleton to make
sure that your skeleton fits the model appropriately in all three dimensions.
Joints
Joints are the building blocks of skeletons. Each joint can have one or more
bones attached to it. The action of a bone attached to a joint is controlled by
the joints rotation and movement. Various joint attributes specify how the
joint can act. For example, you can specify limitations on how far a joint can
rotate.
A root joint is the highest joint in a skeletons hierarchy. A skeleton can have
only one root joint.
A parent joint is any joint higher in a skeletons action hierarchy than any of
the other joints that are influenced by that joints action. Joints below a given
parent joint in the action hierarchy are called child joints.
Root joint
(selected)
Animation
Character
Parent joint
of joint A
Joint A
Bone of
joint A
Child joint of
joint A
Sample skeleton
Joint chains
A joint chain is any group of joints and their bones connected in a series. The
joints are connected linearly; you could draw a line through a joint chains
series of joints and their bones without having to retrace your path. A given
joint chain begins at the highest joint in the joint chains action hierarchy.
This joint is the joint chains parent joint.
Joint chain
Joint chain
Joint chain
Joint chain
Joint chains
Limbs
A limb is any group of one or more connected joint chains. The chains may
branch off from one another, forming a tree-like structure. Unlike a joint
chain, a limbs joints may not be connected linearly; you may not be able to
draw a line through all of a limbs joints and their bones without doubling
back. A given limb begins at the highest joint in the limbs action hierarchy.
This joint is the limbs parent joint.
When you begin building a skeleton that will have many symmetrical limbs,
start in the center of the workspace near the scenes world origin. Starting
near the center will make it easier for you to create skeletons with many
symmetrical parts.
Limb
Limb
Animation
Character
Limbs
Expert users have found that if a skeleton lies entirely in one plane before
you bind the geometry to the skeleton, posing the character with IK handles
can be somewhat awkward in extreme cases. Having some of the joints
rotated slightly at various appropriate angles will make the character easier
to pose later on.
Animation
Character
Creating a joint chain
1. Click here to
continue the
joint chain
2. Click to
create more
joints
or
1. Click here
to continue
the joint chain 2. Click to
create more
joints
Animation
Character
Resizing joint display
You can resize the display of a skeletons joints. Increasing the display size
can make the joints and their bones easier to pick. Decreasing the display
size can make other objects such as flexors easier to pick.
Here is a skeleton displayed at normal size:
Positioning joints
While you are creating a joint chain, you can edit the positioning of any joint
without affecting the joints below it in the joint chains action hierarchy.
Note
To edit the position of a joint after the skeleton is created and accepted,
toggle on (the Select by Component Type icon) and (the Pivot
icon), then use the right mouse button on the Pivot button to turn on Joint
Pivots in the Pivot pick mask.
To position the most recently created joint while creating the joint
chain:
While in create mode, you can use the middle mouse button to modify the
most recent joint (the one currently selected).
The transform manipulator appears and you can move the joint in any
Animation
Character
direction.
Inserting joints
You can insert a joint anywhere in a skeletons action hierarchy below the
root joint.
1. Click to
add a joint
below this one
2. Drag to
position the
new joint
Inserting a joint
Removing joints
You can remove any joint from a skeleton except the root joint. The root joint
is the highest joint in a skeletons action hierarchy, and deleting the root joint
would delete the entire skeleton.
To remove a joint:
1 Select the joint you want to remove.
Note that you can only remove one joint at a time.
2 Select SkeletonsRemove Joint.
The joint is removed. The bone of the joint above the removed joint is
extended to the joint below the removed joint.
Bone is
Click to resized
delete the joint
Animation
Character
Removing a joint
1. Click here to
mirror this limb
2. A mirror copy
of the limb is
created
Mirroring a limb
Animation
Character
Mirroring a skeleton
Connecting skeletons
You can connect two skeletons in two ways: by combining joints and by
connecting joints with a bone.
First, you can connect two skeletons by combining the root joint of one
skeleton with any joint of another skeleton except that skeletons root joint.
The skeleton that becomes a limb of the other skeleton will change its
position in the scene so that it is directly connected to the other skeletons
joint.
Second, you can connect the root joint of one skeleton to any joint of another
skeleton by extending a bone to the root joint from the joint of the other
skeleton. The skeleton that becomes a limb of the other skeleton will not
have to move.
Animation
Character
Connecting skeletons by combining joints
Bone created
to connect the
two skeletons
Animation
Character
Disconnecting a joint
Current root
joint
Click to
create new
root joint
Rerooting a skeleton
To reroot a skeleton:
1 Click the joint where you want the new root.
If you select the child of the entire joint chain, the hierarchy will reverse.
If you select a joint in the middle of the skeleton to become the new root, you
will have two child joints with separate hierarchies below the root joint.
2 Select SkeletonsReroot Skeleton.
Animation
Character
options so that certain joint options and attributes will be set automatically.
The Joint Tools options are displayed in the Joint Tools Tool Settings
window.
preference. Some expert users like to have the local axis of joints
automatically orient towards first child joints, and other expert users prefer
to have the local axis initially oriented the same as the scenes world axis.
By default, the orientation of a joints local axis is xyz. In this orientation, the
positive X-axis points in the same direction as the joints wedge-shaped
bone. That is, the X-axis points towards the center of the joints child joint. If
the joint has more than one child joint, the X-axis points at the child joint that
was created first. The Z-axis points sideways from the joint and its bone
connecting the child joint, and the Y-axis points at right angles to the X-axis
and Z-axis. All three axes are aligned according to the right hand rule.
For example, in a human skeleton the elbow joints X-axis would be pointing
towards the wrist joint. With the arm lying flat, the elbow joint could twist
Animation
Character
about most of the X-axis, turning the rest of the arm. The elbow joint could
partially swing up and down about the Z-axis, but it would not be able to
pivot about the Y-axis.
You can select various combinations of the X-, Y-, and Z-axes to specify the
orientation of a joints local axis. The first axis in the combination is the axis
that points at the joints first child joint. The third axis points sideways from
the joint and its bone connecting the child joint, and the second axis points at
right angles to the first axis and third axis. All three axes are aligned
according to the right hand rule. In terms of yaw, pitch, and roll, rotation
about the first axis produces roll, rotation about the second axis produces
yaw, and rotation about the third axis produces pitch.
Instead of orienting the joints local axis relative to the first child joint, you
can set the local axis to have the same orientation as the scenes world axis.
In this case, the orientation would be set to none.
Animation
Character
Setting IK handle options automatically
See Chapter 12, Posing and Animating Skeletons, for descriptions of the IK
handle options you can set when you create IK handles.
Editing stiffness
Editing a joints preferred angle
Editing joint orientation
Editing scale compensation
Editing joint limits
Dampening rotation near joint limits
You can access settings for a joints attributes, and also the Attribute Editor,
by pressing the right mouse button while the cursor is on the joint you want
to edit.
Animation
Character
Renaming a joint
Maya names joints for you when you create them. By default, joints are
numbered consecutively as you create them. However, you can rename the
joints to better reflect their purpose in your characters skeleton. Its a good
idea to give joints meaningful names so they are easier to select when you
are working with Mayas editors, using the Hypergraph, or using the
Outliner.
To rename a joint:
1 Select the joint.
2 Choose WindowAttribute Editor to open the Attribute Editor.
3 Enter the new name in the joint: field.
The new name takes effect immediately.
Animation
Character
Animation
Character
characters actions. Two types of IK solvers, the single chain IK solver and
the rotate plane IK solver, will then give those angles priority over other
possible angles during joint rotation. The angles you give priority to are
called preferred angles.
Preferred angles can enable smoother motion during animation.
Editing stiffness
This attribute influences how stiffly an IK handle can rotate a joint during
inverse kinematics. If you are not familiar with inverse kinematics (IK), IK
handles, and IK solvers, see Chapter 12, Posing and Animating Skeletons.
When you use inverse kinematics to move a joint chain for animation, you
can set some joints to move less freely than others. You can set joints in the
mid-back of a human to move and bend less freely than those in the lower
back, for example. The resistance to movement of a particular joint is called
its stiffness.
Set stiffness
high in Z-axis Set stiffness
low in X-axis
Animation
Character
was created first. The Z-axis points sideways from the joint and its bone
connecting the child joint, and the Y-axis points at right angles to the X-axis
and Z-axis. All three axes are aligned according to the right hand rule.
For example, in a human skeleton the elbow joints X-axis would be pointing
towards the wrist joint. With the arm lying flat, the elbow joint could twist
about most of the X-axis, turning the rest of the arm. The elbow joint could
partially swing up and down about the Z-axis, but it would not be able to
pivot about the Y-axis.
You can select various combinations of the X-, Y-, and Z-axes to specify the
orientation of a joints local axis. The first axis in the combination is the axis
that points at the joints first child joint. The third axis points sideways from
the joint and its bone connecting the child joint, and the second axis points at
right angles to the first axis and third axis. All three axes are aligned
according to the right hand rule. In terms of yaw, pitch, and roll, rotation
about the first axis produces roll, rotation about the second axis produces
yaw, and rotation about the third axis produces pitch.
Instead of orienting the joints local axis relative to the first child joint, you
can set the local axis to have the same orientation as the scenes world axis.
In this case, the orientation would be set to none.
3 Toggle on the boxes by the Min and Max limits of any value you want to
change.
For example, to set minimum and maximum limits for rotation in X, click the
boxes to the left and right of Rot Limit X.
4 In the Limit X, Y, and Z fields under Translate, Rotate, and Scale, enter the
angles between which you want to limit the joints motion.
Animation
Character
Range of
motion if
the Z-axis
rotation
limits are
set to -15,
45
Range of
motion if
the X-axis
rotation
limits are
set to -45,
90
Animation
Character
solver; it does not affect joints that are animated by other means.
Two settings in the Attribute Editor control a joints dampening: Damp
Range and Damp Strength.
Minimum and Maximum Rotate Damp Range set the number of degrees
inside the joint limits at which resistance begins to occur.
Minimum and Maximum Rotate Damp Strength set the amount of
resistance in the damp range.
Minimum
damp range
Maximum
damp range
Maximum damp
strength affects
Maximum damp
this area
strength affects
this area
Minimum Z-
axis joint
Maximum Z- limit (-15)
axis joint
limit (45)
After youve created a skeleton for your character, you skin the skeleton by
binding the geometry to the skeleton. You can then create flexors for further
skin deformation effects. Animating the character includes animating the
skeleton and animating the effects provided by the flexors.
Animation
Character
This chapter describes posing and animating skeletons. Posing and
animating skeletons includes the following:
Understanding posing and animating skeletons on page 226
Creating IK handles on page 238
Setting IK handle creation options on page 241
Editing IK handle attributes on page 246
Editing IK solvers on page 253
Using IK systems on page 254
Posing IK chains on page 256
Forward kinematics
In forward kinematics, when you pose a joint chain you rotate each joint
individually. For example, if you want a joint chain to reach for a particular
location in space, you have to rotate each joint individually so that the joint
chain can reach the location. To do this, you would rotate the joint chains
parent joint, then the next joint, and so on down the joint chain. When you
animate a skeleton posed with forward kinematics, Maya interpolates the
joint rotations starting with the root joint, then the roots child joints, and so
on down through the skeletons action hierarchy. Maya proceeds forward
through the action hierarchy, starting at the root joint.
Posing and animating skeletons with forward kinematics is an excellent
approach for specifying detailed arc motions, but it can take a fair amount of
time if you are animating a large, complicated skeleton. Also, forward
kinematics is often not very intuitive for specifying goal-directed motion.
When you think about moving your hand to some location in space, you
dont normally think about how you are going to rotate all the joints in your
arm.
The following sequence of five images illustrates the steps required to
extend a W-shaped joint chain with forward kinematics posing.
Animation
Character
Forward kinematics posing: root joint rotation
Animation
Character
solver.
The IK solver is the motor intelligence behind the IK handle. For example, if
you want a joint chain to reach a particular location in space, you can move
the entire chain by using the IK handle that runs through the chain. Given
where you want the joint chain to reach, the IK solver figures out how to
rotate all the joints in the joint chain for you by means of Mayas inverse
kinematics methods.
The following sequence of two images illustrates the steps required to
extend a W-shaped joint chain with inverse kinematics posing.
When you are posing and animating an IK chain, you also need to tell the IK
solver the position and orientation in space where you would like the end
effector to move to next. That information is provided by the IK handles
goal. When you interactively pose an IK chain, what you are really doing is
moving the IK handles goal. The IK solver looks at where the goal is, looks
at where the end effector is, and figures out how to rotate all the joints in the
IK chain to get the end effector to be where the goal is.
A skeleton can have as many IK handles as you think you need for posing
and animating its joint chains. However, be sure you are happy with which
joint is the skeletons root joint before you begin creating IK handles. The
skeletons root must not be between an IK chains start joint and end joint.
You cannot create an IK chain that includes the root joint unless that joint is
the start joint. Also, if you change which joint is the root joint, you will
Animation
Character
invalidate IK chains that include the new root joint unless the joint is the
start joint of an IK chain.
IK solvers
IK solvers provide the motor intelligence of IK handles. IK solvers figure out
how to rotate all the joints in a joint chain controlled by an IK handle. Maya
offers four types of solvers:
Single chain (SC) solver
Rotate plane (RP) solver
Spline solver
Multi-chain (MC) solver
Handle
vector
Handle wire
End effector
Start joint
The start joint is where the IK handle begins. The start joint is the first joint
in the joint chain that is influenced by the IK handle. The start joint could be
the skeletons root joint or any other joint in the skeletons action hierarchy
above the end joint.
End joint
The end joint is the last joint in the joint chain controlled by the IK handle.
The end joint must be below the start joint in the skeletons action hierarchy.
Handle wire
The handle wire is the line that runs through all the joints and bones in a
joint chain controlled by the IK handle.The handle wire begins at the start
joints local axis and by default ends at the end joints local axis.
End effector
The end effector is the end of the IK handle. By default, the end effector is
located at the end joints local axis. However, the end effector can be offset
from the end joint. The end effector does not move from its location at the
end joint (or at some offset from the end joint) during posing and animating.
Also, note that the end effector is parented to the parent joint of the end
joint, not to the end joint.
Goal
The goal indicates where you want an IK handles end effector to be. The
goal, which is indicated by an axis, rests at the IK handles end effector.
During posing, you can move the goal to any location in the scenes world
space. The IK handles end effector tries to keep up with the goal at all times.
The IK handles single chain (SC) solver figures out how the end effector can
have the same position and orientation as the goals position and orientation.
The single chain (SC) solver figures out how to rotate the joint chains joints
so that the end effector can reach the goal. However, depending on the
rotational limits and fully extended length of the joint chain, the end effector
might not be able to reach the goals current position and orientation.
Handle vector
Animation
Character
The handle vector is the line drawn from the start joint to the IK handles
end effector. The end effector is normally located at the IK chains end joint.
The purpose of the handle vector is to indicate at which joints the IK handle
starts and ends. Because of the handle vectors similarity to what some
systems call a limb axis, some expert users refer to the handle vector as the
limb axis.
chains that you would like to stay in more or less the same plane, even
though that plane can rotate. For example, the shoulder, elbow, and wrist
joints of an arm all stay within the same plane, but that plane rotates as the
shoulder joint rotates.
An IK handle using a rotate plane solver is displayed as follows:
Plane
indicator Goal
Handle vector
Pole vector
Handle wire
End joint
Rotate disc
Start joint
Start joint
The start joint is where the IK handle begins. The start joint is the first joint
in the joint chain that is influenced by the IK handle.The start joint could be
the skeletons root joint, or any other joint in the skeletons action hierarchy
above the end joint.
End joint
The end joint is the last joint in the joint chain controlled by the IK
handle.The end joint must be below the start joint in the skeletons action
hierarchy.
Handle wire
The handle wire is the line that runs through all the joints and bones in a
joint chain controlled by the IK handle. The handle wire begins at the start
joints local axis and by default ends at the end joints local axis.
End effector
The end effector is the end of the IK handle. By default, the end effector is
located at the end joints local axis. However, the end effector can be offset
from the end joint. The end effector does not move from its location at the
end joint (or at some offset from the end joint) during posing and animating.
Also, note that the end effector is parented to the parent joint of the end
joint, not to the end joint. You can use the Hypergraph to view the
relationships between the end effector and the joints in the joint chain.
Goal
The goal indicates where you want an IK handles end effector to be. The
goal, which is indicated by an axis, rests at the IK handles end effector.
Animation
Character
During posing, you can move the goal to any location in the scenes world
space. The IK handles end effector tries to keep up with the goal at all times.
The IK handles rotate plane (RP) solver figures out how the end effector can
have the same position as the goals position. The rotate plane (RP) solver
figures out how to rotate the joint chains joints so that the end effector can
reach the goal. However, depending on the rotational limits and fully
extended length of the joint chain, the end effector might not be able to reach
the goals current location.
Handle vector
The handle vector is the line drawn from the start joint to the IK handles
end effector. The end effector is normally located at the IK chains end joint.
Because of the handle vectors similarity to what some systems call a limb
axis, some expert users refer to the handle vector as the limb axis.
Rotation disc
The rotation disc is located at the start joint. The rotation disc indicates how
the joint chain plane can rotate, which twists the joint chain. An indicator in
the rotation disc, called the plane indicator, shows the orientation of the joint
chain plane.
Twist disc
The twist disc is located at the end joint. You can use the twist disc as a tool
to twist the joint chain by rotating the joint chain plane.
Plane indicator
The plane indicator indicates the orientation of the joint chain plane, which
is the degree of twist in the joint chain relative to the reference plane. The
plane indicator can be thought of as the reflection of the joint chain plane in
the rotation disc.
Reference plane
For the joint chain plane to rotate and twist the joint chain, the plane must
rotate relative to some other plane so that the degree of twist can be
measured. The plane that the joint chain plane rotates relative to is the
reference plane. The difference between the two planes indicates the amount
the joint chain twists. The reference plane is defined by the handle vector
and the pole vector.
Pole vector
Like the handle vector, the pole vector starts at the start joint. Unlike the
handle vector, which always ends at its IK handles end effector, the pole
vector can end anywhere you want it to end. The purpose of the pole vector
is to help define the reference plane. During posing, you can sometimes
move the end effector through the reference plane, which moves the handle
vector through the reference plane. When that happens, the handle vector
and pole vector can appear to cross as the joint chain suddenly flips because
the degree of twist suddenly changes by 180 degrees. Because the reference
plane is defined by the handle vector and the pole vector, you can prevent
the flipping effect by simply moving the end of the pole vector to redefine
the reference plane.
Animation
Character
Expert users have found that rotate plane solver IK chains that consist of
between two and four joints are the easiest to pose. Extremely long IK chains
can become awkward to pose and animate.
Note that the joint chain controlled by an IK handle using a rotate plane
solver cannot have any other IK handles running through any of its joints.
Spline solver
The IK spline solver lets you manipulate a long, flexible joint chain that
conforms to the shape of a curve. This solver is useful for animating the
motion of tails, spines, tentacles, snakes, long necks, and similar objects.
Expert users have found that spline solver IK chains that include ten or more
joints with relatively short bones are ideal.
For information on using IK handles with the spline solver, please see
Using IK spline handles on page 259.
Creating IK handles
IK handles are tools that help you pose and animate joint chains with inverse
kinematics. You can create an IK handle for almost any joint chain. A joint
chain that has an IK handle is called an IK chain.
In any IK chain, the joint where the IK handle starts should be closer to the
skeletons root joint than the joint where the IK handle ends. Also, an IK
chain should not include the root joint unless the root joint is the start joint.
You use the IK Handle Tool to create IK handles. You can set certain IK
Handle attributes during IK handle creation from the IK Handle Tools Tool
Settings window. After you create the IK handles, you can edit IK handle
attributes by using the Attributes Editor. Note that you can also use Maya
Embedded Language (MEL) commands to create and edit IK handles. Some
expert users like to define hotkeys based on MEL commands for quickly
creating customized joint chains and IK handles.
During inverse kinematics posing and animating, the rotations of all the
joints in the IK chain are calculated, or solved, by an IK solver. Note that
IK handles using the single chain (SC), rotate plane (RP), and spline solvers
require that the joint chains they control be solved only by them. For
example, two IK handles using one of the single chain (SC), rotate plane
(RP), or spline solvers cannot overlap, allowing both to solve some of the
same joints.
Expert users have found that IK chains that consist of between two and four
joints are the easiest to pose and animate. Extremely long IK chains can
become awkward.
In creating IK handles, you can add IK handles to existing joint chains, or
you can create IK chains (joint chains with IK handles).
Adding an IK handle
You can create an IK handle for any joint chain.
To create an IK handle:
1 Select SkeletonsIK Handle Tool.
2 To change the tool options, select SkeletonsIK Handle Tool- to open the
IK Handle Tool Options window.
See Editing IK handle attributes on page 246 for a description of the IK
Handle Tool options.
3 With the left mouse button, click the start joint and end joint for the IK
handle.
You can click the joints in either order: the IK handle is created with the end
effector on the child joint.
Creating an IK chain
An IK chain is a joint chain that has an IK handle. You can create IK chains
in the same way that you create joint chains, but you must set the Joint
Tools Create IK Handle option.
To create an IK chain:
Animation
Character
1 Select SkeletonsJoint Tool- to open the Joint Tools Tool Settings
window.
2 Toggle on the Create IK Handle option.
You can set IK handle options within the IK Handle Options heading. Click
the triangle on the heading line to view the options. For information on IK
Handle options, see Editing IK handle attributes on page 246.
3 Create the joint chain as you would any skeleton. First, Click in the
workspace at the position of the first joint.
The joint is created.
4 Move the pointer to the position you want the second joint to be and click
again.
The two joints are connected with a bone that indicates the direction of the
joint chains hierarchy: the thinner end of the bones triangle points to the
child joint.
See Positioning joints on page 196 for tips on editing the positions of
joints.
5 Continue moving the pointer and clicking until you have created the chain
of joints for the skeleton.
6 When you finish creating all joints in the chain, press the Enter key.
Ending the joint chain creates the IK handle.
You can edit the IK handle in the Attribute Editor to change its attributes.
If the IK handle uses the default rotate plane (RP) solver, the twist disc is
displayed at the IK chains end joint. Also, the pole vectors axis is displayed.
If the IK handle uses the single chain (SC) solver, no additional manipulators
are displayed.
Animation
Character
Setting automatic IK handle attributes includes:
Viewing IK handle creation options on page 241
Setting the current solver on page 242
Setting autopriority on page 243
Setting solver enable on page 244
Setting snap enable on page 244
Setting sticky on page 244
Setting priority on page 245
Setting weight on page 245
Setting position vs. orientation (PO) weight on page 246
Animation
Character
The multi-chain (MC) solver is only available through the use of a Maya
Embedded Language (MEL) command. Once you enter the command, you
can choose the multi-chain solver from the IK Handle Tools Tool Settings
window.
Now you can choose the multi-chain (MC) solver in the IK Handle Tools
Tool Settings window.
Setting autopriority
You can control the order in which IK chains are solved by having Maya
automatically set their priority based on where the start joints are in the
skeletons action hierarchy. When Maya automatically sets priority, IK
chains whose start joint is the skeletons root joint have a priority of 1. IK
chains whose start joints are child joints of the root joint have a priority of 2,
and so on down the skeletons action hierarchy. The further an IK chains
start joint is from the root joint, the lower its priority.
To set autopriority:
1 Select SkeletonsIK Handle Tool-.
2 Click Autopriority on or off. If off, all IK handles are given a priority of 1.
Setting sticky
You can have an IK handles goal stick to any location in the scene. When
you move the start joint of the IK chain, or even the entire skeleton, the end
joint of the IK chain with a sticky IK handle will stick to its location while the
IK solver provides the appropriate joint rotations. For example, if you are
animating a human character that is reaching up or out while standing in
place, you can animate the natural articulation of the legs much more easily
by making the IK handles that end at the characters feet sticky.
To set sticky:
1 Select SkeletonsIK Handle Tool-.
Setting priority
You can control the order in which a skeletons various IK handles calculate
joint chain action during animation. Each IK handle can be assigned a
priority. IK handles with a priority of 1 will be solved first, IK handles with a
priority of 2 will be solved second, and so on.
Maya can set these priorities for you based on where an IK handles start
joint is in a skeletons action hierarchy, or you can give all IK handles a
priority of 1. Having varied priorities for IK handles can improve overall
inverse kinematics performance.
Animation
Character
To set priority:
1 Select SkeletonsIK Handle Tool-.
2 Slide Priority value to desired setting. Highest priority is 1.
Setting weight
During animation, a skeleton with many IK chains can perform a wide
variety of motions. Because of the specific ways the motions of IK chains can
affect the overall position and orientation of the characters skeleton, not all
the end effectors may be able to reach their goals simulaneously.
Consequently, some of the interpolated IK chain motions might not provide
the effects you wish. For example, on a given limb with two IK chains that
have the same priority, neither of the two IK chains might be able to reach
their goals because they are pulling the limb in different directions. You can
alleviate this situation by assigning the IK handles of those IK chains a
weight.
The assigned weight, combined with the current distance between an IK
handles end effector and its goal, serve to prioritize the solutions of IK
chains whose IK handles have the same priority settings.
When the end effectors of two or more IK handles with the same priority
cannot reach their goals simultaneously, the IK handles whose end effectors
are furthest from their goals and whose weights are greatest will be solved
first.
To set weight:
1 Select SkeletonsIK Handle Tool-.
Animation
Character
Renaming an IK handle
Maya names IK handles for you when you create them. By default, IK
handles are numbered consecutively as you create them. For example, the
first handle would be called ikHandle1, the second ikHandle2, and so
on. You can rename the IK handles to better reflect their purpose in posing
and animating your character. Its a good idea to give IK handles meaningful
names so that they are easier to select when you are working with Mayas
Animation
Character
editors, using the Hypergraph, or using the Outliner. For example, you
could name an IK handle that goes from a right shoulder joint to a right
wrist joint RShtoWrist.
To rename an IK handle:
1 Select the IK handle.
2 Choose WindowAttribute Editor to open the Attribute Editor.
3 Enter the new name in the ikHandle: field.
The new name takes effect immediately.
4 In Transform Attributes, you can make changes to the translate, rotate, scale,
and shear transformations. You can set the rotate order, which is by default
set to xyz. You can change the location of the rotate axis, which is by default
set to 0.0, 0.0, 0.0. Finally, you can toggle whether or not the IK handle
inherits transformations.
Animation
Character
2 Choose WindowAttribute Editor to open the Attribute Editor.
3 Open IK Solver Attributes if not opened.
In IK Solver Attributes, you can choose the IK solver, snap enable, stickiness,
priority, weight, and position vs. orientation (PO) weight.
4 In IK solver, choose the IK solver you want to assign to the IK handle.
By default, only two IK solvers are offered here: the single chain solver
(ikSCsolver) and the rotate plane solver (ikRPsolver), which is the default IK
solver.
To use the spline solver, you must work directly with the IK Spline Handle
Tool (SkeletonsIK Spline Handle Tool).
Editing pivots
An IK handles pivots attributes include the following:
Display rotate pivot toggle
Display scale pivot toggle
Local space rotate pivot and scale pivot
World space rotate pivot and scale pivot
4 In Pivots, you can edit the display rotate pivot toggle and the display scale
pivot toggle. Also, you can edit the coordinates for the local space pivots
rotate and scale transformations and the world space pivots rotate and scale
transformations.
Editing display
An IK handles display attributes include the following:
Display handle
Display local axis
Select handle
Show manipulator default
Visibility
Template
4 In Display, toggle the Display Handle and Display Local Axis settings. Edit
the coordinates of the Select Handle location. Select Show Manip Default as
None, Translate, Rotate, or Scale. Check Visibility on or off, and check
Template on or off.
Animation
Character
To edit node behavior attributes:
1 Select the IK handle.
2 Choose WindowAttribute Editor to open the Attribute Editor.
3 Open Node Behavior if not opened.
4 In Node Behavior, check Caching on or off. Select Node State as Normal,
HasNoEffect, or Blocking.
Editing IK solvers
You can edit the settings of the IK solvers from the Attribute Editor. By
default, Maya names the single chain solver the ikSCsolver and the rotate
plane solver the ikRPsolver. Editing IK solver settings includes:
Editing IK solver attributes: maximum iterations and tolerance
Editing node behavior
Using IK systems
An IK system can organize and manage a collection of IK solvers.
Creating an IK system
To create an IK system:
1 Choose WindowAttribute Editor to open the Attribute Editor.
2 Choose ListAuto Update, clicking auto update off (not checked).
3 Choose ListKinematicsIK Systems.
4 Choose ObjectikSystem.
The Attribute Editor will now show information about an IK system whose
default name is ikSystem. You can change the name by typing in a new
name in the ikSystem: field.
Accessing an IK system
To access an IK system:
1 Select an IK handle.
2 Choose WindowAttribute Editor to open the Attribute Editor.
3 In the Attribute Editor, click on Set Focus.
The Attribute Editor will now display information about the IK system.
Renaming an IK system
You can rename an IK system.
Animation
Character
To rename an IK system:
1 Access the IK system with the Attribute Editor.
2 In the ikSystem: field, replace the current name with the name you would
like to use.
Posing IK chains
Posing IK chains includes the following:
Posing with single chain (SC) solver IK handles
Positioning with rotate plane (RP) solver IK handles
Twisting with rotate plane (RP) solver IK handles
Eliminating flip in rotate plane (RP) solver IK handles
Sticky posing
You can select the IK handle directly or from the Hypergraph. In the
Hypergraph, note that next to each end effector there is an icon you can click
on to select the IK handle that the end effector belongs to.
2 Select the Move Tool or the Rotate Tool.
3 Press the right mouse button and pose the IK handle.
4 The joint chain will move or rotate as you move the mouse.
Animation
Character
You can select the IK handle directly or from the Hypergraph. In the
Hypergraph, next to each end effector is an icon you can click on to select
the IK handle that the end effector belongs to.
2 Select the Move Tool.
3 Press the right mouse button and position the IK handle.
The joint chain will move as you move the mouse.
You can select the IK handle directly or from the Hypergraph. In the
Hypergraph, next to each end effector is an icon you can click on to select
the IK handle that the end effector belongs to.
2 Select the Show Manipulator Tool.
3 Select the pole vector.
Note that the triangular object in the rotation disc is not the pole vector. That
object is the plane indicator. The plane indicator indicates the orientation of
the joint chain plane.
4 Drag the pole vector so that it will not cross the handle vector. Preventing
the handle vector from crossing the pole vector will eliminate flipping.
The joint chain might twist while you drag the pole vector. This is because
when you change the pole vector, you change the orientation of the
reference plane. The joint chains twist is defined in terms of the difference in
degrees between the reference plane and the joint chain plane.
Sticky posing
When you position a joint chain with IK handles, you might want to stick
one or more IK handles to a location in space while you move other IK
handles. This sticking feature of IK handles is useful for positioning
characters engaging in movement where some part of the skeleton is
stationary during part of the motion. For example, your character might be
interacting with a solid object such as a floor or a step on a stairway.
When you make an IK handle sticky, the IK handle sticks as if stuck by a
piece of gum. The IK handle tends to stay stuck, but can be pulled away
depending on how you are moving the skeleton. The IK handles goal and
end effector tend to stay together, but can sometimes separate. A sticky IK
handle is indicated by a dark red sphere on the IK handles goal.
Note that sticky IK handles are only for interactive placement of a skeleton
in a keyframe. They are not active when you play an animation.
To do sticky posing:
1 Select the IK handle if not already selected.
2 Choose WindowAttribute Editor to open the Attribute Editor.
3 Open IK Handle Attributes if not opened.
4 In IK Handle Attributes, set stickiness to sticky.
The dark red sphere at the IK handles goal indicates that the IK handle is
now sticky. The IK handles goal is now set to the goals current position and
orientation for as long as the IK handle is sticky.
5 Pose the skeleton as desired. The sticky IK handle tries to keep its joint chain
always reaching for where youve stuck the IK handles goal.
Animation
Character
The seven IK spline handles
on this creature control its
neck, back, tail, and flippers.
Animation
Character
twist and roll the joint chain
slide the joint chain along the curve
translate, rotate, and scale the curve
To see the effects of animating the joint chain more clearly, bind skin to the
joint chain.
Tip
To improve speed as you play and scrub your animation, set keys only for
the CVs you animate. For instance, select the CVs, then choose KeysSet
Key.
If you use the Curve Editing Tool, select KeysSet Key-, turn on All
Manipulator Handles, and click the Save button. Thereafter when you
choose Set Key, Maya sets keys only for the necessary CVs.
Twist manipulator
Start joint
End joint
Roll manipulator
3 To roll the entire joint chain, click and rotate the circular manipulator at the
start joint.
4 To twist the joint chain, click and rotate the circular manipulator at the end
joint.
You can also adjust twist and roll by selecting the IK handle and entering
values for Roll and Twist in the Channel Box or Attribute Editor. In the
Attribute Editor, expand the IK Solver Attributes section to see these
attributes.
5 Set keys for the handles Roll and Twist attributes.
If the IK handles Solver Enable is on, the solver doesnt use the IK handles
Translate, Rotate, and Scale values as it rotates joints.
Animation
Character
selection box around the end joint of the handle. The default selection
priority ensures youll select the handle rather than the end joint.
2 Choose WindowAttribute Editor to display the Attribute Editor.
3 Expand the IK Solver Attributes section.
4 Turn on Root on Curve.
This constrains the start joint of the IK spline handle to a position on the
curve. It also provides an offset manipulator to slide the start joint along the
curve.
5 Choose ModifyTransformation ToolsShow Manipulator Tool.
The offset manipulator appears at the start joint.
Offset manipulator
at the start joint
6 Drag the manipulator to slide the joint chain along the curve.
If you drag the start joint to the end of the curve, the child joints move off
the end of the curve in a straight line.
Offset manipulator at
the end of the curve
You cannot drag the manipulator past either end of the curve.
You can also enter values for Offset in the Attribute Editor to move the start
joints offset manipulator along the curve. Try various values over 0 to get
the desired position.
Note
If you use Offset (or the offset manipulator) to animate a joint chain sliding
on a curve, the start joint might flip unexpectedly. Use Offset only for
small movements or when the start joint doesnt rotate much.
You can also use a motion path to prevent joint flipping. See Preventing
unwanted start joint flipping on page 272.
Animation
Character
1 Select the curve.
2 Use the Move, Rotate, and Scale tools to translate, rotate, or scale the curve.
If you created the handle with Root on Curve off, translating, rotating, and
scaling the curve doesnt translate the start joint.
3 Set keys for the appropriate Translate, Rotate, and Scale attributes.
Root on Curve
If you turn this option on, the start joint of the IK spline handle is
constrained to a position on the curve. You can drag an offset manipulator to
slide the start joint (and its children) along the curve.
If you turn this option off, you can move the start joint away from the curve.
The start joint is no longer constrained to the curve. Maya ignores the Offset
attribute, and no offset manipulator exists at the start joint.
Animation
Character
Root on Curve.
Note
If Root on Curve is off, the solver ignores any motion you previously
keyed with Offset. Set keys with Root on Curve off or on, not a mixture of
both.
If Root on Curve is off and you move the start joint far enough away from
the curve so that none of the joints can reach the curve, the bones point
straight at the closest point on the curve. If the curve is wavy, the joints jump
from closest point to closest point as you move the straightened joint chain
towards parts of the curve. This is correct operation.
The following figure shows a joint chain in four positions as it points
towards the closest part of the curve.
You can also turn Root on Curve on or off after you create the IK spline
handle by selecting the IK spline handle and displaying the Attribute Editor.
To display the Attribute Editor, select WindowAttribute Editor.
Animation
Character
This option creates a curve used by the IK spline handle.
If you turn on Auto Create Curve and turn off Auto Simplify Curve, the
curve passes through all the joints. This often creates so many CVs that the
curve is unwieldy to manipulate. For this reason, consider turning on Auto
Simplify Curve.
If you turn on Auto Create Curve and Auto Simplify Curve, creating the
handle automatically creates a simplified curve that has a shape similar to
the joint chain. The higher the Number of Spans, the closer the curve
matches the joint chain. The curve has a curve degree of 3 (cubic).
If you turn off Auto Create Curve, you must supply a curve for the joint
chain.
If the joint chain is part of an existing skeleton, youll typically turn this
option on. If youre using a curve as a path for sliding the joint chain, youll
typically turn this option off.
You can set Auto Create Curve in the Tool Options window only as you
create the IK spline handle.
Number of Spans
This option specifies the number of CVs in the curve as follows:
Number CVs
of Spans
1 4
2 5
3 6
4 7
Twist Type
This option specifies how the twist occurs in the joint chain:
Linear twists all parts evenly.
Ease In twists more at the end than the start.
Ease Out twists more at the start than the end.
Animation
Character
2 Choose WindowAttribute Editor to display the Attribute Editor.
3 Expand the IK Solver Attributes section.
The following attributes are displayed:
Solver Enable Turning this off disables the IK spline solver. If youve
bound skin to the joint chain, turn this option off before
returning the joint chain to the bind pose.
While this option is on, avoid moving individual joints or
you might encounter unexpected joint rotations. You also
cannot move or rotate the IK handle.
Be aware that the IK spline solver doesnt operate if there
are joint limits on any of the joints controlled by an IK spline
handle.
Note
Twist Type, Root on Curve, and Root Twist Mode are available when you
select SkeletonsIK Spline Handle Tool-.
In the Attribute Editor, Offset affects the joint chain only if you turn on
Root on Curve. For details on these attributes, see Setting options before
creating the IK spline handle on page 265.
You can prevent start joint flipping in most cases by positioning joints
appropriately when you create the joint chain. When you create each joint
after the start joint, position it roughly in its rest positionthe average
position of its entire range of motion.
Animation
Character
3 Turn on Auto Create Root Axis.
4 Select the start joint, then the end joint, and then the curve youve created.
This creates the IK spline handle with a parent transform node above the
start joint. In a subsequent step youll put the node on a motion path that
prevents the start joint flipping.
5 Select the parent transform node, then Shift-click the curve.
To select the parent transform node, drag a selection box around the start
joint.
6 Select PathsAttach to Path-.
The Attach to Path Options window appears.
7 Turn on Start/End.
8 For the Start Time and End Time, enter the frame range for the joint chains
motion.
The parent transform node and its child joint chain will move from the start
of the curve to the end of the curve in the specified frame range.
9 Turn on Follow.
If the curve has a 3D looping shape, you might also need to turn on Normal
for the Up Direction to avoid unwanted flipping.
10 Leave other options at the default settings.
11 Click the Attach button.
When you play the animation, the parent transform node and joint chain
move along the curve path. The movement will likely be free of unexpected
flipping. However, flipping is unavoidable in some complex paths.
Note that you can still roll and twist the joint chain with the IK handles roll
and twist manipulators for additional control.
If you create a handle that starts at a joint other than the skeletons root, turn
on Auto Parent Curve and turn off Auto Create Root Axis so the handles
curve and start joint move with the transformations of the parent joint.
When you manipulate a tail or neck parented to a spine, avoid moving the
first CV of the curve for the tail or neck. Move the second CV minimally,
preferably only along an imaginary line extending straight out from the end
of the spine. Manipulate the other CVs freely. This technique ensures that
the skin flows naturally where the spine meets the tail or neck.
To prevent unexpected results, Maya doesnt let you overlap the same joint
with two IK spline handles.
Do not parent the curve to the start joint. This creates a dependency graph
loop that causes the start joint to chase the curve as the curve moves. To
Animation
Character
detect such loops, use the MEL cycleCheck -all command described in the
online MEL documentation.
Do not parent the curve to a transform node that would use that same curve
as a motion path. In other words, dont turn on Auto Create Root Axis and
Auto Parent Curve if you plan to put the transform node on that curve. This
creates a dependency graph loop.
IK spline
handle
IK spline
handle
Start joint
Root joint
Handle
Animation
Character
Handle
Pelvic
region
Handle
Handle
Close-up of previous
images pelvic region
Note that you can use two rather than three handles for skeletons: one for
the tail and one for the neck and back combined.
The start joint of the tails handle and the start joint of the backs handle are
near the position of the skeletons root, but one joint below the root in the
skeletons hierarchy. This causes the IK spline joint chains to move with the
roots movement without unexpected joint flipping.
If you use this approach, turn on Auto Parent Curve when you create the
handles. This ensures the curve and joints move with the transformation of
the root.
For most creatures, using only one handle for the tail, back, and neck wont
give you adequate control.
Handle
Handle
Handle
Handle
Handle
The skeletons
root is at its tail.
Though not visible in the preceding figure, a parent transform node appears
hierarchically above the start joint of the handle on the spine.
If the creatures head or tail moves abruptly, put the skeletons root between
the spines midpoint and tail, for instance, near the pelvic region:
Handle
Handle
Handle
Animation
Handle
Character
Handle
Handle
Handle
Handle
Handle
Handle
Close-up of previous
images pelvic region
Each handles start joint in the figure is separated from the root by one joint.
None of the IK spline handles pass through the root. This causes the IK
spline joint chains to move with the roots movement without unexpected
joint flipping.
Animating IK chains
You can animate IK chains by keyframing or by using motion capture data.
Keyframing
For information on keyframing, please see Using Maya: Animation, Part 1:
Keyframe, which describes the tasks and tools for keyframing, including how
to set keys, edit key options, use the Graph Editor, use the Dope Sheet, and
use the Playblast window.
Please note the following keyframing tips for character animation:
Set a minimum number of keys
Use the Channel Box
Motion capture
For information on motion capture, please see Using Maya, Animation, Part 4:
Constraints and Motion Capture. You can have motion capture data drive the
IK handles goals, thereby posing the IK chains.
Animation
Character
Animation
or vertices) are identified as skin points and organized into skin point sets
Character
that are bound to the skeletons joints.
Understanding skinning
Skin is a geometry that has been bound to a skeleton, and skinning is the
process of binding a geometry to a skeleton. After youve built a skeleton
and exercised how that skeleton can be posed and animated, you are ready
to give the skeleton some skin. First, pose the skeleton so that it fits the
geometry properly. Next, bind the geometry to the skeleton, making the
model the skeletons skin. This skin provides the surface of your character.
In Maya, there are two ways to skin a skeleton:
Closest point skinning
Partition set skinning
Animation
Character
Whether you bind by closest point or by partition set, Maya assigns each
skin point set a color. The points in a given skin point are displayed in the
sets color. You can also have the skin point sets joint be displayed in the
skin point sets color.
Bind pose
After youve given the skeleton some skin, whe posed and animated the skin
will deform based on the skeletons action. The only pose in which the skin
is not deformed relative to the original geometry is the bind pose, which is the
pose the skeleton was in when you bound the geometry to it.
If you plan to bind additional skins to the skeleton at a later time, you will
want to be able to return easily to the pose at which the first skins were
bound (the bind pose). Maya saves bind pose information for joints at which
you bind the skin, but not joints without skin.
Binding to the skeleton from the bottom of the skeletons action hierarchy
can make it difficult to return the skeleton to its bind pose. The easiest way
to ensure that you can return to the bind pose is to always bind from the top
of the hierarchy downwards. In cases where you wish to concentrate on the
lower part of the skinning first, it is best to bind simplistic substitute skins to
the upper part of the skeletal hierarchy to ensure that Maya saves bind pose
information for the entire skeleton. Late, you can delete the substitute skins
when you are ready to bind the actual skin.
When you first bind the skin, all cluster percentages will be set to 1.0, giving
the skin a rigid look around the joints. You can apply lattice or jointCluster
flexors to smooth the transition about the joints, or modify the cluster
percentages directly using the Set Editor.
Note that because the skin is bound to the skeleton, the skins transformation
attributes are locked. If you try to manipulate the transformation attributes,
the manipulator appears gray, indicating the attributes are locked. If you
decide you want to modify the geometry that youve bound to the skeleton
as its skin, you must first unbind the skin from the skeleton. After youve
modified the geometry, you can then rebind it to the skeleton.
7 Exercise the skeleton to see how the skin point sets have been created. Note
how the skin point sets move with the joints to which they are bound. You
Animation
Character
might want to edit skin point set membership. To edit set membership, see
Using Maya: Hypergraph, Sets, and Expressions.
Maya binds the selected partitions sets to the skeleton, with each set bound
to the nearest joint.
Note that because the skin is bound to the skeleton, the skins transformation
attributes are locked. If you try to manipulate the transformation attributes,
the manipulator appears gray, indicating the attributes are locked. If you
decide you want to modify the model that youve bound to the skeleton as
its skin, you must first unbind the skin from the skeleton. After youve
modified the geometry, you can then rebind it to the skeleton.
7 Exercise the skeleton to see how the skin point sets have been created. Note
how the skin point sets move with the joints to which they are bound. You
might want to edit skin point set membership. To edit set membership, see
Using Maya: Hypergraph, Sets, and Expressions.
Animation
Character
1 Select any joint on the skeleton.
2 Choose SkinningGo to Bind Pose.
The skeleton assumes the pose it had during skinning, when the geometry
was bound to the skeleton.
If possible, the skeleton assumes the pose it had during skinning, when the
geometry was bound to the skeleton. It may not be possible for Maya to
move the skeleton to the bind pose. Constraints, keyframed IK Handles, IK
Handles using the spline solver, locked attributes and expressions can all
create situations where a skeleton is unable to go to the bind pose. If the
skeleton is unable to move to the bind pose, you will receive an error
message saying: Error: Could not reach bindPose due to
constraints, expressions, or keyframed handles. When this
happens, a quick way to allow the skeleton to reach the bind pose, is to
disable the source of the conflict:
3 Choose ModifyDisable NodesAll.
Maya only stores the bind pose for joints which have skin attached. It is best
to always bind skin from the top-down so that there are no joints above the
bound skin that do not have skin attached. Otherwise, going to the bind
pose may cause your skeleton or skin to become distorted. For this reason , it
is best to have all of the skeleton and skins displayed when you go to the
bind pose. If either the skeleton or the skins are distorted, undo, and
consider resetting the skeletons bind pose to a new position.
Animation
Character
must detach the skin in preserve skin groups mode. If you detach the skin
using the standard detach option, you must reattach the skin by
reperforming the bind skin operation.
Animation
Character
Animation
Character
For more information about Mayas basic deformer tools, please see Using
Maya: Animation, Basic Deformers.
This chapter describes flexors. Using flexors includes the following:
Understanding flexors on page 296
Creating lattice flexors on page 301
Positioning lattice flexors after creation on page 302
Editing joint lattice flexor attributes on page 302
Editing bone lattice flexor attributes on page 313
Creating sculpt flexors on page 324
Editing sculpt flexor attributes on page 325
Understanding flexors
Flexors are high-level deformers that deform skin based on how a skeleton
moves. There are three types of flexors:
Lattice flexors (joint lattice flexors and bone lattice flexors)
Sculpt flexors (joint sculpt flexors and bone sculpt flexors)
Cluster flexors (joint cluster flexors only)
Lattice flexors
Lattice flexors are tools for deforming the skin around joints and the bones
of joints. They can smooth or wrinkle skin around joints and provide muscle
definition around bones. You could use a joint lattice flexor to ease and
smooth the skin around a joint as it bends, or you could use a bone lattice
flexor to show bulging muscles around the bones of joints.
Animation
Character
Skin bending around joint without lattice flexor (note creases)
Skin bending around joint with lattice flexor (note smoothed crease)
Sculpt flexors
Sculpt flexors provide a way to create various types of bulges and dips in a
characters skin.
Animation
Character
Sculpt flexors are ideal for deformations such as muscle bulges, knee cap
action, or elbow cap action. You can create sculpt flexors at joints (joint sculpt
flexors) or at the bones of joints (bone sculpt flexors).
Cluster flexors
Cluster flexors can provide realistic smoothing effects by allowing you to
control the points in a skin point set around a joint with varying percentages
of influence.
To understand cluster flexors, you need some background on the role of the
basic cluster deformers in the skinning process. When you skin a skeleton,
the skin points are organized into a partition of sets called skin point sets. A
skin point set is created to correspond to each joint and bone combination.
Also automatically created for each skin point set is one of Mayas basic
deformers, the cluster deformer. Cluster deformers that enable skinning are
called joint cluster deformers. A joint cluster deformer is what glues a skin
point set to a joint-and-bone combination so that the skin moves with the
skeleton. A joint cluster deformer is like a basic cluster deformer except that
it acts specifically on a skin point set. (For more information on basic cluster
deformers, please refer to Using Maya: Animation, Basic Deformers.)
Cluster flexors are high-level tools that provide you with a way to
manipulate joint cluster deformers. Cluster flexors can be created only at
joints (joint cluster flexors only) because they control joint cluster deformers.
Animation
Character
To create a lattice flexor at a joint or bone:
1 Put the skeleton in bind pose by clicking any joint or bone and choosing
SkinningGo to Bind Pose.
Its possible to create a flexor on a skeleton thats not in the bind pose, but
its not recommendedyou might get unexpected results.
2 Select the joint or joints on which you want to create a joint flexor. To create
a bone flexor, select the parent joint of the bone. To create flexors on all joints
or bones, select any joint on the skeleton.
3 Choose SkinningCreate Flexor... .
The Create Flexor window is displayed.
4 From the Flexor Type: pull-down menu, choose lattice.
5 To create one or more joint lattice flexors, use the Joints box. In the Joints
box, click At Selected Joint(s) to create flexors only at the selected joints, or
click At All Joint(s) to create flexors at all the skeletons joints.
6 To create one or more bone lattice flexors, use the Bones box. In the Bones
box, click At Selected Bone(s) to create flexors only at the bones of the
selected parent joints, or click At All Bone(s) to create flexors for all the
bones.
7 To specify the divisions of the lattice, use the Lattice Options box. The
default is 2 S divisions, 5 T divisions, and 2 U divisions. You can enter new
numbers for the divisions or use the sliders. The greater the number of
divisions, the smoother the deformation effect; the smaller the number of
divisions, the faster the performance.
8 Click Position the flexor if you want to adjust the location of the lattice
flexor before closing the Create Flexor window.
9 If you would like to move, rotate, or scale the flexor without worrying about
deforming the skin, you can do so now. Click Position the Flexor. Then
choose one of the transform tools (move, rotate, or scale) and change the
flexors position.
10 To create the lattice flexor(s), click OK.
Once you have created the lattice flexors, you edit them to control how they
deform the skin. To edit joint lattice flexors, see Editing joint lattice flexor
attributes on page 302. To edit bone lattice flexors, see Editing bone lattice
flexor attributes on page 313.
Animation
Character
Flexors dont deform skin in the bind pose. To see the effects of flexors, you
must view the skeleton in another pose.
2 Select a joint lattice flexor.
3 Choose WindowAttribute Editor... .
The Attribute Editor is displayed. In the Attribute Editor, you can modify
the attributes of lattice flexors on joints to create specific effects.
Editing creasing
The creasing attribute affects the bulging of a joints point groups on the
inside of a bend. When you enter a creasing value, the flexor points on the
inside of the bend move inward or outward to change the shape of the
bulge.
A positive creasing value causes the skin to bulge outward.
A negative creasing value causes the skin to tuck inward.
To edit creasing:
1 View the joint lattice flexors attributes in the Attribute Editor.
Editing rounding
Rounding affects the bulging of a joints point groups on the outside of a
bend. When you enter a rounding value, the flexor points on the outside of
the bend move outward or inward to change the shape of the bulge.
A positive rounding value causes the skin to bulge outward.
A negative rounding value causes the skin to bulge inward.
The following figures illustrate positive and negative rounding:
Animation
Positive rounding effect with joint lattice flexor Character
To edit rounding:
1 View the joint lattice flexors attributes in the Attribute Editor.
2 In Rounding, enter a new value or use the slider. A positive rounding value
causes the skin to bulge outward, and a negative rounding value causes the
skin to bulge inward.
Note that you can also edit the rounding attribute from the Channel Box.
Editing length in
The Length In attribute affects the locations of flexor points along the joints
point group around the upper bone. When you enter a Length In value, the
flexor planes along the upper bone move away from or towards the joint.
A positive Length In value causes the lattices to move away from the joint,
spreading the bend effect up the upper bone.
A negative Length In value causes the lattices to move towards the joint,
making the bend effect more local to the joint.
When you change the Length In value, you modify the regions affected by
the round, crease, and width effects.
The following figures illustrate positive and negative length in effects.
Animation
Character
Positive length in effect with joint lattice flexor
Animation
Character
Positive length out effect with joint lattice flexor
Animation
Character
Negative width left effect with joint lattice flexor
2 In Width Right, enter a new value or use the slider. A positive value causes
the skin to bulge outward, and a negative value causes the skin to bulge
inward.
Note that you can also edit the width right attribute from the Channel Box.
Animation
Character
Editing length in on page 314
Editing length out on page 316
Editing width left on page 318
Editing width right on page 311
Editing bicep on page 321
Editing tricep on page 322
Editing length in
The Length In attribute affects the locations of flexor points along the bones
point group. When you enter a Length In value, the flexor planes move
away from or towards the center of the bone.
A positive Length In value causes the lattices to move away from the center,
spreading the bend effect to a greater area of the bone.
A negative Length In value causes the lattices to move towards the center,
making the bend effect more localized.
By changing the Length In value, you can lengthen or shorten the bulging
created by the other deformation parameters.
The following figures illustrate no effect, positive length in effect, and
negative length in effect.
Animation
Character
No length in effect with bone lattice flexor
The following figures illustrate positive and negative length out effects.
Animation
Character
Positive length out effect with bone lattice flexor
Animation
Character
Negative width left effect with bone lattice flexor
Editing bicep
Bicep affects the bulging of a bones point group on the inside of a bend.
When you enter a Bicep value, the flexor points on the inside of the bend
move outward or inward to change the shape of the bulge.
A positive Bicep value causes the skin to bulge outward.
A negative Bicep value causes the skin to bulge inward.
The following illustrate positive and negative bicep effects.
Animation
Character
Positive bicep effect with bone lattice flexor
To edit bicep:
1 View the bone lattice flexors attributes in the Attribute Editor.
2 In the Attribute Editor, choose Extra Attributes.
3 In Bicep, enter a new value or use the slider. A positive value causes the skin
to bulge outward, and a negative value causes the skin to bulge inward.
Note that you can also edit the bicep attribute from the Channel Box.
Editing tricep
The Tricep attribute affects the bulging of a bones point group on the
outside of a bend. When you enter a Tricep value, the flexor points on the
outside of the bend move outward or inward to change the shape of the
bulge.
A positive Tricep value causes the skin to bulge outward.
A negative Tricep value causes the skin to bulge inward.
The following illustrate positive and negative tricep effects.
Animation
Character
Positive tricep effect with bone lattice flexor
To edit tricep:
1 View the bone lattice flexors attributes in the Attribute Editor.
2 In the Attribute Editor, choose Extra Attributes.
3 In Tricep, enter a new value or use the slider. A positive value causes the
skin to bulge outward, and a negative value causes the skin to bulge inward.
Note that you can also edit the tricep attribute from the Channel Box.
Animation
Character
Once you have created the sculpt flexors, you manipulate them to deform
the skin when the joints move. See Joint-driven sculpting on page 325.
Joint-driven sculpting
To have a joints attributes drive the sculpt deformation, use the Set Driven
Key tool. (For more information on Set Driven Key, please refer to Using
Maya: Animation, Keyframe.)
Animation
Character
During skinning, cluster deformers are automatically created to bind skin
point sets to joints. These cluster deformers that bind skin point sets to joints
are called joint clusters. Joint clusters indicate their deformation effects on
skin point sets by their drop-off values. The drop-off values are percentage
values that indicate the range and magnitude of the deformation effects. By
controlling the range and magnitude of drop-off, you can control the
smoothness of skin around a joint.
Cluster flexors provide a way for you to manipulate the drop-off directly.
Rather than having to specify actual values for the percentages, you can use
the cluster flexors manipulators to edit the deformation effects.
5 Click the boxes under Joints to indicate where you want to position the
flexor or flexors: at selected joints or at all joints.
Except for simple cases, you will probably want to adjust the cluster to
position it and change the percentages for the best effect on the skin bending
around the joint.
6 Click Create.
Cluster flexors are created at the selected joints.
7 Open the Hypergraph by choosing WindowHypergraph... .
The Hypergraph will indicate the cluster flexor(s) as a jointFlexor with a
number appended. The number indicates the order in which the flexors have
been created.
When you select the cluster flexor, note that a J is displayed near the
cluster flexors joint.
Animation
Character
Cluster flexor manipulator rings
Each ring includes two manipulators: a diamond manipulator and a radial
manipulator.
Diamond
manipulator
Radial
manipulator
Animation
Character
Radial manipulator (selected)
Located on the ring, the radial manipulator controls the magnitude of
smoothing. The radial manipulator controls the magnitude of drop-off of the
joint clusters acting on the skin point sets bound to the current joint and the
current joints parent joint.
A C D
animating characters dampening
characters 11, 27 animating 27 joints 67
IK chains 124 deforming 25 Degrees of Freedom 52, 60
keyframing 124 flexors 25 dependency graph loops
motion capture 125 geometry 12 IK spline 112, 119
necks, tails, spines 103 modeling 12 diamond manipulator 173
with skin and skeleton skeletons 14
Disconnect Joint 49
groups 136 skinning 22, 127
attributes child joints 16, 33
editing joints 55
setting IK spline handle 115
closest point
binding by 130
E
Auto Create Curve 113 cluster flexors 25, 143 end effectors 76, 79
Auto Create Root Axis 112, 122 creating 171 displaying 84
Auto Joint Limits 54 editing attributes 172 end joints 35, 74, 76, 78
Auto Joint Orient 53 editing with manipulators 175
Auto Parent Curve 122 manipulators 172
Auto Simplify Curve 113 Connect Joint 46 F
Autopriority 87 control vertices (CVs) 22
fish
creating
animating with IK spline 118,
cluster flexors 171
122
B IK chains 83
IK handles 82 flexors 25, 140
IK spline handle 103 cluster flexors 25, 143
ball joints 52, 60
joint chains 36 lattice flexors 25, 140
Bicep deformation 165
joints 36 sculpt flexors 25, 142
bind pose 133
lattice flexors 145 flipping
reseting 133
parent transform with IK eliminating in rotate plane
returing to 133
spline 112 (RP) solver IK handles 101
binding by closest point 130 preventing IK spline start
sculpt flexors 168
binding by partition set 131 joint 116
Curve Editing Tool 105
binding multiple objects 132 flipping in motion path
curves
bone lattice flexors 145 auto-creating with IK spline preventing IK spline start
bones 14 handle 113 joint 117
bone lattice flexors 145 auto-simplifying with IK spline forward kinematics 20, 70
compensating scale 54, 64 handle 113
Index
K N reference planes 80
Remove Joint 42
keyframing 124 Number of Spans 113, 114 Reroot Skeleton 50
minimum keys 124 rerooting skeletons 50
using Channel Box 124 rolling
kinematics 70 O IK spline handle 106
root joints 18, 32
offset
Root on Curve 107
L IK spline handle 108
overlapping Root Twist Mode 114
lattice flexors 25, 140 IK spline handle joints 119 Rotate Damp Range 68
bone lattice flexors 145 Rotate Damp Strength 68
creating 145 rotate plane (RP) solvers 77
editing bone lattice flexor
attributes 157
P behavior 81
end effectors 79
editing joint lattice flexor parent joints 16, 33 end joints 78
attributes 146 partition set goals 79
joint lattice flexors 145 binding by 131 handle vectors 79
positioning 146 partitions 22 handle wires 78
Length in deformation 150, 158 pelvic region joint chain planes 79
Length out deformation 152, 160 positioning skeleton root plane indicators 80
limbs 17, 34 in 123 pole vectors 80
mirroring 45 plane indicators 80 reference planes 80
limits PO weight 90 rotation discs 80
joint limits 64 start joints 78
points 22
twist discs 80
skin point sets 22
skin points 22 rotation discs 80
M pole vectors axis Rounding deformation 149
displaying 84
Mirror 45
pole vectors 80
Mirror Across 45
posing S
Mirror Joint 45
IK chains 100 Scale Compensate 54
mirroring 43 sticky posing 102
sculpt flexors 25, 142
modeling 12 Power Animator creating 168
motion capture 125 IK spline twisting in Maya 114 editing attributes 169
motion paths Preferred Angle 61 joint-driven sculpting 169
Index
setting keys
IK spline handle 106
Snap Curve To Root 113
Snap Enable 88
V
single chain (SC) solvers 75 Solver Enable 88 vertices 22
behavior 77 IK spline handle 115
end effectors 76 spline solvers 81
end joints 76
goals 77
start joint flipping W
in motion path 117
handle vectors 77 Width left deformation 154, 162
preventing IK spline 116
handle wires 76 Width right deformation 155, 163
start joints 35, 74, 76, 78
start joints 76
stickiness 102
sinuous motion
IK spline handle 122 Sticky 89
sticky posing 102
Z
skeletons 14, 32
animating 14 Stiffness 62 zero rotation
building 14, 31 IK spline joint orientation 116
combining 46
construction strategies 50 T
disconnecting 49
flexors 25 tips
mirroring 45 building skeletons with
grid 32
posing 14
IK chain length 35
rerooting 50
IK chains with rotate plane
skinning 22, 127
(RP) solvers 81
viewing hierarchy outline 39
IK chains with single chain
skin (SC) solvers 77
binding 127 IK spline handle creation 118
skin point sets 22 skeletons with many limbs 34
skin point sets 22 using mirroring to create
displaying colors 134 limbs 43
editing 134 tool options
skin points 22 IK spline handle 109
skinning 22, 127 transforming
binding by closest point 130 IK spline handle curve 109
binding by partition set 131 Tricep deformation 166
binding multiple objects 132
twist discs 80
detaching skin 134
displaying 84
reattaching skin 134
Twist Type 115
sliding
twisting
joint chain along curve 107
IK spline handle 106
snakes
animating with IK spline 118,
122
Editors: James A. Compton, Marilyn Smith, Jeff Gammon, Pat Coleman, Pete Gaughan
Copyright 2000 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights
reserved. No part of this publication may be stored in a retrieval system, transmitted, or reproduced
in any way, including but not limited to photocopy, photograph, magnetic or other record, without
the prior agreement and written permission of the publisher.
Copyright 2000 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights
reserved. The authors created reusable Maya scripts and project files in this publication expressly
for reuse by readers. Sybex grants readers permission to reuse for any purpose the code found in
this publication or its accompanying CD-ROM so long as authors are attributed in any application
containing the reusable code and the code itself is never distributed, posted online by electronic
transmission, sold or commercially exploited as a stand-alone product. Aside from this specific
exception concerning reusable scripts and project files, no part of this publication may be stored in
a retrieval system, transmitted, or reproduced in any way, including but not limited to photocopy,
photograph, magnetic or other record, without the prior agreement and written permission of the
publisher.
The CD Interface music is from GIRA Sound AURIA Music Library GIRA Sound 1996.
TRADEMARKS: SYBEX has attempted throughout this book to distinguish proprietary trademarks
from descriptive terms by following the capitalization style used by the manufacturer.
The author and publisher have made their best efforts to prepare this book, and the content is
based upon final release software whenever possible. Portions of the manuscript may be based
upon pre-release versions supplied by software manufacturer(s). The author and the publisher
make no representation or warranties of any kind with regard to the completeness or accuracy of
the contents herein and accept no liability of any kind including but not limited to performance,
merchantability, fitness for any particular purpose, or any losses or damages of any kind caused or
alleged to be caused directly or indirectly from this book.
ISBN: 0-7821-2521-2
10 9 8 7 6 5 4 3 2 1
The media and/or any online materials accompanying this book that are available now or in the
future contain programs and/or text files (the Software ) to be used in connection with the book.
SYBEX hereby grants to you a license to use the Software, subject to the terms that follow. Your
purchase, acceptance, or use of the Software will constitute your acceptance of such terms.
The Software compilation is the property of SYBEX unless otherwise indicated and is protected by
copyright to SYBEX or other copyright owner(s) as indicated in the media files (the Owner(s) ).
You are hereby granted a single-user license to use the Software for your personal, noncommercial
use only. You may not reproduce, sell, distribute, publish, circulate, or commercially exploit the
Software, or any portion thereof, without the written consent of SYBEX and the specific copyright
owner(s) of any component software included on this media.
In the event that the Software or components include specific license requirements or end-user
agreements, statements of condition, disclaimers, limitations or warranties ( End-User License ),
those End-User Licenses supersede the terms and conditions herein as to that particular Software
component. Your purchase, acceptance, or use of the Software will constitute your acceptance of
such End-User Licenses.
By purchase, use or acceptance of the Software you further agree to comply with all export laws
and regulations of the United States as such laws and regulations may exist from time to time.
Software Support
Components of the supplemental Software and any offers associated with them may be supported
by the specific Owner(s) of that material but they are not supported by SYBEX. Information
regarding any available support may be obtained from the Owner(s) using the information provided
in the appropriate read.me files or listed elsewhere on the media.
Should the manufacturer(s) or other Owner(s) cease to offer support or decline to honor any offer,
SYBEX bears no responsibility. This notice concerning support for the Software is provided for your
information only. SYBEX is not the agent or principal of the Owner(s), and SYBEX is in no way
responsible for providing any support for the Software, nor is it liable or responsible for any support
provided, or not provided, by the Owner(s).
Warranty
SYBEX warrants the enclosed media to be free of physical defects for a period of ninety (90) days
after purchase. The Software is not available from SYBEX in any other form or media than that
enclosed herein or posted to www.sybex.com. If you discover a defect in the media during this
warranty period, you may obtain a replacement of identical format at no charge by sending the
defective media, postage prepaid, with proof of purchase to:
SYBEX Inc.
Customer Service Department
1151 Marina Village Parkway
Alameda, CA 94501
(510) 523-8233
Fax: (510) 523-2373
e-mail: [email protected]
WEB: HTTP://WWW.SYBEX.COM
After the 90-day period, you can obtain replacement media of identical format by sending us the
defective disk, proof of purchase, and a check or money order for $10, payable to SYBEX.
Disclaimer
SYBEX makes no warranty or representation, either expressed or implied, with respect to the
Software or its contents, quality, performance, merchantability, or fitness for a particular purpose. In
no event will SYBEX, its distributors, or dealers be liable to you or any other party for direct,
indirect, special, incidental, consequential, or other damages arising out of the use of or inability to
use the Software or its contents even if advised of the possibility of such damage. In the event that
the Software includes an online update feature, SYBEX further disclaims any obligation to provide
this feature for any specific duration other than the initial posting.
The exclusion of implied warranties is not permitted by some states. Therefore, the above
exclusion may not apply to you. This warranty provides you with specific legal rights; there may be
other rights that you may have that vary from state to state. The pricing of the book with the
Software by SYBEX reflects the allocation of risk and limitations on liability contained in this
agreement of Terms and Conditions.
Shareware Distribution
This Software may contain various programs that are distributed as shareware. Copyright laws
apply to both shareware and ordinary commercial software, and the copyright Owner(s) retains all
rights. If you try a shareware program and continue using it, you are expected to register it.
Individual programs differ on details of trial periods, registration, and payment. Please observe the
requirements stated in appropriate files.
Copy Protection
The Software in whole or in part may or may not be copy-protected or encrypted. However, in all
cases, reselling or redistributing these files without authorization is expressly forbidden except as
specifically provided for by the Owner(s) therein.
To our families and friends (especially Philip, Michele, Kristin, Joshua, and Kenlee), whose love,
insight and countless hours of sacrifice have made this book possible.
Acknowledgments
A book like this doesn t appear by smoke and mirrors, but by the hard work and dedication of a
great number of people. While everyone who had any part in this book deserves credit, we have
room to mention only a special few.
First, we d like to thank the hard-working, inspired people at Alias|Wavefront for making such
fantastic tools for us. We are especially indebted to Chris Ford, Mark Sylvester, Duncan
Brinsmead, Russell Owen, Jackie Farrell, Sharon Zamora, Mike Stivers, Katriona Lord-Levins,
Tracy Hawken, and Vic Fina. Their contributions to this book have been invaluable.
We are privileged to thank Ellen Pasternack and Habib Zargarpour from Industrial Light & Magic,
who were always willing to help, and went beyond the call of duty with their time and effort, and
also Don Davidson of New Jersey Newsphotos, for his eternal faith and patience.
We would also like to thank the acquisitions, editorial, and production team assembled by Sybex for
their insightful, timely, and professional management of the evolving work, especially Jim Compton,
Cheryl Applewood, Mark Smith, and Adrienne Crew. Marilyn Smith, Jeff Gammon, Pat Coleman,
and Pete Gaughan also contributed greatly to the editing. On the production side, Robin Kibby, Lisa
Reardon, Teresa Trego, Molly Glover, and Jennifer Campbell displayed their usual skill and
resourcefulness in turning the edited manuscript into a finished book. Keith McNeil, Kara Schwartz,
and Ginger Warner made the companion CD-ROM a reality.
Thanks also to our agency, Studio B Literary Agency, who made the contracts go smoothly and
were our champions from day one, especially Neil Salkind and Sherry Rogelberg.
Without the generous support and freedom our employers have given us, this book could never
have been written. A special thanks to Richard Silver of Cambridge Electronics and the staff at The
Lighthouse. We would also like to thank the faculty and staff of two fine universities, California
Lutheran University, and the University of North Carolina at Asheville, especially the late Dr.
Jonathon Boe, Michael Arndt, Mike Adams, Joan Wines, Tom Cochran, and Jim Pitts.
Our loved ones have been with us throughout this book s production, and have given their time
and energy to this work as much as we have. From this large group, we would like to give special
thanks to Joan and Lee Gibbs, Michele Harovas, Marilyn Harovas, and the late Philip Harovas,
Peter Lee s parents, Melanie and Jim Davis, and Kristin, Joshua, and Kenlee Kundert-Gibbs.
Foreword
Welcome to the wonderful world of Maya. Little did I realize fifteen years ago that I would be writing
the foreword to a book about a product that is the result of an idea I had in 1984 to do something
with computers and art.
I can imagine how excited you must be. You have the book, the software, and a hot computer; and
now you are going to get busy and educate yourself in the many disciplines that it takes to be an
accomplished Maya animator. Good luck to you. The investment you are about to make in yourself
is worth every minute you put into it and every hour, week, weekend, and holiday that you work
through as you babysit that final render or rush to make a 9 a.m. deadline. There are thousands of
people just like you who have dedicated themselves to becoming world-class experts at Maya. This
book is now a part of your continuing education program.
When we started Wavefront in 1984, we had a vision of how an artist would use our tools to create
amazing images. That vision attracted many like-minded people to our way of doing things.
Coincidentally, during that same spring in 1984, two other companies were having the same
conversations: in Paris the early developers of Explore from Thomson Digital Images (TDI), and in
Toronto the founding team at Alias Research. Each of the companies had attracted like-minded
artists and animators that gravitated to our approach to the computer graphics problem. Now those
various methodologies, features, functions, and workflows are represented in our next-generation
application, Maya.
Maya is the combination and, in many ways, a culmination of hundreds of man years of effort at
creating a computer graphics system that meets the demanding requirements of users from the
ultrahigh-end film studios to the start-up animation companies that are springing up in garages
around the planet. Maya effectively brings together the best thinking of all three systems plus new
technologies, workflow, and usability features that were impossible to imagine fifteen years ago.
There is a lot here to learn. Nevertheless, diligence, patience, and an open attitude will help you
succeed as you go through the exercises in this book. Challenge yourself.
Learning Maya is a lot like learning the Japanese game of GO. They say it takes minutes to learn
and a lifetime to master. You can get through the Alias|Wavefront tutorials in a couple of days.
However, that just gets you to beginner status. You obviously want to improve your skills beyond
this you purchased Mastering Maya Complete 2 to move beyond Maya s beginning tutorials.
Your ability to utilize the skills that you learn in this book in creative ways will enable you to develop
unique solutions to your future graphics problems. It is only after years of grappling with tough
visual problems that you achieve expert status. Remember, there are usually more than a few ways
to solve the same problem within Maya. Everything can be combined with everything else, and this
is one of the most powerful aspects of the software.
This book will get you acquainted with Maya Complete Version 2. When we started work on Maya
in 1995, after the merger of Alias and Wavefront, we wanted to deliver a software system that
would change the way computer animation was created by challenging established ways of
working even those we pioneered ourselves. In Version 1, we set our goals high, and we met most
of them. Version 2 now completes our original design plans for the software and its architecture.
Software is never actually done, just as a great painting always seems to need just a little more if
I only had the time.
I had the chance to review a few of chapters of this book while they were still being edited,
somewhat like getting a look at Alpha software. The great thing about a book not written by a
product s manufacturer is that certain liberties can be taken by the authors. They can have fun
with the lessons and their comments. I am sure you will appreciate the tone the book uses as you
are led though lessons that will reinforce your knowledge of each of the various aspects of Maya.
The lessons build upon themselves, which is great for taking you through the process
incrementally. I have always enjoyed learning this way. The best part of the book is the enclosed
CD. This way, you know you have a safety net; if you make a mistake, you can always reload the
lesson examples.
Once you have gotten a good feel for the software and its potential, it will be time to meet others
who share your enthusiasm for Maya. Internet news groups, online chats, Maya rings, and the
various Alias|Wavefront and Maya Web sites are all good forums to meet others and discuss
specific aspects of the software, its uses, and how much this book helped you in getting more out
of the software. I encourage you to take time regularly to interact with other users. See if there is a
user group in your community and make sure you plan a trip to Siggraph each year for the Global
Users Association s annual meeting.
Well, enough about how great life will be once you have learned Maya; it is time to get to work and
start exercising your gray cells. I hope that this book becomes just one more part of your
investment in lifelong learning and continuing education. This is just the beginning. Have fun. I still
do every day!
Mark Sylvester
Ambassador
Alias|Wavefront
November, 1999
Introduction
Introduction
Maya a word full of mystery, wonder, and power. It conjures up all sorts of imagery. Not
coincidentally, so does the software, which can be a magical imaging tool. But as with any other
tool, making magic requires an artist who knows the proper way to use that tool.
In Mastering Maya Complete 2, you will learn how to use Maya to create images that the rest of us
have never seen before. How can we be sure of that? Because you are unique, with your own life
experiences, point of view, and artistic flair. We can guarantee that no one has seen the images
you will create, because they come from YOU.
The point to reading this book is to give yourself the knowledge you need to use this tool called
Maya to the best of your ability. Then, and only then, will the imagery you create come closer to
what you see in your mind.
Mastering Maya Complete 2 is a comprehensive, practical guide to every aspect of the program.
You ll begin with a tour of the user interface and its tools for optimizing your workflow. Then you ll
learn the basics of computer modeling and the major types of modeling available in Maya: NURBS,
polygon, and organic. You ll work through the stages of animation and rendering, and you ll learn
to use the MEL scripting language. In the last group of chapters, you ll work with some of Maya s
most advanced tools, including its particle dynamics. Finally, you ll be introduced to the amazing
Paint Effects module, which is new in Maya 2.5.
Introduction
To implement this approach, we ve created a fully integrated book and CD-ROM. The companion
CD includes working files Maya project files, sketches, TIF images, and MEL scripts that will get
you started with each exercise, as well as rendered images and animations you can use to check
your progress as you go. (The CD also includes some illustrations that are best viewed in color,
and bonus material, as described at the back of the book.)
Nearly every exercise is intended to create production-quality finished work, but most of them can
be done by anyone who has a little experience with 3D software and some patience and
persistence. You don t need to be an accomplished draftsperson, but you do need to work with
care. And you should be willing to step away from a project and come back to it when you are
ready. A few exercises are intended for more advanced users and are identified that way.
Even though some projects begin in one chapter and continue in another, you don t need to read
the whole book straight through from beginning to end. (Of course, we like to think that once you
start, you ll find it hard to stop.) As with any how-to book, you can focus on the subjects that
interest you or the tasks you need to accomplish first, particularly if you are already working at an
intermediate level.
Introduction
If you are a relative beginner, or if you are self-taught and feel that your background in the
fundamentals has a few holes in it, you should start from the beginning and work through the first
half of the book. Here you will learn how to create a human model from the ground up, texture it,
add a skeletal control system (IK) to it, and animate and render it. You will also learn how to
populate your world with objects that behave as they do in the real world.
Users at the intermediate level will find plenty of interest beyond the fundamentals. Two chapters
introduce the MEL scripting language, giving you enough of a foundation to get started learning
how to harness the full power of Maya and make the software handle repetitive operations for you.
As you ll see, you don t need to learn the entire scripting language in order to customize your
workspace for automation and efficiency. The last five chapters provide an in-depth look at the
advanced topic of particle dynamics and a hands-on introduction to Maya s newest and most
powerful tool, Paint Effects.
In fact, if you re beyond the absolute beginner stage, you can find valuable information in
practically every chapter. Scan through the Table of Contents to find the topics you re most
interested in, or check the What s New in Maya 2 notes to see what new features are covered
in a chapter. Again, everyone who tries out the exercises will find a wealth of fun, useful,
educational, and sometimes dazzling projects.
Note As an added attraction, and to inspire you to create dazzling work of your own, we ve
collected 16 pages of some of the most beautiful color illustrations created in Maya.
You ll see artwork developed in the exercises, along with pictures and animation stills
created by the authors and other Maya artists, with hints about the Maya tools they
used.
Introduction
Part I: Maya Fundamentals introduces Maya and its tools with the following topics:
Chapter 1: Your First Maya Animation uses a hands-on example building and launching a
rocket ship to introduce the basic elements of Maya: modeling, texturing, lighting, animation,
dynamics and rendering. This provides a good foundation if you aren t accustomed to using Maya.
Next we explore the Maya interface further in Chapter 2: The Maya Interface. We look in depth at
the elements that make up models and windows, and the various menus and interfaces you ll
work with.
In Chapter 3: Techniques for Speeding Up Workflow, we introduce Maya tools that allow you to
work efficiently, with the largest amount of screen real estate and in the fastest way.
Chapter 4: The Hypergraph: Your Roadmap to a Scene shows how the Hypergraph (or
dependency graph) gives Maya its power. The Hypergraph is the heart of Maya, bringing together
all of its elements. Don t underestimate its power and simplicity.
Chapter 5: Modeling Basics uses simple objects to introduce basic modeling concepts and Maya
s way of implementing them. The example projects are a great way to learn about construction
history.
In Chapter 6: NURBS Modeling we open up the world of NURBS modeling, showing what
elements make up a NURBS surface, how to edit them, and finally how to apply these concepts by
modeling an aftershave bottle. As we introduce more tools, you ll create a more advanced
aftershave bottle, and finally a human face.
Chapter 7: Polygon Modeling explores the basic ingredients that make up a polygonal model and
how to edit them. Extrusions, UV mapping, edge smoothing and model smoothing are also
explored. The hands-on project is the creation of a human hand in polygons.
All the work you ve done so far leads up to Chapter 8: Organic Modeling. In this chapter, we
show you how to take a dog from a sketch to a finished model.
Chapter 9: Working with Artisan, is a guided tour of Artisan. You ll learn why it s such a useful
set of tools and what you can do with it besides just denting your models, and you ll get a
preview of MEL scripting in Artisan s MEL script painting function.
Part III: Animation shows how to add motion to models you ve created:
In Chapter 10: Animating in Maya you will get started creating, controlling, and editing animation
in Maya. We take our human model further by using Set Driven Keys to control our polygonal
human hands fingers.
In Chapter 11: Paths and Bones you are introduced to setting up skeletons correctly the first time,
and you ll learn how to animate cameras and objects properly and quickly, with motion paths.
Chapter 12: Deformers and Chapter 13: Skinning and Character Setup show you how to use
deformers to add secondary animation to your Inverse Kinematics (IK) characters, and also how to
use these deformers to create facial expressions and phonemes.
Chapter 14: Character Animation: a Walk Cycle and More introduces and explains walk cycles,
showing how to add emotion to your character s movements. You ll also learn how to animate
run cycles, catching and throwing a ball, and more complex movements such as somersaults.
In Chapter 15: Working with Rigid Body Dynamics you will learn what rigid bodies are and how
to control them, how to use fields and forces for different results, and how to bake the animation
when you are done, speeding up interactivity and ensuring that no discrepancies occur while batch
rendering.
Part IV: Working with MEL shows how to make the Maya Embedded Language work for you,
even if you re not a programmer:
Chapter 16: MEL Basics is a jumping-off point for beginning MEL users, ending with examples
that put the theories into practice.
Chapter 17: Programming with MEL takes MEL scripting further, showing you how to create,
debug, and edit MEL scripts and MEL interfaces.
Part V: Rendering takes you through the details of producing rendered images and animations:
Chapter 18: Rendering Basics explores the way Maya defines a rendered image, how to use
Interactive Photorealistic Rendering (IPR), image planes, and Depth of Field. You will also learn
how to set up renders that allow for changes to be made quickly and without rerendering the entire
animation.
With Chapter 19: Shading and Texturing Surfaces you will learn how to texture surfaces right the
first time, and how to create effects with layered shaders that would be hard or impossible without
them. The examples used are those of texturing the dog model and the clothing and skin of the
child model.
Chapter 20: Lighting examines the Maya lighting system, the shadow types available, effects you
can add to lights, and proper studio lighting of your subjects. You will learn how to balance speed
and quality with depth-mapped shadows and when to use raytraced shadows, as well as fog, light
color, glows and halos.
Part VI: Advanced Maya Effects extends your Maya skills to work with particles and soft bodies,
as well as the new Paint Effects tool:
In Chapter 21: Particle Basics we show you how and when to use particles, how to control them,
and give you several examples of uses for them.
Then, in Chapter 22: Particle Rendering, we show you the different ways to render particles, and
why each has its own place in your rendering pipeline.
With Chapter 23: Using Particle Expressions and Ramps we really get our hands wet with
particles, as we show you how to add expressions to grow and move the particles, as well as to
define their lifespan and what happens to them at death.
Chapter 24: Dynamics of Soft Bodies takes the particle and rigid body knowledge you have
gained, and puts it to use in soft body simulation. We cover Goal Weights, springs, contraints and
more. The chapter concludes with two great uses of soft bodies: simulated water ripples from a
fountain and a water tentacle out of science fiction.
Chapter 25: Paint Effects takes you into the world of the newest Maya tool. You will learn what it
can do and what its hundreds of attributes mean, to help you immediately understand and start
using Paint Effects. The tutorial that ends the chapter takes you step-by-step into adding real hair
to the child model, explaining how to approach it and why each step is taken.
Finally, the Appendix offers some food for thought as Perry Harovas and John Kundert-Gibbs
interview four of the leading lights in animation and computer graphics. You ll learn about how
Maya was created and the challenges it may tackle next; how the new Paint Effects tool was
developed; the philosophy behind the Maya user interface; and how Maya was used in the latest
Star Wars movie.
Introduction
Alias|Wavefront provides a Qualification Chart in the printed documentation and on its Web site
(www.aliaswavefront.com/qual_charts), certifying particular combinations of processors,
operating system versions, graphics cards, and drivers for operation with Maya NT. Be sure to
check this chart for your configuration.
Alias|Wavefront lists the following minimum hardware requirements for running Maya Complete on
Windows NT; to work at a comfortable pace, you ll probably want more processor speed, RAM,
and disk space:
" High-performance graphics card. See the Qualification Chart for current recommendations.
" Three-button mouse with mouse driver software. The Microsoft Intellimouse is not supported in
this release.
" Disk space as follows for an NTFS file system (for a FAT file system, space requirements would
be approximately doubled)
" Up to 15MB temporary space on the C: drive to start the installation program
" TCP/IP network protocol software (for Maya batch rendering and other features)
" Web browser: Netscape Navigator 3.0 or Internet Explorer 3.0 (or higher)
" Graphics card driver software (available from the card manufacturer s web site)
" Appropriate networking software and hardware if you plan to use and share files on IRIX
workstations
Introduction
What s Next?
By the time you finish this book, you ll be well on your way to mastery of Maya 2. A number of
chapters offer suggestions for further reading related to animation and 3D graphics, and the
accompanying CD contains links to some of the most important Web sites in the field. Be sure to
check the sites maintained by Perry Harovas (www.lighthousepost.com) and Sybex
(www.sybex.com) for updates and bonus material as Maya evolves.
As you work through this book and begin exploring Maya on your own, you ll probably think of
topics you d like us to cover further and other improvements we can make. You can use the Sybex
Web site to provide feedback (click the Contact link and then the Book Content Issues link to
display a form where you can type your comments) or send e-mail directly to Perry Harovas
([email protected]), John Kundert-Gibbs ([email protected]), or Peter Lee
([email protected]).
Now it s up to you to make the most of the tools that Maya offers. Have fun, and remember that
the most important tool is your own imagination!
Part Overview
Create your first Maya animation
While we won t deal with theory or do a lot of explaining in this chapter (that s what the rest of the
book is for!), if you follow along, you should get a very good idea of what Maya is about and how
you can use it in your future endeavors.
Before you start the animation in this chapter, take a few minutes to read through the Introduction
to this book. It contains information that will make it easier to work through the tutorials, and it will
give you an overview of how to best use the book to get the results you want.
If you are already familiar with other 3D animation packages, going through this chapter should get
you ready to use Maya proficiently. If you are new to the whole world of 3D animation, or if you
would like a little more grounding in the fundamentals of Maya, you may want to read Chapters 2
and 3 before reading this chapter. Those two chapters will get you up to speed on both the Maya
interface and many of the conventions of 3D animation.
While this modeling and animation project is a bit simplified, it is definitely a real world example
of work you can do in Maya. Don t get discouraged if things don t turn out well immediately
(especially if you are new to 3D modeling and animation). Remember that you can return to this
project as you progress through the book, refining your work. Given a bit of time and practice, you
should be able to get this project looking very good even if you ve never done 3D work before! To
give you an idea of what you re working toward, here s a still shot from the completed animation.
(To get the full effect, see the Chapter 1 Color Gallery on the CD).
The first step to almost any animation in Maya is to build your scene elements; therefore, we ll
build the rocket (and ground) as our first step. To build our little ship, we ll use just a couple of the
many different modeling techniques Maya has available for you.
1. First, let s create a project and save our file, so it has a home. Open Maya by double-clicking
its desktop icon. Now, from the File menu, choose File Project New. In the New Project
options window, click the Use Defaults button, type in a name for your project (something like
rocketProject) in the Scene File Locations text box, and click Accept to accept these choices.
You now have your project saved in your default directory on your hard drive. To save your
actual scene, you need to choose File Save Scene As, and then choose an appropriate
name for the file (like rocket1.ma).
Tip Your project consists of several folders (or directories) of information about the scene
(which is where your scene file is stored), any rendering jobs, source images, output
images, textures, and so forth. Whenever you first create a new scene in Maya, there are
two steps to saving: first, save your project (which contains all the proper places for Maya
to store your project s information), and then save the actual scene file.
Warning Maya is based on the Unix operating system, which means you must never use
spaces in your filenames even if you re running the NT version of Maya. If you do,
Maya will give you an error when you try to open your scene later, and you won t
be able to access your earlier work! The operating system will allow you to save
according to its filename conventions, but Maya s file system won t recognize any
names with spaces.
Tip It is a very good idea to append a number to the name of every scene (for example,
rocket1). As you work, you will want to save your scene often, in case you run into any
problems, and, rather than just saving over your old scene, you should save a new scene
each time, numbered sequentially (rocket2, rocket3, and so on). Every time you are told
to save in this project, remember to save a new file with a higher number. If you are
concerned about disk space on your hard drive, you can erase earlier versions of your
project as you work through later ones. We generally save about
2. One you have saved your project and file, look over the interface for a moment (see Chapter 2
for a tour of the interface if you have never used Maya before). Then change your scene
window from the default perspective view to a four view of the scene by first clicking in the
scene (big) window and then pressing and releasing the spacebar quickly. Your scene window
should change to four smaller panes, each labeled for its view angle (top, side, front and persp
perspective). Select the side view by clicking your mouse inside this pane, then press and
release the spacebar quickly again to make the side view take up the entire viewing pane.
Note If switching between panes is difficult for you (or if you are completely new to Maya),
you should read through Chapter 2 to learn about the Maya interface, before
continuing in this chapter.
To create the body of the rocket, we ll use an EP (Edit Point) curve tool to define four points that
make up the rocket s outline, and then revolve this curve into a surface.
3. Pick the EP Curve tool (Create EP Curve Tool); your cursor should turn into a cross,
indicating that you re now using the EP Curve tool. Because we want the first (top) point of the
curve to lie directly on the Y axis (the thick vertical line at the center of the pane), we need to
turn on the snap to grid button before we create the first point on the curve click the Snap
to Grid button on the Status Line in Maya (the topmost toolbar).
4. A little below the top of the window, where the X axis meets one of the other grid lines, click
once (with your left mouse button) to create your first point. Now turn off the Snap to Grid
button (click it again), and create three more points, approximately like the following image. If
you hold down the mouse button when you click to create a point, you can move that point
around until you like its positioning; you can also hit the backspace key to remove the last point
you made. When you are satisfied with the shape of the ship, hit the Enter key to save the
points (the curve will turn green).
5. Our next step is to create an actual surface from our outline. Be sure Modeling is showing on
the Status Line (at the far left top of the screen). If not, choose it from the pop-up menu there.
Now revolve the curve by choosing Surfaces Revolve .
Tip The symbol in Maya is known as an option box. Selecting this box with your mouse will
open a window where you can change the options of your command in this case, the
Revolve command.
6. In the Revolve options window, click the Reset button and then set the segments to 16 (instead
of the default 8). Click the Revolve button and close the options window. You should now see
your curve transformed into a squat looking rocket ship body! To see your rocket ship shaded,
hit the 3 key (on the main keyboard; not the numeric keypad) and the 6 key the 3 key changes
your view to high-resolution, while the 6 key turns on flat shading mode (instead of wire frame).
7. Rename your object (shown in the Channel box, at the right of the main window) from
revolvedSurface1 to something more appropriate, like body: click once on the name
(revolvedSurface1) and type in your new name, replacing the old one. Save your work now.
Tip If you don t see the object name listed (and a Channels menu directly above it), try
holding down the Ctrl key and pressing the A key. This should change your view to the
Channel box view.
Tip If something goes wrong on this or any step in the project, remember that you can always
hit the Z (undo) key to move back one or more steps in your work.
8. Now we need to build our rocket engine exhaust nozzle. We ll use the same method we
learned to create the rocket itself: Choose the EP curve tool (or hit the Y key, which will
reselect the last used tool for you), and then click several points in the shape of an exhaust
cone.
Tip To make the size (scale) of the curve easier to see, try creating the exhaust nozzle
directly below the rocket body.
9. When you are satisfied with the look of your exhaust nozzle, hit the Enter key and, while the
engine is still selected (green), choose Surfaces Revolve to revolve the engine (note that we
don t have to use the options this time; this revolve operation will use the same options you
set for the rocket body last time). Hit the 3 key to smooth out the view of the engine nozzle;
then rename the object (in the Channel box) from revolvedSurface2 to nozzle and save your
work.
10. We now need to move the engine into the base of the rocket. Choose the engine (if it s not
green, click or drag a selection marquee on the engine be sure not to highlight the rocket
body), then press the W key to bring up the Move tool. You should see several colored arrows
(above the engine) around a yellow box. Click and drag up on the green arrow until the nozzle
is where you want it to be.
The QWERTY keys (across the top left of your keyboard) are shortcut keys. Memorize these
keys now using shortcut keys is one secret to getting work done in Maya quickly! Here s
the function for each one:
" The Q key puts Maya into select mode (where you can only select, not modify, scene
elements).
" The R key places Maya in Scale mode (not rotate mode!).
" The T key places Maya in Manipulator mode (we won t deal with this tool in our work
here).
" Finally, the Y key places Maya in whatever mode besides Move, Scale, and Rotate was
last chosen (the EP Curve Tool, in our work).
11. Now let s create a cockpit for our ship from a default sphere. Click the sphere (ball) button on
your tool shelf, or choose Create NURBS Primitives Sphere (remember to press the 3 key
to display the sphere in hi-res mode). You won t be able to see the sphere, as it is currently
inside the rocket body, so change to Move mode (press the W key) and move the sphere to the
right of the rocket body. Now change to scale mode (the R key) and stretch the sphere up until
it is about twice as tall as it is thick, by pulling the green scale handle up. Finally, change back
to Move mode (the W key) and move the sphere into position near the front end of the rocket
body. Be sure to change the name of the object (in the Channel box) from nurbsSphere1 to
cockpit, and save your work.
Note If you are not familiar with shelves, see Chapter 2 for an introduction to them.
12. No space ship would be complete without some fancy fins on it. We ll create one fin using a
default cone, and then adjust its points to make it look more like a fin. Choose Create
Polygon Primitives Cone , set the Subdivisions along Height option to 5 (instead of 1), click
Create and close the Cone Options window; then name the cone fin1. Set Maya to Move
mode, and then move the cone out so it is below the cockpit. Now change to Rotate mode (the
E key) and rotate the cone so it points away from the side of the ship. To do this, grab the
outermost ring of the Rotate tool and drag to the right.
13. The fin is almost correctly placed, but it s currently much too small. Change to scale mode
(the R key), and then scale the whole cone out (click the yellow box in the center, and then
drag to the right) until it is the right size. We re getting closer, but now the cone has been
scaled out in all directions. To fix this, change to four-view mode (press the spacebar quickly),
and, in front or top view, click on the red (X axis) scale button and scale the fin so it is thin in
that dimension.
14. Now that the cone/fin is thin, return to the side view (click in the side view, and then press and
release the spacebar). Highlight the fin so it is green; then press the F8 key to go into
Component selection mode. Drag a selection marquee around the point at the tip (it will turn
yellow), and then move that point down so it is about as low as the exhaust nozzle-don t worry
that it looks very angular right now. Next, draw a selection marquee around the second row of
points in from the tip (be sure to select only this row), and move them down some as well.
Finally, choose the bottom set of points on the next two rows in (toward the body), and move
them up a bit. You should now have a curved fin. Save your work.
15. When you like the shape of the fin, press the F8 key again to return to Object mode. While the
fin is nice, it could use some smoothing. Be sure the fin is still selected (green), and then
choose Edit Polygons Smooth to smooth out the angles between polygon facets. At this
point, you might wish to move the fin in toward the body more, so there is no gap between the
fin and body.
16. Great, we have one fin. Now we need to make two more. Rather than model these new fins, let
s make Maya do the work. First, we need to move the pivot point of the fin (the point around
which it rotates) to 0 on the X and Z axes, then we ll just tell Maya to make two duplicates and
rotate them.
17. Click on the fin to highlight it, press the Insert key on your keyboard, click the blue handle (it
may be difficult to see), and drag it to the center line. To see if the pivot point is close to 0, look
at the feedback line (just above the scene panel) and watch the Z component move. Stop
when you are as close to 0 as you can get. When the pivot point has been moved, press the
Insert key again to return to Normal mode.
18. Now choose Edit Duplicate and, in the options window, click the Reset button, and then
set Rotate Y (the middle box) to 120 (120 degrees, or one third of a circle), and Set Number of
Copies to 2. Press Duplicate and close the window. You will now have three fins spaced evenly
around the body of the ship Maya even names the other fins fin2 and fin3 for you!
19. As a last step, we need to make some ground for our rocket to take off from. Choose Create
NURBS Primitives Plane , click the Reset button (in the options window), and then set the
Width to 1000 (so the ground is very big). Click Create and Close; then rename the plane
ground. You ll note that the plane is right in the middle of the rocket. Using the Move tool,
move the plane down until it is a significant distance below the ship don t let the rocket body,
fins, or nozzle touch the plane, or you will have big problems later in this chapter!
20. Now that we have all of our pieces, we need to get rid of the construction history for each of
them, and then erase the curves that generated them (otherwise we ll have problems later on
in the animation process). First, select everything in the scene (or RM choose Select All in the
scene window); then choose Edit Delete by Type History. Now find the curves you used to
build the body and nozzle of the rocket (you can choose any component of the rocket and then
use the right and left arrow keys to scroll through all the components or you can use the
outliner or hypergraph to find the curves). When you have each curve selected, just hit the
Backspace key to delete it.
Note If the phrase RM choose is unfamiliar, see the list of Maya three-button mouse
operations in Chapter 2.
21. As a last step, we need to make all our rocket components into one group (we ll call it rocket),
and move the pivot point of our rocket down to the ground plane (the reason for this will be
apparent as we animate the ship).
22. Drag a selection marquee around the ship and all its components (be sure not to include the
ground, though!); then hold down the Ctrl key and press G. This creates a new group (called
group1) that contains all the pieces of the rocket we have modeled. Rename this group rocket.
Tip In the future, if you click on any component of the rocket (the body, say) and press the
up-arrow key, Maya will automatically move up the group s hierarchy and choose the
rocket group for you.
23. Be sure the rocket group is still selected (check to see that its name is showing in the Channel
box); then press the Insert key. Move the pivot point down (using the green handle) until it is
below the bottom of the nozzle. Moving the pivot point will be important when we animate the
scale of the ship (otherwise the ship will scale around its middle, instead of its bottom). Be sure
to press the Insert key again when you are done moving the pivot point. Save your work.
24. Let s take a look at our handiwork. Change to perspective view in the scene panel (remember
the spacebar trick), change to shaded mode (press the 6 key), and then rotate around your
ship by holding down the Alt key and left mouse button (LM button) and dragging around the
scene window.
If your results are very different from those you see in the book, you may wish to return to the area
that is different and rework it until you are satisfied with the results.
Note Materials in Maya are the general container for a shading network, which gives an
object its color, transparency, reflectivity, and so forth. Normally, you create a material,
then edit the material s settings or add textures (images or procedural textures) to it to
get the look you want. Think of materials in Maya as your own virtual paint can.
1. Select the cockpit and then choose Window Hypershade, opening the Hypershade window.
2. To create a new material, look down the left-hand side of the Hypershade until you find the
Create section. Choose the Phong shader (the very center sphere) and, with your middle
mouse button, drag (MM drag) the phong material into the window on the right. Name the
window cockpitPhong by holding down the Ctrl key, double-clicking the default name
(phong1), and then typing in the new name.
3. To assign this new material to the cockpit, just MM drag the material ball onto the cockpit in the
scene window. Because the phong material is still gray, you won t see much difference yet.
4. To adjust the color of the new material, double-click it in the Hypershade. This will open the
Attribute Editor (to the right of the scene panel or in its own floating window), with several
options you can control for color and other attributes.
5. All we re interested in for the cockpit is its color. Click on the gray rectangle next to the word
color, and, in the color picker that pops up, choose a very dark blue (almost black) color. You
can watch the cockpit itself change as you adjust the color. When you get a color you like, click
the Accept button.
6. Let s make another phong material for the body of the rocket. MM drag a phong material onto
the right side of the Hypershade window, and then rename this material bodyPhong. Now MM
drag the material ball onto the body of the rocket.
7. First, adjust the color of the new material to a very pale blue-gray (the color of brushed
aluminum). To make this work right, you ll need to set the saturation of your color very low (we
set it to 0.075).
8. When you accept the color, you ll probably notice that the highlights on the rocket body are
big and ugly. Fortunately, we can compensate for this. In the Attribute Editor, set the Cosine
Power (the size of the highlight) to a large number, like 75, and set the Specular color to a
darker gray (drag the slider to the left). When you finish, you should have a more pleasing
highlight.
9. To create the ground shade (we don t want a highlight on the ground!), let s use the lambert
shader, which cannot create a highlight. MM drag a lambert material (top right) onto the right
side of the Hypershade; then rename it groundLambert. Then MM drag the new material onto
the ground plane, assigning it to the plane.
10. In the Attribute Editor, set the color of the ground plane to a dusty orange-yellow (a desert dirt
color).
11. The last two materials we ll make will be a bit more interesting. First, let s create a material
with a procedural texture for the nozzle. Create a new phong shader, name it nozzlePhong,
and assign it to the nozzle.
12. Instead of assigning a color to the new material, click the little checkerboard next to it (to the
right of the color slider). This will bring up the Create Render Node window. Click on the
Checker button, and your material will have a checker pattern to it.
13. While this texture as it currently looks might be all right for playing checkers, it s not what we
re after. In the Attribute Editor, make both of the colors in the checker pattern a shade of gray
(drag the sliders next to the color swatches). Finally, decrease the Contrast setting to about
0.7. These changes will make the pattern much subtler.
14. Now click on the place2Dtexture1 tab (at the top of the Attribute Editor) and set the Repeat UV
to 16 and 0.5, respectively. This will give the nozzle the ringed appearance common to rocket
nozzles.
15. Finally, let s create the fin material, using a ramp to get our effect. First, create a new phong
material (called finPhong), and assign it to all three fins you will probably have to rotate the
scene panel in order to see all three fins so you can do this.
16. In the Attribute Editor, click the checker box next to Color again to bring up the Create Render
Node window. Choose Ramp from the list of 2D textures. You should see a default ramp
appear, and all the fins should have the colors applied to them.
17. While the smooth transitions of the default ramp are nice, they re not what we need for our
fins. From the Interpolation pop-up menu, choose None. This turns off the smooth interpolation
of the colors, making the ramp a series of color bars.
18. To change the ramp colors, select the ramp node (the circle to the left of the color bar) and
then click on the Selected Color swatch to bring up the color picker. To create a new color
node, just click in the color swatch where you want it. To move a color up or down, drag the
circle on the left of the color bar. Finally, to remove a color, click on the box to the right of the
color bar. You can use whatever colors you like for the ramp, but when you are finished, you
should have something like the following.
We now have a fully textured ship and ground plane. While none of these materials is terribly
complex, they give the ship some color, and add to the cartoonish feel of the world we re creating.
To be able to see our ship when we render it, we ll next need to add some lights to the scene.
1. First, let s create our ambient light. Select Rendering from the pop-up menu at the top left of
the screen. Then, choose Lights Create Ambient Light . In the options box, set the intensity
to 0.2, and then click Create and Close.
Tip To see how the scene is lit so far, press the 7 key on your keyboard to go into lighted
mode (the scene should be almost dark). Press the 6 key to return to flat shaded mode.
2. Now let s create our spotlights. From the shelf, choose Lights Create Spot Light . In the
option window, click the Reset button, and then set the penumbra angle to 10 (this fades the
edges of the spotlight). Click Create and Close. Rename this light frontSpot (if the Channel
box isn t open, press Ctrl+A to toggle it back on). Press the W key to get into Move mode, and
then move the light up and away from the ship, toward the camera. Be sure the light is above
the rocket by a significant amount; otherwise, it won t light the ground below the ship (which
gives depth and solidity to the scene).
Tip To move your lights, you will need to use the top and side views (use the spacebar to
see these views), and scale these views out by holding down the Alt key, along with the
left and middle mouse buttons, and dragging to the left in each window pane.
3. Because we want this spotlight to aim at the ship at all times, let s add an aim constraint to it.
First, click on any part of the ship; then press the up-arrow key (be sure the Channel box says
rocket in its title area). Then, holding down the Shift key, click (or drag around) the light,
highlighting it as well. Finally, from the Animation menu set (choose Animation from the top-left
pop-up menu), choose Constrain Aim. The focus of the spotlight will now be locked onto the
rocket, wherever it goes.
4. We now need to create another light, this one off to the right side of the ship. Create a new
spotlight (Lights Create Spot Light), call it rightSideSpot, and move it off to the right of (and
above) the ship.
5. We want this light to follow the ship as well, so we ll do the same trick again: First, select the
rocket (remember to press the up-arrow), then Shift+select the rightSideSpot light. Finally,
choose Constrain Aim to force the light to look at the ship.
6. Finally, let s create our last spotlight (which will stay pointed at the launch area). Once again,
create a spotlight; then name the new light leftSideSpot, and move it to the left and above the
rocket.
7. As we won t be auto-aiming the light, we ll need to do it manually. In the top view (with the
light still selected), from the panel menu at the top of the top view panel, choose Panel Look
Through Selected to change the view to show what the light sees (nothing at this point). Rotate
the view until the rocket is centered in the view (hold down the Alt key and drag with the left
mouse button). To return to top view, choose Panel Orthographic Top.
8. To see how your scene is lit, press the 7 key again. It should be well (and evenly) lit across the
ship and the ground near it. If not, try moving your lights around, or increasing their intensity.
Tip It is often difficult to see how well lit your scene is using the flat (openGL) renderer. To
get a better view of your scene, choose Render Render into New Window from the
Rendering menu set (the top-left pop-up menu). This will create a quick little rendering of
your scene.
Keyframed Animation
First we need to create a keyframe animation of the ship about to take off. For our simple
animation, we ll only animate the scale of the ship as it squashes, getting ready for takeoff, and
then stretches as it leaps off the ground. This is classic cartoon anticipation and overshoot you
ll recognize the effect from any old Tex Avery cartoons you run across.
Note Keyframe is an old animation term for important moments in an animation (key
frames). In digital animation, you tell the computer which frames are important (the
keyframes), and the computer in-betweens the rest of the frames between these
key frames, creating an animation.
1. To create the initial keyframe, first be sure you re on the first frame of the animation (use the
VCR-like controls at the bottom-right of the screen, and check to see that the timeline marker is
at 1).
2. Next, select the rocket (be sure it s the whole rocket, and not just the body); then, in the
Channel box, drag your mouse over the names of the three scale channels (scale X, Y, and Z).
Then, with the right mouse button over the selected channels, choose (RM choose) Key
Selected from the pop-up menu. The channels for scale should turn orange, indicating that they
re now keyframed.
3. Once you have created your first keyframe manually, you can make Maya automatically
keyframe your channels from that point on. Check to be sure the auto-keyframe option is on by
verifying that the key icon at the bottom-right of the screen (below the VCR-like time controls) is
red. If it s not, simply click on it to turn it red.
4. Now we need to make our animation longer (it defaults to 24 frames, or one second of
animation). In the number field for the end time (to the right of the time range slider), set the
frame range to 100 frames a bit over four seconds.
Note Maya defaults to 24 frames per second film speed. Thus, 24 frames are one second,
and 96 frames are four seconds.
5. Move the time marker (the gray bar in the time slider) out to 48 frames (2 seconds) by dragging
it across the time slider or just click about where the 48th frame would be. Be sure your rocket
is still selected, and then enter scale mode (R key) and scale down the Y (green) axis so that
the rocket becomes shorter (a scale of about 0.7 on the Y axis channel should do). You may
notice that this simply shrinks the rocket; we also need to scale out the X and Z axes to make
the rocket appear more squashed. While we could do this via the X and Z scale handles, it is
easier to do so in the Channel box itself. Click in the scale X box, and then enter a value of 1.4.
Do the same in the scale Z box. Your rocket should now look squashed.
6. We now need to hold this squashed look for some frames (a hold keyframe). Move the time
marker to frame 60, select the scale X, Y, and Z channel names again, and RM choose Key
Selected (alternatively, you could reenter the numbers you had before, forcing Maya to create
a new keyframe via the auto-keyframe option).
7. At this point, it s a good idea to play back your animation to see how it looks so far. Click the
Rewind button on the VCR-like controls (or press Alt+Shift+V); then click the Play button (or
press Alt+V) to play the animation. The rocket should squash down and then hold its
appearance and then the animation loops and repeats itself.
8. Now let s make the rocket stretch out, as if stretching to take off from the ground (don t worry
for now that it s not moving up). Move to frame 70 and set the X, Y, and Z scales to 0.7, 1.4,
and 0.7, respectively (the rocket should look stretched out now).
9. We need another hold keyframe (with the rocket stretched out), so move to frame 78, choose
the scale channels, and RM choose Key Selected once again.
10. Now move to frame 90 (close to four seconds), and reset all the scale channels to 1 the ship
will now return to its original shape at 90 frames. When you play back the animation, you
should see the rocket squash, preparing for takeoff, then stretch up (as it takes off don t
worry, we ll take care of that next!), and finally return to its original shape. If you don t like
how the animation runs, you can Shift+click on any keyframe (highlighting it in red), and then
drag that keyframe left or right on the timeline, thereby adjusting the speed of the animation
between each keyframe.
1. First, we need to make both the rocket and ground rigid bodies, so they ll react to each other
and the forces we apply to them. Select the ground plane, and then change to the Dynamics
menu set (from the pop-up menu at the top left of your screen). Choose Bodies Create
Passive Rigid Body . (Be sure not to select Active!) In the options window, set the Static and
Dynamic Friction to 0.5, and set the Bounciness to 0.2. Click Create and Close to create the
rigid body.
2. Now let s make the rocket a rigid body. Select any of the rocket s body parts and press the
up-arrow (be sure rocket is the name selected in the Channel box). Choose Bodies Create
Passive Rigid Body . In the options window, set the rocket s mass to 1000, set the Impulse
Y to 5000, and set the Impulse Position Y to 12 (this forces the impulse to be above the rocket
s body, so the rocket won t spin around when you launch it). Click Create and Close.
Tip If you get an error when you try to create the rocket s rigid body, check (using the
hypergraph or outliner) to be sure you have erased the two curves for the nozzle and
body of the rocket. If you haven t, do so this should take care of any error messages.
3. With the rocket still selected, choose Fields Create Gravity . In the options window, set the
magnitude of gravity to 25 (this setting is far heavier than Earth s gravity, which is 9.8, but it
makes the animation look better!), and then click Create and Close. Because the rocket was
selected when you created the gravity field, it will be attached to gravity (that is, affected by
it).
4. If you play back the animation now, you will see that it looks just the same as before. That s
because our rocket is still a passive rigid body (meaning that no forces can affect it). What we
have to do is keyframe the rocket to be an active rigid body just at the frame where it should
take off. Be sure the rocket is selected, and then move to frame 62. Under the Shapes node (in
the Channel box), you should see a channel called Active (toward the bottom) that is set to off.
Click once on the text (the word Active), and then RM choose Key Selected to set a keyframe.
Now move to frame 63, click in the text box that says off, and type in the word on. This will set
a keyframe, turning the rocket s rigid body on, so it can now be affected by forces.
5. Before you play back the animation, you ll want it to run longer. Set the playback length to
1000 instead of 100. (Type 1000 in the end-time number box just to the right of the time range
slider.) The frame range should now go from 1 to 1000. Rewind and play back the animation:
you should see the rocket zoom off into parts unknown.
Tip If the rocket gets stuck in the ground, you ve got a rigid body interpenetration error, a
problem you ll learn more about in Chapter 15. To fix it, move the ground down a bit and
run the animation again.
Warning When playing back dynamics animations, it is extremely important to rewind the
animation before you play it back each time. If you don t, Maya will become
confused about its calculations, and you will see very strange results!
6. To make our ship stop going up and up, we need to turn off our impulse. Go to frame 104 (with
the rocket still selected), select the channel for Impulse Y, and RM choose Key Selected. Move
to frame 105, and type 0 in the Impulse Y number field (setting the impulse to 0 from this point
on). When you play back the animation, the rocket should rise out of sight, and then, around
frame 450, crash back down into the ground, bouncing around until it comes to rest.
Tip To see the animation better, try zooming your camera back (press Alt with the left and
middle mouse buttons, and drag left) this is called scaling the view. Also, if you don t
like the way the rocket bounces off the ground, you can set the ground s bounciness
setting to lower (or higher), and you can change the rocket s impulse setting from 5000
at the start to some other very similar number (like 5001). This small change will make
the bounces go in very different directions.
You should now have a complete rocket animation, using keyframes for part of it, and making Maya
do the calculations for the rest. Next, we ll discuss how to make a new camera, and have it aim at
the ship at all times; then we ll talk about how to render the whole animation out.
Note Aiming a camera at an object is not a good idea for realistic animation; it is generally
better to keyframe the camera to follow the object s motion, as this introduces
human errors into the camera tracking (making the motion look like a person
operating a camera instead of a computer operating one). For our cartoonish
animation, having a camera follow the rocket is all right; however, if you wish, you are
welcome to keyframe the motion instead.
1. Create a new camera (Create Camera) and name it followCamera. Using the four view
panes, move the camera down the X axis (to the right in the top view), and then move it up a
bit off the ground plane do not rotate the camera at this point!
2. Select the rocket, and then Shift-select the new camera. In the animation menu set, choose
Constrain Aim to force the camera to point at the rocket.
3. To look through your new view, choose a panel (the top view, say), and choose Panels Look
Through Selected. Make this your sole viewing pane (press the spacebar), and then play back
the animation. You should see the camera follow the rocket up into the air, and then back down
again.
Tip If the camera is too close to the action, or too far away, just zoom your view (Alt+LM and
RM buttons and drag) to get a better view.
Playblasting the animation is one step: Choose Window Playblast and watch as Maya creates an
animation for you, using the basic shading mode of your computer. Once the animation is
complete, you will be able to view it in its own little movie window. You ll learn more about
playblasting in Chapter 11.
Rendering the final product is a bit more complex and takes much longer. Essentially, a final
(batch) rendering creates a high-quality snapshot of each frame of the animation, using all the
lighting, material, and animation information your scene can provide. The results of a final
rendering can be excellent, but it is a fairly slow process, as your computer has to do many
calculations for every pixel of every image. Thus, you will only want to proceed with these steps
when you re sure you re happy with your animation.
1. Choose Window Render Globals to open the Render Globals option window. In the Image
File Output section, set the Frame/Animation Extension to name.ext.#, set the end frame to
about 700 (you want to be sure it s a large enough number that the rocket has come to rest
first), set the Frame Padding to 4 (this adds zeroes before your frame number, so the frame will
be numbered render.001, render.002, and so forth, instead of render.1, render.2, etc.), and set
the active Camera to followCamera (otherwise Maya will use the default persp camera, and
you will waste your rendering time).
2. Twirl down the Resolution arrow, and set the Render Resolution to 320240.
3. Twirl down the Anti-aliasing Quality arrow, and set the Presets field to Intermediate Quality (this
makes for faster rendering, but with decent quality).
4. When you have finished your settings, close the Render Globals window, and open the
Rendering menu set (the top-left pop-up menu). Choose Render (Save) Batch Render. Type
in a name (like rocketRender) in the File box, and click Save/Render.
5. Maya will render out all 700 frames of the animation (which will take some time). You can view
the progress of each frame in the Feedback line (at the bottom-right of the screen), or, to view
the current frame that is rendering, choose Render Show Batch Render. To cancel the
render at any time, choose Render Cancel Batch Render.
6. When the rendering job is finished, you can view it using the fcheck utility. In IRIX, type fcheck
in a shell window; in NT, choose Run (from the Start menu), and type fcheck in the text field. A
window will open, letting you navigate to your images directory (it should find this for you
automatically). Choose the first frame of your animation and hit OK. Fcheck will cycle all frames
into memory and then play back the animation at full speed.
Congratulations! You have modeled, textured, lit, animated and rendered an animation in Maya. If
patting yourself on the back isn t your style, you can move on to the advanced section (next),
where you will learn how to create a particle exhaust trail for the rocket. If this was enough practice
for a start, just skip right on to Chapter 2 and learn about the Maya interface.
1. First, we need to create our emitter. Select the nozzle on the rocket this will be the emitter s
parent, forcing the emitter to go along for the ride when the rocket launches. In the
Dynamics menu set (the top-left pop-up menu), choose Particles Add Emitter . In the
options window, make the name of the emitter exhaustEmitter, set the emitter type to
Directional, set the Rate to 0, and the Spread to 0.3. Twirl down the Emission Direction arrow,
and set the DirectionY to 1 (so the emitter points downward). Twirl down the Emission Speed
arrow and set the Speed to 60. Finally, click Add and Close. You now have a particle emitter
attached to the nozzle of the rocket.
2. Right now (if you play back the animation), the particle emitter will shoot out no particles,
because its rate is set to 0 particles per second. Just before the rocket takes off (frame 63) we
need to turn on the engine our particles. Go to frame 59, select the Rate channel text for
the emitter in the Channel box , and RM choose Key Selected to set a keyframe at 0 for this
frame.
3. Now go to frame 60 and set a rate of 200 so there are suddenly many particles shooting out
from the ship. If you play back the animation now, a shower of particles (points by default; we
ll fix that in a moment) will shoot out from the exhaust nozzle.
4. Now we need to turn off our rocket. Go to frame 104 and set a keyframe for the Rate at 200
(select the Rate text, and RM choose Key Selected). Now, at frame 105 (where the impulse
turns off as well), set a new keyframe for Rate at 0. When you now play back the animation,
the particles will stop coming out of the rocket at frame 105 however, the particles hang
around forever (they never die). We need to give our particles a life span so they will die off like
good flames should.
5. With the emitter still selected, press Ctrl+A to toggle on the Attribute Editor. Once in the
Attribute Editor, click on the particleShape1 tab at the top; then, in the Add Dynamic Attributes
section, click the Lifespan button. In the resulting window, choose Add Per Object Attribute,
and click the Add Attribute button.
6. If you now scroll back up to the Render Attributes section, you will see that a new attribute,
Lifespan, has been added with a default value of 1 (for one second). As this value is fine for our
purposes, we can leave it at 1 second. When you now play back the animation, you should see
the particles die out a second after they are created (thus the trail of particles follows the rocket
up as it takes off). Save your work.
7. Now that we have a good trail of particles to work with, let s change the rendering type from
points to something more interesting. In the Attribute Editor (with the particleShape1 node still
selected), under the Render Attributes section, set the Render Type to Cloud (s/w for software
rendered). Next, click the Current Render Type button to add the attributes that belong with the
cloud render type.
8. In the new fields, make the radius 1, the Surface Shading 1, and the Threshold 0.5. When you
play back the animation (which will now run significantly slower), you should see that the
exhaust particles are now spheres. To see what they would look like in a real rendering,
choose Render Render into New Window (from the Rendering menu set).
9. Now we re closing in on a good exhaust cloud. The last piece of the puzzle is to create a
texture for the particles. Play the animation to a frame where the particles are showing, then
open the hypershade (Window Hypershade). To create a cloud texture, we need to create a
volumetric texture. To do so, scroll down the left-hand window until you reach Create:
Materials, and click the + sign to the left of the Materials folder. A Volume folder will appear
below the materials swatches, and clicking on it will open the volume materials. MM drag the
particleCloud material (the light blue ball) onto the right-hand window of the hypershade, and
then rename the material exhaustVM.
10. MM drag the material onto the exhaust particles, move over to the Attribute Editor, and set the
color of the material to a bright yellow. Set the Transparency to a light gray (by moving the
slider to the right), and set the Glow Intensity to 0.5. Test render your current frame the
exhaust should now glow a bright yellow as it is emitted from the nozzle. If you re not satisfied
with the look of the exhaust, try adjusting some of the material settings or the render attributes
of the particleShape1 node. Save your work again.
When you are satisfied with the look of your exhaust, you can render out the entire animation
sequence (see the rendering section, above) to see how things look with your exhaust plume. To
compare your work with mine, you can take a look at 01rocket.mov on the CD-ROM.
Summary
Congratulations! You have completed a real-world animation project your first time out. If your work
is not up to the way you would like it, that s all right: it can take quite a while to get an animation
package producing just what you had in mind. No matter how you did, you can always return to this
project as you continue through this book.
You may find that after a few more chapters, you d like to give this project another try. My
suggestion in that case is to use this chapter as a reference, not a guide. In other words, try to do
the work by yourself, and read the directions here only when you get stuck. In this way, you ll
make the project your own, and you ll learn even more from it.
Whether you tried this rocket animation with years of digital 3D experience under your belt or it was
your first foray into the wonderful world of 3D, you should see by now how powerful the Maya
environment can be. Now that you have an idea of what Maya can do, it s time to learn why and
how Maya does what it does. Throughout this book, we ll give you a great deal more explanation
about what we re doing than we did in this chapter, but you ll also still be working on real world
projects, refining both your understanding of and skill with Maya. You ve taken your first step
into the world of Maya now use this book as your guide to a journey through your new and exciting
world.
While the Maya interface may at first glance appear much as it did in version 1, there are
many significant changes too many, in fact, to detail here. Here are some highlights of the
revised interface:
" A new Create menu that contains all object-creation items (except lights), and replaces the
more awkward Primitives menu.
" The Hypershade, a Hypergraph-like window for the creation, modification, and connection
of materials and textures.
" The Visor, a sub-window of the Hypershade, which allows you to create, view, and manage
images, textures, and materials.
" A new Relationship editor, which allows you to manage the relationship of sets, partitions,
light linking, and other matters from just one window.
" All Maya buttons, fields, icons, and sliders now have pop-up text that describes the
function.
" Maya Complete adds Artisan and F/X tools, built-in, while Maya Unlimited also provides
Cloth, Fur, and Maya Live.
What makes Maya different? First, interacting with it is very intuitive, for several reasons. All scene
windows, plus the Hypershade and Hypergraph windows, are easily navigated via the same
keyboard and mouse combinations for zooming, tracking, and rotation (in perspective camera
views only). Because navigating all these windows is the same, you only have to learn one set of
commands to get around Maya s world. Moving objects around a Maya scene window is similarly
intuitive: Select the move, scale, or rotation (or any other) tool, grab a manipulator handle (or the
center box, to manipulate on all axes simultaneously), and alter the object. To try out an example,
you can create a new scene in Maya, add a ball (by clicking the sphere object in the toolbar, or by
choosing Create NURBS Primitives Sphere). Now rotate around the ball by holding the Alt key
down and pressing the left mouse button. This type of rotation is known as camera, or scene
rotation. To rotate the ball itself, choose the rotate tool from the toolbar (or simply press the E key
on the keyboard), then choose any of the manipulator rings around the ball and rotate it by
dragging with the left mouse button. To move an object, choose the move tool (or press the W key).
To scale, choose the scale tool (or press the R key).
Maya makes extensive use of all three mouse buttons. This book like the Maya manuals
uses a shorthand notation to describe the basic mouse operations.
Click, or LM click, means to click (press and release) with the left mouse button.
Drag, or LM drag, means to click the left mouse button, hold it down, and drag.
Shift+click means to LM click, then hold down the Shift key, and click another item.
Choose means to either click or hold the left mouse button down and choose an item from a
menu.
MM drag means to click and drag with the middle mouse button.
RM choose means to hold the right mouse button down (in a specified area) and choose an
item from the pop-up contextual menu.
Rotate view means to rotate the (perspective) camera; that is, hold the Alt key and the left
mouse button down, and then drag in the perspective window to rotate the view.
Move view means to move (any) camera; that is, hold the Alt key and the middle mouse
button down, and then drag in any scene window to move the view.
Scale view means to scale or zoom (any) camera; that is, hold the Alt key and the left and
middle mouse buttons down, and then drag in any scene window to scale (or zoom) the view
in or out.
Another powerful difference between Maya and other packages lies in how you interact with Maya
s GUI (its graphical user interface). There are nearly always two or more ways to accomplish a
task called workflows in Maya. For example, if you prefer not to use menus on top of the screen,
you can use Maya s hotbox (which is itself customizable) to access all menus, or any grouping
therein, by merely pressing and holding the spacebar.
You can also, as noted before, create items via the toolbar or, equivalently, via menu commands.
Most impressive, however, is that Maya will let you decide how you interact with it. If you are not
satisfied with Maya s interface, you have many ways you can alter it, including creating marking
menus, toolbar buttons, and hot keys. All of these can be created fairly quickly (especially the
toolbar buttons) but can contain extremely complex instructions.
Note For more on how to tune Maya s GUI for your own work, see Chapter 3, Techniques
for Speeding up Workflow, or Chapter 16, MEL Basics.
Finally, Maya s plug-in architecture (or API) and especially its built-in scripting language, MEL, are
very open and comprehensive. Because of Maya s API, plug-ins (like the built-in Artisan and FX)
fit seamlessly into the program, so much so that it is often difficult to determine where the main
program stops and the plug-in begins. While the API is fairly complex and is best left to
knowledgeable programmers, MEL (or Maya Embedded Language) is a reasonably simple
scripting language that gives just about anyone with a bit of programming experience access to
nearly all of Maya s very powerful features in a program environment. Not only can you create
specialized, time-saving scripts with MEL, you can also create entire windows, or even a whole
new GUI for the program (because Maya s entire GUI is built on MEL scripts in the first place).
This feature can allow, for example, a technical director to create a custom interface for her artists,
allowing them to deal with character animation without their having to know anything about the
low-level details of the construction and stringing (or animation setup) of the character.
As should be obvious from these features, Maya provides a very modern, intuitive, and
customizable environment for you. Whether you are a shop of one person or one hundred, Maya s
adjustable interface will get you building complex animations far more quickly than other even
more expensive packages. Let s now take a more thorough tour through the Maya interface,
looking at several important areas of the GUI.
Interface Elements
Although there are many elements to Maya, they can be grouped into about nine categories. We
will work through each category in turn.
Scene Windows
The scene windows are your primary interface with the objects (and lights and cameras) you
create. When you open a new Maya scene, it opens the default configuration, which is one large
scene window (the default perspective camera), alongside either the Channel box (or the Attribute
Editor if your preferences are set to toggle between the Attribute Editor and the Channel box).
Tip New to Maya 2 is that you can set the Attribute Editor to be a window adjacent to the
perspective window (replacing the Channel box), rather than a floating window. You can
then toggle between the Attribute Editor and the Channel box by pressing Alt+A. Should
you wish to force the Attribute Editor to toggle with the Channel box, choose Options UI
Preferences and select the Open Attribute Editor In Main Maya Window radio button.
Once the default window is open, you can select the perspective view by clicking anywhere inside
the window. When this (or any) window is selected, its borders turn blue. At this point, you can
rotate, scale, or translate the view to adjust what you see in this window (for specifics on how to do
this, please see the earlier sidebar on mouse conventions). The default scene window is called the
Persp (for perspective) view and is just the view from the default perspective camera that Maya
builds upon opening a new scene.
Tip You can build other perspective cameras by choosing Create Camera. To view the
scene through this new camera, select the camera (click on it in the scene window or
choose it in the Hypergraph or Outliner), and choose Panels Look Through Selected,
or, equivalently, choose Panels Perspective camera1.
In addition to the default perspective camera, Maya also creates three orthographic views Top,
Side, and Front that you can also see (in what s called a four view layout) by selecting the
perspective window and then quickly pressing and releasing the spacebar.
To make one of the orthographic views fill the screen, click in it (to select this window), and press
and release the spacebar again. Being able to switch quickly between different view layouts and
window sizes greatly speeds up your workflow in Maya, as no extensive menu selection process is
required to rapidly change views.
Tip To switch views in Maya without losing your current selection, MM click in the view you
wish to activate (e.g., the front view), then press the space bar.
Open a new scene in Maya; then hold down the Alt key and the left mouse button and drag the
mouse around. The scene should spin around as you drag the mouse.
Tip If the scene does not rotate as you drag (you may see the cursor become a circle with a
line through it), you may be in an orthographic view, which does not allow rotations. To
move to a perspective view, hit the spacebar to show the four-view layout; then click in
the perspective window (top right) and hit the spacebar again.
To translate a scene (move up/down or left/right), hold the Alt key down once again, hold down the
middle mouse button (MMB), and drag the mouse around. You will see the scene move around
with the mouse movements (note that the camera is actually moving opposite to your mouse
movements: as you drag right, the camera moves left, so the objects appear to move right. You can
see this clearly if you make cameras visible and look at the camera in a different view as you drag).
To scale your view (zoom the camera in and out), hold down the Alt key once again, hold down
both the left and middle mouse buttons, and drag. As you drag right, the scene grows larger (you
re zooming in); as you drag left, the scene grows smaller (you re zooming out). If you wish to
quickly zoom into a specific area of your scene, hold down the Alt and Ctrl keys, and then drag
(with the left mouse button only) a box around the area of the scene you are interested in, starting
on the left side. When you release the mouse, the scene will zoom in, covering the area you
outlined. If you drag the mouse from right to left, the scene will zoom out so that the entire scene
window you start with fits into the box you drag (the smaller your box, the further out you zoom). If
you now open the Hypergraph or Hypershade (Window Hypergraph or Window Hypershade),
you can use the same key/mouse combinations to scale or move around either of these windows.
You will note, however, that you cannot rotate either of these views, as this would accomplish
nothing useful.
Note You can think of the Alt key as the movement key. Whenever you hold down the Alt
key, you are in move mode, rather than in object manipulation (or some other) mode.
The consistent use of the Alt key for movement is just one more example of the
thought that has gone into the Maya interface.
Scene Objects
Scene objects (geometry, curves, cameras, and lights) are the fundamental building blocks from
which you create a Maya scene or animation. The procedure for creating and manipulating any
object is generally the same: Create the object (most often in the Create menu), choose a
manipulation tool (like Translate or Rotate), and alter the object. You can also adjust the pivot point
(or center ) of an object, and you can manipulate the individual components of geometric
objects.
Tip Maya s built-in help files are a great (and easy) resource. To access them, just use the
Help menu, and choose Maya Library (or the specific aspect of the program you are
interested in) from the Help menu. Within the startup window (which will open in a Web
browser, as it is an HTML document), you will be able to search for a term, browse
through a complete index of all Maya documents (the index alone is about 1.7MB of
data!), or read any of the Maya manuals in electronic form.
To create a piece of geometry (a sphere or cone, for example), you choose the type of geometry
you wish to create from the Create menu. For a three-dimensional object (like a torus or a cube),
you can choose from either polygonal or NURBS primitives. Using the NURBS option, you can also
select a two-dimensional (non-surface) square or circle. When you create an object, you can either
use the last saved settings or open the Creation Options window and adjust the object s settings
to what you desire before creating it.
Note NURBS (or Non-Uniform Rational B-Spline) objects are created via a series of curves
(or isoparms) that are mathematically derived from several points (control vertices, or
CVs). NURBS surfaces are more complex to calculate, but they can be warped and
twisted more before they show excessive unnatural creasing. Polygonal surfaces, on
the other hand, are created by placing many small triangular or rectangular surfaces
together. Polys are simpler to calculate at least for simple surfaces but tend to show
their constituent blocks if they are bent or distorted too much especially if the surfaces
are created with a minimal number of polygons, or facets. NURBS surfaces tend to be
better suited to organic forms (like bodies), while polygonal surfaces generally work
better for more mechanical objects (like space ships); but this is by no means a
hard-and-fast rule.
As an example, let s create a default polygonal sphere, and then use the options box to create a
NURBS cylinder. To create the poly sphere, simply choose Create Polygon Primitives Sphere.
On releasing the mouse, you should see a sphere appear at the center of Maya s default grid. If
you look closely, you will note that the sphere consists of many rectangular objects (more
accurately called quadrilaterals) that butt up against each other, forming the sphere. Now move the
sphere aside (press the W key and move the sphere away from the center of the grid) and create a
NURBS cylinder with nondefault options. To access the options window of the NURBS cylinder,
choose Create NURBS Primitives Cylinder (choosing the symbol the option box in a
Maya menu item always brings up an option window). Upon releasing the mouse button, you
should see the following window.
This window provides a great number of options. You can define any of the following:
" the axis the cylinder will use as its long axis
" the height-to-radius ratio (a higher number will make a taller cylinder)
" the number of spans (vertical pieces) and sections (horizontal pieces) that make up the cylinder
For the purposes of this little example, try setting the End Sweep Angle to 270 (this will create a
three-quarters cylinder), the Height to Radius to 4 (making the cylinder taller), and the Caps option
to Both (creating a cap on both the top and bottom of the cylinder). When you click the Create
button at the bottom, you should get an object like this:
Tip You can almost always reset an object to its default settings by using the Reset button in
the options window.
Tip To get a smoothly shaded object (instead of a wireframe), press the 6 key on your
keyboard (not the numeric keypad). To view an object at a higher resolution, press the 3
key. The image above uses these settings to display the cylinder.
Creating a camera object is as simple as creating a geometry object. Choose Create Camera
and a new perspective camera (initially called camera1, camera2, etc., until you save it with a more
specific name) is created. To adjust the camera s options as you create it, choose the option box
(), and change the camera s settings. While all the settings in the camera options box are a bit
much for an introductory chapter, most are fairly self-explanatory to anyone familiar with
photography or 3D animation.
Note For more on camera options and other rendering basics, please see Chapter 18.
Some notable options are that you can make any new camera orthographic (as opposed to
perspective), you have control over near and far clipping planes (where the camera stops seeing
objects that are too far away or too close), and you can choose to have two or three nodes on
the camera (allowing you to manipulate where the camera is looking, for example, via a
manipulator handle outside the camera itself). Try creating a camera with two nodes (under
Animation options). When you create this camera, it will automatically have a second manipulator
handle you can move (by pressing the W key and dragging the handle around), and the camera
follows where the manipulator handle goes.
To create lights, use the Lights menu (under the Rendering menu set, or via the hotbox).
Note Maya has four menu sets: Animation, Modeling, Dynamics, and Rendering. To switch
between them, use the pop-up menu on the left of the toolbar to select the appropriate
set. Optionally, you can choose Hotbox Controls Show All (brought up by pressing
the spacebar); the hotbox will then show all menu sets.
When creating lights, you can choose from Ambient (a light which fills all space evenly, like indirect
sunlight in a room), Directional (parallel light rays from one source, mimicking direct sunlight), Point
(radial light like that from a bare light bulb), and Spot (light as from a theatrical spot light). For
example, create a spot light (Lights Create Spot Light ) with the following options: Intensity 1.5,
Cone Angle 50, Penumbra 10, and Color a light blue (click the default white color chip to bring up
the color picker; then choose a light blue color). The penumbra controls how quickly your spotlight
fades out around its edges: a value of 0 means that the spotlight goes from full intensity to 0 at
its edges (not a very natural look); a value of 10 or 20 degrees makes the spotlight fade out from
full intensity to 0 over that number of degrees. If your spotlight were aimed at a simple plane, the
rendered image would look something like the light on the right (on the left is a spotlight with a
penumbra of 0).
You can also create either CV (control vertex) or EP (Edit Point) curves via the Create menu
(Create EP Curve Tool or CV Curve Tool). The CV Curve Tool creates a CV with each click of
the mouse. The EP Curve Tool creates Edit Points as you click the mouse button. Control vertices
lie off the curve they control, while Edit Points lie on the curve. Each type of curve tool is useful
under certain circumstances the basic rule of thumb is that for smoother curves, use the CV curve
tool, while for more tightly controlled curves, use the EP curve tool. In the following image,
matching a CV curve and an EP curve created with identical mouse clicks, note that the CV curve
(on the left) is smoother, its extremes much less pronounced than the EP curve (on the right), as
the CV curve is not forced to pass through each point you define, whereas the EP curve must.
Note After an EP curve is created, it is automatically converted into a CV curve. You can
see this by switching to component mode and noting that the edit points have changed
into CVs, and that their position is no longer the same.
To create, say, a CV curve, choose Create CV Curve Tool (or click the CV Curve Tool button on
Shelf 1), and then click several times in the scene window with the mouse. You can also drag the
points around as you create them, or even erase points by hitting the Delete or Backspace key, or
by pressing the Z key to undo the last action. When you are satisfied with the curve, hit the Enter
key, and the curve is constructed.
Tip If you do not see the manipulator handle, be sure the cylinder is highlighted by clicking (or
click+dragging) on it.
To move the cylinder on the X axis only, click and drag on the red arrow; to move on the Y axis,
click and drag on the green arrow; to move on the Z axis, click and drag on the blue arrow. To
move the object freely in all directions, click and drag on the yellow box at the center of the
manipulator handles. Try moving the object up a little on the Y axis and to the right on the X axis.
Note All manipulator handle colors are consistent with the axis marker, on the bottom-left of
a scene window X is red, Y is green, and Z is blue. This consistency lets you know
what axis you are adjusting, no matter from what angle you are viewing the scene.
To scale the cylinder, press the R key, and then scale the object on the X (red), Y (green), or Z
(blue) axis or click and drag on the yellow box at the center of the manipulator to scale on all axes
simultaneously. Try scaling the cylinder up on the Y axis and then out in all directions, as shown on
the left below.
To rotate the cylinder, press the E key, and then rotate around the X (red), Y (green), or Z (blue)
axes or click the yellow circle on the outside to rotate on all axes at once (rotating on all axes at
once is difficult to control and therefore not advisable). Try rotating clockwise on the Z axis and
then counter-clockwise on the X axis, as shown on the right below.
Note Manipulator controls have their shortcut keys arranged so that they follow the top row
of a QWERTY keyboard Q for select, W for move, E for rotate, R for scale, T for the
Manipulator tool, and Y for the Last Used Tool (like the CV curve tool, for example).
This layout makes the manipulator tools very easy to access, and it s easy to
remember their shortcut keys.
Finally, it is possible to move the pivot point of your cylinder (or any object) so that it is not in the
object s center. To move the pivot point, press the Insert key on your keyboard (turning the
manipulator handle into the pivot-point handle); then move the handle to where you want the object
s center of rotation, movement, and scaling to be. Try moving the pivot point of the cylinder to its
bottom, so that any further rotation will occur from that point.
Tip Once you have moved the pivot point, you must return the manipulator to its normal
state by pressing the Insert key once again.
As shown below, the Select By Component Type button is on the Status line, just to the right of the
word Objects (or Components, if that is selected). The leftmost of these three buttons is Select by
Hierarchy; the middle button is Select by Object; the right button is Select by Component Type.
You can adjust components of an object just as you would an object itself by using the move,
rotate, and scale tools. Try selecting the top row of CVs on the cylinder (click-drag a square around
them), then moving them up some, scaling them out on the X and Z axes, and rotating them around
a bit.
Tip To select several CVs (or facets) at once, you can drag a selection marquee around
them. To add more components, hold down the Shift key and drag (or click) more points.
(If the points are already selected, Shift+clicking or dragging them will deselect them.)
Remember that you can always maneuver around the scene window (hold down the Alt
key as you drag the mouse) to make the selection easier.
If you now switch back to object mode, you will once again be able to choose and manipulate the
entire object. Modeling (and even animation) is often a dance between object-mode and
component-mode manipulation of your objects, and remembering that the F8 key switches between
these two modes can be a real time saver.
The quicker, easier method for selecting specific component types is to use a contextual menu
while your mouse is over an object. To try this, create a sphere in an empty scene and then, with
your mouse over the sphere, hold down the right mouse button. You will be presented with several
options for component masking, plus a menu of actions you can perform on the object (such as
templating or untemplating it).
By selecting Control Vertex (for example) from this pop-up menu, you can easily move into
component selection mode for CVs, and begin manipulating your CVs as you wish. To return to
object mode, press the F8 key twice.
While the contextual menu method is quick and easy, it does not give you access to all the
component types you might wish to choose from. To choose a component type not listed in the
pop-up menu, you need to use the Status line. To the right of the Object/Component text field and
Hierarchy/Object/Component icons is a set of eight blue icons, each representing a class of
components you can enable or disable in your selection process. To the left of these icons is a
black triangle; this allows you to enable or disable all objects for selection. The component types
you enable here will then be available when you drag your mouse over an object in component
mode.
Warning If you turn off all components, you will not be able to select anything in the scene
window including objects in object mode! This is a good place to look first if you
discover you cannot choose any objects in a scene.
If you hold down the right mouse button on any of the blue icons, you will see a menu of subtypes
you can either enable (check) or disable (uncheck) for component selection. Enabling or disabling
component types is known as selection masking, and it s a great way to simplify the task of
picking a specific object or component in a complex scene. If you are not familiar with components
or selection masking, try playing around with these options in Maya before going on.
Window Layouts
In addition to the default window layout (the perspective view plus either the Channel box or the
Attribute Editor), there are many other built-in layouts Maya provides, and as is consistent with the
Maya interface philosophy if you wish, you can create your own.
Built-in Layouts
Maya offers two types of built-in layouts: generic layouts and prebuilt, or saved ones. Generic
layouts are just basic layouts elements (like a four-view layout), while saved layouts are useful
combinations of the basic elements prebuilt into layouts for different purposes. To begin with, let s
look at how to access a generic layout. Under the Panels Layouts menu (accessed either via the
Panels menu in the scene panel, or, as shown below, the hotbox) are several layout choices for
your scene windows.
Choosing the Four layout (the first choice) will place the view you currently have active (often the
perspective view) in the upper-left quadrant of a four-view layout. (note that this is different from the
layout you get by pressing the spacebar, as the perspective view or whichever view you have
active ends up in the top-left quadrant, instead of the usual top-right.) The 3 Top/Left/Right/Bottom
Split views place the active window on the top (or left/right/bottom) half of the screen, then split this
view into two; the other half of the screen has a single view window. The 2 Stacked or Side by Side
layouts are similar, except that they don t split the active view in half (thus the active view and one
other view share the screen space evenly, either top-and-bottom or left-and-right). There is also a
single view, which is the same as selecting a view and pressing the spacebar to make it fill the
entire screen.
While the generic views can be useful (especially for building your own layouts discussed below),
the prebuilt layouts are more commonly used because they fulfil specific needs. To access the
saved layouts, choose Panels Saved Layouts and then select a saved layout to use.
Single Perspective View and Four View are the views you are already familiar with. Rather than
look at each saved layout in a list, let s examine just a few once you understand a couple of the
saved layouts, the rest are fairly self-explanatory. The Persp/Graph/Hypergraph is a generic three
view (as described above) with the top half split between the perspective view and the Hypergraph,
while the bottom half of the screen is occupied by the Graph Editor. This view was created from the
generic 3 Top Split view by changing each panel to the Perspective/Hypergraph/Graph Editor view
and then saving it. New in version 2 of Maya are several layouts involving the Hypershade. The
Hypershade/Outliner/Persp view is a generic 3 Bottom Split, with the Hypershade occupying the
top half of the screen and the Outliner and perspective view splitting the bottom half. Also new in
version 2 is the Persp/Relationship Editor layout, which stacks the perspective view on top of the
Relationship Editor. Toward the bottom of the menu are several layouts specifically for use with
Maya Live, including Maya Live Setup, Track, Solve, and Manual MatchMove.
Warning If you decide to erase a saved layout, be sure that you (or anyone else working on
your machine) is not interested in using it any further. To get the layout back, you ll
either have to reconstruct it manually or reinstall Maya.
As an example of how to create your own layout for later use, let s create a layout with the
perspective view filling half the screen on the top, and the bottom being split between the
Hypergraph and the Hypershade. (This can be a useful layout if you need to connect several
materials to several objects at a time, as selecting the objects in the perspective window can
become tedious.) As with most things in Maya, you have a choice about how to create your new
layout: you can either start from a generic layout or modify one of the prebuilt ones. Although
starting from a prebuilt layout is often simpler, we will start from a generic layout in order to
describe the whole procedure.
2. Make sure the top half of the window is occupied by the perspective view (if not, select the top
half, then choose Panels Perspective Persp).
3. Now select the lower left quadrant and choose Panels Panel Hypergraph. This should turn
the lower left window into a view of the Hypergraph.
4. Finally, select the lower right quadrant and choose Panels Panel Hypershade, turning this
corner into a view of the Hypershade.
5. To save our new layout, choose Panels Saved Layouts Edit Layouts, which brings up a
window with several tabs.
7. In the layouts tab, choose New Layout, then rename the layout from its default name (Panel
Configuration 20) to something more memorable, like Persp/Hypergraph/Hypershade, and hit
the Enter key to change the name.
On closing the window, your new layout will be placed at the bottom of the Saved Layouts menu. If
you later choose to discard this new layout, return to the Edit Layouts menu, select the new layout,
and click the Delete button.
Note You can actually build a custom configuration directly inside the Edit Layouts menu, by
using the Panels and Edit Layouts tabs. This method is more difficult than the one
outlined above, however, so my recommendation is to stick with the above method.
The Hotbox
The hotbox in Maya is a tool for displaying all of the menus relevant to your work at a given
moment, without taking up any screen real estate when it s not in use. While you can do
everything you wish in Maya without ever using the hotbox, once you get used to the way the
hotbox conserves space and puts nearly all of Maya s tools in easy reach, you ll wonder how you
ever got along without it. The hotbox is so universally useful that one member of this author team
has created a default setup with no menus showing at all, allowing that much more room for the
scene windows. If you haven t ever used the hotbox before, it is accessed merely by pressing
(and holding) the spacebar. In its default configuration, you will see something like the following.
The top row of the hotbox always shows the general menus (the menus that are available in all
menu sets), like the Window, Options, Create, and Modify menus. The second row replicates the
menu set of the active panel (in this case, the perspective view), with menu items such as View,
Lighting, and Panels. The third row has a Recent Commands menu (showing the last 15
commands you performed) and a Hotbox Controls menu, which allows you to fine-tune how the
hotbox (and general menus) displays its information. The bottom row of menus is, in this case, the
Modeling menu set, with specialized menus for editing curves, surfaces and polygons. In the very
center of the hotbox (where the A|W logo sits) is a quick way to change views from perspective to
front to side to top, as well as an options menu for how the hotbox displays. Access to all these
menus is the same: press (and hold the hotbox menus will not remain open when you release the
mouse button) the left mouse button over the menu, then drag inside the nested menu to select the
item you wish, releasing the mouse when it is over your selection.
In addition to the menus you can see, there are four regions, called zones (defined by the four lines
proceeding out from the hotbox at 45-degree angles), which have special functions. The top zone
allows you to quickly select from several saved layouts. The right zone allows you to toggle
elements of Maya s GUI on or off (we will discuss customizing your workspace in the following
chapter). The bottom zone lets you change the selected window to any of several useful views (like
the Hypergraph or the Hypershade). The left zone lets you toggle between object and component
mode (mimicking the F8 key), and it also lets you toggle on and off several masking modes.
While you can use the hotbox in its default configuration, it is more useful (if a bit more cluttered)
when you turn on all menu sets (Modeling, Rendering, and so on) at once. In the Hotbox Controls
menu, choose Show All, which displays all menu sets at once.
In this configuration, you have access to nearly all of Maya s tools in one place, and it s all
available at the press of the spacebar. If you are not familiar with using the hotbox, try forcing
yourself to use it for all your menu choices for a couple of hours of work; you will soon find out how
powerfully useful the hotbox is, and you ll probably use it for most of your future work.
Menus
While we have discussed menu sets on and off throughout this chapter, let s take a moment to
look at how Maya s menus are organized. The top row of menus (or the top row in the hotbox) is
split into two parts: the menus that are always present (the constant menus) and those that change
according to the mode the program is in (the mode menus, like the Animation menu set, for
example). Always present are File, Edit, Modify, Create, Display, Window, and Options. To change
the variable menus, choose the menu set you want from the Status line (just below the menus or
under Hotbox Controls in the hotbox). The sets you can choose from are Modeling, Animation,
Dynamics, and Rendering. The elements listed in these menus are fairly obvious, for the most part;
the only real curveball is that in order to create a light, you must be in the Rendering menu set
(lights cannot be created via the Create menu).
In addition to the general menus, nearly every view window in Maya has a built-in menu. The
perspective view, for example, has the following menus: View, Shading, Lighting, Show, and
Panels (the Show menu allows you to show and hide different types of objects). The Hypergraph
view contains these menus: Edit, View, Bookmarks, Graph, Rendering, Options, Show, and Help.
For perspective and orthographic views, you can either access these menus from the top of the
window pane or use the second row of menus in the hotbox. For views like the Hypergraph or
Hypershade, pressing and holding the right mouse button will bring up the menus (or you can use
the menu across the top of the window). There are also menus for the Channel box and Attribute
Editor.
Generally speaking, most windows in Maya have their own menu set, which explains why Maya
doesn t just use one menu bar across the top of the screen: there are at least one hundred
individual menus, and there would be no space to place all these menus across one screen.
Attempting to nest all these menus, on the other hand, might have taken 10 or more levels of
nesting to fit all the menus into one menu bar, making the task of picking any individual menu item
both laborious and baffling. Given the complexity of the task, organizing Maya s windows into
contextual subsets was both a necessity and a more elegant solution to the problem.
Shelves
While we have not touched on shelves much in this chapter, they offer a convenient way of
grouping your most frequently used commands and tools together in one place. The shelf bar is
one of the most noticeable features of Maya s GUI. It appears just below the Status line. Labeled
with Shelf1, Shelf2, and so on, the left side of the Shelf line contains the manipulation tools that we
have discussed above. Additionally, there are several buttons, organized into a tab called Shelf1
(and Shelf2, etc.) that perform useful commands. For example, to create a NURBS sphere, you
merely click on the blue sphere button; to create a spotlight, click the spotlight button; to create a
CV curve, click the CV curve button (the leftmost button on the right side of the shelf).
Note You can customize these shelf buttons to suit your needs. For more on how to do this,
see Chapter 3 or Chapter 16.
Having these buttons available on a shelf makes the process of creating each item much more
straightforward than having to find them in a hierarchical menu set.
If you have used a 3D animation program in the past, you will probably be familiar with a scene
management tool like the Outliner. From top to bottom, the Outliner (Window Outliner) lists all
objects in your scene, including cameras (note that the orthographic views top, side and front are
just cameras listed in the Outliner), lights, curves, and geometric objects. If you have objects that
are parented to one another (a leg, for example, is parented to a body so that they move together),
the Outliner will indicate this by a twirl-down arrow to the left of the parent object (the body in this
case). Clicking the arrow will show the child object (the leg) which, because it is the child object, is
tabbed in under the parent. The Outliner menu contains several options, which will be discussed
further in the following chapter.
The Hypergraph, by contrast, is probably like nothing you ve seen before. It is, essentially, a linked
(or hyperlinked) outline of your scene, showing not only your scene elements, but how they are
connected. While the Hypergraph may at first appear bewildering, its fashion of laying out a scene
can prove invaluable. The following image shows how the scene shown in the Outliner, above,
would look in the Hypergraph.
Note The Channel box is so named because elements that can be animated in a 3D
program have often been termed channels. To animate a ball going up and down,
you would animate its Y-axis channel (by setting several keyframes over time). While
Maya uses the term attribute for anything that could potentially be keyable in a scene,
those which have actually been set to keyable are placed in the Channel box.
As you ll see throughout this book, the Attribute Editor and Channel box are your keys to
controlling all of an object s attributes, including numerical inputs for translation, rotation, scale,
and visibility, as well as its construction history, like spans of CVs and the radius of a circular
object. The Attribute Editor, in addition (via its tabbed windows) allows you to access materials,
tessellation criteria, and other features. To toggle between the Channel box and Attribute Editor, or
to bring up the Attribute Editor in a separate window, just press Ctrl+A.
Note Materials? Tessellation? If you re new to 3D animation, don t worry about absorbing
all the jargon right away. The following chapters introduce all the essential concepts in
a logical and straightforward way.
If you click on the name of an attribute in the Channel box and then MM drag in the scene window,
you will get a virtual slider that controls the number next to the channel name. This is a very
powerful, time-saving feature in Maya.
The Timeline
The timeline, just below the main scene window(s), is the key to animation in Maya.
The numbers on the timeline by default are set to frames (and by default, frames per second is set
to film rate 24 so 24 frames equals one second of animation). To the right of the time slider is the
current time marker (probably set to 1.00) see the image above for where the current time (and
other timeline items) is. To change the current time in your animation, you can either drag the time
marker in the time slider or double-click in the current time field and enter a number (like 5) you
will then see the time marker move to that frame larger numbers (like frame 20) are, of course,
later in the animation. Below the time slider is a range marker (the gray bar with a 1 on one end
and a 24 on the other) that lets you control the range of the time slider within a larger animation. To
change the position of the time slider while maintaining the same range (24 frames by default), just
drag the range bar by its middle. To change the starting point of the range, drag the left square left
or right. To change the ending point, drag the right square to the left or right.
To the left of the time range bar are two numeric fields. The left-most field sets the animation start
frame (often people will set this number to 0 for the first frame instead of 1). The field to its right
sets the starting frame of the time range (changing this number is equivalent to dragging the left
square of the time range slider). To the right of the time range bar are two more fields; the left one
sets the ending time of the animation range (equivalent to dragging the right square on the time
range bar), while the right field controls the end point of the animation (set to 48 frames as a
default).
To change the settings for the time slider, open the animation preferences window (either click the
Animation Preferences button, to the right of the key icon at the bottom right of the screen) or open
it by choosing Options General Preferences Animation tab. In this tab, you can control how the
units are displayed on the timeline and numeric fields, set playback to normal or free (required for
playback of dynamics), and even adjust animation beginning and end points and so forth. Under
the Units tab, you can change from the default film (24fps) to (25fps), (30fps), seconds, minutes, or
even hours for your slider units.
Tip To play back an animation, you can either use the VCR-like controls to the right of the
time line, or press Ctrl+V to start and stop the animation, and Ctrl+Shift+V to reset the
animation to its starting frame.
Note For information on how to use MEL commands with the Script Editor, please see
Chapter 16, MEL Basics.
To see how the Script Editor works, type sphere (in lowercase letters) into the input window and
press the Enter key on the numeric keypad (not the alpha keyboard). You should see the line
// Result: nurbsSphere1 makeNurbsSphere1 //
appear in the history window (telling you what Maya has done to complete your command), and a
sphere will appear at the origin of your scene.
Because the Command line is just the last input line in the Script Editor, you don t have to open
the Script Editor for a simple command. Try closing the Script Editor and then, in the Command
line, type in cone (all small letters), and press either Enter key. A cone should appear in your
scene, and the Feedback line (to the right of the Command line) should now read
Result: nurbsCone1 makeNurbsCone1
letting you know what actions Maya has taken to complete your command.
Tip To focus on the Command line when you are in a scene window (so you don t have
to click in the Command line field with your mouse), just press the ` key at the top-left of
your keyboard.
Summary
You ve seen in this quick tour that while Maya is a very deep and complex program, a great deal
of thought has gone into making the interface as intuitive as possible. Consistent interface
elements (like using the Alt key and mouse drags to move around many different windows),
grouping tools together, and even placing clues about your orientation in space and the type of tool
you re using directly in the scene windows all of these features work together to ease the new
user s entrance into this complex environment.
More importantly, the interface is completely customizable, from its smallest to its largest detail, so
that you can tailor the program to meet your needs. As you grow more comfortable with using
Maya, you will want to optimize its interface to allow you to work more quickly with less clutter. In
the following chapter, we will explore exactly this issue, looking into built-in options, creating
buttons and menus of your own, and making the best use of some of Maya s organizational
windows (like the Outliner and Hypergraph). If you are very new to Maya, spend a bit of time
playing with the interface after reading this chapter. If you are an advanced beginner or beyond
read through the next chapter to see how you can make Maya work even better for you.
In addition to several subtle improvements that make the interface more consistent and
easier to use, the new Hypershade is a striking improvement in the way Maya handles
textures, materials, and the like. Because the Hypershade works much like the Hypergraph,
working with materials and textures now feels similar to working with geometry in the
Hypergraph, and navigating the complexities of a shading network is simplified greatly. This
reworking of the Maya interface for version 2 (plus a little effort on your part to get to know
the Hypershade) can greatly improve workflow in Maya, speeding up complex tasks, and
making simpler ones & well, simpler.
Most interface options are, fittingly enough, under the Options UI Preferences menu. On
selecting this choice from the menu, you will see a multi-tabbed window that allows you to adjust
many of Maya s UI settings.
For each tab, you have the option of saving your preferences automatically (on quitting) for use in
you next Maya session, or saving them explicitly (by clicking the Save button) by saving explicitly,
you can alter your preferences for one session without affecting the interface when you restart
Maya. If you are unsure how to return to a default set of options, try using the Save Explicitly option
until you are sure you like the interface changes you make. Under the Windows tab, you can adjust
top and bottom dimensions for both the main window and Script Editor, though it is probably easier
to do this interactively in the Maya window itself. You can also turn off the title bar and main menu
bar doing so removes the blue border at the top of the screen (which contains the title of the
scene) and the menu set at the top of the main window, saving about 30 or 40 pixels of space for
your scene window, and cleaning up the interface look a bit. You can also tell Maya to either
remember or forget where you position your windows, and whether the Attribute Editor appears in a
separate, floating window (as in version 1) or replaces the Channel box when Ctrl+A is pressed.
Tip You can also turn off the main menu bar and/or pane menus under the Hotbox Controls
menu in the hotbox: display the hotbox and choose Controls Window Options Show
Main (or Panel) Menu Bar.
Under the Shelf tab, you can adjust how the shelf icons are presented, and you can tell Maya
whether to save shelf contents automatically or only when you explicitly tell it to save (generally it is
better to have Maya save the contents automatically, unless you are experimenting with a new
look). The Layout tab allows you to turn all components of the window (except the main scene
window) on or off. If, for example, you are only modeling for a time, you could turn off the time and
range sliders, freeing up more space for your scene. The Panels tab allows you to turn panel
menus on or off, and also lets you specify how the main scene window will first appear when you
open a new Maya scene (it defaults to Single Perspective view).
Tip You can also quickly turn panel menus on or off directly in the Options menu (Options
Layer Bar, for example). Being able to turn panels on and off quickly makes it easy to
switch from, say, a modeling user interface (UI) set to an animation UI set.
The Miscellaneous tab lets you choose how your Web browser (usually Netscape Communicator or
Microsoft Internet Explorer) will be activated upon a request for online help. You can also choose
which menu set Maya defaults to on opening, and whether the focus (the cursor) will stay on the
command line after you execute a MEL command from it.
Note For more on how to use the hotbox and how to set its options, see Chapter 2.
Note This discussion of customizing shelves, hotkeys, and marking menus is very basic.
Because MEL scripts are the most efficient tool for customizing these interface
elements, you ll find a much more thorough discussion of these topics in Chapter 16.
Shelves
While we briefly discussed shelves in the previous chapter, they might have appeared only
marginally useful. What makes shelves really useful is not what appears on them by default, but the
fact that you can easily add new buttons to any shelf. You can, for example, make any menu item a
shelf button, or even place MEL scripts on the shelf, allowing you to perform complex tasks at the
click of your mouse. Additionally, as you can create and use multiple shelves (to create a new
shelf, choose Options Customize UI Shelves, select the Shelves tab, and click the New Shelf
button), you can make a shelf specific to a task. For example, a shelf could be devoted to just MEL
scripts, and another could be given over to common tasks for a specific project you re working on.
To switch to a new shelf (shelf2, for example), simply click its tab on the shelf bar. To create a new
shelf button from a menu item, hold down the Ctrl, Alt, and Shift keys (all together), and choose the
menu item from the menu bar (not the hotbox). A new button will appear on the active shelf, and
clicking this button will be the same as selecting the menu item you had chosen.
Warning You must create shelf buttons from the main (or panel) menu bar, not the hotbox.
As many users turn off these menu bars, it is a bit of a pain to create new shelf
buttons you first have to reactivate the menu bar, then create the button, and
finally turn the menu bar off again.
To delete any shelf button, just MM drag it onto the trash can at the top right of the shelf bar. To
move an item to a different place on the shelf, simply MM drag it to the place you wish it to be.
Other shelf items will adjust themselves to the new placement.
As an example, let s create a button that automatically creates a NURBS cylinder, and place it just
next to the NURBS sphere button on shelf 1. First, be sure you have shelf 1 selected by making
sure its tab is frontmost. Next, hold down the Ctrl, Alt, and Shift keys and, from the main menu bar,
select Create Nurbs Primitives Cylinder. A new button should appear at the far right of shelf 1.
Finally, just MM drag the new button between the sphere and cone icons on the shelf. Voil, one
more primitive you can now create without resorting to the menu bar!
Tip You could also create a NURBS cylinder button that automatically brings up the options
window. Just hold down the Ctrl, Alt, and Shift keys and choose Create Nurbs
Primitives Cylinder .
You can create as many of these buttons as you wish (though you might have to scroll through the
list if you create too many on one shelf), and/or delete any of the default buttons Maya provides for
you, thus customizing your shelves to contain buttons that are the most useful to you (buttons for
items like the Hypergraph and Hypershade are very nice to place on shelf 1 for easy access). You
can also create new shelves by opening the Shelves Options window (Options Customize UI
Shelves). Under the Shelves tab, click the New Shelf button, give it a name, click Save All Shelves,
and close the window.
You can also turn MEL scripts into shelf buttons. To see how this works, let s create a very simple
example. Open the Script Editor (click the Script Editor icon at the bottom right of the screen, or
choose Window General Editors Script Editor). In the input (bottom) section of the window,
type in the following:
sphere n ball r 2;
Highlight this text (drag over it, or triple-click the line), MM drag the text up to the shelf, and a new
button will appear. Now, whenever you click this new button, a new NURBS sphere named ball,
with a radius of 2, will appear at the origin of your scene. Even this simple example makes it clear
how powerful a little MEL scripting can be; clicking one button not only creates a sphere, but names
it and gives it the radius you wish. You could even build a whole shelf for geometric primitives, with
a group of buttons for each primitive type, each button having a different option set.
Tip You can also highlight any text in the history (top) section of the Script Editor, recording
your actions into a macro. You could therefore perform several complex steps in the
Maya interface (that you wish to repeat later), and turn all these steps into a button by
highlighting all the text in the history window and MM dragging it to a shelf. Thus, with no
MEL programming knowledge, you can create buttons that do very complex actions. For
specific examples, see Chapter 16.
Hotkeys
If you have used Maya for any time, you are already familiar with many of its hotkeys, which are
simply shortcuts to commands (or command modifiers) that are accessible by a keystroke.
Accessing the Move tool, for example, is a simple matter of pressing the W key. As with most of
Maya s interface, you are not limited to the hotkeys Maya has built in: You can create your own
hotkeys, or even change or delete the hotkeys Maya has built in.
Note Again, you ll find a more thorough discussion of customizing hotkeys in Chapter 16.
As an example of how to create a hotkey, let s make a keyboard shortcut to bring up the
Hypergraph. First, open the hotkeys options window (Options Customize UI Hotkeys). In this
window, scroll down until you reach the Window Menu set, then find Window >Hypergraph and
highlight it.
First, we need to find a key that is not currently mapped to any other hotkey. Under Key Settings, in
the Key text field, type a lowercase h (H is different from h for hotkeys!), be sure the Press radio
button is enabled, and check the Alt box (which means the hotkey will be Alt+h, not just h). Now
click the Query Key button to see if any hotkey currently uses this combination. You should see a
dialog telling you no command is currently mapped to this key (if not, try another key/modifier
combination). To enable the new hotkey, click the Apply New Settings button; you should now see
(in the text window at the top) that Alt h Press has been assigned to the Hypergraph command.
Press the Save button to save your changes. To test the new button out, close the hotkeys options
window, then press Alt+h in the scene window. The Hypergraph should pop right up for you!
Tip You can also create your own commands and assign them to hotkeys. This is covered
briefly in the next section, and more thoroughly in Chapter 16.
Marking Menus
In addition to shelves and hotkeys, you can also create entire contextual menus (called marking
menus) that appear either in the hotbox or when you press a hotkey combination.
Note You ll find a more thorough discussion of creating and using marking menus in
Chapter 16.
Let s create a marking menu that will create a sphere using one of four options: radius = 1, radius
= 2, radius = 3, radius = 4. First, open the Marking Menus options window (Options Customize UI
Marking Menus). In this window, you will see listed several marking menus that have already
been created for Maya, including the region menus that appear to the north, east, south, and west
in the hotbox (for more on this, see Chapter 2).
For our purposes, we want to create a new marking menu, so click the Create Marking Menu
button. This brings up the Create Marking Menu window, with several blank boxes that we will use
to create our own marking menu.
First, give the marking menu a name, such as CreateSpheres. Because we will create a marking
menu with four options, it is logical to use the top, right, bottom, and left boxes as our menu
positions. There are a couple of ways to assign a command to a menu item: you can MM drag a
shelf button that you have made (or one of the default buttons, like the cone button) onto a menu
box, you can MM drag MEL scripts or lines to the menu item, or you can RM click on a menu item
and choose Edit Menu Item (the option we will use here). Starting at the top center box, RM choose
Edit Menu Item, and in the window that pops up, type Sphere radius 1 in the Label field, and type
sphere r 1; in the Command(s) field (be sure the sphere command is in lower case!). Finally, click
Save and Close to save your changes.
Now, move over to the right center (east) box, RM choose Edit Menu Item, and repeat the steps
from above, but this time label the button Sphere radius 2, and make the MEL command sphere
r 2;. Move to the south and west boxes, and repeat the steps, making the south box create a
sphere of radius 3 and the west box create one of radius 4. When you are finished, your Create
Marking Menu window should look as follows.
To test the buttons, click in the Click Here to Test box. You should see all your menu options
appear, and if you choose an option, an appropriately sized sphere should appear in your scene
window.
Once you have your menu working as you want, click Save and then Close to return you to the
Marking Menus Options window. Your new CreateSpheres menu should now appear at the bottom
of the list, highlighted (if it s not highlighted, do so). We now have our menu, but we can t access
it from the scene window. To do so, we need to choose whether we want the menu to be part of the
hotbox or accessible via a keystroke. This time, let s create a marking menu that will appear when
we press a special key: under Settings, choose Hotkey Editor from the pop-up menu and then click
the Apply Settings button. To the right of the CreateSpheres item in the list at the top of the
window, there should now be the message Accessible in Hotkey Editor, meaning that we can now
make a hotkey for our new menu.
Close the Marking Menu Options window and open the Hotkeys Options window (Options
Customize UI Hotkeys). Scroll all the way to the bottom of the hotkey list, and, in the User
Defined section, you should see CreateSpheres (Press) and CreateSpheres (Release).
Tip The press and release states are important to a marking menu. When the hotkey is
pressed (the press state), the menu will appear; when the key is released (the release
state), the menu disappears. If you forget to define a release state for your menu, it will
not disappear when you release the hotkey!
Now we just follow the steps we used in the last section to define a hotkey. First, select the
CreateSphere (Press) item; then query a key Ctrl+r should be open for your use. When you have
found an open key combination, be sure your Action radio button is set to Press; then click the
Apply New Settings button. You should see that CreateSphere (Press) is now set to Ctrl r Press in
the top list. To define the release state, select the CreateSphere (Release) item, type r and the
control modifier in the Key Settings, and be sure the Action is set to Release (not Press). Then click
the Apply New Settings button, and the release state should be mapped. Finally, press the Save
and Close buttons in the Hotkeys Options window. (Whew!)
To test your new marking menu, hold down Ctrl+r, and press the left mouse button. You should see
your marking menu, ready for use!
Although there are many steps involved in creating a marking menu (so you probably wouldn t
create one for a quick, simple task), consider the power a marking menu gives you: a complete
new menu with multiple items (and even subitems) that you can access anywhere in the scene
window at the click of a key. Marking menus are relatively easy to create, and a great idea for tasks
you repeat often especially if they have multiple options.
Working in Layers
Working in layers can be particularly useful when you are modeling a multiple-part, complex object
(the inner workings of a mechanical clock, for example, or a complex creature like a human or dog).
By placing groups of objects in layers (fingers in one layer, hand in another, arm in another), you
can easily hide, display, template or otherwise adjust large groups of objects all at once, rather than
tediously selecting each object and then changing it or, worse yet, being unable to select one
object that is hidden behind another.
The Layer bar is a quick visual reference for working in layers, so if you have it turned off, turn it
back on again (Options Layer Bar). The Layer bar should appear just above your scene window,
with the Default layer already selected (the Default layer is where all objects that have not been
assigned to other layers are stored). To create a new layer, just click the layer icon (the icon to the
far left of the Layer bar that looks like three sheets of paper). If you double-click on the default layer
name (layer1), a dialog box will open, allowing you to rename the layer to whatever you wish. Once
you have made and named a layer, create a couple of simple objects (like a sphere and a cylinder),
select them, and, from the triangle button to the left of the layer name, choose Assign Selected.
The objects you had selected are now part of your new layer. Return to the scene window, deselect
all objects, and (again from the Layer pop-up menu), choose Select All in Layer. You will see your
objects selected once again, as they are a part of this new layer.
To get a better view of your new layer, choose Edit Membership from the layer pop-up menu. This
brings up the Relationship Editor, with all layers on the left side, and all objects on the right side.
When you click on a layer name, all objects in that layer become highlighted on the right. You can
then click on any object on the right side, toggling its inclusion in the layer (highlighted means it is
included; not highlighted means it is not). You can quickly change which layer you are working with,
and which objects are included in each layer by using this window. Try placing one object in your
layer, another in the default layer.
Note Each object can only belong to one layer. Therefore, if you highlight your sphere in the
default layer (for example), it will be unselected from your other layer.
Tip You can also adjust each layer s attributes by choosing Layer Attributes from the Layer
pop-up menu.
To quickly hide or show all objects in a layer, check the Visible box in the Layer pop-up menu. This
menu can also change the state of each layer individually. The Standard state is your normal
working state. The Template state turns the objects into templates (they cannot be selected or
moved, and they turn a pinkish orange). The Reference state makes the layer a reference layer,
once again making all objects in it unselectable, but keeping their display properties.
While working in layers for a simple scene like our example may seem a waste of time, as we move
on to more ambitious projects you ll see how useful being able to select, hide, template or
otherwise alter several objects in a complex scene can be. If you have not used layers before in
Maya or any other program, try modeling an intricate object that has many overlapping pieces and
you ll quickly appreciate how useful layers can be.
The Outliner
There are two basic ways to look at all of the information in your scene: the Outliner and the
Hypergraph. While the Hypergraph is the more flexible and powerful of the two, the Outliner is
usually easier for a new Maya user, and it performs several tasks in a more straightforward fashion
than does the Hypergraph. Conceptually, the Outliner is exactly what its name implies: it is an
outline of the scene you are working on.
To open the Outliner, choose Window Outliner from the main menu set (or hotbox). If you had
created a default sphere, and it was selected, the Outliner window would look as shown on the
facing page.
The first four items in the Outliner are the four default cameras (plus any other cameras you might
have created). Next are listed geometric objects (like the sphere). Finally, sets (groupings of
objects, like the default light and object sets) are listed. Any highlighted objects (in gray) are
selected in the scene, and vice versa. You can rename any object listed in the Outliner by
double-clicking its name. You can also bring up the Attribute Editor and focus it on any object in the
Outliner by double-clicking on its icon.
There are several viewing options available in the Outliner, accessed either via the Outliner s
menu or by holding down the right mouse button anywhere inside the Outliner window. Some
options you have are to show only specific types of objects, like geometry (Show Objects
Geometry), to show shape nodes for objects (more on this in Chapter 4), or to show all objects,
rather than just the DAG (Directed Acyclic Graph a technical term for the common objects you see
in the scene) objects. If, for example, you turn on Show Shapes, a plus sign appears to the left of
any object in the scene that has a shape node (as a sphere or other geometric object would have).
By clicking on the plus sign, you can expand the outline to see the shape node; in the case of our
sphere, this would reveal the nurbsSphereShape1 node.
The Outliner can be used in several ways, but there are two that are probably the most appropriate:
to get a quick look at the scene as a whole, and to access objects in a complex scene in a more
convenient manner than having to pick the object. The first use for the Outliner getting an
overview of the scene is the function of any good outline (from the outline of a term paper to the
schematic outline of an electrical circuit). Because you can show or hide any type of object in the
Outliner, you could, for example, look only at the lights in a scene; this would allow you to see
quickly how many lights there are, and, by double-clicking on the light icons, you could just as
quickly bring up the Attribute Editor to examine or adjust their options.
The second main use for the Outliner allowing quick selection flows from the first. As the Outliner
provides easy access to any or all objects in the scene, you can rapidly choose, alter (via the
Attribute Editor), or rename objects in a convenient list form, rather than having to hunt through a
scene to find them, never knowing for sure if you have forgotten an object. In complex scenes, the
ability to choose objects becomes even more important. Consider an object like a Christmas tree
with a hundred ornamental lights on it. The tree itself might consist of two or three dozen objects
(branches, base, and so on), and the hundred lights would be intertwined in the tree, making them
very difficult to select for modification. In the Outliner, however, this job would be easy. First you
would choose to show only light objects (Show Objects Lights) and then move down the
outline of the scene, selecting and adjusting lights at will. As should be apparent, this method of
interacting with your scene can be a real lifesaver.
The Hypergraph
The Hypergraph performs many of the same functions as the Outliner, but it uses a completely new
interface design. The whole of the next chapter is devoted to the Hypergraph, so we will only
mention it briefly here. This tool is worth noting in a chapter on interface optimization, as it can
radically reduce the time you spend hunting through the scene and other windows, and it can really
speed up your workflow.
To bring up the Hypergraph, choose Window Hypergraph from the main menu set. For a scene
with a single sphere, the Hypergraph would look as follows when you first bring it up.
In its simplest incarnation (with many options turned off), the Hypergraph is actually simpler to
understand than the Outliner. There is only one object apparent in the Hypergraph for the scene in
this case, the NURBS sphere. When an object is selected in a scene, the corresponding box in the
Hypergraph turns yellow; if the object is not selected, the object remains gray (similar to the default
shading color of all objects in Maya). Clicking on a box in the Hypergraph is the same as selecting
the object in the scene window: the box turns yellow (indicating it is selected) and the object in the
scene is highlighted in green. You can select multiple objects in the Hypergraph by either
Shift+clicking on them or simply dragging a selection marquee around them. To deselect a single
item, Shift+click on it in the Hypergraph. To deselect everything, just click in the empty space in the
Hypergraph window. The Hypergraph contains many menus, and while a complete discussion of
them must wait until the next chapter, it is worth noting that you can choose to display only certain
objects in the Hypergraph (Show Objects NurbsObjects, for example), or show object
components like shape nodes (Options Display Shape Nodes).
Where the Hypergraph really shines is in its ability to act like any other scene window. You can
scale and track through the Hypergraph just as you would in any scene window, allowing you to
see the entire sweep of a complex scene, or any part thereof, very easily. You can also focus on a
selected object very quickly (say, for example, the object is selected in a scene window) by
pressing the F key on the keyboard; or you can expand the view to contain all elements of a scene
by pressing the A key. For simple scenes, the Outliner is a very useful tool, but for complex ones,
the Hypergraph can be a much faster interface, as it allows such tracking and focusing across
hundreds of scene elements. Which scene outline interface you want to use is, of course, your
choice, but you should become familiar with both; one author, in fact, often uses both the Outliner
and the Hypergraph in tandem on very complex scenes, allowing him to work in both views at once.
The Hypershade
While the multilister from Maya 1 was a useful interface for working with textures, materials, and
utility nodes, it was not intuitive, and its interface did not fit in with the rest of Maya s interface
conventions. Version 2 provides the Hypershade to remedy that problem (though you can still, of
course, use the multilister). Using a similar convention to the Hypergraph, the Hypershade not only
shows you interactive previews of what a material or texture will look like, it shows how the
elements of a shader network are connected, giving you more information in a more intuitive
interface than the multilister. Also, as with the Hypergraph, you can zoom and track the
Hypershade like any Maya scene window, and use the F key (frame selected) and A key (frame all)
to quickly focus on any element(s) you wish, making it easier to navigate scenes with large
numbers of shading groups.
On the left is the Visor window, which is similar to the Outliner but contains graphic icons of
textures and allows you to create, as well as view, any material node you wish. On the right is a
Hypergraph-like window, known as the graphing window, with all materials listed in a new scene,
there will only be two materials listed, the lambert1 shader (the default shader for geometry) and
the particleCloud1 shader (the default shader for particles).
Tip The three buttons at the top left control your view of the Hypershade window. Click the
left button to turn off the visor, so that the graphing window fills the Hypershade, or click
the right button to turn off the graphing window and view only the visor. (Click either
button a second time to restore the view.) Click the middle button to clear the view.
To select a material, simply click on it (it highlights in yellow to show that it is selected). You can
then view that material s upstream connections, its down stream connections, or both by clicking
the appropriate button at the top right of the Hypershade window or by choosing Graph and the
connection type from the Hypershade menu. The particle cloud, for example, has several inputs
and outputs that appear as shown next if you click the Show Up and Downstream connection
button. To get back to a general view of materials, choose Materials from the pop-up menu at the
top of the Hypershade window.
Note An upstream connection is any Hypershade node that feeds into the selected node
(its output is fed into the currently selected node or it is upstream in the data flow). A
downstream connection is any node that the currently selected node feeds data into
thus it is downstream from the selected node in the data flow.
Tip You can also view shading groups, utilities, lights, cameras, and so on, by choosing the
item from the pop-up menu.
In addition to looking at materials, textures, and such, you can also create these items directly in
the Hypershade in one of two ways. To create a material graphically, find the Create subsection of
the visor (below the Rendering section), click on the Materials folder to open it (unless it is already
open), and MM drag a material ball into the Hypershade side try the phongE material, for example.
After dragging, you will get a new phongE material in the Hypershade, ready for you to adjust. To
assign this new material, you can just MM drag it on top of any object in your scene window. (Or
you can click on the triangle below the phongE name and choose Assign Material to Selected; this
is a good method of assigning the material to several objects at once.) To change the material s
attributes (color or transparency, for example), double-click on the material ball to bring up the
Attribute Editor, and then make any changes you wish to the material. The ball in the Hypershade,
as well as any objects that have this material assigned to them, will be automatically updated with
your changes. The other method for creating a new material is simply to choose Create Material
from the menu in the Hypershade Create Materials phongE, for example. This produces a
new material in the Hypershade window, just as MM dragging the material icon from the visor does.
To assign a texture to your new material, you can again choose to create the material via menu
commands (Create Textures 2D Fractal, for example), or just MM drag a swatch from the
Create: Textures folder in the visor on top of your material.
Once you complete the drag, a menu will open, letting you select which element of the material
(which input) you wish to assign the fractal (or other) texture to. The most common choice is simply
Color, so choose that. The Hypershade window will be updated to show that there is a texture input
connection (coming from the left is input; going to the right is output) of a fractal texture, and the
phongE material ball, plus any objects with the phongE material in your scene, will update to show
the new texture.
While there are many other functions the Hypershade can perform besides the basics we have
covered here, the centralized power of being able to create, modify, connect and disconnect
materials, textures, and so forth, should be obvious from the quick tour we have taken. It is worth
the effort to get to know the Hypershade, as it will save you a great deal of time and effort later on
in your work with Maya s shader networks.
Tip For more on rendering with the Hypershade, see Chapter 18.
Open a new scene in Maya. Either sketch out a top and side view of an arm and then scan it into
your computer, or use the sketches included on the CD-ROM (ArmTop.tif and ArmSide.tif).
Tip Sketching your image before you model is always a good idea even if you have no skill
at drawing. It is much easier to see what you re creating by quickly drawing it on paper
than it is to try to create an object in 3D space out of your head. You will find that
sketching an object before modeling it, far from taking extra time, will save you a great
deal of time, and give you better-looking results as well.
Note When you sketch an object for use as a background image for modeling, it is important
that your two views (top and side here) are exactly the same size. We generally use
graph paper in these circumstances, as it is easy to see how large the image is on this
type of paper.
As we will use these sketches to make our model, they need to be loaded into Maya s top and
side views so we can reference them as we build our arm. First, open the Outliner and select the
top camera icon, double-clicking it to open the Attribute Editor. In the Attribute Editor, click the
Environment triangle, and then click the Image Plane: Create button to create an image plane for
the top view camera. When you click this button, the Attribute Editor will focus on the image plane
(imagePlane1), but you still need to assign your arm image to the plane. To do so, scroll down to
the Image Name line and click the Browse button. Find your top arm image (or use the ArmTop.tif
image on the CD) and choose it. Repeat this process for the side view, using the side arm view
image instead. When you are finished, your four view (press the space bar quickly to get this)
should look as follows.
In order to keep from accidentally selecting one of these planes as we continue to work, let s put
them on their own layer and make that layer a reference (unselectable) layer. From the layer bar,
click the Create a New Layer button, rename this layer ImagePlanes, select both image planes,
and choose Assign Selected from the layer menu. To make the layer a reference layer, choose
Reference from the layer menu.
There are several good modeling techniques to use from this point on, but we will use a common,
fairly painless, method that produces good results quickly: lofting a series of circles into a shape.
Note Lofting creates a shape in something like the way a wooden ship hull is laid (or lofted)
over a skeleton of wood that defines the shape the hull will have once the lofting
process is complete. (The metaphor of shipbuilding and hulls will become quite
familiar, as it underlies much of the terminology of 3D modeling.)
First, create a new layer (click the New Layer button in the Layer bar) and name it Circles we will
assign our circles to this layer so they are separate from our eventual lofted surface. Next, expand
one of the views (the top, say) to fill the screen (click in that pane, and then press the spacebar
quickly). We could create our circles by going to the menu each time, but let s speed up our
workflow by quickly making a button on the shelf to make our circles. Hold down the Ctrl, Alt and
Shift keys and, from the main menu bar (this won t work from the hotbox!), choose Create
Nurbs Primitives Circle; a new button should appear on your shelf, and clicking that button will
create a circle.
If you now click the Circle button, the circle will probably be flush with the plane, which means we
would have to turn it perpendicular to the plane each time. Rather than do this every time we create
a circle, let s change the options once and save them, so that each new circle will be oriented
correctly. Choose Create Nurbs Primitives Circle , and in the options window, change the
Normal Axis setting to the Z axis. (From our angle, the circle will now appear as a line.) Click the
Save button (to save the settings) and close the window. The old Circle button on the shelf will
remember its original settings (when you created it), so you will need to MM drag this button to the
trash can on the shelf bar, then recreate the button (or, if you have read this far before starting the
process, just change the circle settings first!).
Now we re ready to build our arm. In the top view (don t worry about the side view yet), Click the
Circle button, move the new circle down to the bottom of the arm, and scale it to the same size as
the bottom of the sketched arm. Remember that you can zoom your view in to see how accurately
you re placing the circles.
Tip If you find the background image too distracting, select the camera (top here), open the
Attribute Editor, click the imagePlane1 tab, and reduce the alpha gain to about 0.5. This
will fade the image back a bit, giving you a clearer view of the circles you are creating.
To create the arm, create several circles, and position and scale them to fit the sketch of the arm in
the top view. Be sure to place more circles around the elbow area, as that area will eventually bend
(as any good elbow should), and therefore needs more definition. When you are finished, your
arm should look similar to the following image.
When you have finished with the top view, you will now need to switch to the side view, this time
scaling and moving the circles so they fit from this view as well. (Don t move them along the X
axis, however!) Your completed side view should look similar to this.
Tip If you find you need a new circle to help build the shape in the side view, add one just
be sure to go back to the top view and adjust it there!
We now have the outline of our arm finished it s time to create the arm itself! We need to select
all the circles that will make up our arm and then loft them. But don t just drag a selection marquee
around the circles; the loft tool depends on the order in which you select your circles, so we need to
be careful about the order we select them. Starting at either end (the top or bottom of the arm),
Shift+click on each circle in order, until all are selected. Before we loft these circles, first assign
them to the Circles layer for later use (choose Assign Selected from the Circles layer menu). Now
let s see how we did: Loft the circles into a surface (Surfaces Loft). You should see an arm-like
tube appear in your perspective window.
Because of the image planes, it s a bit difficult to see our arm. From the imagePlane layer menu,
uncheck the Visible box to make the planes disappear.
You will probably find that the arm doesn t look quite realistic. Fortunately, because Maya
remembers construction history, you can go back and tweak the position, scale, and rotation of the
circles (using the same techniques we used to create the circles, above) to get the arm to look the
way you want it. When you like your arm, turn off the circle layer s visibility so you can see the
surface more clearly.
Tip Templating the lofted surface (Display Object Components Templates) so you can t
accidentally select it is a real time saver. To untemplate the object when you are
finished with adjustments, select the lofted surface in the Outliner or Hypergraph, and
choose Display Object Components Templates again.
Now we need to string our arm with an IK chain so we can move it around like a natural arm. Make
the side view fill your workspace, and then choose the IK Joint tool from the shelf (or choose
Skeleton Joint Tool). Starting at the top (shoulder), click (or drag) the tool where the shoulder
joint should be, then click again where the elbow should be, and finally, click where the wrist would
be. If you don t like where your joint is, undo the last click (press the Z key) and try again. When
you are satisfied with the look of the joints, press the Enter key to confirm the new skeleton.
Warning Be sure not to make all three joints follow a straight line. Maya s IK solver uses the
direction of the joint s initial bend to determine which direction it will bend later. If
you make the joints straight, Maya won t know which direction to bend the arm,
and you will get bizarre results.
We could now manipulate the joints using the rotate tool, but it is generally easier to create an IK
chain to make the moving process simpler. To do so, choose the IK Handle tool on the shelf (or
choose Skeleton IK Handle Tool) and click first on the shoulder joint and then on the wrist joint.
(Skip the elbow joint so that the kinematics chain will go through the elbow, allowing it to bend with
the wrist movements). You should now see a green line connecting the shoulder and wrist joints. If
you wish, you can now move the joint around by drag selecting the wrist IK handle and moving the
arm however only the joint moves at present; we need to attach the arm to our new joint.
Tip If you move the joint around before attaching the arm to it, be sure to undo (press Z)
back to the original position before attaching the arm.
The final step, attaching the arm surface to the arm joint, is a process of selecting the joint and
surface and binding them together. First, select the root joint of the arm skeleton (the shoulder
joint), then Shift-select the arm surface. Finally, choose Skin Bind Skin Smooth Bind to bind
the two together. To see your beautiful new arm at work, drag-select the wrist joint and use the
move tool to move the wrist around. The skeleton (and arm surface) should follow the wrist where
you drag it.
Note You may notice that the elbow doesn t bend properly (it folds too much). You can use
the Artisan tool to adjust the joint goal weights of the arm to make the bend far more
realistic looking. For more on how to do this, see Chapter 9.
Summary
In this chapter, we went over many elements in Maya that you can either adjust or use as-is to get
the most out of your work. Looking at general options, shortcuts, organizational windows like the
Hypergraph, the Hypershade, and the Outliner, and working in layers, we saw how much one can
adjust Maya s default interface to improve your workflow. The final working example building a
moveable arm took many of the workflow lessons we learned in this and the last chapter and put
them to real-world use. We created a shortcut button, worked in layers, and used hotkeys to
choose the scale, move, and rotate tools, all of which increased the speed with which we
completed a reasonably complex task. In the next chapter, devoted to the Hypergraph, we will see
how a thorough knowledge of this interface element can improve your workflow on complex tasks
even more.
Even if much of what you have read in this chapter is a bit confusing to you now, try to remember,
as you continue working on your projects, the little tricks and shortcuts we have discussed here.
With a bit of practice, many of the techniques discussed in this chapter will become second nature
to you, and your Maya skills and products will reflect this.
Note The types of objects visible in a scene depend on the filtering choices you ve made
using the Hypergraph s Options Display menu.
Tip Because you will probably access the Hypergraph many times while working in Maya, it is
a good idea to create a button on your shelf for it. From the menu bar (not the hotbox),
choose Window Hypergraph while holding down the Ctrl, Alt, and Shift keys. A new
button will appear on the shelf for the Hypergraph. You can also create a hotkey for the
Hypergraph if you prefer (see Chapter 3 for more on how to do this).
If you compare this view to a view of the same scene in the Outliner, you can see that the
Hypergraph is actually less complex (as it doesn t show the cameras or default sets), but it is
organized in a side-to-side manner, rather than top-to-bottom.
You will also notice that the Hypergraph indicates a selected object by coloring it yellow (the cone
in this case), while the Outliner highlights the object in a gray bar.
Zooming and tracking in the Hypergraph use the same techniques as in the scene windows. To
zoom, hold down the Alt key and the left and middle mouse buttons dragging to the left zooms out,
while dragging to the right zooms in. To track across (or up and down) the Hypergraph window,
hold down the Alt key and the middle mouse button, and then drag the mouse around to track
through the window. By tracking and zooming, you can quickly move through even a large scene,
finding the nodes you re interested in. Additionally, you can use two hotkeys to frame the
Hypergraph around a selected object or around all objects in the Hypergraph. To focus the window
on one or more selected objects (highlighted in green or white in the scene window), press the F
key. To expand the view to fit all displayed objects, press the A key. If you try this with our example
scene (with the cone selected), pressing F will fill the Hypergraph window with the cone node, while
pressing A will expand the view to fit both the sphere and the cone.
Tip The A and F keys also work in any scene window pressing F will focus the window on
the selected object(s), while pressing A will make the entire scene fit in the window. This
is another way in which the Hypergraph and scene windows behave in the same manner.
If your scene is complex, and you find yourself consistently hunting for a particular object (or group
of objects) in the Hypergraph, you can save yourself a great deal of time by bookmarking any or all
views you are likely to need at a later point. Although our example scene is too simple to warrant
using bookmarks, let s see how the process works by creating three bookmarks: one focusing on
the sphere, one focusing on the cone, and the third showing both objects. First, highlight the cone
and press the F key (or just zoom and track until the cone box fills the Hypergraph window). Then
choose Bookmarks Create Bookmark from the Hypergraph menu set. Choosing the option box
will open a window that lets you name the bookmark (if you don t open the option box, Maya will
choose a default name for you). In this case, type cone and click the OK button. You now have a
bookmark for this view arrangement, which you can return to at any time. Next, select the sphere
object and press the F key, then create a bookmark for it (name it sphere). Finally, create a
bookmark for the complete view of the scene (press the A key to jump to a complete view of the
scene) and name it all.
To test your bookmarks, zoom and track the window to a completely different view, and then
choose Bookmarks Cone (or Sphere or All) from the Hypergraph menu set. The view should
jump back to the one you defined for that bookmark. To edit your bookmarks (add a new one,
delete a bookmark, or rename one), choose Bookmarks Bookmark Editor, select the bookmark
you wish to edit, and choose the appropriate choice from the Bookmark Editor Edit menu. Again,
using bookmarks in a scene as simple as our example is not very useful however, in a scene with
hundreds of objects, using bookmarks can save a great deal of time and frustration.
Tip You can also create bookmarks for different types of views (with the Hypergraph in
different modes as discussed later in this chapter). This functionality can really save
time, as you can avoid having to continually reset the Hypergraph s view modes as you
switch between different aspects of your project.
One other nice feature of the Hypergraph is that it shows you when an object is keyframed, by
changing its box shape in the window from a rectangle to a parallelogram. If you keyframe the ball
shape, for example, its Hypergraph representation will change to give you a visual indication that it
is now a keyframed node.
Parenting one object to another (the child object will then follow its parent s movements, rotations,
and scaling) is just a matter of MM dragging the child object on top of its parent-to-be. In our
example, MM drag the ball (sphere) onto the hat (cone). The ball will now appear beneath the hat
with a line connecting the two showing that it is now the child of the hat.
If you now select the hat, you will notice that the ball also becomes highlighted (in the scene
window), and that any transformation you apply to the hat is automatically applied to the ball. To
unparent (disconnect) the two objects, MM drag the ball into an empty space in the Hypergraph
window. The objects will once again be side by side (with no interconnecting line), indicating that
they are independent of each other.
If you are not used to working with Maya, the entire concept of nodes may seem pretty frightening.
The theory may seem difficult, but in practice, nodes and attributes are fairly easy to understand:
Nodes are anything that can be shown in the Hypergraph, while attributes are what appears in the
channel box or Attribute Editor when a node is selected. (Actually, nodes appear in the Channel
box and Attribute Editor as well: They are the boldface items you can click on to rename or to open
their attribute groups in the Channel box, or the tabs in the Attribute Editor.)
Thus, for the Hypergraph at least, all you see are nodes, and changing Hypergraph display modes
just changes which nodes you are looking at for your scene.
To see how changing display modes changes the nodes you see in a scene, let s again look at
our simple example scene (the ball and hat). From the Hypergraph menu set (or by holding down
the right mouse button inside the Hypergraph window), choose Options Display Shape Nodes.
Now that shape nodes can be seen in the Hypergraph, you will see the ballShape and hatShape
nodes, which are separate from the ball and hat nodes. (The ball and hat nodes are called
transform nodes, and are in control of where the object is, its rotation, and its scaling, while the
shape nodes are in charge of what the object looks like.)
You can also show all nodes (many of which are normally invisible) that lead into and out of an
object node, revealing the hidden depths of what Maya is doing when you create a simple
object. Select the ball node and choose Graph Up and Downstream Connections from the
Hypergraph menu set. You will then see all of the input and output nodes connected to your ball.
In this layout, the ball transform node sits atop the others, while the bottom three nodes show the
flow of information for this object: the makeNurbsSphere1 node (where you control radius, U and V
isoparms, and so forth) outputs to the ballShape node, which then outputs to the
initialShadingGroup node, where the ball is given a texture and made visible.
Note No objects in Maya are visible unless they are attached to a shading group. While the
underlying structure of an object is contained in its shape and transform nodes, it is
only in the shading group that the object is given a color and texture therefore, without
its connection to a shading group, you could not see the object.
If you wish to dig even deeper, choose the initialShadingGroup node, and display the up and
downstream connections again. This time, you will see the shapes (plus a lambert shader the
default one) that feed into the initial shading group, plus the shading group s output to the renderer
and lights, as shown next. To return to your original view, just choose Graph Scene Hierarchy
or choose one of the bookmarks you had previously saved: a nice time-saver!
Because Maya is constructed on nodes, and the Hypergraph can show just about any node
grouping (based on your filtering choices), you should begin to see how valuable a tool the
Hypergraph can be as you work through the different stages of your animation process. From
modeling to texturing to lighting to animation, the Hypergraph is flexible enough that it can display
the data you need and even only the data you need, should you wish for each stage of your
work. Just keep in mind that the Hypergraph shows nodes, and Maya is built on nodes, so all you
have to do is figure out which nodes you want to see for any given stage of your animation process,
and you can get the Hypergraph to display them for you.
While there are a great number of nodes in Maya, they tend to fall under one of these
general categories:
" Underworld nodes (nodes that are created, for example, when a curve is drawn on a
surface)
" Texture nodes (colors, procedural textures, or image files used to alter the behavior of a
material node)
" Utility nodes (which provide a utility to a shader network, such as the multiply/divide node)
While the Hypergraph s default view is very useful, it is just a first step to viewing your scene in the
Hypergraph. By using the Hypergraph s menu choices (the most common of which are repeated in
buttons across the top of the Hypergraph), you can make the Hypergraph show you just what you
need in an organized, concise manner. To see what the Hypergraph can do, let s take a quick tour
through its menus, highlighting several items that might prove especially useful in your later work.
Tip You can also collapse and expand nodes by simply double-clicking on the top node of the
group you wish to hide or reveal.
If you have several groups of collapsed nodes beneath a parent node (for example, if you have
several child objects, all of which have collapsed subnodes), you can expand all nodes at once by
choosing Edit Expand All. The option Show Selected displays items that are selected in the
scene window (or Outliner) but have been filtered out of the Hypergraph display. For example, if
you have turned off display of NURBS objects in the Hypergraph, but choose a NURBS sphere in
the scene window, you can force the Hypergraph to show it by choosing the Show Selected menu
item. The Attributes menu item brings up the Attribute Editor for the selected item (the same as
selecting the item and pressing Ctrl+A).
Note There are also a couple of options in the Edit menu (and elsewhere) for use with the
freeform layout, but we will discuss this type of layout below.
These four framing options (Frame All, Selection, Hierarchy, and Branch) can be accessed by the
four leftmost buttons in the Hypergraph toolbar, which is located atop the Hypergraph window.
Framing a hierarchy frames the selected object plus any other objects in that hierarchy. Framing a
branch frames the selected object plus any objects below it in the hierarchy. If the ball is the child of
the hat in our example scene, selecting the ball and then framing the hierarchy would focus the
window on the hat and ball nodes; framing the branch would focus the window only on the ball (and
any child nodes it might have).
The graph Up and Downstream Connections and Scene Hierarchy menu items are also available
as buttons on the Hypergraph toolbar:
Should your graph get behind your scene window (an unlikely event, but possible), you can force
the Hypergraph to rebuild itself by choosing Graph Rebuild. By using this command, you can be
sure the Hypergraph is up to date if you ever suspect it is not. Finally, the Layout command in the
Graph menu lets you change (or reset) the arrangement of items when you are looking at upstream
or downstream connections. Arranging these nodes may allow you to make more sense of them or
to move unwanted nodes off screen while you work.
Note When you graph the up and/or downstream connections in the Hypergraph, you are
creating what is known as a dependency graph. Put simply, a dependency graph
shows the connections between nodes (like shading network elements) in a Maya
scene, allowing you to see the flow of information from one node to another in other
words, how each node depends on the others to which it is connected.
Note With the advent of the Hypershade, the Rendering menu set in the Hypergraph is no
longer as useful as it once was. It is still very convenient, however, to have all shading
information accessible in the same window as the scene hierarchy, especially when
you just want to take a quick peek at a shading item rather than work with it
extensively.
Note You can also display a background image for the Hypergraph window if you are in
freeform layout mode (see below) by choosing Options Display Background
Image (in freeform) from the Display submenu.
The Orientation submenu of the Display menu lets you toggle between horizontal (the default
layout) and vertical layout modes. If you like working in an Outliner-like fashion (with nodes stacked
on top of each other), you may prefer the vertical orientation mode. The Layout submenu allows
you to choose automatic (default) or freeform layout mode the freeform layout mode lets you move
nodes around into any shape you wish, while the automatic mode places the nodes in a
predetermined order next to one another. The Transitions submenu enables you to create an
animated transition between views when you choose View Previous or Next View. By default, the
view changes instantaneously, but by checking the Animate Transitions box (and then choosing
how many frames the transitions will be), you can force the Hypergraph window to scroll from one
view to the other. While they are cute, transitions are more of a time waster than anything useful
unless you need to figure out where one view is in relation to another. The Update submenu lets
you choose when to update the Hypergraph window; you can choose to update on a selection, on a
node creation, on both (the default), or on neither.
To break one of these connections, just click on one of the arrows (highlighting it yellow) and hit the
Delete key. You can, for example, break the deformer connection between the lattice and the ball if
you highlight the arrow that shows the ffd1LatticeShape.latticeOutput to ffd1.deformedLatticePoints
connection (the one shown in the image above). If you alter the deformer (scale it, say), you will
immediately see the ball return to its original shape when you delete the connection.
To make a connection between nodes, just MM drag one node on top of another (the node that will
output a value will be the one you drag; the one that will accept an input value will be the node you
drag onto). Once you have completed the drag operation, the Connection Editor will open, allowing
you to choose which attributes to connect. If, for example, you MM drag ffd1Lattice onto ball, you
might connect the lattice s visibility attribute to the ball s visibility (click on each of these attributes
on the right and left of the Connection Editor to connect them). Then, when you hide the lattice, the
ball will hide as well. To confirm that the connection has been made, you will see a new arrow in
the Hypergraph showing the connected attributes.
In general, most people use the Hypergraph (and now the Hypershade as well) primarily to make
and break connections between shader nodes in a shader network, such as the luminance output
of a texture being fed into the transparency of a material node. While the connected attributes are
different, however, the method of making and breaking connections is the same as described
above.
The Connection Editor is an extremely useful Maya feature. Essentially, it lets you connect
any output of one node to any matching (that is, of the same data type) input of another
node. The Connection Editor can do some amazing things, connecting even the most bizarre
attributes (as long as their data types match). This base-level control over connections gives
you creative control over anything from ramp texture colors to object rotation order based on
another object s position (or that of another node on the same object), visibility, node state,
or whatever else you can dream up. In shader networks, the output color of one node (like a
fractal map) is often automatically input into the input color of another node (like a phongE
texture) when you create a texture map. With the Connection Editor, you can also plug the
output color of one node into the bump map node a node that controls how bumpy a
surface looks of a texture (which is the same as MM dragging the node onto the bump map
channel of the texture), or even control the intensity (or height) of a different bump map
based on the output of this node.
While the number of attributes available to connect via the Connection Editor can be a bit
overwhelming, the window s controls are fairly straightforward. Let s take a look at how the
Connection Editor works.
To make a connection, first load the left and right sides of the Connection Editor with the two
nodes you wish to connect (or, alternatively, MM drag one node onto another in the Attribute
Editor to automatically open and load the Connection Editor). Then click on the output
attribute you wish to use and, from the list of attributes with matching data types (not grayed
out), choose the input node.
Some data types, like color, have arrows next to them, allowing you to access their
component attributes in the case of color, it would be the red, green, and blue components
of the color. Thus, while color (a vector) may not be a match (and is thus grayed out) for the
X scale of an object, you can connect the red component of color to the object s X scale;
depending on the direction of this connection, the object s redness would be controlled by
its X scale, or the object s scale would be controlled by its redness.
The controls in the Connection Editor s window are easy to use. The buttons at the top
enable you to reload the left or right side of the window (thus changing which node is loaded
on each side of the window). By clicking the from -> to button, you can change the
direction of the input/output of the two nodes (making it to <- from ).
The Right and Left Side Filters menus let you display (in the windows below) only those
attributes you are interested in this can be a great way to reduce the clutter of available
attributes to a more manageable number.
Under the Options menu, you can change the default behavior of the Connection Editor
which is to make and break connections automatically as you click on the attributes in the
left and right windows to a manual mode. If manual mode is selected, you must press the
(now enabled) Make and Break buttons at the bottom of the window to create (or disconnect)
the connection between two attributes.
The Clear All button removes all connections, and the Remove button removes the loaded
nodes.
Finally, the two arrow keys just below the left and right windows allow you to step through all
nodes on an object (for example, the shape to the transform node of a geometric object),
saving you a trip back to the Hypergraph to highlight a new node, and then reload it into the
Connection Editor. To disconnect two attributes, just click on a connected attribute on one
side of the window to unhighlight it.
The possibilities for using the Connection Editor are so many and varied that the best advice
is just to open a new project, create some objects and shader networks, and play with
different connections, so you can get a feel for the different ways you can control one node
via another. This way, when you are faced with what might appear a difficult problem in a
real world situation, you may see that some clever use of the Connection Editor will do
the trick nicely.
To enter freeform layout mode, either choose Options Layout Freeform Layout, or click the
Freeform Layout toggle button on the toolbar in the Hypergraph (the button farthest to the right).
Once you are in freeform layout mode, you can drag nodes anywhere in the Hypergraph window
that you wish, including into shapes or figures. To load a background image for your new layout,
choose View Load Background Image and browse to find your image. You can also reset your
freeform layout to its default arrangement by choosing Edit Reset Freeform Layout. Thus, no
matter how much mess you make of your node arrangement, you can always return to a clean view
at the touch of a button.
As an example of using the freeform layout, let s build a human figure in the Hypergraph (we won
t actually build a character in the scene window, but if you have one you ve already built, feel
free to use that figure instead of our random assortment of primitives). First create 20 or 30 scene
primitives (they can all lie on top of each other, as we won t use them in the scene window). If you
wish, you can lay them out in the scene window in the form of a person, or you can just arrange
them in the Hypergraph. In the Hypergraph, be sure you are in freeform layout mode, then drag
nodes up to the head region (renaming them things like skull, nose, right eye, and so on),
the body, the arms, and the legs. When you re finished, you should have a graph that looks
something like a person, where every node is intuitively related to its (supposed) function in the
scene window. Obviously, arranging nodes like this in a complex scene can save you a great deal
of time when it comes to finding a particular node (the right eye, for example) that you wish to
manipulate.
Summary
In this chapter, we have taken a fairly thorough tour of the Hypergraph, exploring its navigation
features, the scene-related actions you can perform in the Hypergraph window, the different
options for viewing and layout the Hypergraph gives you, and even how to see, make, and break
attribute connections from the Hypergraph. You should feel more comfortable using the
Hypergraph now, as you now understand how to use it and what options are available to you to aid
in laying out the Hypergraph in an intuitive manner. As you proceed in this book (or in your own
animation adventures), be sure to continue using the Hypergraph with your scenes. Soon, you will
find this tool not only familiar, but indispensable for all your work in Maya.
Part II - Modeling
Part II - Modeling
Part Overview
Use the basic modeling tools
In the following pages you will have an opportunity to try out some of Maya s modeling aids as you
learn some modeling fundamentals, and then you will create a living room scene using Maya s
primitives.
What Is Modeling?
Before we delve into modeling specifically in Maya, we need to go through a few concepts of
modeling in general. Let us begin with a working definition of what modeling is in computer
animation. Here is one that would seem acceptable to most people: 3D modeling is the process of
creating three-dimensional surfaces using a computer for the purpose of rendering them into a
picture or a sequence of pictures.
But let s think about this for a moment. In fields such as the automobile industry, architecture, or
engineering, the digital models are actually built with specific products in mind their purpose is the
creation of a physical model or prototype, and ultimately a working automobile, or building, or
whatever. For such models, rendering is only a stage they go through in order to get to their
ultimate destination. For the 3D artist working in computer animation, however, the ultimate
destination for the models they build is pictures that only exist in TV, videos, or movies all 2D
environments.
This difference gives rise to a very important principle, which determines how we should build
models for computer animation. Here is the principle: The only thing that really matters in modeling
in computer animation is the picture(s) people will see. Modeling anything that will not be seen,
therefore, is (generally speaking) a waste of time.
It s All an Illusion
Digital animation, then, is a world of facades. If you will only see the back and right walls of a room
(as in the image below), it makes no sense to build the front or the left side. Modeling for the
computer animator is all about creating illusions for the eye to feast on build only what the eye (the
camera) will see. We will certainly have more to say about this later on, but suffice it to say for now
that this is the reason why careful preproduction planning is so crucial, and why well-organized
production teams will always create very detailed storyboards before they commit to building
anything.
Let s face it, a professional sculptor or an architect will usually have a much easier time with
modeling on the computer than a person with no such background, just as a painter or a
photographer will find it easier to do texturing or lighting in a digital environment. Many of the
skills that are used in these fields transfer immediately into the computer environment, and
other skills soon follow, as the artist becomes familiar with their surroundings.
But don t be too discouraged if you want to become a modeler but have no such
background. There are other things to keep in mind. Not all artists are able to transfer their
traditional skills fully into the digital environment; and more importantly, there are other skills,
specific to digital modeling, that also must be learned. Computer animation is a different
world, and the computer, a different tool. Digital modeling should be viewed as a separate
and independent artistic medium as different as painting is to sculpting, for example, each
with its own sets of rules and technical skills. One must feel as comfortable with the computer
as a painter would with a brush, or a sculptor with clay. And just as some painters know
nothing about sculpting but still are great painters, so can one be a great 3D modeler without
being a sculptor, or an architect, or a painter.
Having said these things, however, there are other, less obvious, factors in the production
environment that determine whether a model is good or bad, and these are just as important. The
two criteria most frequently used in animation are how heavy or light a model is and how well it can
be set up for animation.
Improperly built models often end up being computationally heavy, meaning they are built with too
much geometry and can cause numerous problems for the animators, or lose precious production
time in rendering. A light model, in contrast, does not have a lot of geometry and thus allows the
animator to act more interactively with it, producing better animation in shorter time. It generally
renders faster, too.
If a model is going to be deformed in a certain way in other words, to bend and stretch as it acts a
certain way the modeler needs to build the model with that in mind, putting the necessary points
where they will deform properly. In some cases, not having points in certain areas is actually better.
One reason why modelers build NURBS faces (the next chapter is an in-depth look at NURBS
modeling) and not polygon faces (Chapter 7 covers polygon modeling) for facial animation is that a
well-built NURBS face (on the left below) is a lot easier to set up for animation than a Polygon face,
even though the latter is easier to build. Notice the extra lines in the Polygon model (on the right).
Modeling Tools
Later in this chapter you ll get a taste of the process of modeling in Maya. First, however, let s
look at the Maya interface features available to us. Maya has a vast array of tools that can aid us in
modeling. Here are some of the more basic and useful functions we will be covering in this chapter:
" Templates
" Layers
" Pick-masking
" Snapping
Templates
Objects that become templates remain visible but cannot be selected like other objects. The
standard way to turn an object into a template is to select the object and then select Display
Object Components Templates. You can also open the Attribute Editor (Ctrl+A), choose Display,
and toggle on Template.
Because the templated object cannot be selected in the usual way by dragging, in order to
untemplate it, you have to select it either in the Outliner or the Hypergraph editor, or use a selection
mask (see Pick-Masking later in the chapter), and then toggle it back with the same command.
There is another way to template objects, and that is by using the Layer Bar (discussed in the next
section). A layer also has templating capability, and it is generally the more efficient way to
template objects because it can handle groups.
Tip Templating using layers is a bit different from templating using the method just described.
A regular template can be picked using Selection Mask for templates, but not the ones
templated using layers they can only be selected from the Layer menu.
The Layer Bar is on by default, but if you don t see it, select Options UI Preferences and turn it
on. You can also see the Layers using Windows Layer Editor. To create a new layer, you can
click on New Layer in the Layer Editor, or click the New Layer button on the Layer Bar it s the
button left of the Default layer.
To add an object or a group of objects, first select them. Then click on the layer to which you want
to add the objects, display the Layers menu, and select Assign Selected. To move an object from
one layer to another, simply select the object and assign it to the other layer. You can also use the
Relationship Editor to do the same thing: display the Layers menu, select Edit Membership to open
the Relationship Editor, and connect the objects and the layers the way you would normally do.
You can hide the layer objects, template them, or reference them.
Referenced objects of a layer are just like templated objects, except that they can be used for
snapping (see the section Snapping below) and they can appear as shaded surfaces.
Removing a layer does not delete its member objects, but only the layer itself.
Tip Use the Layer Colors palette to identify different groups of objects as belonging to a layer.
Double-click on the color box in the Layer Bar to pop open the Layer Colors palette and
assign a color, or use the Layer Editor to do the same. Using different colors can not only
make things much easier to work with for very complex scenes; it can also make the
scene a bit more interesting to look at, as you can see below (and in the Color Gallery on
the CD).
Pick-Masking
One of the most elegant features of the Maya interface is its ability to limit selection to specific
types of objects, components, or hierarchical elements. This function is also known as creating a
pick mask or selection mask. (Maya uses the terms interchangeably.) You can RM choose an
object to pick-mask elements which specifically apply to that object, or you can use the buttons on
the Status Line to pick only the elements you want to select.
When you RM choose an object you are working on, Maya automatically figures out which
selections should become available for that specific object type and gives you the appropriate
choices. For a curve, you get a different set of marking menu items from the one used for a NURBS
surface, as you can see here.
The really cool thing about this feature is that depending on the pick mask you choose, Maya
adjusts the display of control vertices, edit points, and hulls accordingly so that you will only select
what you want to select, and hides the rest. For example, if you pick-mask Control Vertex, Maya
will automatically go into the component selection mode and display only the CVs for you to select.
Or if you pick-mask Hull, it will only show hulls.
Various selection masks can be created using the Status Line in three different levels. You can limit
your selection by component types such as CVs, Edit Points, Faces, Edges, and so on.
You can also create selection masks to pick only object types such as Curves, Surfaces, Joints,
and so on.
And finally, you can limit selection by hierarchy types, such as pick-masking only the root or leaf
level of a hierarchy. When you are in the hierarchy mode, you can also create a pick mask to select
only templated objects as well.
Note When you are limiting selection by hierarchy types, the marking menu s component
selection masks do not work, because Maya is only allowing root or leaf nodes to be
selected.
Note that when several elements are active in the selection mask, Maya has a priority list that
causes certain elements to be selected before others. Maya s default selection mask is set to
select by object type with all the different object types turned on, so when you drag over a NURBS
surface and a joint at the same time, it should select both objects. But because Maya s default
priority list has joints before NURBS surfaces, it will select the joint and leave the NURBS
surface unselected. If you want to see the priority list, go to Options General Preferences
Select.
Warning Do not change the default priority list or turn it off unless you have a good reason to.
The priority list was defined with careful deliberation, and you will find as you work
your way through the various stages of a production in Maya that the default
priorities make a lot of sense and are very efficient.
Snapping
The snapping tools allow you to transform an object or a component to snap to grids, curves,
points, view planes, or a surface. These elements become targets, or magnets, when activated.
You can access these tools, in the order just listed as buttons in the Status Line:
You also can use Maya s default hotkeys for snapping to grids, curves, or points. This is a more
efficient way of using the snapping tools. These are the hotkeys:
Let s briefly try out these tools. Create two curves as shown below. Select Create CV Curve
Tool and X+click on the grid. Click six times and press Enter to complete the first curve. Type y to
access the CV Curve tool again and draw the second curve.
RM choose to pick-mask CVs over the first curve. Then select the bottom CV, select the Move Tool
by typing w, and V+drag to the first CV of the second curve. It should snap to the CV as shown on
the facing page. Now try to C+drag the last CV of the first curve to the second curve. It s not
snapping because snapping to a curve is distance sensitive. Drag the selected CV over the second
curve, making sure it s right over the curve. Now C+drag the CV again back and forth. It should
stay on and along the curve. Snap-to-curve also snaps to curves on surface and surface isoparm
curves as well.
Tip You can also snap the manipulator to stay locked on one of the manipulator handles
when you are in the perspective view, restricting the manipulator s movements to XY,
XZ, or YZ handles, just as if you were in an orthographic window. Just Ctrl+click on the
manipulator handle where you want the snap to happen, and the square plane at the
center of the manipulator facing the camera will rotate to face the manipulator handle.
Note that the constraint only applies when you drag the manipulator center, not one of the
axis handles. To release the constraint, Ctrl+click the center of the manipulator (this
actually snaps the manipulator to move along the camera view plane).
Trying this on your own computer, you ll see that the sphere has turned green, and if you are in
shaded mode, the sphere is no longer shaded. It has become live, a magnet for other elements,
and while it is in that mode it cannot be selected. Select Create EP Curve Tool and try clicking a
few times in the perspective window. All the Edit Points snap to the sphere surface. Hit Enter to
complete the curve and try translating it. The manipulator now shows only X and Y handles, which
are actually U and V handles that move the curve along the parameters of the sphere surface.
Toggle the Make Live button off, and the curve should translate in the XYZ 3D space again.
Start a new scene. Select Create CV Curve Tool, and X+click to snap the CVs on the ground
plane as shown below. Do not press Enter yet. Choose Create Construction Plane , click Apply
with everything at default, then set the Pole Axis to YZ and click Apply again. Close the option box.
You should see the planes intersecting, as shown here.
Select the hotbox (space bar) North Zone Persp/Outliner. In the Outliner, select plane1 and
then select Modify Make Live. Continue to X+click the CVs on the plane1 as shown next, until it
comes to the grid next to the intersection point of the two construction planes. Since plane1 is now
live, the CVs snap to the plane s grid. Only construction planes allow the CVs to continue to build
in this way.
In the Outliner, select plane2 and then select Modify Make Live. Start X+clicking the CVs on
plane2 until it comes to the grid above the ground plane. Toggle off the Modify Make Live option
and finish X+clicking the CVs once again on the ground plane, as shown below. Press Enter to
complete the curve!
Tip If you are transforming an existing object to a live plane, you have to move the
manipulator s center, not one of its axis handles, to make it snap to the plane.
Freeze Transformations
When you create any object, it is initially placed at the origin, or (0,0,0) in the world space. As you
work with the object, transforming it in various ways through translation, rotation, and scaling, there
may be times when you want the point where you ve placed the object to become its local origin,
or (0,0,0), even though it is not the world space origin. To do this, select the object, and then select
Modify Freeze Transformations.
You can also delete a specific object s construction history by selecting Edit Delete by Type
History. You will see more examples of construction history in the next chapter s tutorial.
Although they are all different in form, many of these primitives are created involving similar
variables, an example of which we will see a bit later. By starting with the primitives, you can
immediately create simple objects, which then can be manipulated in various ways to produce
more complex surfaces easily and quickly.
Building a Staircase
Let s begin exploring primitives by building a spiral staircase. In this example, we will start with a
cube to represent an individual step in the staircase, and then copy it many times.
Manipulate it as follows: in the Channel box, type 6, 0, and 0.5 for Translate X, Y, and Z
respectively, and 5, 0.5, 1 for Scale X, Y, and Z. You should now see the cube placed as follows:
Tip In the Channel box, the default naming convention is set to Nice. For example, you
read Translate X in the first line of the Channel box. If you are a beginner, this is very
helpful, because everything is clearly stated. But you can also change this to Short
format by pressing RM choose Channel Names Short. The first line should now read
tx , which looks cleaner, and gives a bit more space for the modeling windows.
Keeping the cube selected, go to Edit Duplicate Option box. Set the numbers in the dialog box as
follows: Translate 0,0.5, 1; Rotate 0, 10, 0; Number of Copies, 35; Geometry Type, Instance.
Click the Duplicate button, and voila! You should now have a spiral staircase. Note that the
duplicates here are instances, which means any manipulation to the shape of the original cube will
be applied to the duplicates as well. Go to the top view, RM choose Vertex over the original cube,
select the four vertices at the top side of the cube, and then rotate and translate them until they
overlap the duplicated cube at the bottom side, as shown below.
You can also, by selecting all the vertices of the original cube and translating them in X and Z, get
different shapes for the spiral staircase, as shown here.
Tip In situations like the example given here, you will find that it is better to use instances
rather than make actual copies of the original geometry as they are much lighter
(computationally less taxing on the CPU) than copied duplicates, and you can manipulate
the shape of the instanced duplicates with the original geometry.
Choose Create NURBS Primitives Torus, and in the Channel box, under INPUTS, click
makeNurbTorus1. You will see the various variables that form the shape of the torus.
Note You can also get to these same variables before you create the object via the Torus
dialog box, or after you create the object via the Attribute Editor.
Try doing the same with some other primitives, like the cylinder and the sphere. Note that many of
the torus primitive s properties have exactly the same counterparts in the other primitives you
should go over those variables with the other primitives as well in order to see the various possible
shapes they can form with different settings.
Tip When dealing with these settings for the primitives, sometimes you just have to play
with it and see what comes out as you experiment with the input variables. The results
may surprise you.
Now let s experiment with some torus settings. Click on Radius; then, inside the modeling window,
MM drag slowly and see what happens to the torus.
The radius measures the distance from the center of the geometry to its circumference. In the case
of a torus, this measures the center of the circle revolving around it, which effectively means the
Radius setting controls the size of the torus.
Start Sweep and End Sweep determine in degrees where the torus starts and where it stops
revolving along V.
For the Degree section, click on Cubic and you will see a pull-down menu with Linear as the other
degree choice this setting will give sharp edges to the torus, as shown on the next page. Sections
subdivide the torus along V, and Spans subdivide it along U.
Warning The subdivisions should all be finalized before any CVs are pulled, as changing the
sections or spans of the torus afterward will produce unpredictable results.
Height Ratio is the ratio between height and radius; this effectively determines the thickness of the
torus.
And finally, Minor Sweep determines in degrees the amount of surface (along U) the circle
revolving around the torus will have.
Now, before you say, OK, so it s a donut, the facing page shows some example models that
were created on the fly with the torus primitive. Though all are simple models, there probably are
some examples in the collection that you did not expect to see, which illustrates the point: The
primitives are very useful objects, not because of what they are, but because of what they are
capable of becoming, and because they can help us create the final surfaces we want.
We will get to the lamp and the dog by the window in the later chapters, but for now, we can build
the rest with three simple primitives that Maya provides us with.
1. Create a new scene. Drop a sphere into the scene: either click on the sphere icon in Shelf1 or
select Create NURBS Primitives Sphere. Go into side view, pick-mask Control Vertex, and
drag to select the top two rows of CVs. Type w to use the Move tool.
2. Snap the CVs to the first grid above the ground level by X+dragging the Y handle to the first
grid above the ground level. Make sure you are not dragging the center of the manipulator, or
all the CVs will snap to one point. If the grid isn t displayed, select Display Grid to make it
visible. Repeat the same action with the two bottom rows of CVs to the grid below ground level,
as below.
3. Go to the top view, and again snap the edge rows of CVs to the unit grids on each side of the
sphere, as below.
4. Take the sphere, which now looks more like a cube with round edges, and duplicate it several
times (Edit Duplicate), scaling, translating, and rotating it to make the sofa, as shown here.
Tip When you are building several objects, it is good form to build each object at the origin
and then move it out of the center when it is finished. As long as you do not freeze its
transformation or change the pivot, you can always transform it back to its original
position for further modifications.
5. For the cushions, copy the sphere, pull the top row of CVs (which looks like a single point)
down just a bit, scale and translate it to be on the sofa, and make two more copies to cover the
whole sofa. When the sofa is done, select all of its elements and select Edit Group. This
makes it a lot easier for us to work with the sofa as one entity. We can hide the sofa for now
while we move on to the table and the chair. Select Display Hide Hide Selection.
6. For the table, select Create NURBS Primitives Cylinder , set Caps to Top and click
Create. This will become the table top. Move it to a side for now. For the table stump, select
Create NURBS Primitives Torus, and set the Height Ratio to 0.2 and Minor Sweep to 190
degrees. Translate the cylinder to the top of the torus, and scale and translate each object to
form the table shape you see below. Group the cylinder and the torus; then translate them to
the ground level.
Select Display Show Show Last Hidden to make the sofa visible again. Place the sofa and
the table roughly in the positions shown here.
To select the whole hierarchy in the modeling window, select one object in the hierarchy and
press the (Up Arrow) key. If there are branches in the hierarchy, press the key until you
reach the root level.
7. The chair is a bit trickier. Copy the sphere, and hide all the rest. Translate the sphere to (0.5, 0,
0.5) using the Channel box. Switch to top view, and snap the middle CVs to the grid for each
side of the sphere as shown:
8. In the side view, grab the two rows of CVs at the right bottom corner and snap them to the Y
axis. Grab the rows of CVs at the left side and snap them to the second grid to the left. Grab
the CVs at the top-left corner and drag them down as shown below:
9. In the perspective view, select the CVs as shown and push them back in Z a little. You can also
select the CVs at the chair s side and scale them out to make the chair look rounder. If you
are having a hard time seeing the right CVs, toggle the hulls to be visible, by choosing Display
NURBS Components Hulls.
10. To finish, copy one of the cushions from the sofa and put it on the chair. Group the chair and
the cushion. Select Display Show All. Create three planes by selecting Create NURBS
Primitives Planes for the floor and the two walls, then arrange the furniture as you see fit.
Shown below is the final textured and lit living room. We will come back to this scene later to
add more interesting pieces.
Summary
This chapter introduced the basic concepts of modeling and the tools that Maya provides to aid you
in creating and editing surfaces. You also learned how to use primitives to build more complex
objects such as a staircase or pieces of furniture.
In the next two chapters, we will delve further into two major types of modeling: NURBS modeling
and polygon modeling. NURBS modeling is often used in high-end productions that demand
photorealistic models, while polygon modeling is still the preferred choice for gaming companies.
The chapter then introduces the tools that Maya provides for working with curves and demonstrates
them in the first of three hands-on tutorials, creating the curves for an aftershave bottle. The
second half of the chapter moves on to Maya s tools for creating and editing surfaces and
concludes with two more hands-on exercises: one that completes the aftershave bottle and one
that creates a human face.
The last of these tutorials is quite advanced, in the sense that the operations are more involved and
the instructions are not as detailed as in the basic tutorials. It assumes that the reader has more
working familiarity with Maya s interface and basic techniques than the earlier tutorials. If you find
you are having problems following the advanced tutorial, it may be wise to skip it and come back to
it after you ve got more Maya experience under your belt.
Nevertheless, these and other techno-words are built into the very fabric of what computer
animation is. Maya is, after all, computer software the better grounded you become in these
esoteric concepts, the deeper and further you will be able to go in mastering your art. At the
same time, be assured that as dry (or exciting!) as things may get in the following sections, nothing
overly technical will be thrown at you.
Tip If you find you do not understand many of the concepts being presented in the next few
sections, just skip them for now. You can come back later when those topics have
become a bit more relevant to you.
Note Historically, a spline was a plank of wood bent to form part of a ship s hull by forcing it
between pairs of posts, known as ducks. The placement of these ducks determined
the shape of the plank s curve, just as the placement of CVs determines the shape of
a curve in computer graphics.
There are different ways to calculate how the CV positions are interpreted into curve shapes, and
these different methods types of equations or formulas distinguish the splines further into Bezier
curves, B-splines, or NURBS. NURBS, the focus of our attention in this chapter, stands for
Non-Uniform Rational B-Splines.
Note Unless you re a mathematician, don t worry about all the components of this
daunting acronym. The important thing to understand is how a NURBS curve behaves.
The advantage a NURBS curve has over the other types of splines lies essentially in the way it can
be cut and joined. Regular splines cannot be cut and joined at arbitrary points along the curve, only
where their control points are A NURBS curve, however, can be cut and joined anywhere, because
any point on the curve can be calculated and located. This advantage carries over into surfaces as
well. NURBS surfaces can be attached to other NURBS surfaces with different numbers of spans,
or isoparms, for this reason.
Edit Points (EPs) are points where curve segments join to form one continuous line. They are also
called knots. Maya has a CV Curve tool and an EP Curve tool for creating curves. But make no
mistake the two tools may create curves a bit differently, but in the end, both create the same
NURBS curve.
To see this at work, create a default curve made of two spans: either five clicks of CVs or three
clicks of EPs. Now pick-mask Curve Point and try dragging along the curve. At the top of the Maya
window you should see the curve parameter value changing as you drag. The start of the curve is
assigned a parameter value, U[0]. The second edit point of the curve is assigned the value U[1],
and the end of the curve, U[2]. The halfway point between the start of the curve and the second
edit point is assigned a value of U[0.5]. Any point on the curve can be similarly assigned a
parameter value this way. Easy enough. This method of calculating the point values along the
curve is called uniform parameterization.
Another calculation method in Maya is called chord length parameterization, and the way it assigns
the U value to a point on the curve is more complicated. We need not go into discussions of exactly
how the calculation is done, but the value assignment is dependent on the distances between
successive edit points of the curve, not the number of edit points. So two curves with the same
number of edit points but drawn differently will end up with different parameter values at those edit
points.
How does all this relate to surfaces? A surface is basically an area in 3D space defined by the
parameterization of two variables, U and V. The surface is calculated in such way that at any point
inside the area, a UV coordinate can be given, and the area is given UV directions. This is exactly
the same situation as with the curves, except now you have the V parameterization of the surface
as well.
Uniform parameterization produces more predictable values for the curves and surfaces than chord
length and is therefore the preferred choice for modeling in general. Uniform is the default setting in
Maya. The advantage of chord length parameterization is in texturing: it allows more evenly
distributed textures on uneven surfaces than the uniform method. The bottles shown here are
revolved from curves that have exactly the same CV placements, except that the one on the left
uses chord length and the other is uniform:
Surface Normals
A surface also has a front side and a back side, and it has normals. A normal is essentially a vector
shooting out perpendicularly from a point on the front side of a surface. In other words, it is the
direction that surface point is directly facing. The concept of surface normals is very important for
using certain modeling tools, as well as for texturing and rendering, and it is important that you
become comfortable with the concept.
You can use the right-hand rule to determine which side of a surface is front, or which way the
normals are pointing. If the thumb points to the increasing U direction, and the index finger points to
the increasing V direction, then the middle finger bent perpendicularly to these two fingers is the
direction of the surface normals.
Tip You can see the surface normals of an object while in shaded mode by selecting the
object and then selecting Display NURBS Components Normals.
Surfaces, like curves, are made up of spans, or rather they span a given number of span areas.
The area covered by one UV span is called a patch. The flowing lines separating the patches are
called isoparms. These are the surface equivalents of knots, or edit points. Pick-masking the
Isoparm element allows you to select any flowing isoparametric curve either with a U value or V
value on the surface, just like selecting a curve point on a curve. With surfaces, you can also
pick-mask Surface Point, which enables you to select any point on the surface with a UV parameter
value.
Tip When you select a surface point and choose Edit Surfaces Insert Isoparms, both U
and V isoparms are inserted.
Creating Curves
Whew, that s about enough with those relatives! Let s move on to creating curves. Maya has
several tools for creating curves, and also a Text tool. As mentioned already, Maya can create
curves either with edit points or with CVs.
Generally, if the curve needs to pass through a specific point, then the EP Curve tool would be a
better choice, as the edit points actually lie on the curve. The CV Curve tool should be preferred in
most other situations because it is better at controlling the curve shape.
Tip You can also edit CVs or EPs while you are creating a curve by pressing the Insert key.
With this method, you can select multiple points for repositioning. To continue creating
the curve, just press the Insert key again.
Because when you release the mouse the Pencil tool completes building the curve, you will often
end up with several separate curves when the drawing is done. Again, you can easily attach these
curves using Edit Curves Attach Curves. The raw curves on the left here have been rebuilt and
attached to create the curve on the right.
Tip It s far better to end up with several separate curves that better represent what you
wanted to draw than to trying to draw everything as one curve.
Arc Tools
In contrast to the free form of the Pencil tool, the Arc tools enable you to create circular arcs of
various angles. There are two types: the simple two-point circular arc, and the three-point circular
arc, which has one more control point than the other tool.
Tip Once you ve created, for example, a three-point circular arc, you can still manipulate the
arc edit points. First select Modify Transformation Tools Show Manipulator Tool (or
press the T hotkey) and then, in the Channel box, under Inputs, choose
makeThreePointCircularArc. The three points should be visible now.
Yet another curve creation method is Duplicate Surface Curves, which is actually not part of the
Create menu but appears on the Edit Curves menu. It can be a very efficient and powerful curve
generator, especially now that in Maya 2 it has the ability to duplicate all the isoparms of a surface.
Create a default cylinder, pick-mask Isoparm, select an isoparm anywhere on the surface, and
select Edit Curves Duplicate Surface Curves. A curve with the same number of spans as the
cylinder has been duplicated.
Translate the duplicated curve out of the cylinder. Select cylinder as object, and repeat Edit Curves
Duplicate Surface Curves. This time, all the isoparms of the cylinder duplicated. You can set the
options so that only U or V will duplicate. The default is both.
Editing Curves
Once you have created the curves you need, Maya provides various actions and tools to edit them.
In this section, we ll talk about attaching and detaching curves, aligning curves and surfaces,
rebuilding curves, inserting knots, adding points to a curve, cutting and filleting curves, and
offsetting curves.
Tip When selecting curve points on two or more curves, first select the curve point on one
curve, then pick-mask Curve Point on the other curve, and Shift+click the second curve
point. The first selection stays selected.
When both proper end curve points are selected, select Edit Curves Attach Curves. Blend is the
default attachment method, and Blend Bias 0.5 means both curves will meet halfway. This is the
ideal setting when you need to maintain symmetry. When the Blend Bias is set to 0, the first
selected curve will attach itself to the second curve.
If you find the curve shapes are changing too much when you attach them, try clicking Insert Knot
in the option box. For situations where you absolutely need to have the curves maintain their
original shape, you can change the Attach Method to Connect. For this to work properly, however,
the curve ends have to be touching already.
Warning When attaching curves or surfaces, if the construction history is on, make sure the
Keep Original option (the default setting) is toggled on as well. Odd behavior may
occur if it is toggled off and the attached object is modified later.
Detach Curves is simple to use. It works by either selecting curve points, or edit points, or both,
then selecting Edit Curves Detach Curves. It also works on multiple curves as well.
To set up the example curves, create two CV curves, as below, using X+click to snap them to the
grid. Make copies and translate them aside:
Position continuity, also called zero-order continuity (C0), occurs when the two end CVs are placed
in the same 3D space. Select the two copied curves and select Edit Curves Align Curves . Set
Continuity to Position, and modify Boundary to Both. Click Align to see the result shown here:
Tangent continuity, also called first-order continuity (C1), occurs when the tangents at the ends of
the two curves have the same slope in addition to position continuity. Practically speaking, this
occurs when the two end CVs of the curves all line up. Type Z to undo. Select the two original
curves, change Continuity to Tangent in the option box, and click Align to see the result shown
here:
Curvature continuity, also called second-order continuity (C2), occurs when, in addition to having
tangent continuity, the curves curve away from their end points in the same way. Another way of
saying this is that the radii of the curvatures of the two curves are the same. Practically speaking,
this means that in the curve being modified, the third CV from the end point, in addition to the
second CV, is also translated to accommodate the curvature change. Type Z to undo your last
change, then select the curves again, and change Continuity to Curvature. Click Align again. Notice
the change in position of the third CV from the end.
Note There are few tools in Maya that give options for curvature continuity: Align is one, and
the other is Project Tangent, which is not covered in this book.
The default setting for Align Curves and Surfaces (they are the same action) is Modify Position
First, which means the first curve selected will move in its entirety to align itself. After you have
performed the Align, try playing with the various optional settings in Channel box Inputs to get a
better idea of the options.
Rebuilding Curves
Rebuild Curves allows you to rebuild curves in various ways. Rebuilding curves is important for
creating good surfaces. When you work with curves for a while, they can end up with unnecessary
CVs, or CVs bunched up unevenly. They can be cleaned with the Rebuild Curves tool, and from
cleanly built (or rebuilt) curves come clean surfaces. Create a curve using the Pencil Curve tool.
With the curve still selected, select Edit Curves Rebuild Curve .
When the Rebuild Type is set to Uniform, which is the default setting, you have to manually state
how many spans the curve should have. The default is set at four spans, but the number will vary
greatly depending on the complexity of the required shape.
The Reduce setting simplifies the curve according to the set Global or Local Tolerance level. The
Match Knots setting requires two curves to be selected: it reparameterizes the first curve to match
the number of knots in the second curve. The No Multiple Knots setting gets rid of multiple knots
which are sometimes created when curves are attached or knots inserted. A multiple knot occurs
when more than one knot, or edit point, occupies the same position on a curve. The Curvature
setting redistributes and inserts more edit points in areas of higher curvature according to a
Tolerance level just like the Reduce setting.
Note To change the Global Tolerance setting for the Reduce or Curvature options, go to
Options General Preferences Modeling.
Let s cover one more option. The Keep CV option allows you to rebuild the parameter of the curve
while keeping the CVs in their original position. When you insert knots, the span of the curve
increases, along with creation of more CVs, but the parameterized values of points along the curve
stay the same as before the insertion. The Keep CV option recalculates the curve parameters to
include the inserted knot, while keeping the CVs in the same position.
Inserting Knots
Insert Knot allows you to add more edit points or CVs to further edit a curve. To use Insert Knot,
you select a curve point on the curve where you want the extra edit point to be created and then
choose Insert Knot. Note that another CV is created as well. A new option for Insert Knot in Maya
2, also available for Insert Isoparms for surfaces, is the Between Selections option. Select two edit
points; then select Edit Curves Insert Knot , click the Between Selections option, and click
Insert. Another edit point is added exactly halfway between the two selected edit points.
Warning If you select two curve points with this option, these two curve points will also turn
into edit points, along with the new edit point you ve inserted in the middle. This
may not be the result you desire.
Create a curve, and then select Edit Curves Curve Editing Tool. Grab the Parameter position
handle (see below) and move it along the curve while keeping V pressed to snap the editor to edit
points. Once it s on the edit point you want, you can modify the curve tangent direction and scale
around the edit point without moving the edit point itself.
Cutting Curves
Edit Curves Cut Curve is another very useful curve editing function. It takes multiple curves and
detaches them where they intersect. The default option setting for Find Intersections is In 2D and
3D, which finds the intersections for the curves even if they are not actually touching in 3D space,
but only seem to touch in one of the active (2D) views.
Filleting Curves
Curve Fillet takes two curves that intersect and creates a fillet. Unlike Cut Curve, which can be
projected from a 2D view, the fillet curves actually have to be touching. The default setting creates
a circular fillet from the two curves. Where the lines are intersecting, sometimes the fillet occurs at
the wrong corner. In such cases, you need to cut the curves first, and then select the curves you
want to fillet. The Trim and Join settings in the option box can also save you a lot of time by
trimming the curves and attaching the segments into one curve.
Offsetting Curves
Offset Curve duplicates a curve with an offset distance that you set in the option box. There is an
important difference between offsetting a curve and copying and scaling a curve. When a curve is
duplicated and uniformly scaled, it maintains the curve shape, whereas a curve created from the
offset maintains the distance between it and the original curve, though not necessarily the original
shape.
1. Start with edit points building straight lines. Make sure you are in top view, and X+click the edit
points as shown here:
2. Select the two curves at the top-right corner, and fillet the curves with just the Trim option
turned on. Do the same for the other three corners. Now you should have eight curve
segments. Attach the curves, starting from the top-right corner, with the options set to Connect
Attach Method and Remove Multiple Knots. You should have no problems with the corners
until the last corner curve:
3. With the last corner, use Pick Mask Curve Point to force the curves to attach at the bottom
right. With the curve still selected, select Edit Curves Open/Close Curves to close the curve,
making it periodic (closed). Rebuild the curve with the options set to Uniform and Keep CVs.
The curve should now have a parameter range of 32 spans. Snap the CV at the top middle to
the origin as shown here:
4. Using the marking menu, get into the Persp/Outliner view. Although there is now only one
curve, you will notice there are a lot of invisible nodes because of the construction history.
Since we no longer need the fillet and the attach history, we can delete these: select curve,
then Edit Delete By Type History.
5. Select the curve, select Edit Curve Offset Offset Curve , set the Offset Distance to 0.5,
and reduce the Max Subdivision Density to 0. This is important in keeping the same number of
curve spans for the offset. Click Offset, and check the Attribute Editor (Ctrl+A) to make sure the
offset curve created has 32 spans like the original curve. Translate the curve up in Y to 1. Now
duplicate the offset curve: Edit Duplicate , set Translate to (0, 2, 0) and Number of Copies
to 3. Click the Duplicate button to create three more curves. Close the option box. You should
see three curves on top of the offset curve as shown here:
Tip Clicking Reset before closing the option box is good practice after actions like Duplicate,
especially when you often use the box with a hotkey. Resetting saves the effort of having
to go into the Options again, unless of course, you know you will be using the nondefault
setting next time as well.
6. Translate the first duplicated curve down in Y to 2, and translate the second one up to 6. Select
the third one at the top and Offset it with Offset Distance 0.5. Note that the new offset curve
s translation values are at (0, 0, 0). Move it up in Y to 1. Offset the curve again with Offset
Distance 0.5. Duplicate the offset curve with the same settings. You should now see ten curves
in total, as shown on the next page.
7. Delete the top curve. In the Surface section, we will use these curves further to create an
aftershave bottle. Save the scene as Aftershave_1.
Tip When you build curves for lofting, it is a good idea to build the curves in the order in
which they will be lofted. In our tutorial, we built the curves in order so that we only have
to marquee the curves and loft. If they are not built in order, you have to select them one
by one sequentially in order for lofting to work properly. Having to select individual curves
each time you are lofting, when there are a lot of curves to select, can be frustrating.
Creating Surfaces
Once the curves are all prepared, Maya provides us with various ways of creating surfaces from
them. We will now cover these surface creation actions and tools in Maya s Surfaces menu. We
will look at the Text tool under the Create menu as well, as it is closely related to the Bevel tool.
Revolve
Revolve takes selected curves and revolves them around a designated axis, which you set in the
option box. The default revolve axis is vertical, which is Y. The other settings are X, Z, and Free.
The last option makes available the Axis boxes, which use the translation values of the Show
Manipulator axis handle (see Show Manipulator tool). This means you can interactively change the
revolve axis after creating a surface by manipulating the Show Manipulator tool.
For a simple example, let s build a lamp to go into the living room we built in the previous chapter.
Start a new scene and select CV Curve Tool. Draw curves in the front view as below.
With the curves selected, select Surfaces Revolve. The default setting works fine for our
purpose, and we see a revolved lamp. But wait, the lamp cover seems a bit lacking in design. Let
s see if we can make it look a bit more stylish. Select the lamp cover, go to Channel Box Input,
and click on revolve2. Change Degree to Linear, and Sections to 12. Now select the profile curve
for the lamp cover and, again in Channel Box, translate it (1, 2, 2), rotate it ( 25, 25, 25), and
scale it (1, 2, 1). The Chapter 6 Color Gallery on the CD shows the finished version. We can add
this lamp to the living room later on, so save the file as Lamp for future use.
Lofting
Lofting is without a doubt the most often used function in surface creation, and hence, the most
important. The Loft command creates a surface using the selected curves, isoparms, or trimmed
edges as spans and edges. The settings for Maya s Loft command are simple, and the default
setting need not be changed for most occasions.
You can loft any combination of curves, isoparms, and even trimmed edges. One thing you must
always be careful about, however, is the order of the curves you pick for lofting. Make sure you are
picking all the curves in order and in the direction you want the U to be going. The first curve picked
will set the U parameter in the direction of the second curve.
Tip If the curves being lofted are uniform curves and have the same number of spans, then
the resulting lofted surface will retain the same uniform parameterization and number of
spans as the curves.
An excellent example to use for learning about lofting is the torus primitive. Create the default torus,
and while it s still selected, open Edit Curve Duplicate Surface Curves , click on V, and click
Duplicate. Select just the torus and delete it. You are left with eight circles to loft. Select all of them
and loft with the default setting by selecting Surfaces Loft. You end up with seven-eighths of a
torus, as shown below. Select the surface and check the Attribute Editor. Note that it has seven
spans in U, its Form U is Open, and from the top view, its span direction for U is clockwise.
Undo with Z until you have only the curves again. This time, select the circles individually
counterclockwise, and in the Loft option box, click on the Close setting. Loft, and you should get a
complete torus as in the illustration. Note that now the U span is 8, its Form U is Periodic, or
closed, and its span direction for U is counterclockwise.
Extrude
The Extrude command extrudes a surface from selected curves, or curves on surface, or isoparms.
Extruding isn t complicated, but it can get confusing because there are so many buttons you can
click in the Extrude option box.
Extruding usually involves two or more curves, or curves on a surface, or even isoparms. The first
curve is the Profile that will be extruded, and the last one is the Path that will guide the extrusion.
The Extrude command provides several settings that control the shape of the surface being
extruded:
" The Tube setting in the option box makes the profile curve turn with the path.
" The Flat setting lets the profile curve maintain its own orientation as it moves along the path.
" The Distance setting only requires one curve, and it activates the Extrude Length slider. With
Distance, you can determine the direction of the extrusion with either the Specify setting, in
which different axis choices are listed, or the Profile normal, in which the extrusion goes along
the direction of the profile curve s normal.
" The Result Position option lets you either make the path come to the profile curve, which is the
At Profile setting, or make the profile go to the path, which is the At Path setting.
The following example illustrates a general method that should work well as a way to create
extrusions. Let s say you wanted to build a frame for the fireplace in the living room from Chapter
5. Start a new scene. With the EP Curve tool set to Linear, create the fireplace frame path using a
construction plane as shown below. Then, in the top view, create the profile curve for the frame.
Now select the profile, move its center to one of the ends of the path curve and select Surfaces
Extrude with everything at the default setting. We should now have a frame shape like the one
below. Note that you can adjust the shape of the surface by manipulating the curves.
For a quick example of a planar, get a circle and apply a default planar on it by selecting the circle,
then selecting Surfaces Planar to get a trimmed surface. Pick-mask on the circle and try moving
a CV up and down. The trimmed circle surface will disappear and come into existence only when
the CV is perfectly on the ground plane.
To get a good understanding of working with planar objects, let s create a simple letter M. Start a
new scene, select Create Text , and type M inside the Text field (we are being very economical
here). Although the Trim option is available here for creating a planar surface, we will create it
another way later. Leave everything at its default and click Create. A planar curve outline of the
letter M is created. Go to the Perspective window to see the planar curve letter in 3D. You should
see the picture a) below.
Beveling is almost the opposite of planar in that it usually creates depth in flat things. It is a very
flexible and powerful function that can take a curve, an isoparm, or even a trimmed edge and
create bevels, or sloping edges.
Let s bevel the planar outline of the letter M you created in the previous section. Select the M
curve and select Surface Bevel . The options here are not complicated, but they can be a bit
confusing because of the orientation: Top Side bevels the back of the letter, Bottom Side bevels the
front, and Both bevels front and back.
Tip When the text is created in Maya, it is facing front. If you have trouble relating Top to
back, Bottom to front, and Height to extrusion depth, just imagine the letters lying face
down on the ground.
You can make the bevel corners Straight or Circular, and you can have the bevel edges straight,
arc in (Concave) with sharp definitions, or arc out (Convex) smoothly. You can leave the Bevel
Width, Depth, and Height at default settings we ll be interactively adjusting them afterwards. Click
Bevel, and you should see the picture b) below.
But first, if you want to change the default settings for corners and edges, go to Channel box
Input and click on bevel1 to get at those settings. Press T to activate Show Manipulator for Bevel
history. You should see three blue dots connected with lines. If you don t see these, go to Channel
box Input and click bevel1 again, and they should appear.
These blue dots are handles with which you can manipulate Bevel Width, Depth (the depth of the
bevels, or the sloping edges), or Height (which is the depth of the actual extrusion of the text
curve). Manipulate them until you are satisfied with the shape of the letter M, then pick-mask
Isoparm and select the front edge of the bevel surface, as in the picture c) above. Select Surface
Planar and you should see the front side of the M now covered. You can use the letter to decorate
the living room later. Save the file. You can see a rendered version of the letter in the Color Gallery
on the CD.
Boundary
The boundary function is most easily described when compared to lofted curves. When two curves
are lofted, the result is a four-sided surface, two of whose opposing edges are defined by the
curves. The other two edges are automatically calculated to be straight lines going from one curve
to the other. When more than two curves are being lofted, the other two edges can become curved,
but these, too are interpolations between the curves being lofted. A boundary function, in contrast,
enables the four sides of a surface to be created from four curves, thus giving the artist more
control over precisely how the surface edges should be defined.
Let s take a closer look at boundaries. Start a new scene. Create four different curves with two or
three spans each. Place them in such way as to have their ends intersect. You can select the
curves in any order you want, or drag-select them all together, but the first curve picked determines
the UV parameterization of the boundary surface, as the surface U parameters are determined by
the curve s own U parameters. So if the UV direction for the boundary is important, you should
keep that in mind when you are building the first curve.
Once the curves are all selected, select Surfaces Boundary with the default settings. You should
end up with a surface that has three or four UV spans. Save this file, as you can use the same
curves for working with birails in the next section.
The Boundary function can also create surfaces with only three curves. This type of surface
created with the boundary is not really a surface with three edges, but rather a surface with one
zero-length edge. The order of picking is significant in this case because the pinched zero-length
edge (also called the degenerate surface) occurs between the first two curves picked. This is
important in situations where the surface patch needs to be attached to another surface patch.
Note Square works much like Boundary in that it takes three or four curves and produces a
surface patch. The way it creates tangency, however, is more complex, and it is
considered an advanced tool.
Birails
Birails are functions much like boundaries in that they work to determine the four sides of a surface.
Essentially, birails extrude one or more profile curves along two rail curves, or paths. The
parameters of the profile curve(s) define the V parameters of the birailed surface, and the two rail
curves define the U parameters of the surface.
Let s see how birailing works. Get the curves you built for testing the boundary function. Select
Surface Birail Birail 1 Tool. (We will delve into the options a bit later.) Maya asks you to select
the profile curve; select one of the curves. Now you are instructed to select the two rail curves;
select the two curves adjacent to the first picked curve. The birail surface is created.
You can try this again with different order of selections and see how the surface differs in each
case, and how it also differs from the boundary surface. The fourth curve of the boundary is
basically ignored, being replaced by the profile curve. Let s look at the other birail tools.
Choose Birail 2 Tool, and again leave all the settings at their defaults. You are instructed to select
two profile curves now. Select the two parallel curves. Then pick the two rail curves. A birail is
created. Notice how this surface looks much like the boundary surface? That is because the same
four curves are used to create the surface.
For the Birail 3+ Tool, we need another curve to act as a profile curve. It would be good to build a
curve with two or three spans like the other curves, and you should make sure the newly added
profile curve is touching the rail curves. You should have something like the curves shown here:
The Birail 3+ tool works a bit differently you select all the profile curves first, hit Enter, and then
pick the two rail curves. The birailed surface appears. Birail 3+ is basically a high-level loft, with the
U parameter surface edges following the rail curves, and you can have control of the inner areas of
a surface with the Birail 3+ tool that you cannot get with boundary or the other birail tools.
Let s look briefly at a few option settings. All three types of Birails have Non-proportional or
Proportional settings under Transform Control. The first setting modifies only the parts of the profile
curve that change when it birails, whereas the Proportional setting maintains the shape of the
profile curve thus the name. So if the rail curves grow wider, the Nonproportional setting will only
stretch the profile sideways, but the Proportional setting will enlarge the entire profile.
The Rebuild option also allows the curves for the birail to have their own rebuild options, which may
in some situations give us much lighter surfaces. For the rebuild settings, refer to Rebuilding
Curves above.
Editing Surfaces
Once a surface is created, you will often need to manipulate it to produce its final form. Maya s
many surface editing tools and actions behave exactly the same way as their curve counterparts,
which we have already covered. We will be going through those pretty quickly, while some others
we will be spending more time on, such as the Trim tool. We will also focus more on modeling
techniques using these tools.
Tip You can also check the Feedback Line just above the Layer Bar to see if what is
highlighted has a neatly rounded parameter value (assuming it is a uniform surface). If it
does, it usually means you have selected an isoparm.
Align Surfaces is the surface equivalent of Align Curves. They actually use the same option box. In
most situations, simply attaching or stitching (see Chapter 8) creates the continuity we desire, but
in those cases where you specifically want surface curvature continuity, you would want to use
Align Surface first.
Create a torus. Go to the Inputs, click makeNurbTorus1, set its variables as follows, and you should
see a quarter-formed torus:
With the torus still selected, select Edit Surfaces Extend Surfaces. Open the Attribute Editor,
select the extendSurface tab, and set Extend Side to Both and Extend Direction to V.
The Offset Surfaces option is the surface equivalent of Offset Curves, with simpler settings. In its
option box, the Surface Fit setting calculates the distance of the offset from the surface, whereas
the CV Fit setting calculates the distance of the offset from the CVs. Select the extended torus, and
apply Offset Surface. Go into the Inputs window, click on Distance, then in the modeling window,
MM drag to interactively adjust the distance of the offset. It seems 0.2 is a good distance. You
should see something like the picture below.
Tip It s often better to use editing functions at default settings, and then interactively change
the settings by using the Attribute Editor or the Channel box with Show Manipulator.
Try offsetting a curve from one of the top edges, lower it a bit, and use it with the two surface edge
isoparms to create a loft between the two surfaces. Repeat for the bottom edges, and you should
see something like this:
Let s try building a spherical opening protruding from a wall. We will use projections, trimming, and
filleting to do this. Create a NURBS sphere, scale it uniformly to 2 and rotate it 90 degrees in X.
Create a NURBS circle, which should appear right inside the sphere. Go to top view, select both,
and select Edit Surface Project Curve On Surface, with the default setting. Go back to the
Perspective window, and you should see two curves on surface on the sphere (as in the image on
the left below).
Select the sphere and scale it up to (3, 3, 3). Notice that the hole on sphere is keeping its size.
When you move the circle, the hole follows it. Select the sphere and apply Edit Delete By Type
History to erase the procedural relationship between the circle and the curve on surface.
Untrimming Surfaces
Oops! We made a mistake, we wanted to make a hole at the front of the sphere, not at the top
since we deleted the history, we can t move the hole. Now we have a bit of a problem. Curves
on surface can be deleted like objects, but not trimmed edges. There is a command specifically
designed for untrimming surfaces, which is Edit Surfaces Untrim Surfaces. You can choose to
delete only the last trim or use the default setting, Untrim All. Select the sphere and apply Untrim
Surfaces.
Intersect Surfaces
As well as projecting curves and isoparms, Maya can also create curves on surfaces when NURBS
surfaces intersect. The Edit Surfaces Intersect Surfaces with default settings creates curves on
surfaces on both intersecting surfaces. Create a NURBS plane, rotate it 90 degrees in X, translate
it 1 in Z, and scale it uniformly to 30. This will be the wall. Drag-select both the sphere and the
plane, and select Edit Surfaces Intersect Surfaces. You should see curves on surface on both
surfaces. Select the plane and trim out the circle. Trim the sphere as well, and you should see
something like below.
Now, to try out Round, undo the fillet action. To use Round, we must have two edges. Select Edit
Surfaces Round Tool, and select the trimmed edges. You should see the yellow Round radius
manipulator indicating the fillet radius. You can interactively change the radius by grabbing the end
handles of the manipulator. The default is 1, which is fine for this example. Press Enter, and you ll
see the fillet created once again. But with Round, the surfaces are also trimmed so that the fillet
actually joins the trimmed edges of the surfaces. To finish up, you would want to offset the sphere
and loft their trimmed edges to get some thickness, and create a tunnel into the wall, as in the
picture on the right next.
1. Open the Aftershave_1 file from the previous exercise. Marquee-select the nine curves (they
should be in proper order) and apply Edit Surfaces Loft. Delete all the curves. Duplicate the
lofted surface, and enter 1 for Scale Y in the Channel box. Translate it up, and you should
see something like image a) below.
2. Pick-mask Control Vertex over the top surface and, in the front view, translate the points down
in Y and closer together. You should have something like image b) above.
3. Select the edge isoparms and select Edit Surfaces Attach , check off Keep Originals, and
click Attach. We now have the body of the aftershave bottle. Select the top edge isoparm of the
surface, select Edit Curves Offset Offset Curve , set Offset Distance to 0.5, Max
Subdivision Density to 0, and click Offset. An offset curve is created as below. Loft between the
surface edge isoparm and the offset curve. Then select the offset curve again, and apply
Surfaces Planar with the default settings. You should have the surface s top covered as
below.
4. Attach the lofted surfaces together. Put a cylinder and a sphere to the top as the bottle cap.
You may want to squash the bottom of the sphere a bit. The modeling part is done. Again, you
can find the finished version in the Chapter 6 Color Gallery on the CD.
The face we ll create appears in the Chapter 6 Color Gallery on the CD.
1. Start out with a sphere. Cut out the front and the back parts the front will be the mouth, and
the back will be the neck. Shape the sphere into a very rough figure of a human head as below.
Note A person s face was used for this model, but it is not shown here for reasons of
privacy. When you are modeling a face, make sure you have a picture or a sketch to
import as image plane.
2. Cut the head in half in the middle. Refine the head more, pulling out the chin, nose, and cheek.
When you are moving the boundary edge CVs in the middle, make sure you are moving the
CVs beside them as well. You also want to keep the X values of the edge CVs at zero, and
only move them in Y and Z. The isoparms should be tightly gathering at the beginning of the
neck area as shown on the next page. Insert isoparms where you need them, and delete rows
of CVs where you do not need them.
Tip When you are inserting isoparms, make sure you are using the Between Selections
option whenever you can.
Note the number of isoparms at this stage. We have enough to have a simple head and neck, if not
the face. The number of U isoparms isn t so important right now, but there are eight V isoparms
radiating from the mouth for half a face, which is about right at this stage. Rebuild the surface with
the Keep CVs setting checked, and everything else at default.
3. The mouth should be built first. As a rule, for a simple half face, you want three isoparms for
the mouth bottom, three for the mouth corner, and three for the mouth top. This would be listed
in the Attribute Editor as eight spans of V isoparms, the first isoparm having the value of zero.
Cut the face just around the forehead area. Hide the head. Duplicate the half face, then make
its Scale X value 1. This becomes the half face on the right. Open the Connection Editor.
Select the first face s shape node and load it into the Output window. Load the second face s
shape node into the Input window. Connect World Space to Create as shown in the next
illustration. Now the second face on the right deforms when the CVs of the first face on the left
are moved.
4. Don t create the oral cavity. The surface edge should be right at the end of the inner lip.
Concentrate instead on forming a clean mouth, with the CVs all placed properly and not
bunched up chaotically, especially in the mouth corner area. You can add U isoparms to make
the nose more defined, but do not add V isoparms at this point. Once the mouth looks
acceptable, rebuild the surface. The V isoparm count should still be eight spans.
5. Duplicate curves from U isoparms of the face. Unhide the head, and do the same. Delete the
surfaces. You are left with only the curves, as in a) shown next. Loft, and tweak the curve CVs
to refine the head further, as in b).
6. Cut the face from the head as before, and add U and V isoparms to define the nostril area, as
in c). Make sure to insert the isoparms gradually as you are sculpting; otherwise you are
unnecessarily challenging yourself. Although the face and the head are detached, they are still
procedurally connected to the curves. If you want to make changes involving both surfaces,
you can still do so by moving the curves CVs. Their tangency is maintained.
7. Once the nose is finished, you can move on to the eyes. What we are going to do is cut the
face into four patches. The mouth and the nose are basically done, and there is no reason to
add anymore isoparms to it. The eye area requires a lot of isoparm insertions, and we d like to
localize the density as much as we can. And cutting the eye area into two patches along the
eyeline allows you to create holes for the eyes.
8. Cut the mouth area from the face, selecting the isoparm a bit below the eye sockets. Cut the
jaw area from the face, again, along the isoparm just beside the eye sockets.
9. Only the eye area remains to be sculpted and it is probably the most difficult. Before cutting
the eye area into eye_top and eye_bot patches, insert all the V isoparms you ll need. You
need two isoparms close together to clamp the eye s corner, two on each side, at least three
or four isoparms for the eye itself, and at least one isoparm between the eye area and the
edge. Once the V isoparms are inserted as in e) above, you can cut the U isoparm along the
eyeline. You need to insert the U isoparms in the two eye patches as you are sculpting the eye
area, but they should roughly look like e) after a while.
The picture d) above is an example of what can go wrong at this stage. The U isoparm was cut
prematurely. You can still insert isoparms in the two resulting patches carefully so that they will
match, but it isn t efficient. Also, the cut was made without putting in eyeballs to see exactly
where the eyeline is. As a result, the cut was made a bit lower than it should have been.
10. The ear is basically a deformed sphere with holes. If there is a trick to building it, it s not much
of a trick build the front half first, and then the back half. The ear below has been cut in half to
show this. The rest is sculpting, pushing and pulling CVs into the shape you see. The eyes can
be as simple as a plain sphere, or as complicated as the one here. There are two spheres, the
inner one deformed for realistic pupils, and the outer one transparent and used for specularity
only.
11. You need to insert two more isoparms in order to fold the eyelids. Since we re building a child,
the eyes should become a bit larger and the nose a bit rounder. Once the shapes look OK,
attach the left and the right side geometries. Use the Blend with Insert Knot setting. You should
end up with eye_top patch, eye_bot patch, mouth patch, and the jaw patch as shown below. If
the edges no longer meet perfectly, it is not a problem, as long as they are not too far apart.
For the space that gets created between the eyes and the face patches at the corners, stick in
a simple polygon face to fill the hole, as shown here. The eye area should be built in such way
that the patches will close the eyes without any problem.
12. Use the Global Stitch with Tangency option. Select everything, including the head geometry. If
any seams were noticeable, this should get rid of them. Make a copy of the face. You can
delete the curves, the original face patches, and other unnecessary nodes. We did not build an
oral cavity for this model, but if you wanted to build one, you would start by offsetting the inner
mouth edge isoparm, and duplicating the offset curves. You should build it when you are
building targets for Blend Shapes. The hair is built from a plane, which starts out from the back
and wraps around the head like a towel.
Summary
This was a long chapter, covering a lot of material. You learned to create and manipulate NURBS
curves and surfaces, and saw examples of building things with them. We also went through an
advanced tutorial on building a human face, which takes a lot of practice to become good at. The
next chapter will also be quite substantial, introducing the world of polygons. Then we will come
back to modeling with NURBS again in Chapter 8, where we will proceed to build a puppy dog in
patches.
We begin by introducing some terms and concepts related to polygons. Then we describe how to
create and edit polygons using the Maya tools. Finally, we discuss the more advanced topic of
mapping textures. To demonstrate all the concepts, the tutorial at the end of this chapter provides
instructions for building a hand using polygons.
As far as we (and Maya) are concerned, polygons are triangles, rectangles, pentagons, and other
many-sided line drawings. The endpoint is called the vertex, the line is called the edge, and the
area inside is called the face.
Polygon Faces
Faces have a front side and a back side. When you are building the face, the front side is
determined by the direction of the vertices creating the edges (see the Creating Faces section
later in this chapter).
The most basic polygon surface is the triangular face. The front side of a triangular face has only
one normal vector, because triangles are, by definition, planar. Quadrangular polygons (quads) are
four-sided faces, which may or may not be planar. You also can create faces that have five or more
sides, called n-sided faces. However, as a general rule, you should try to keep your polygon
surfaces as triangles or quads.
Note We could say that a triangular face is the building block of all modeling. Every type of
surface geometry is converted into triangular faces (a process known as tessellation)
before it is rendered.
Faces in a polygon surface are usually connected (attached to each other), sharing common
vertices and edges. They can be extracted with their own unshared edges and vertices while still
being part of the polygon surface, but then they will not become soft edges, which means they will
not be smoothed in the tessellation process. (Extracting faces is discussed later in this chapter, in
the Editing Polygons section.)
By default, faces have UV values assigned to them when they are created. As explained in Chapter
6, a surface in 3D space is defined by the parameterization of the variables U and V. A UV
coordinate can be given at any point inside the area, and the area is given UV directions. UVs are
needed for texturing purposes. UVs are difficult to distinguish from the regular vertex points, but
they turn bright green when they are selected.
Note You may find polygons that do not have UV values, especially when the surface is a
model imported from another program. If the UV values are missing from the polygon
surface, you need to assign them manually, as described in the Mapping Textures
section later in this chapter.
Creating Polygons
Polygons are usually created by clicking on vertices, much like creating curves, to generate edges.
Two or more edges create a face, which contains face normals and vertex normals. You can also
create polygon primitives or convert NURBS into polygons.
Note Notice that the polygon cube, cylinder, and cone surfaces are all one-piece solids,
unlike their NURBS counterparts, which are made up of several pieces.
As an example, select Create Polygon Primitives Sphere . The Subdivisions Around Axis
attribute is equivalent to the Sections attribute of the NURBS sphere, and Subdivisions Along
Height is the same as the Spans attribute of a NURBS sphere. You also can choose the axis for
the sphere s up direction. The Texture setting, which is turned on by default, maps UV values to
the sphere being created. We will talk more about textures toward the end of this chapter. To
create the sphere, click Create.
You can try editing the sphere s radius and subdivision attributes in the Channel box s Input
section or in the Attribute Editor s polySphere tab. In the latter, you can also edit the Axis setting to
change the sphere s orientation. The examples below show spheres with different settings.
Displaying Polygons
Maya provides many different ways of modifying the display of polygons (perhaps too many, in
fact):
" From Display Custom Polygon Display q, which provides more details and the ability to control
the display of more than one polygon
" From Options General Preferences (in the Display Polygons section), which is a detailed display
that lets you control multiple polygons, similar to the Custom Polygon dialog box
" From the Attribute Editor s Shape tab (in the Mesh Component Display section), which focuses
on one polygon, as shown next
The following sections describe the display options for the polygon surfaces that are available
through these dialog boxes.
Displaying Vertices
You can set vertices so that they are visible when the polygon is not selected. Vertex normals also
can be made visible. The Backface Culling option for vertices is turned on by default in the Custom
Polygon Display Options dialog box (shown below), but it doesn t have any effect if the Backface
Culling option is set to Off.
There are three degrees of backface culling, and they can be very useful when you need to select
only the front side of a surface (the Attribute Editor and the Custom Polygon Display Options dialog
box have slightly different wording for these options):
" The Soft/Hard setting displays the soft edges as dotted lines.
The Border Edges setting is off by default. When you turn on this setting, you can see the border
edges in thicker lines. The default width for border edges is 2, but you can increase the thickness.
The Custom Polygon Display Options dialog box also offers a Texture Borders option, which
represents the starting point and endpoint for the texture UV placement. These display options for
edges and borders are illustrated below.
Displaying Faces
The choices for displaying faces are Centers, Normals, Triangles, and Warp. The Triangles option
is available if the faces are not triangular, and it displays the faces in triangles made up of dotted
lines. When Warp is turned on, it detects any face that is warped, or nonplanar. The different
settings for displaying faces are shown below.
Note The Triangles option for face display is different from the Triangulate function, which
actually adds the edges to the faces. With the Triangles option, the surface itself does
not change; it only displays triangles.
You can choose to display face normals, as well as vertex normals, and set different line lengths to
represent them.
Displaying Numbers
Through the Custom Polygon Display Options dialog box, you can display numbers for vertices,
edges, faces, and UVs of polygon surfaces in the order of their creation. Examples of item
numbering for vertices, edges, and faces are shown below. UV topics are covered later in the
chapter.
Coloring Vertices
You can color vertices in Shaded mode by checking the Color In Shaded Display option in the
Custom Polygon Display Options dialog box. To apply color to vertex, select the appropriate
vertices and select Edit Polygons Colors Apply Color . In the option box, you can create the
color you want for the vertices, and then click the Apply Color button. (See the Color Gallery on the
CD for the full effect.)
Another display function that is indispensable in working with polygons is accessed by selecting
Polygons Display Poly Count. In many game productions, keeping a model s poly count below a
certain number is crucial in maintaining real-time interactivity of the game.
" The numbers in green on the left side of the window show the total polygon count in vertices,
edges, faces, and UVs for all the visible polygon surfaces inside the window.
" The numbers in white on the left side of the window show the numbers of the specific selected
components.
" The numbers in white on the right side of the window show the total polygon count for the
selected object.
Creating Faces
Let s use the Create Polygon tool to draw two faces:
2. Set all the options to their default values by clicking the Reset Tool button, and then change the
Limit Points setting to 3.
3. Click in the modeling window in a counterclockwise direction as shown below. On the third
click, a triangular face is created.
4. Change the Limit Points setting to 1 (the default). Then click again, as shown below. Press
Enter after the fourth click to create a quadrangular face.
Note If you leave the Limit Points setting at its default of 1, then after you ve entered the
desired number of vertices, you just press Enter to complete the action.
5. Choose Display Custom Polygon Display . Click the All button at the top of the dialog box
to set the display for both faces. Then check the Normals check box next to Vertices and the
Vertices check box next to Show Item Numbers. Switch to perspective view, and you will see
that the normal directions for the faces are opposite, as shown below.
The direction of the vertex creation determines the direction of the normal. This means that the
front side of a face is created by vertices going counterclockwise.
Note Faces that are not triangular may or may not be planar. If you want to make sure the
faces you are building remain planar, you can select the Ensure Planarity option for the
Create Polygon and Append To Polygon tools. This option forces the face being built
to remain planar.
Adding Faces
The Append To Polygon tool is the same as the Create Polygon tool, except that it adds faces to
existing faces rather than creating new ones. Let s add some faces to our triangular face:
2. Click on the triangular face to select it. You can tell it s selected because the border edges
appear thicker.
Tip By default, to select a face, you need to click or marquee its center. If you want to be able
to just click anywhere inside the face and select it, choose Options General
Preferences Modeling, and change the Polygon setting from Center to Whole Face.
3. Select the edge on the left side, and you will see pink arrows going clockwise around the
triangular face. Also, a bright green dot appears at the zero vertex. That is where the
appending begins. (Because the arrows go in the opposite direction from the way the face is
created, this process can be rather confusing if you are not careful.)
4. Click two more times, as shown below. Then press Enter. You now have a quadrangular face
attached to the original face. Note the vertex numbers are 3 and 4. You can continue to add
faces this way.
You can set the Append To Polygon tool to continue adding faces by setting the Limit Points option
to 4. You can try this with the quadrangular face. After the second click, another quadrangular face
is created, and you are still in the Append mode. You can build polygonal strips in one round of
clicking this way, as illustrated below. You also can create a triangular face by pressing Enter after
the first vertex placement, but that will exit Append mode. Another technique is to click on one
edge, then click on another adjoining edge to create a face that is attached to those two faces, and
continue to attach the face to more edges as you go.
Tip You can reposition a vertex while you are creating it, just as you can with curves (see
Chapter 6). Just MM click or press the Insert key.
Quadrangles usually convert more cleanly than the triangles. However, after the conversion
process, you may prefer to work with triangles or a quadrangulated version, as shown in the center
illustration on the next page.
The Count setting forces the converted polygon to try to match a set number of face counts. The
Control Points setting creates vertices in place of CVs. After the conversion, you can edit the
conversion settings in the Attribute Editor or the Channel box.
Selecting Polygons
Before you can edit and manipulate your polygons, you need to select them. As usual, Maya offers
several techniques for accomplishing this task. You will most often select components using the
selection mask, by RM choosing over the surface you re working on. Alternatively, you can use
hotkeys and the tools on the Polygons Selection menu.
F9 Selects vertices
To select more than one component, select a component, pick-mask to another selection mode,
and then Shift+select the other component. The illustration below shows the marking menu list for
the various polygon components.
You can also convert any selected component elements to another by using the Convert functions
on the Selection submenu. As you can see in the illustration below, conversion is not cyclical
converting the selected vertices to UVs will give a larger region of UVs than the one you started
with.
Constraining Selections
At the bottom of the Selection submenu is an advanced tool called Selection Constraints. Here are
some examples of what you can do with this tool:
" You can constrain the selection to specific locations, such as border components or inside
components.
" You can have only hard edges selected or only soft edges selected.
" You can select only triangular faces, only quads, or only faces with more than four sides.
" You can expand or shrink a selected region, or select the selection s boundary.
Some examples of polygon selection constraints are shown below. You may notice that the n-sided
faces look like they are quads. It s easy to confuse the two, but when you count the vertices or the
edges, the selected n-sided faces have more than four. All the n-sided faces have smaller adjacent
faces that divide their sides into two edges and three vertices. Another way to tell if a face is
n-sided is to turn on the Triangles option in the Custom Polygon Display Options dialog box.
Tip The contents of the Selection Constraint dialog box depend on the types of components
being constrained. A good practice is to pick-mask the component you wish to select, and
then open the dialog box. Another is to make sure to click the Constrain Nothing button
before you close this dialog box.
Editing Polygons
This section focuses on the tools for working with polygons. You have many options, ranging from
moving polygon components to manually softening or hardening a polygon s edges. You can find
the editing tools on various menus, including the Edit Polygons menu, the Tool Options submenu,
the Booleans submenu, and the Normals submenu.
Note The number of Polygon tools available has expanded considerably in Maya 2. Here,
we cover the option settings for the functions you are likely to use most often. For
information about the other functions option settings, consult the Maya
documentation.
The Move Component function has a local mode and global mode. You can switch between these
modes by clicking on the toggle handle, as shown below. In local mode, the Z axis is always
pointing in the direction of the surface normal.
With the Duplicate Face and Extrude functions, you can either keep the resulting faces together or
have them remain separate by toggling Polygons Tool Options Keep Faces Together. Note
that although the duplicated faces are discontinuous from the original faces, they are still
components of one polygon object.
You can use a face to create a hole in another face. The examples below were created by
duplicating the face, then selecting Polygons Make Hole Tool. With the default settings, the Make
Hole tool creates an extrusion with the second face becoming a hole for the first. Alternatively, you
can produce holed surfaces by selecting Merge settings in the option box. If you do not want to
disturb the position of the original surface, set Merge to First.
To fill surfaces with unwanted holes, use the Fill Hole function on the Polygons menu. You must
select edges around the hole before it can be filled.
After a Boolean operation, the vertices may end up not matching well, requiring some cleanup. For
example, in the Difference operation, the first picked object remains, minus the intersecting part. In
the operation shown below, the torus ends up with some messy face topology at the intersection
point, which will need to be cleaned up.
Combining polygon objects is simple, but dividing one polygon object into separate objects is a bit
more involved. Before any of the faces of the polygon object can become separate objects, they
must be extracted to become different shells.
Note An object that was created through the Combine operation already has extracted
pieces. Thus, you can simply apply the Edit Polygons Separate operation to undo
the Combine action; you don t need to use Extract first.
The Extract function, also on the Edit Polygons menu, does exactly what it says: It extracts the
selected faces from their neighbors so that the edges and vertices of the extracted faces are no
longer shared. Once a face is extracted, it becomes a separate shell inside the object, and the Edit
Polygons Separate operation can be applied.
The Edit Polygons Merge Vertices function merges vertices so that instead of there being several
overlapping vertices at one point, only one vertex is shared by the edges. Often, you will not see
any difference until you try moving the edges or faces, as shown below.
The Edit Polygons Merge Edge function merges border edges. When you select the tool, the
border edges become thicker. Click on the first edge, and then the second edge. Both edges turn
orange. When you click again, the two edges merge. There are three Merge modes:
" With Middle, the default mode, the first and the second edge merge at the halfway point.
" With the Merge mode set to First, the second edge snaps to the first edge.
" With the Merge mode set to Second, the first edge snaps to the second edge.
After the merge, you are still in the Merge mode, and the tool asks for another first edge to be
picked.
You can also merge adjacent edges to clean up messy polygons or simplify edges. The Edit
Polygons Merge Multiple Edges function takes multiple edges and sews them together, as
shown below. After you use Merge Multiple Edges, you can polish the results by using the Merge
Edge tool.
" You can delete only corner vertices, or vertices that are joined by only two edges (called winged
vertices).
Warning When you delete an edge inside a surface, be sure the vertex of adjoining edges is
not a winged vertex. If it is a winged vertex, then you should not delete it.
The Edit Polygons Collapse function does not work like Delete. In contrast, Collapse allows you
to collapse faces and edges so that the remaining vertices are shared, as illustrated below.
You can t subdivide faces with holes. In those cases, use Edit Polygons Split Polygon Tool. In
fact, the Split Polygon tool is probably one of the tools you ll use most frequently. With this tool,
you can divide faces into smaller pieces.
Note Do not confuse the Split Polygon tool with the Append To Polygon tool on the
Polygons menu. The Append To Polygon tool creates faces at the outer edges of a
surface, whereas the Split Polygon tool edits faces by dividing them into smaller
pieces.
You can insert vertices on edges, thereby splitting an edge into two, and insert edges on faces,
thereby splitting the face. Let s see how this works:
1. Create a plane, zoom in from the top view, and select Edit Polygons Split Polygon Tool. The
surface is highlighted in green.
2. Click on one of the inner edges, as shown below. A bright green dot appears on the edge.
3. Press Enter, pick-mask Vertex, and you ll see that a vertex has been added, splitting the edge
into two.
4. Select the tool again, click on the opposite side, and click-drag to the point you first created.
Press Enter, and the face splits into two.
You can set the Subdivision option for the Split Polygon tool so that with each click, it creates any
number of vertices. This option is especially useful in situations where you want to create evenly
distributed vertices, as shown in the lower image below. However, the Subdivision setting will not
work if your second click is inside the face and not on another edge, as shown in the upper image
below.
Warning When you want to place a vertex at the end of an edge, don t click on the
endpoints of that edge. You may select the wrong edge that way. Instead, click on
the middle of the edge you want and drag to the endpoint.
The Sculpt Polygons tool, or Artisan, on the Edit Polygons menu is also especially useful in
polygonal modeling. It can save you hours of pulling and pushing vertices on dense surfaces with
just several brush strokes. See Chapter 9 for more information about using the Artisan tools.
Soften/Harden, another function found on the Normals submenu, can manually determine if a
polygon s edge is to be hard (edgy and sharp) or soft (smooth and rounded). Let s try out this
tool:
2. Select Display Custom Polygon Display . In its dialog box, turn on both Vertex Normal and
Face Normal.
3. Zoom in to look closely at the vertices of the sphere in Shaded mode. You should see normals,
as shown below.
4. It may appear messy, but if you look carefully, you can see that each vertex has four normals
coming out of it, with each vertex normal in parallel to its corresponding face normal. Pick-mask
Edge and select the upper half of the sphere.
5. With the upper sphere s edges still selected, select Edit Polygon Normals Soften/Harden
.
6. Click the All Soft (180) button, then the Soft/Hard button. The upper half of the sphere now has
only one vertex normal coming out, which is not parallel to any of the face normals, as shown
below. The other vertex normals are deleted because the edges are now soft edges. Note that
the upper half of the sphere is rendered smoothly as well.
7. Open the Attribute Editor for the sphere and go to the tab called polySoftEdge1.
8. Open the Poly Soft Edge History. You ll see the Angle slider set at 180. Try moving the Angle
slider down. From around 35 degrees and lower, you should see the deleted vertex normals
popping back in, and the edges becoming hard edges again.
Mapping Textures
As with NURBS surfaces, textures are mapped to polygon surfaces parametrically, with UV values.
But UVs are not an intrinsic part of a polygonal surface. They must be mapped. A polygonal
surface can acquire UV values through various types of projection mapping, normalization, or
unitization. The best way to explain all this and the other tools you need to use for texturing is to
step through some examples, which is what we ll do here.
Note This section requires some familiarity with Hypershade. You may want to read through
Using Hypershade in Chapter 19 first.
First, let s create a polygon to work with in the Texture View window.
1. Start a new scene and select Edit Polygons Texture Texture View.
2. Select Polygons Create Polygon Tool . Make sure that the Texture option is set to
Normalize.
3. Go to top view and create a triangle, as shown below. Press Enter to complete the action, and
you will see the triangle appear in the Texture View window.
4. Create a blinn shader in Hypershade, assign a diagonal ramp to it, and assign the shader to
the triangle.
5. Press number 6 to get into Textured Display mode and select the triangle again. Your display
should look something like the one shown below. Note that the triangle fits the texture
horizontally, which represents U parameterization from 0 to 1. Normalized texture maps to the
surface in this manner.
Note You ll find the image above and the following series of images in the Color Gallery on
the CD.
Tip It s a good idea to keep the Texture View window open when you are working with
polygon textures. Most of the Texture submenu options can be accessed from inside this
view, and we will be using it constantly in this section.
In the Texture View window, the texture image repeats according to the settings in Image Range;
the default is 10 repetitions. You may find the repetitions a bit disorienting at first, but it s better to
have it repeat than to have it show just once. If you find the default grid setting distracting, you can
turn it off or change its display setting. You can transform UVs in the Texture View window in the
same way that you transform regular vertices. If the selected faces have a projection mapping, you
can edit the Mapping manipulator as well.
Transforming UVs
We ll continue and transform the UVs.
1. In the Texture View window, select the UVs and select the Move tool. A 2D Move manipulator
appears. Move the manipulator, and you will see the texture in the triangular face update.
2. Select the Rotate tool, and a 2D Rotate manipulator appears. Rotate the UVs, and the texture
inside the triangle updates accordingly.
4. Open the Append To Polygon Tool option box, turn off Ensure Planarity, and set Texture to
Normalize.
5. Select the right edge, then switch to side view and click the vertices up so that you end up with
a diagonal face, as shown below.
When it becomes part of the surface, the ramp texture is automatically assigned. As the texture
map is normalized, it is mapped to the diagonal face horizontally, from 0 to 1.
Sewing Textures
In our example, although the faces are attached to each other with shared edges and vertices, the
UVs are mapped separately. If you want to have the two faces share the texture mapping, you can
sew the textures. But first, let s position the textures properly.
1. In the modeling window, select the UVs on the edge that joins the faces.
2. In the Texture View window, take note of which two UVs of the triangle and the diagonal face
are selected. Select all the UVs of the diagonal face, then rotate and translate them so that the
two UVs of the triangle and the diagonal face are next to each other, as shown below.
3. Select the common edge of the two faces. Then in the Texture View window, select Edit Sew
Texture. The UVs of the triangle and the diagonal face snap to each other and become shared
UVs.
Note The Edit Cut Texture option performs the opposite function. It takes shared UVs and
separates them, creating two new UVs per edge.
Unitizing UVs
Now let s see what happens when we unitize our polygonal surface.
1. Open the Append To Polygon Tool option box. Set Texture to Unitize and turn on Ensure
Planarity.
2. In perspective view, select the longest edge of the triangle. When you see pink arrows, click on
the nearest edge of the diagonal face.
3. In front view, click a vertex straight up to the diagonal face s height. The new face is planar,
and it should look something like the image shown below. The Unitized setting stretches the
UVs for the new face to fit the texture UV unit.
4. Repeat the sewing procedure: Rotate and translate the unitized UVs to line up to the triangle
and sew it. You should see something like the image shown under step 2 in the next section.
Notice that now there is a smooth texture transition from the triangle to the unitized face.
Assigning UVs
From time to time, you will encounter models imported from other programs that carry no UV
information with them. You will need to assign UV values to these surfaces, following a procedure
like the one outlined here.
1. Open the Append To Polygon Tool option box again if you ve closed it. Set Texture to None.
2. Select the top edge of the unitized face. When you see the arrows, select the top edge of the
diagonal face. Press Enter to create a triangle, as shown next. Although it is part of the
polygonal surface, this new triangle has no UV information, and therefore no texture is
displayed. Note that nothing new appears in the Texture View window.
3. Select the face of the new triangle. Open the Normalize UVs option box from the Texture
submenu or the Edit menu in the Texture View window. The default setting will make the
triangle stretch from 0 to 1 in both U and V, which is not what we want.
4. Select Preserve Aspect Ratio, and it will normalize only one of the two values, in this case, U.
Click on Apply, and texture appears on the new triangle as well as in its normalized UV points
in the Texture View window.
5. Sew the new texture to the diagonal face by rotating and translating the new triangle. You
should see the UVs connected, as shown below.
Projection Mapping
Maya has three types of projection mapping functions available from the Texture submenu: Planar,
Cylindrical, and Spherical Mapping. There is also a Create UVs Based on Camera function, which
creates UV values of a planar mapping projected from the camera view.
1. Start a new scene and create a polygonal cube. With the cube still selected, open the Texture
View window. You should see the cube UVs laid out as shown below. The default setting for
the cube normalizes UVs so that they are all connected for the whole object.
2. Rotate the cube in the Z axis 45 degrees. Then select its front face. Make sure that the Assign
Shader to Each Projection function on the Texture submenu is checked, and apply Planar
Mapping with the default settings. The Assign Shader to Each Projection setting automatically
creates a default polygon shader with a checker texture and assigns it to the selected polygon.
The default planar projection fits the texture to the bounding box of the selected object or face,
and projects the map along the Z axis.
3. The black and white checker colors are too intense for viewing in the Texture View window. In
Hypershade, select the checker texture and assign dull blue to one color and green to the
other. Note how the UV points are mapped as a square rotated 45 degrees in the Texture View
window.
4. Select the cube. If you don t see the texture showing in the Texture View window, as shown
below, select Image Selected Images texturedFacets pCube1.
Warning Do not confuse projection mappings for polygons with the projections for NURBS.
When creating textures for polygons in Hypershade, use the Normal setting. If you
need to create a texture as a projection, the Interactive Placement button should be
used only for NURBS, not polygons.
An example of a situation where mapping would be a bit harder is if we selected the face at the top
and rotated it in the Y and X axes to make it near vertical and diagonal, as shown next. If we apply
the default planar mapping, we get stretched UVs (as in the top-left image). Note how the UVs are
stretched in the Texture View window as well. If we set the option to Y-axis projection, again the
result is not what we want (as in the top-right image). We could grab the manipulator handle and
rotate and scale until the texture fits the surface straight, but that takes effort. Instead, we can set
the option to Fit to Best Plane. The projection will project in the direction of the surface normal, and
as a result, we get a perfect fit (as in the bottom-left image). Another option is to apply planar
mapping with camera direction (as in bottom-right image). For this example, the cube was selected
as object, so all the UVs are mapped exactly as the UVs you see through the camera in the
modeling window.
The Cylindrical and Spherical Mapping options are similar in principle to planar mapping, and they
are simpler to apply. Often, the shape of the polygonal object will dictate which type of mapping is
best suited for it. See the examples below.
Note In this tutorial, we will use some tools that haven t been covered yet in this book. You
are encouraged to look ahead for more information about those tools, as well as to
infer things from looking at the pictures.
1. Start a new scene. Create a poly cube. Select a face on the X axis and extrude it four times.
Scale it until you see something like the image shown below. Delete the faces at the back side.
2. Select Polygons Tool Options and turn off Keep Faces Together. Select the four front faces
and extrude them three times, as shown next. These will be the fingers. As you are extruding,
scale the faces down a bit each time to taper them. At every point, you should be tweaking the
vertices to try to form a rough hand shape. For example, try to roughly round the wrist area at
the back.
Tip Turn on the Backface Culling options Keep Wire setting. This will help you to avoid
accidentally selecting vertices or faces at the back side of the hand.
3. Push back the pinky finger, pulling it away from the ring finger to the side, and pull the middle
finger out a bit. You can select faces to do this; however, in this situation, moving vertices
seems to work best. Push up the two vertices where the knuckles should be.
1. On the left side of the hand, draw two edges using Edit Polygons Split Polygon Tool. Next, at
the bottom (the palm of the hand), draw four more edges. Pull out the vertex at the side and the
one at the bottom beside it, then pull them down. Select the face that sticks out with the
vertices, and extrude it twice, turning and scaling it as you do. See the next graphic for
guidance. This is going to be the thumb. Save the file as hand_one. (Maya will append a .mb
extension automatically.)
2. Add two lines of edges going around the hand using the Split Polygon tool. Use the tool to
place extra faces around where the thumb bends into the hand, and move the triangular face
further into the palm.
3. For the wrist, select the border edges, apply Polygons Fill Hole to create an n-sided face,
select it, and then extrude the face at the back, as shown next. After you extrude it, delete the
face again.
Tip Keep the faces you are creating limited to quads and triangles. They should also run
smoothly along set lines and not be placed haphazardly.
4. Scale out the hand to make it wider. Bend the fingers straight down, and bend the thumb into
the palm at an angle, as shown below.
5. A lot of history has accumulated on the hand by now. Delete the history from the object and
save the scene as hand_two.mb.
1. Make a copy of the hand and scale it up a bit. We ll call this the rough hand and call the
original one the smooth hand (it isn t yet, but it soon will be).
2. Using Hypershade, assign a material to the rough hand, and make it totally transparent. In the
Shaded mode, the rough hand should still display as a wireframe, as shown below.
3. Select Window Connection Editor. Select the rough hand, press the down arrow key to
select its Shape node, and load it to the Outputs window by clicking the Reload Left button.
Load the smooth hand s Shape node to the Inputs window the same way.
4. Scroll down in the left window until you find World Mesh[0] and select it. Scroll down in the right
window until you find In Mesh and select it. Both attributes become italicized, as shown next.
When you select the rough hand, the smooth hand turns pink to show that the hands are
procedurally connected.
5. Select and move some vertices on the rough hand, and the smooth hand should deform along
with the rough hand. Note that you can also move the smooth hand s vertices independently.
Save the scene as hand_three.mb.
1. Select the smooth hand and apply Edit Polygons Smooth to it with the default setting. Some
things immediately stand out as needing improvement, such as consistency in the width and
the direction of the fingers. We need to fix these problems before we can apply Smooth again.
2. Before we start to tweak, let s put the smooth hand and the rough hand on different layers.
Once the smooth hand is in a layer, select the Reference setting for the layer. The Template
setting will only display the hand as a wireframe, but the Reference setting will display the hand
in Shaded mode, while still disabling it from being selected.
3. Tweak the rough hand until you are comfortable with the shape it has created in the smooth
hand, as shown next. You can hide the rough hand for now, and move back to the smooth
hand by switching from Reference to Standard in the Layer menu.
1. Place vertices around the fingers and the thumb where the joints will bend. Think ahead to how
another edge line will be placed in between every line with the second Smooth. The area
between the fingers needs to have a bit more space, and the knuckles should stick out more as
well. (Don t worry too much about creating hard edges or creases at this point.)
2. The thumb area needs special attention. Get rid of the extra edges, as shown below. Make
sure that there are no winged vertices left behind. If you need to make adjustments that require
moving a whole area, use the rough hand. Save the scene as hand_four.mb.
3. Apply Smooth one more time. At this point, the density of the surface calls out for the Sculpt
Polygon tool. But such areas as the finger joints and fingernails should still be modified by
selecting vertices. Notice the vertex placements around the finger joint areas and fingernails
shown below.
4. Using Edit Polygons Sculpt Polygon Tool, start pushing and pulling to get more definition for
the hand, especially the palm, the knuckles, and the wrist area. Smooth out where the thumb
joins the hand as well. If you want to build a more mature-looking hand, you can try making the
bones protrude along the back of the hand, and put more space between the fingers.
Tip Change the Radius setting according to the specific area you are sculpting, and always
set the Opacity low. It may be frustrating to need to click many times, but retaining control
of the tool you are using is important.
The hand model is pretty much finished at this point. The hand will be used in the child model we
will be building in upcoming chapters, so save the file as child_hand.mb.
Summary
In this chapter, you learned what polygons are, how to create them, and work with them in Maya,
and how to texture-map them using the Texture View window. We went through an advanced
tutorial, building a polygon hand, which we will use for the child model later in the book.
In the next chapter, we will explore NURBS (patch modeling). We will build a dog model in NURBS
patches, covering some advanced modeling concepts as we go.
At the same time, this is a difficult chapter. The time required to build this model will vary depending
on your skill level and familiarity with organic modeling, but you probably won t be able to build the
whole dog in one session. It is also important to keep in mind that you are not producing a work of
art at this point. Spend time learning the tools and techniques of organic modeling, but don t dwell
too long on tweaking CVs! (And you can always use the prepared model found on the
accompanying CD instead of building it from scratch.)
One last reminder. As with any real-life projects, things can get pretty messy as you work your way
through this chapter. It is important for you to practice good work habits. Save your work often.
Name things carefully. Take regular breaks to clear your head. Always ask why you are doing what
you are doing, instead of blindly working through the steps of the project. You will learn much more
that way.
The best way to start is to actually sketch your model if you can. This approach encourages you to
be aware of the parts you need to create and to think of ways to build them.
For this example, we need to know what the dog will look like. We ll start with a sketch of a puppy,
which is based on several pictures of various dogs. As long as the body proportions and the bone
structures remain similar, the sketch should be sufficient for our purposes. For our project, we will
use this sketch as a background image.
The next thing we need to know is what this dog is going to be doing. Let s say the dog will be
walking or running, so we only need to concern ourselves with the movements of the dog related to
those specific actions (walking and running are fairly easy to set up). If the dog were to move in
other, more complicated ways, such as sitting or rolling on the ground, then we would need to test
the dog to account for those movements as well.
Note In studio productions, the models are not considered complete until they have gone
through many extreme poses to test their suitability for animation. The designer may
need to modify the model if it fails to hold its shape under certain extreme poses at the
testing stage. In some cases, different versions of the model may be required for
different animation situations.
1. Create a new scene and go to side view. To bring in the image of the dog from the
accompanying CD, select View Camera Attribute Editor Environment and click the Image
Plane Create button. You can use the Image Name field to browse for the image
puppy_sketch.tif on the CD.
2. Create a sphere, rotate it 90 degrees in the X axis, and scale it out. Go to the Channel box,
open makeNurbSphere1, and set Sections to 10 and Spans to 20. Translate the sphere to
about where the puppy s body is, as shown below.
Tip If you find the image plane too bright, you can darken the picture by lowering the Color
Gain setting in the Image Plane Attributes section of the Attribute Editor.
3. Pick-mask the sphere s CVs or hulls and transform them using translate, rotate, and scale
procedures to get the same profile form as the dog in the picture. Space the isoparms as
shown and explained below.
The Face Two rows of CVs should do for the nose area, because we will place a sphere for
the nose later. Also, since we are not including eyelids or a mouth, we can use a minimum
number of isoparms for the face three rows of CVs will do.
The Body Use three rows of CVs for the back of the head and the neck, and three more for
the chest area. Use one row for the stomach area, and three rows for the back leg area. Note
that the stomach shape is actually created by three rows of CVs; the row for the stomach area
works together with the last row of the chest area and the beginning row of the back leg area.
The Tail Two rows tie the tail to the back of the torso, and two more make the tail curve
tightly towards the end. The last three rows shape the endpoint of the tail one more than we
need. Select the third row of CVs from the end of the tail and press the Delete key to remove it.
Scale the last two rows out to fit the profile of the tail.
4. Switch to a two-view layout by selecting Window View Arrangement 2 Side by Side (you
can also use the marking menu and select Panels Layouts 2 Side by Side). Make one
window perspective view and the other top view.
5. Select hulls again, and scale the CVs in the X axis to make the shape look more like a puppy.
You can scale in the Y or Z axis as well, to fine tune the profile shape. You can hide the
camera for the perspective view by turning off Show Cameras. You should end with
something like the shape shown below.
Tip Use the arrow keys to go up and down the UV parameters with the selection of CVs. This
technique is especially useful when you are selecting hulls.
As you are building your model, you should always be asking yourself how many CVs you
need to get the shape you want. In answering that question, there is one simple rule: It takes
three CVs to curve a line. It follows that only three rows of CVs are needed to curve a
surface. When you study models with this rule in mind, it may surprise you to see how often
unnecessary isoparms are placed for simple curvatures on surfaces.
You might want to add one more row to tie the curve, making it very tight and edgy.
Another way to tighten a curve is to increase the CV weights, instead of adding more CVs.
The only drawback to this technique is that sometimes the weight information gets lost when
models are transferred to other programs.
Be a minimalist when you are starting out. The fewer CVs you have, the easier it is to control
the surface area. You can easily insert more isoparms later to refine your model, but it is
more difficult to get rid of them without disturbing what you ve already built. Having fewer
CVs also lets you concentrate on the big blocks of the model you are creating and ignore the
details, which is considered good form in drawing and sculpting.
1. In perspective view, select the Select tool from the Minibar. Pick-mask Isoparm and click on the
first vertical isoparm going around the nose area. In the Feedback line (above the Layer bar),
you should read U Isoparm 19.000. When you select the next isoparm, it should say U
Isoparm 18.000, and so on.
2. Click on the horizontal isoparm around the eye level. You should see V Isoparm 9.000 in
the Feedback line. The isoparm around the mouth level should be V Isoparm 1.000, and so
on. If your isoparms show opposite numbers, such as 1.000 in place of 19.000, you can
reverse the parameter values by selecting Edit Surfaces Reverse Surface Direction ,
setting the Surface Direction to V, and then clicking the Reverse button.
Tip When selecting isoparms, if the number ends neatly, such as 1.000 or 1.25, it usually
means you have selected the proper isoparm. If the number ends not so neatly, such as
9.01 or 15.476, it usually means you ve missed the isoparm. One way to be sure is to
select any U or V isoparm near the isoparm you want, then enter the exact value for the
isoparm in the numeric input field in the right corner of the Feedback line section.
3. Shift+click U isoparms 13, 12, and 11. Then choose Edit Surfaces Insert Isoparms , select
Between Selections, and click Insert. You should see two U isoparms inserted: 12.5 and 11.5.
5. Insert three isoparms between V isoparms 2 and 3 to get 2.25, 2.5, and 2.75. The inserted
isoparms should be placed as shown below.
1. Select the V isoparms 2.5 and 7.5, then choose Edit Surfaces Detach Surfaces. Delete the
right half. The image should look like the one shown below.
2. Select V isoparms 2.375 (or it may be 3.375 depending on the way you cut your surface) and
1.875 and choose Edit Surfaces Detach Surfaces again to detach those areas. Now there
are three pieces. We need to divide these into 15 separate regions.
3. Select the U isoparms 12.5, 11.5, 9, and 7 along the three pieces and detach them. You may
want to do this in several steps. Get rid of the patches where the legs will be. We end up with
two holes and 13 patches.
4. This is a good place to pause and clean up. Group the 13 pieces and name them if you wish. If
you haven t saved the file yet, do so now. While you are in the middle of building a model, the
naming of objects and their groupings are simply for your own convenience, and they don t
need to be organized too carefully. The scene name, however, should be indicative of what you
ve done, such as Dog_13pieces, or of where you are in the modeling stage, such as
Dog_model_1.
Tip It is simplest to rename objects in the Outliner. Just double-click the node and type in the
name. When you are naming a series of nodes, such as obj1, obj2, obj3, and so on, you
can also copy one name and paste it repeatedly the numbers will be updated
automatically.
After you ve cut up the surface, the smaller patches retain the parameter values they had before
they were detached. They must be parameterized again using Rebuild Surfaces before you can
apply stitching. If you don t do this, the results will be unpredictable. We will take care of this a little
later in the chapter, in the Rebuilding the Parameters section.
1. Create a layer, name it something like Dog Body, and assign the 13 patches to it. We can hide
them or turn them into templated objects later when we are working with the legs.
2. Create a sphere and set its spans to 20. Detach it in the middle to get a half sphere with 10
spans. Delete the top half. Use move, rotate, and scale procedures to transform the bottom half
to the position shown below.
3. Select hulls and build the leg in side view (in the same way that we built the profile of the dog
s body). Note the way that the rows of CVs are distributed in the side view shown below.
Then scale the leg to the proper size in the X axis in the perspective view or the front view.
4. Move the leg to where it should be on the dog, a bit to the side, and tweak the CVs to place the
top opening of the leg near where the hole is on the dog s body, as shown on the next page. It
is important to try to place the two spans of the leg geometry next to the two spans of the hole
on each side. This may be frustrating, but you actually must guess how well the leg is being
positioned for stitching with the body pieces. Keep in mind that after you gain some experience,
your guesses will become more accurate.
Tip By now, you should be aware that typing in numbers to position items is often not possible
when you are building models. Organic modeling is fun and frustrating at the same time
because you need to trust your artistic senses more and start guesstimating, as
opposed to being precise. Guessing is not being sloppy. It is doing things roughly now,
knowing that you will tweak later.
5. Create a layer and name it Dog Legs. Assign the front leg to it and turn off its visibility.
6. Build the back leg the same way you created the front leg. Ten spans of isoparms are enough.
You now should have something similar to the illustration shown at the top of the next page.
Notice how the isoparms are placed around the joints as you are moving the hulls and the CVs.
Also, the top end of the back leg is a bit higher and to the back than the hole on the body. This
was done intentionally in preparation for stitching.
7. As a final step, we need to cut the legs into four pieces. Select V isoparms 1, 3, 5, and 7 and
detach them. For both the front and the back legs, the isoparm values should be the same.
Group them accordingly, name them, and assign them to the Dog_Legs layer.
1. Select Edit Surfaces Rebuild Surfaces and make sure the setting is as below. The Keep CVs
box should be checked. Don t close this dialog box.
2. In the modeling window, press Ctrl+A to open the Attribute Editor. Select the top patch of the
dog s head, and look at the Nurbs Surface History of the geometry. In the Spans UV fields,
the values are 8 and 3, but the Min Max Range for U and V have different numbers. We need
to reparameterize the patch to get the Max Range numbers to match the Span values (or go
from 0 to 1, which is another optional setting in the Rebuild Surface Options dialog box).
3. Select all the geometry pieces in the modeling window and click Rebuild. You should see very
slight changes in the isoparm placements. Although the changes may seems insignificant, they
are necessary for proper calculations between the patches to take place. Select the dog s top
head patch again. The Max numbers for UV should now match the corresponding Span values.
Stitching Basics
Maya has three different types of stitching available from the Edit Surfaces Stitches submenu:
Stitch Surface Points, Stitch Edges Tool, and Global Stitch. We will use the Stitch Edges tool to put
together the different parts of the dog and continue to shape its body, and then use the Global
Stitch function to keep the patches seamless.
Another way to use Stitch Surface Points is to open its option box and turn off the Assign Equal
Weights setting. Then when you select CVs and apply the stitching, the first point will stay where it
is, and the other points will snap to the first point, as on the right side of the picture above. The
points in this setting are said to be in a master-slave relationship. The point that does not move is
the master, and the points that move are the slaves.
Stitching Edges
The Stitch Edges tool is used to join two surface edges together. The default setting joins the
edges in a master-slave relationship. When you open the option box for this tool, you will see that
Weighting Factor On Edge1 is set to 1 and Weighting Factor On Edge2 is set to 0. This means the
first edge isoparm you picked will not move, and the second edge isoparm you picked will snap to
the first edge, as on the top right of the picture shown on the next page. If you want to apply equal
weighting for both edges so that they will both move to meet in the middle, adjust the Weighting
Factor settings to 0.5 for both edges. The edges will then meet halfway, as in the picture below on
the bottom right.
Global Stitching
Global Stitch is a new addition in Maya 2. This function can stitch all of the edges of adjacent
surfaces together. It automatically gives all the surface edges being stitched equal weights.
Note For both the Stitch Edges tool and the Global Stitch function, you have the option of
maintaining C0 continuity or C1 continuity, also known as tangent continuity, between
the stitched edges. See Chapter 6 for more information about the degrees of
continuity.
First, we ll attach the legs to the dog s body by stitching the leg edges.
1. In perspective view, select the front leg and press the F key to center the geometry so that you
can rotate around it. Select Edit Surfaces Stitch Stitch Edges Tool and click the Reset
Tool button to make sure you re using the default settings. Then check the Tangent setting
and close the option box.
2. Select the top-edge isoparm (it s also called a surface boundary isoparm) of the leg patch.
Then select the patch edge located at the top side of the hole. The patch edge should snap to
the leg patch, and the two patches should turn bright green. (You don t need to press Enter to
complete the stitching process at this point.)
3. Go to the next boundary isoparm of the leg and repeat the stitching with the side edge of the
hole.
4. Repeat the process with the next two edges. You should have a cross shape of green patches
coming out from the body to the leg patches, as shown below.
Tip In addition to pressing Enter to complete the stitching action, you can press any of the
tool hotkeys, such as the Q key for the selection mode. To repeat the stitch action, press
the Y key.
6. Repeat the procedure with the back leg, as shown below. Make sure to select the leg boundary
isoparm first and the body boundary isoparm second because the order of selection
determines the master-slave relationship. The slave edge snaps to the master edge, and it is
important that the leg patches function as master edges.
1. To stitch the top patch of the dog s head to the adjacent patches, select Edit Surfaces
Stitch Stitch Edges Tool (leave the default settings). Select the boundary edge of one of the
adjacent patches, and then select the edge of the head patch, as shown on the left side of the
image on the next page. Complete the action by pressing Enter. Then repeat the procedure
with the other adjoining patch as shown on the right. Even though the head patch may look like
it is lined up after the first stitching, you still need to stitch it to the second adjacent patch to
make sure that the patches are lined up properly.
2. Repeat the procedure to stitch the corners on the other five patches. Below is an example of
one of the patches that must be stitched three times. The patch represented as number 2
needs to be stitched to three other number 1 patches. Pick the number 1 patch boundary
isoparms first each time, and then select the boundary isoparm of the number 2 patch being
stitched.
In the case of where the stomach meets the back leg, the isoparm has actually folded (as shown on
the right side above). In such situations, you need to tweak the CVs of the master edges (the leg
patches in our example) to get rid of the creases. Shown on the next page are some of the ways
CVs have been pulled and rotated to correct the problems. Note that where the two edges are
being joined as in the top-left picture, you must move the four CVs on each of the patches, eight
CVs in all, together in order to maintain their tangency. When you move the CVs on the master
edges, the slave edges will follow to keep the tangent continuity between the surfaces.
Place the eye and the nose in the appropriate positions, and pull in a couple of the CVs on the
head to make room for the eye (but don t touch the two end CVs along the boundaries). You can
create the ear by deforming the hulls of another sphere with six spans.
1. Select all the objects in the modeling window except for the nose. Group them. Select Edit
Duplicate , set Scale X to 1, and click Duplicate. You should have a mirrored group of
objects.
2. You now see the whole model of the dog. Before you attach the middle patches, make sure
you like what you see. Are the body parts proportional? Are the legs too close or too far apart?
If you want to modify any parts of the dog, undo the duplication and make the necessary
changes before continuing.
3. When you are satisfied with the way everything is, select the edge isoparms of all the patches
that meet at the middle, or the Y axis, and attach them using the default settings. You should
end up with ten attached pieces making up the profile of the puppy.
In the picture of the final model of the puppy, shown below, notice that the left side patches are still
stitched together, while the right side patches are not. This is fine, because we no longer need the
stitches.
1. Select all the patches in the modeling window and select Edit Delete By Type History.
Note In our particular project, the history and the transformation information of the patches
are no longer needed, so we can delete them. However, in other situations, this
information may be important. Of course, this depends on the application of whatever
command was used to create the history or the transformation information. So, you ll
need to decide whether to delete or retain this information on a case-by-case basis.
3. Group the legs and name them. Give the group nodes sensible names, such as Front_Legs, or
L_frontleg. You may not feel you need to name the leaf nodes; however, it is a good idea to
rename everything, rather than leaving a node named something like
leg33detachedSurface2detachedSurface2.
5. Put the face and body pieces into the Dog_Body layer. Put the leg pieces into the Dog_Legs
layer.
Global Stitching
Finally, there s the matter of global stitching, a new surface-editing feature in Maya 2. Unlike
regular stitching, global stitching doesn t have master-slave distinction; all the pieces are held
together with equal weight. When we were building the model, we didn t use this stitching method
because we needed the control provided by the regular stitch, namely the master-slave relationship
of the edges being stitched. Now that the model is put together seamlessly with first-order
continuity (C1) among the patches, we can easily stitch all the pieces together with one command.
1. Select all the pieces except for the face objects, then select Edit Surfaces Stitch Global
Stitch .
2. Click Reset to set everything to the default settings. Then click Global Stitch. Now if you move
any of the patches, you will notice that they behave like rubber, stretching to keep themselves
together.
3. The model is now ready to be set up for animation. Save the final scene as Dog_Final.mb.
You can find this finished version in the working files and a rendered image in the Chapter 8
Color Gallery on the CD.
Summary
In this chapter, we stepped through building a complicated patch model of a dog, from scratch to
finish. In addition to learning one specific method of building a dog in patches, we also covered the
concepts and techniques for building complex models in general. These techniques included
rebuilding surfaces, mirroring and attaching parts, and stitching to create seamlessness.
We will return to the dog model to fit it with skeletons in Chapter 11, then set it up for animation in
Chapter 13.
One special tool we did not use in this chapter is Artisan, which is revolutionizing the way that
computer animators do their work. The next chapter is devoted to the topic of Artisan.
Tip Because they work as paintbrushes, Artisan tools are most efficiently used with a
graphics tablet. In this book, however, we re assuming a plain vanilla configuration
that doesn t include a tablet, so the instructions in this chapter show how to use Artisan
with a mouse and keyboard as the only input devices. If you do have a tablet, it should be
configured, for the most part, automatically when you launch Maya. For more information
on how to use your tablet with Artisan, see the online documentation under Basics:
Artisan.
A great deal has changed in Artisan for version 2 of Maya, including the much-needed new
polygonal sculpting tool (which lets you sculpt polygons as well as NURBS surfaces). Other
new tools have been added, including the extremely versatile Attribute Paint tool, which lets
you choose to paint any (paintable) attribute on your geometry say goal weights for soft
bodies or polygon facet colors on your model. Other enhancements to Artisan include a more
streamlined options window (with more options, grouped in a more logical order) and better
control while painting on complex surfaces like multi-surfaces that have been stitched
together. Artisan has gone, in its present incarnation, from a cool but underdeveloped plug-in
to a robust, easy to use, and incredibly powerful set of tools what s more, these better tools
are now built right into Maya Complete!
Sculpt Polygons This tool allows you to sculpt polygonal shapes as if they were virtual clay.
To open this tool, choose (from the Modeling menu set) Edit Polygons Sculpt Polygons Tool.
Sculpt Surfaces This tool allows you to sculpt NURBS surfaces as if they were virtual clay. To
open this tool, choose (from the Modeling menu set) Edit Surfaces Sculpt Surfaces Tool.
Paint Set Membership This tool allows you to paint on membership in sets, rather than having
to pick each point and assign it. To open this tool, choose (from the Animation menu set)
Deform Paint Set Membership Tool.
Paint Selection This tool allows you to select vertices on a NURBS or polygonal surface by
painting on the surface rather than selecting points individually. To open this tool, choose Modify
Paint Selection Tool.
Paint Weights This tool allows you to set the weights of clusters of vertices by simply painting
on a surface. To open this tool, choose (from the Animation menu set) Deform Paint Weights
Tool.
Script Paint With this tool, you can paint onto an object the output of a MEL script using your
mouse or graphics tablet, instead of manually running the script at each point. To open this tool,
choose Modify Script Paint Tool.
Attribute Paint This tool allows you to paint any (paintable) attribute onto your selected model.
You can paint on colors, goal weights, or other attributes that you assign to be paintable. To
open this tool, choose Modify Attribute Paint Tool.
Paint Skin Weights After binding skin to bones, you can use this tool to modify the weights of
the bound points to each joint in your bone chain, resulting in smoother, more natural skin
motion. To open this tool, choose (from the Animation menu set) Skin Edit Smooth Skin
Paint Skin Weights Tool.
Paint Vertex Color This tool lets you paint colors directly onto individual polygons on a surface.
To open this tool, choose (from the Modeling menu set) Edit Polygons Colors Paint Vertex
Color Tool.
Tip If you don t see the Artisan tools in the menus listed above, Artisan may not be
auto-loading. To get Artisan to load when Maya launches, choose Options General
Preferences. Click the Modules tab, check the Artisan check box, and then restart Maya.
Note When using Artisan sculpting tools, it is always important to have a large number of
points to work with either vertices (for NURBS surfaces) or facets (for polygon
surfaces). If you do not provide enough points for Artisan to work with, it will not push
and pull the object s surface in ways you expect.
With the sphere selected, choose Edit Polygons Sculpt Polygons Tool (from the Modeling
menu set). This brings up the following window, which is generally the same for every Artisan tool.
Note As most settings are the same from one tool to another, we will introduce them here
and refer back to them in later sections of this chapter.
In this window (be sure you re in the Sculpt tab), set Radius U and L to about 0.3, set the
Operation mode to Push, and set the Maximum Displacement to around 0.5. When you move your
mouse over the sphere now (don t click anything just yet), you will see a red circle with an arrow
pointing inward (toward the center of the sphere) and the label Ps. The circle tells you your brush
s radius of influence, the arrow is the direction of the effect, plus the amount of influence it will
have (longer arrows mean bigger pushes and pulls), and the Ps stands for push, the current
mode of the brush. To see how this feedback works, try changing the radius of the brush to a
smaller value; the red circle will diminish to match. You can also change the direction of the effect;
under Sculpt Variables, choose the X axis radio button. As you now move the mouse around, you
will see that the arrow always stays pointing down the X axis. You can try the other settings here as
well when you re done, set it back to Normal.
Now that you have a feeling for some of Artisan s settings, try clicking and dragging the mouse
over the surface. You should see the sphere dent inward as you drag your mouse across its
surface, the dent always pointing inward toward the center of the sphere (because the brush option
is set to Normal). If you make a few drags across the sphere, you will end up with something like
the following.
If you don t like what you have (or just to see how this works), you can erase your work. Click the
Erase radio button (under Operation), then paint over the parts you don t like. If you want to reset
the entire sphere, click the Flood button near the top right of the window. This will flood the
entire sphere with the Erase command, thus resetting the sphere back to its original shape.
Tip The Flood button can be used with any operation, such as push and pull, to apply a
certain value to an entire object. You can then fine-tune specific parts of your surface by
painting on them as normal.
You may notice that, as you make several strokes on top of one another, the polygon facets will
tend to get very jagged looking (as if the sphere were made up of crinkly paper instead of clay). To
smooth out your strokes, there are two options: the Smooth operation or the Auto Smooth option.
Let s start with the Smooth operation. Once you have several strokes deforming your sphere (try
pulling the points out this time), switch over to the Smooth operation by selecting its radio button on
the Sculpt tab. Now brush over the sphere, concentrating on the sharpest edges. You ll see these
edges move back toward their original positions on the (undeformed) sphere, and the strokes you
have made will smooth out.
Note The Smooth operation relaxes whatever you paint over, making it tend to return
back to its original position, and thus smoothing the shape back out.
Now erase your sphere back to normal, check the Auto Smooth option, and set the Strength slider
to about 5. As you paint strokes over the surface of the sphere (be sure you re in push or pull
mode!), you will notice that the polygons don t become as jagged as they did when the Auto
Smooth option was off. To create smoothly organic shapes, always use a combination of the Auto
Smooth option and the Smooth operation mode.
Aside from adjusting radius, modes, and other options, you can also change brush shapes, using
the row of buttons near the top labeled Shape the icon on each button shows its stamp shape.
Erase the sphere back to neutral, and then try stamping the sphere with each of the brush shapes
to see how they compare.
Note Stamping is simply clicking and releasing your mouse button (without dragging). The
brush creates a stamp of its shape right on you object s surface. When you drag
over the surface, you are laying down a series of stamps. You can see this effect if you
drag very quickly over your object s surface: If the mouse is moving quickly, each
stamp will be noticeably separate from the others, rather than all running together.
As the Sculpt tool is set up right now, every time you make one stroke on top of another, the sphere
will deform more and more (as if the effect were layering on top of itself) because you have the
Surface: Update on Each Stroke option turned on.
If you wish to set a maximum amount by which your strokes can deform the sphere, just uncheck
the Update on each stroke option. The same strokes will then produce something like this:
As you have probably noticed, you can also set the opacity of your brush. Opacity refers to the
percentage of a tool s total effect that each application of it will have on your object. As an
analogy, consider a real-world paintbrush: If the paint you re applying is highly opaque, one coat
may be enough to cover your wall, whereas a semi-transparent paint would take several coats. In
Artisan, if you have your brush set to Push with a maximum displacement ( push in ) set to 1, and
your opacity is 0.5 (or 50%), when you click on the surface of your sphere, it will only push in about
0.5 units, instead of 1. You can use the opacity setting to reduce the effect of your strokes, making
each one subtler, thus allowing you to deform your objects in smaller increments than we have
done so far.
Before we leave this introductory section, you should note that you can bring up a marking menu
with several Artisan options by simply pressing the U key and clicking the mouse button. In addition
to the settings available in the marking menu, there are hotkeys defined for several of the most
common tasks, and you can create your own hotkeys for most Artisan settings.
Tip In version 1 of Maya, altering the radius of the brush was mapped to the Ctrl+right- and
left-arrow keystrokes. In version 2, modifying the upper brush radius is now mapped to B
plus mouse-dragging right or left (the new lower radius setting is not yet mapped). Max
displacement is now mapped to M plus mouse-dragging right and left. To find out how to
map other tool settings to hotkeys, see the Maya help files, or Chapters 3 and 16 in this
book.
Tip If you have a graphics tablet, you can set the pressure of the stylus to map to brush
radius or displacement amount. See the Maya help files for more on how to do this.
If you are familiar with Artisan s marking menu and hotkeys, you do not need to keep the options
window open for most operations. If you are starting out, however, it is a good idea to keep the
window open. Throughout this chapter, we will access all Artisan options via the option window,
though experienced users will find it more efficient to access them through the marking menu or
hotkeys.
Tip For a complete list of Artisan s hotkey functions (and those that are not yet mapped),
choose Options Customize UI Hotkeys, and scroll down to the Artisan section of the
list (it s near the bottom). If you map any new hotkeys, be sure to save your preferences
for future use (Options Save Preferences).
Tip If you do not have (or don t like) the head from Chapter 6, use the file headStarter.ma
on the CD-ROM.
First things first: we don t want to alter the shape of the person s ears or eyes, so hide them from
view (select each, and then choose Display Hide Hide Selection).
Drag-select the remains of the head, and then open the Sculpt Surfaces Tool (Edit Surfaces
Sculpt Surfaces Tool ). The entire surface of the head will now be available for sculpting (if you
had only selected one portion of the head, it would have been the only part available for sculpting).
You will see yellow bands where each surface is stitched to the others if you see all the surfaces
isoparms, go to the Display tab and uncheck Show Active Lines. Because there are stitched seams
in this model, it will be bit more challenging to sculpt this surface without pulling apart the seams.
Note Seams are a highly complex surface structure, and, while Artisan does a great job
treating the object as a whole, you have to know how to adjust the Sculpt Surfaces
Tool settings to get it to work as well as possible.
In the Sculpt Surfaces Tool window, select the Seam tab and adjust the Seam Tolerance and Min
Length to 1. Setting these a bit higher than their defaults allows Artisan to see the common
edges more easily as you work with the tool.
Tip Before you start deforming the face shape, it is a good idea to save a temporary version
the project file. If your settings get too messed up, it s easier to go back to that file than
to have to go back to the original and hide the eyes and ears again.
One problem you will run into (if you let your brush stray too far) is that the upper head will not
deform correctly it has too few isoparms to deform well with Artisan. If we were planning to model
the upper head next, we would need to insert more isoparms. But since we are not, we can just
leave it alone for now (you can even deselect it if you want to be safer).
Let s create a heavier pair of eyebrows, using the Pull mode. We don t need to pull out each one,
because Artisan has a Reflect mode that will allow us to do both sides simultaneously. Click the
Stroke tab, turn the Reflection option on (check the box), and set the reflection mode to V Dir
(Horizontal). When you now pass your mouse over the head, you will see two brushes, mirrored
around the centerline of the head. Now turn back to the Sculpt tab, set the Operation mode to Pull,
and adjust the radius of the brush(es) to something that looks appropriate for eyebrow size, turn the
opacity down to about 0.5, and set Max Displacement to about 0.5 as well.
Tip By holding down the B key and moving the mouse left and right, you can interactively
adjust the brush size and see the changes in the brush right on the face (the range of
sizes the brush can take on min to max size is determined by the brush minimum and
maximum settings in the Sculpt Surfaces options window). This is a much faster way to
adjust brush size to a desired radius.
Starting close to the center, pull a stroke along the top of the eyes (where the brows are), and pull
out a heavier eyebrow. You ll notice both sides pull out with just one stroke a great time-saver! If
you don t like your work, remember that you can erase your model back to its original state again
with the Erase function.
Once you have eyebrows you re pleased with, let s try creating an indentation below the cheeks
that goes back toward the ears specifically, across the seam boundary between the face and
cheek patches of the face.
Tip This is a well-modeled face: the stitches occur in places that would normally get no
tweaking by tools such as Artisan (even though we re going to do that here). Placing
seams in areas that won t move is very good practice: even though Artisan works well
with stitches, it is not perfect. Whenever possible, it is better if you don t have to tweak
stitched surfaces in the first place.
You will probably get unsatisfactory results at this point (and you may have to reopen your saved
temp file; even erasing sometimes fails to set the stitches back to normal). The two surfaces are
obviously not working as one, each one deforming a different amount under the brush s pressure.
The solution here is to increase the number of surfaces the tool looks for as it works. (Be sure to
get a clean copy of your head to start from first!) Click the Miscellaneous tab and set the number of
surfaces to two or more (or just click the Infinite radio button), and turn on the Use Common Edge
Info option. With these new settings (and a bit of practice try starting with the brush completely on
one surface, then moving it to the other), you should get a nice sunken cheek look. Save this
project for use later in this chapter.
Although this was a fast and simple introduction to real-world modeling using Artisan, it should give
you a good idea of just how powerful the tool can be for making subtle adjustments to your models.
All it takes is a bit of practice and some knowledge of what the Sculpt Surfaces Tool can do.
Note You can actually stitch surfaces using the Sculpt Surfaces Tool. For more information
on how to do this, see Maya s online help (Basics: Chapter 7).
Let s use our base head from the last section, and create a few sets of points on it (or you can use
the 9headStarter.ma project on the CD-ROM). First drag-select the entire head, then open the
Paint Set Membership tool (Deform Paint Set Membership Tool ). With the Paint Set
Membership tool open, the head should now be made up of several colors, each representing one
of the sets that has been created for the head. (See the Chapter 9 Color Gallery on the CD for the
full effect.)
Tip If you do not see a colored face, click the Display tab and be sure the Color Feedback
option is on. While here, you can also (if you prefer) turn off Active Display Vertices,
which hides the isoparms and CVs on the head.
The Paint Set Membership tool works in three modes: Add, Transfer, and Remove. Add adds the
painted points to the selected set, Remove deletes points from the selected set, and Transfer
transfers points to the selected set. You will notice that there is no opacity setting: all points are
either in a set or not there is no in-between.
Tip It is important to understand the difference between Add and Transfer. Add places the
painted points into the selected set, but does not remove them from membership in any
other sets. Transfer both adds points to the selected set and removes them from
membership in any other sets.
To begin, let s add some points from the top of the head to the shapesSet that has all face points
in it (in the Set Membership tab, select shapesSet under Set to Modify). With your brush mode set
to Add (you can adjust the radius just as you did previously), paint some points on the top of the
head into the shapesSet. The newly added points will change color as they are added to the set.
(See in the Chapter 9 Color Gallery on the CD for the full effect.)
Now let s remove some points from set3 (the set around the jaws). Set your Paint Set Membership
tool to Remove and paint out some of the points. As the CVs are removed, they disappear from
view. (See the Chapter 9 Color Gallery on the CD for the full effect.)
Finally, let s transfer some points from one set to another. With the Paint Set Membership tool set
to Transfer, select set2 (the set of CVs around the mouth), and then paint over the area below the
eyes. You will notice that the points change color as they are transferred from their old set to set2.
(See the Chapter 9 Color Gallery on the CD for the full effect.)
Note The set you select in the Paint Set Membership Tool window is the set the points will
transfer to. Points from any other set will be moved into your selected set.
The Paint Set Membership tool can be very useful if you have several objects (such as this head)
and you wish to form selection (or deform) sets across object boundaries for use in later deform
processes, or just for ease of selection. Rather than have to carefully pick out points and be sure
you don t accidentally pick points on the back side of the object! you can intuitively paint these
points into your sets with a brush.
Painting Selections
Akin to the Paint Set Membership tool, the Paint Selection tool allows you to pick vertices (or
polygon facets) that you can then manipulate in standard ways. Open a new scene, create a
NURBS plane, scale it out a bit, and set its U and V patches to around 50 each (to give Artisan
enough points to work with). Now open the Paint Selection tool (Modify Paint Selection Tool ).
The selection types here are Select, Unselect, and Toggle (which selects unselected points and
vice versa). There are also global Select, Unselect and Toggle buttons. To quickly see how this
works, pick out a brush shape and paint over part of the plane to select its points. You can now use
the Move, Rotate, or Scale tools to alter just these points.
The advantage of being able to paint on selections may not be obvious with a simple plane, where
you could just drag out selections with the Marquee tool. But on something more complex, like our
head, the Paint Selection tool can be a great asset. Once again, open your neutral head project (or
use the 9starterHead.ma project on the CD-ROM). Now, using the Paint Selection tool, select
points around the mouth and make the face smile, using the Move tool and the Scale tool you will
probably have to move back and forth between the Paint Selection tool (changing the points
selected) and the Move and Scale tools.
Tip Remember that the Reflect mode allows you to select points on both sides of the head
simultaneously cutting your selection time in half.
Painting Weights
If selecting CVs via painting doesn t give you enough control over the points you re manipulating,
you can use the Paint Weights tool to set the goal weight (the amount of effect a manipulation will
have on a given vertex or facet) of each CV in an intuitive manner.
Note There are several other ways to set CV weights, but the Paint Weights tool is so easy
to use, it s not often necessary to go beyond this tool.
To see how this tool works, let s create an Aztec (stair-stepped) pyramid just by painting different
weights on a simple NURBS plane. Open a new scene, create a NURBS plane with about 50 U
and V patches, and scale it out to about the size of the scene grid (for easier viewing). There is one
step we must do before we can use the Paint Weights tool we must first make the plane s CVs
into a cluster so their weights can be manipulated (select the plane, then choose Deform Create
Cluster). If you forget this step (which is very easy to do), you will be extremely confused by the
lack of responsiveness the tool has!
Now that you have a cluster, drag-select both it and the plane the cluster is mapped to, and open
the Paint Weights tool (choose Deform Paint Weights Tool in the Animation menu set).
Tip You should see the plane turn white, indicating that its goal weights are all set to a value
of 1. If this doesn t happen, be sure you created a cluster from the plane, and then
check to see if color feedback is on (it s under the Display tab of the tool). It may be
hard to see the color with the plane s isoparms showing, so turn off Show Active Lines
as well.
First, we need to flood the entire plane/cluster with a goal weight of 0, or no influence (CVs with a 0
weight won t react to any manipulation). Set the operation mode to Replace (which replaces the
old goal weight with your selection), set the Value (of the goal weight) to 0, and click the Flood
button. The entire plane should turn black, indicating it now has a goal weight of 0. This is the base
of our pyramid, which will not move. Now we need to paint our stairs. Choose the square brush
option (the button that looks like a blue square), and change the value to 0.1 instead of 0. This next
part is a neat trick: Instead of having to manually increase the goal weight value each time, we can
place the Paint Weights Tool into Add mode (by clicking the appropriate radio button), and each
brush stamp will increase the goal weight by 0.1. Thus, the more times you click on a spot, the
higher the goal weight goes, and the lighter the area s shade of gray will become.
Tip This tool also has Smooth and Scale operation modes. The Smooth mode smooths
transitions between areas of different goal weights. The Scale mode scales (or multiplies)
the object s goal weight by the number in the Value box.
With the square brush chosen, set the radius of the brush larger than the edges of the plane, center
the brush around the origin, and stamp a higher goal weight onto a large square area of the plane
(you will probably find this easier to do in the top orthographic view).
Note You can set the orientation of any brush that s not round. In the Stroke tab, you can
choose from Up Vector (default), U and V Tangent (horizontal and vertical aligned),
and Path Direction (which changes the orientation depending on your stroke).
You should see a large square portion of the plane become a slightly lighter gray than before. Make
the brush radius a bit smaller and repeat the stamp now a smaller portion of the plane should get
just a bit lighter. Continue this process until you are at the center with a very small radius. Your
plane should look as follows.
To make your pyramid, switch to the Move tool, select the cluster weight only (not the plane you
may need to do this in the hypergraph or outliner), and then move it straight up the Y axis. You
should see something that looks like a stair-stepped pyramid.
As a further exercise, try making a hilly terrain by using a simple plane, a cluster, and painted goal
weights.
Let s now return to our favorite head either open your own file or use 9headStarter.ma from
the companion CD and examine how to weight the mouth clusters to allow for better manipulation
of facial expressions. With the head showing, select only the lower face section (with the mouth)
and create a cluster out of it. Shift-select the cluster and mouth, then open the Paint Weights tool
(you should see the area turn white, indicating a goal weight of 1 for all points). As before, first flood
the area with a goal weight of 0 (so the areas we don t want to move won t). Using the Add (or
Replace) and Smooth modes, paint the areas around the lips, giving the corners of the mouth, and
the cheeks above them, the highest weighting. Try to imagine where the skin bends and stretches
the most as you smile and frown (or look in the mirror), and then paint these creases onto the
mouth. You may find it necessary to move the mouth and then repaint the goal weights to get the
effect you want.
Tip Remember that turning on Reflection will cut your work in half.
When you are finished, try making the face purse its lips and then frown. You should find that this
method of creating facial animations can after a bit of practice become a very powerful tool in
your character animation bag.
Note To learn how to create your own scripts, see Chapters 16 and 17.
The predefined scripts include painting on geometry, particle emitters, and soft body goal weights.
For our purposes putting a fuzzy haircut on our head we ll use the geometry paint script.
Open your head project (or use 9headStarter.ma on the CD-ROM). In an empty space in the
scene, create a short, very narrow cylinder (be sure to cap it in the cylinder creation options, so it s
not hollow). As the hairs will be very thin, and we will paint on lots of them, reduce the number of
sections to four and be sure there is only one span. In relation to the head, the hair should look
something like the small tube to the right of the ear.
Now open the Script Paint tool (Modify Script Paint Tool ), click the Setup tab, and, in the Tool
Setup Command text field, type geometryPaint, and hit the Enter key. This will bring up a window
with options for the geometryPaint.mel script. In the Geometry text field, type in
nurbsCylinder1 (or whatever you name your hair shape).
Tip If you would like a more random look (as hair isn t usually all the same length!), you can
create a second (or third) hair strand. Then, in the geometry field, type in the names of all
geometry you wish to use for the hair, with a space between each name.
For Operation Mode, select Create/Modify, set the grid to about 100 by 100 (this determines how
densely the hair will be placed), be sure the Align checkbox is enabled (so the hair will point out
from each point on the head), and set the jitter to 0.3 or greater (this controls how randomly each
hair is placed).
If you try to use the paint brush now, you will probably see the hair being built all around the head,
but not attached to it there is an offset to your geometry (its distance from the origin) that is
causing this problem. To correct this problem, move all your hair objects back to 0, 0, 0 on the grid.
Back in the Script Paint Tools Settings window, be sure your brush mode is set to Replace, pick a
good radius for your brush, and paint some hair on your head!
Tip With all the geometry you create building hair, your system response time may become
very slow. In a situation like this, you ll need to find a compromise between the amount
of hair your head needs and the time (and patience) you have, or feel free to use the hair
brushes in Paint Effects (see Chapter 25).
You may notice that you have difficulty getting the hair to paint on the head properly. As painting
shapes on a complex surface (the head) involves difficult calculations on Maya s part, you may
need to adjust several of the settings in the Script Paint settings window to get the right look.
Note The Paint Vertex Colors tool is a simply series of presets of the Attribute Paint tool,
which we will use next.
Tip We could also use the Script Paint tool to do this; it has a predefined script, paintGoalPP,
which will do the same thing.
Note For information on how to create soft bodies, see Chapter 24.
Note For information about how to make an attribute paintable, see Appendix C of Maya
Basics in the online help documents.
Open the file 9rodSB.ma, on your CD-ROM (or build a skinny cylinder, animate it, and make it a
soft body). If you play back the animation, you will see that the entire fishing rod moves back
and forth as one solid piece we re going to change that by reducing the goal weights at the top of
the rod. Select the rod and open the Attribute Paint tool (Modify Attribute Paint Tool ). Click the
Attr (attribute) tab and then, under Paintable Object Type, expand the particle selection (click the +
sign) until you see goalPP and highlight it. The goalPP attribute will now be placed in the Paintable
Object list beneath; highlight this text, then click the right arrow, moving the goalPP over to the
Selected side. Finally, click the Save Selection checkbox, so you don t have to repeat these steps
if you change tools.
Move back to the Attr. Paint tab, set the operation mode to Replace and the Value (goal weight) to
0, and click the Flood button. This sets all goal weights to 0, meaning that the soft body will not
move with its (invisible) animated parent anymore you can play back the animation to test this, if
you wish. Once you see how the goal weight attribute works, flood the entire rod with a value of
0.5, so there will be some connection between the rod and its animated parent.
Once you have the entire rod set to 0.5, set your mode to Add, and set your value to 0.1 we re
going to increase the goal weight as we go down the rod by simply painting on a lighter color. Set
your brush radius fairly large, so it wraps around the whole cylinder you can also change the brush
shape to square if you prefer. To get a smooth transition from dark to light, you will probably need
to use the Smooth mode as well as the Add mode. Run a couple of frames of the animation
frequently to see how you are progressing.
Tip A very good method for getting smooth transitions on an object like this is to start at the
bottom and make a series of upward brush strokes, each one going up a bit further.
Warning You must rewind animations using soft bodies before playing them back. If you don
t rewind, the animation will give you bizarre results.
While it can take a bit of practice to paint goal weights onto objects effectively, learning how to do
so can really improve the control you have over soft body animations, allowing you to create much
subtler variations of motion than would be feasible without such a paint method for applying goal
weights.
With your project open, try moving the joint up and down (drag-select the bottom joint and then use
the Move tool to move it and the arm up and down). You will notice that, while the bound skin
moves with the joints, the elbow area doesn t respond correctly: it needs to crinkle just a bit more.
Select the cylinder and open the Paint Skin Weights tool (in the Animation menu set, choose Skin
Edit Smooth Skin Paint Skin Weights Tool ). You should see a grayscale image of the
cylinder and, in the Skin Paint tab, you will have a choice of your three joints (joint1 at the shoulder,
joint2 at the elbow, and joint3 at the wrist). If you select joint1, for example, the color of the cylinder
will show what the bind weight of each point is for this joint. Again, white represents a bind weight
of 1, fully affected by any joint motion, and black is a bind weight of 0, not affected at all.
Tip If your cylinder is not colored, be sure Color feedback is on (under the Display tab), and
also be sure your scene is set to shaded mode (press the 5 or 6 key on the keyboard).
You can see by looking at the color feedback (in the Chapter 9 Color Gallery on the CD) that the
inside of the elbow is very dark when either joint1 or joint2 is selected, indicating it is not being
influenced by either joint very much. Let s paint slightly higher values into this area. First, bend the
arm some (as above) so you can see your results as you work. Set your brush mode to Add, set
the value to about 0.1, and set your opacity fairly low (like 0.1 or 0.2). Next, set your brush to a
fairly small radius, zoom in on the elbow area, and start painting higher goal weights on, switching
between joints 1 and 2, and watching what happens. Your goal is to get a nicer crease between the
upper and lower arm here, and setting higher goal weights at and just above the elbow for the top
toint (or just below the elbow for the bottom joint). The elbow will increase the joint s influence,
making it pull the elbow area into more of a crease.
Tip If your strokes make the elbow area too lumpy, use the Smooth mode to smooth the
lumps out you may not want to smooth out all the lumps, however, as skin does wrinkle
as it bends!
Once you have worked a while, you should end up with something like the following (also see the
Chapter 9 Color Gallery on the CD).
The effect here is subtle, but subtlety is what this tool is all about. The difference between the two
images above is not great, but the second is far more appealing and realistic than the first and
getting this elbow bend without the Paint Skin Weights tool would be very difficult and
time-consuming. Once again, Artisan makes a difficult, painstaking task a lot easier.
Summary
This chapter has presented all the Artisan tools and, while the review was fairly brisk, you should
have a very good feel for how Artisan works by now. Keep in mind that all the tools operate in a
similar manner, just with different options. You may be thinking at this point that virtual painting is
something of an art to master (hence the name Artisan ), but don t be intimidated. Consider
this: How would you accomplish any of the tasks we have done in this chapter without Artisan
tools? Only when you imagine working without these tools is their power really evident. Artisan s
tools take highly complex tasks that used to require custom programming and/or hours of dull,
painstaking work and place all of these tasks in easy reach. Artisan is also highly intuitive: after all,
just about anyone understands paintbrushes. Because Artisan is now built into Maya Complete
(and Unlimited), and with all the new improvements of the tool set in version 2, you can save
yourself hours of time and frustration if, the next time a job seems too difficult, you first consider
using Artisan.
Chapter Deformers
12:
Part Overview
Animating in Maya
Deformers
Keyframe Animation
Animation, at its most basic level, is change over an interval of time. In Maya, almost anything can
be changed over time; in other words, almost anything you create in Maya can be animated.
You ve learned how Maya has a node-based structure. Any attribute within the node that has a
numeric value is keyable. Keying, or keyframing, in Maya is the act of assigning a numeric value to
a node attribute at a specific time frame. As the frames change, so can the attribute value. For
example, the basic attribute Visibility actually has a numeric value of either 1 (for on) or 0 (for off),
so it can be keyframed and animated. Keyframing is a concept taken from classic 2D animation.
Senior animators draw important key poses of characters being animated at certain frame
intervals, called keyframes. Then the junior animators take over and draw all the frames between
the keyframes, which are called in-betweens. The same thing happens when you are animating in
Maya. You are the senior animator who establishes the key poses of whatever it is you are
animating, and the computer is the whole department of junior animators drawing the in-betweens
for you.
Note Other kinds of animation include rotoscoping, which is actually a kind of keyframe
animation, and motion capture, a way of creating function curves from live actors
performances. Motion capture is a complicated procedure, and although the
technology is improving quickly, it is still difficult to use it to produce high-quality
animation without needing to do manual cleanups.
There are different levels of animating. At the most basic level, you are moving things from A
to B, which almost anyone can do. The next level of animating involves learning and
intelligently using certain animation principles, such as squash and stretch, anticipation, key
posing, and so on. The 2D cell-animation schools are still the best places to learn these
things, although computer animation schools are beginning to offer classes in this area. If
you want to be an animator, there is no way around it you must learn these principles.
The ability to bring life to a character, however, requires more than just following animation
principles. A successful animator also has a good sense of timing, which belongs to the
realm of performance. Timing is a skill you are born with as much as it is a learned thing, and
certain individuals are naturally better at animating than others, just as some people are
naturally better dancers or singers than others. In fact, the ability to create authentic
emotions and pathos in animated characters requires great acting skills.
A good way to discover if you are an animator or not is to go through a whole animation
project, and ask yourself which parts of the project you enjoy spending time on the most. An
animator s focus will generally be different from that of the other 3D artists. Modeler and
texture artists, for example, are usually interested in how things look; they want to create
beautiful images, evoking certain feelings. Animators are usually interested in telling a good
story.
Animation Controls
Before we get more deeply into keyframing, let s look at some animation control tools: the time
slider and the range slider. These and the other tools discussed in this chapter are in Maya s
Animation module.
You can click or drag in the time slider to do various things. When you click on a frame number,
that frame becomes the current time. If you drag the mouse, the animation updates interactively,
which is called scrubbing.
When you MM click or drag, the current time indicator moves to where the mouse is without
updating the animation. This is a valuable function when you want to quickly keyframe the values of
one frame to other frames. MM dragging is also used for scrubbing only the audio, as opposed to
scrubbing the whole scene.
The time slider can also become a virtual time slider inside the modeling window, the Graph Editor,
or the Dope Sheet. This happens when you press the K key on the keyboard at the same time that
you press the mouse buttons. By K+dragging in any window, you can scrub the animation. By
K+MM dragging, you can move the current time without updating the scene, and scrub only the
audio. This technique can be especially useful when you are editing function curves in the Graph
Editor. The Graph Editor and Dope Sheet are discussed later in this chapter, when we get to the
topic of editing keyframes.
RM choosing inside the time slider opens the Key Edit menu. This menu offers the standard
key-editing functions, which we will discuss later in the chapter in the Editing Keyframes section.
It also provides access to several useful submenus:
" With the Set Range To submenu, you can control the playback range in various ways. One
option here is the Sound Length setting, which you can also use to discover the length of an
audio file.
" With the Sound submenu, you can show, hide, or rename any of the audio files that have been
imported.
" With the Playblast function, you can preview your animation as real-time movie clips (the
Playblast function is discussed in Chapter 11).
Tip In order to actually play the audio file, you need to set the Playback Speed setting to
Normal in Animation Preferences, found under Options General Preferences.
The Auto Key button on the range slider (the next-to-last item on the slider) lets you set keys
automatically as you transform the selected object in the modeling window. Using Auto Key for
keyframing is explained in the Creating Keyframes section of this chapter.
The Animation Preferences button on the right end of the range slider lets you view the animation
settings in the General Preferences dialog box. The animation settings include options that let you
adjust the time slider. For example, setting the Height to 2x or 4x, as shown below, can help you
see the audio waves more clearly, which is helpful when you are scrubbing audio files.
You can also select the Units tab of the General Preferences dialog box and adjust the Time
setting. The default Time setting is 24 fps (frames per second).
Creating Keyframes
There are many ways of creating keyframes in Maya. You can use the hotkeys, the Set Key or Set
Breakdown function in the Animate menu, the Channel box, the Graph Editor, or the Attribute
Editor. All of these methods are described in the following sections.
The Prompt setting lets you set keyframes at multiple frames. If you select Prompt, when you click
on the Set Key button (or press the S hotkey), you are prompted for the frames to keyframe. Enter
the frame numbers you want keyframed and click OK.
Keyable Attributes
All keyable attributes are displayed in the Channel box. The default attributes are Translation,
Rotation, Scale, and Visibility.
In Maya, each object can have its own keyable attribute settings. You can add or remove the
keyable attributes of an object by using the Channel Control. Select an object, then choose Window
General Editors Channel Control.
The Channel Control shows a long list of nonkeyable attributes on the right, and a list of ten default
keyable attributes on the left. When you select an attribute in either list, the Move >> or the <<Move
button becomes active, and you can move the selected attribute to make it keyable or nonkeyable.
Any changes you make in the Channel Control are reflected in the Channel box. The Channel
Control also has a tab for Locked attributes. When an attribute becomes locked, its value becomes
static and nonkeyable. The fields for the attribute also become gray.
Tip Some people find it easier to use the Channel box to lock attributes. Creating keyframes
with the Channel box is discussed after the following section on the Set Breakdown
function.
Set Breakdown, a new feature in Maya 2, works the same way as Set Key, except that instead of
setting keys, it sets breakdowns. What distinguishes breakdown frames from keyframes is that
when regular keys are inserted into a breakdown curve, the breakdown frames become bound
by the regular keys, and the breakdowns maintain a proportional time relationship to those keys.
To get a better idea of how breakdowns differ from keys, try the simple exercise in the Working
with Breakdowns section later in this chapter.
The Key Selected option keyframes the attributes that are selected in the Channel box. The Key All
option keyframes all the keyable attributes for the selected object. The Breakdown Selected and
Breakdown All options work the same way for breakdowns. The Lock and Unlock options work on
selected attributes.
Tip You can create a user-defined hotkey for Key Selected in the Channel box. Shift+S is a
good choice. You may find that selecting attributes in the Channel box and hotkeying
them is a very convenient method of keyframing.
You can lock attributes and set keys, but the keys are set for all X, Y, Z values of translation,
rotation, or scale attributes. One advantage of using the Attribute Editor is that you can easily
access nonkeyable attributes and keyframe them using the editor.
1. Create a Sphere and set keys for its translation attributes at frame 1.
3. Move to frame 10, and translate the sphere to a different position. The change is automatically
keyframed.
4. Move to frame 20 and try rotating the sphere. Nothing is keyed because there are no initial
keyframes for the rotation attributes.
Warning If you use Auto Key, make sure you toggle it off when you are finished. If you don t,
you may unknowingly keyframe objects and end up with a lot of undesirable and
unnecessary animation.
Editing Keyframes
After you ve created the keys or breakdowns, you can edit them using the Edit Keys submenu,
Channel box, Graph Editor, Dope Sheet, or time slider. We will cover the Graph Editor first because
it is the most important keyframe-editing tool, and you will use it most often.
Tip If you are not familiar with animation curves, the Graph Editor may look complicated to
you. It is more complex than most other editors in Maya, but it is very important that you
learn to work with the Graph Editor and the animation curves. Animators should know
how to read animation curves, visualizing how an object will move differently when the
curves are edited a certain way. This alone often separates good animators from bad
ones.
To see how the Graph Editor works, let s create some animation curves:
2. Using the marking menu hotbox, select Persp/Graph View. The top window should now show
perspective view, and the bottom should display the Graph Editor.
3. Press A to fit all the curves to the window. You should see six animation curves, one for each
channel of the six attributes.
4. Marquee-select a few keyframes near the current time indicator. Notice that the graph outliner
to the left shows which curve keys were selected. Move them, and you will see the sphere
update interactively.
5. You can also work with only the curves you want by selecting those curves in the graph
outliner. Select the translate curves, and only those curves are displayed.
6. Make sure the Graph Editor is the active window by clicking inside it, then double-click the
Move tool to open the option box. As shown below, listed under MoveKey Options are
moveOnly and moveOver. The default moveOver setting lets you move selected keyframes
over other keyframes. The moveOnly setting allows you to move the keyframes only between
other keyframes.
7. Open the Scale tool option box. Again, you ll see settings that are different in the Graph
Editor. The default Gestural setting sets the pivot point for scaling the selected keys to where
you place the mouse. The Manipulator setting lets you create a box to move and scale, as
shown below. This may be the better setting for many situations.
The Time Snap and Value Snap Tools The Time Snap tool, which makes the keyframes snap to
frames, should always be turned on, because it makes editing keyframes easier. You will have
fewer occasions to use the Value Snap tool, which snaps the keyframes to the nearest integer
values. Before moving on to the other tools, turn on the Time Snap tool. Instead of working without
the snap function, then needing to snap the keyframes later, it is much better to have the Time
Snap tool on from the beginning.
Note There are Time Snap functions in the Graph Editor, the Dope Sheet, and the time
slider. You can also access Time Snap in the Animation Preferences section of the
General Preferences dialog box, where Snap is On by default.
The Move Tool As you saw earlier, the Move tool in the Graph Editor is actually the Move
Nearest Picked Key tool, and it works differently from the Move tool you pick from the Minibar.
The Move tool moves only one key at a time. It will move anything that is closest to the mouse
arrow on an active curve, whether that item is a keyframe or a tangent handle. It will not move
curves. You can constrain the tool using the Shift key for horizontal or vertical movements, just
as you can constrain the regular Move tool.
The Insert Key and Add Key Tools The Insert Key and Add Key tools are similar. Insert Key
inserts a key on the curve at the selected frame. Add Key adds a key to whatever value and
frame you are clicking, changing the curve shape accordingly.
The Tangent Tools The tangent tools let you change the shape of the curve around the
keyframes. The Spline (the default shape), Linear, and Flat tools let you pick those shapes. You
can see other types on the Tangents menu. Select a few keyframes and play with the types to
see how they behave.
In situations where you want to break the tangent or increase the roundness of the curve at specific
keyframes, you can use the Unify or Break tool (also available from the Keys menu).
Before you can free a keyframe s tangent weight and change it, the tangent of the keyframe must
become weighted. Select the keyframe (you can also select the entire curve) and select Curves
Weighted Tangents. The tangent handles change, as shown on the next page. You can then
unlock the weights, using the Free Weight tool, and change the curve shape. After you are finished
adjusting the curve shape, you can use the Lock Weight tool to lock the tangent weights of the
keyframes.
The Buffer Curve Snap and Swap Tools The Buffer Curve Snap and Swap tools are new
features in Maya 2. When you edit a curve, changing its shape, the original shape remains as a
buffer (as shown above in the example of the free tangent weight). The Buffer Curve Swap tool
snaps the changed curve to the buffer. The Buffer Curve Snap Tool snaps the buffer to the
changed curve.
The Key Stats Fields Tool The Key Stats Fields tool lets you enter precise values for
keyframes. It is especially handy when you need to assign the same values for multiple
keyframes.
Cut, Copy, and Paste Functions Using Edit menu functions, you can cut, copy, and paste
selected keyframes. Before you paste, however, make sure to set the proper option settings, or
unexpected results could occur. Go to Edit Paste and look over the different settings.
The curves shown on the next page were copied from the original curve (shown as a white curve),
then pasted with different option settings back to the original curve. The first example shows a
curve inserted into the current time with the Connect setting checked. Notice that the curve being
pasted has moved up in such a way that the starting point of the curve connects to the original
curve at the current time indicator. If you turn off the Connect setting, you get the second example
shown on the top right. The pasted curve is still inserted into the original curve, but it is not
translated vertically to connect with the original curve. The Merge setting produces the third
example, where the curve being pasted merges with the original curve. Note that the last keyframe
of the resulting curve is the same as the pasted curve. The fourth example is pasted with the Time
Range set to Start and Time Offset set to 30. Note that, in this case, you would get the same result
if you set the Time Range to Clipboard and Time Offset to 29, because the copied curve on the
Clipboard starts from frame 1.
Note When using functions with numerous optional settings, you will often have different
ways of achieving the same result. Different situations will make different settings
optimal for those situations. In order to know which are optimal for a particular setting,
you need to have a clear understanding of what the settings do. It s frustrating to
discover that a function that works for one situation will not work for another because
different settings are required, and you don t know what those setting changes should
be.
Pre and Post Infinity Cycles and Extrapolations View Infinity displays the curve values before
and after the first and last keyframes, to infinity. Under the Curves menu, you can select Pre and/or
Post Infinity cycles or extrapolations, as shown in the images on the next page.
" The default setting is Constant, which means the values for the first and last keyframes are
maintained.
" The Post Infinity Cycle with Offset takes the last keyframe value as the starting point for the next
cycle.
" The Post Infinity Oscillate setting mirrors the cycle before it.
Add and Remove Inbetween Functions Two other nifty functions are Add Inbetween and
Remove Inbetween, found on the Keys menu. These are simple functions that either add or
remove a frame into the current time, causing all the keyframes after the current time to move
one frame forward or backward.
The Auto Load Option In some situations, you may want to deselect an object and select
another, but still maintain the keyframes of the first object. In such a situation, you can turn off
the Auto Load function on the List menu.
The Dope Sheet also has a Dopesheet Summary line, which selects all the keyframes of the
selected objects for editing. Alternatively, you can open the summary to select all of the specific
keyable attributes of the selected objects for editing. For example, you can select the Move tool,
select all objects in the modeling window, select the Dopesheet Summary in the Dope Sheet, and
move all the keyframes for the entire scene. You can also open the Dopesheet Summary, select
Rotate, and then move only the rotation keyframes of all the selected objects in the scene.
Note The difference between Delete and Cut is usually not significant, but it is worth
knowing. Cut puts the keyframes into the Clipboard. Delete simply deletes. If you have
keyframes in the Clipboard that you want to keep, use Delete to remove animation
from the selected attributes so that you don t replace the Clipboard items.
Cut Keys and Copy Keys have the same option settings. Select Edit Keys Copy to open the
Copy Keys Options dialog box. The Hierarchy setting Selected copies only the animation curves of
the selected object. The Below setting copies all the curves of the object plus all the objects below
the hierarchy of the selected object. You can also control the time range of the curves being copied
by clicking Start/End and typing values in the Start Time and End Time boxes.
The Paste options are the same as the Graph Editor s Paste options. If you copy animation curves
from a hierarchy, you can paste them into the same hierarchy as well as into other hierarchies.
Tip You can cut or copy curves from multiple objects. The objects selection order is
important in this case because the curves are copied in the same sequence. Also, when
you are pasting to multiple objects, their selection order needs to be the same as the
order in which the objects were selected for the Copy Keys function.
By Shift+clicking and dragging, you can select a frame, or a range of frames, which is displayed in
a red block with arrows at the start, in the middle, and at the end of the block. You can then move
the frame or frame range by dragging the arrows in the middle of the block, scale it by dragging the
arrows at the side, or edit it by selecting the functions with RM choose.
The Cut, Copy, Paste, and Delete functions are the same as those in the Graph Editor, without the
options. The Paste function has Connect set to Off. The Paste Connect function works like the
Graph Editor s Paste with the default settings.
2. Translate it in the X axis to 5 at frame 20, and 0 again at frame 30, setting breakdowns. You
can set breakdowns by RM choosing in the Channel box or by selecting Animate Set
Breakdown. Everything should be the same as if keyframes were used, except that the ticks in
time slider are red at frame 1 and green at frames 20 and 30, as shown in the next image.
4. Open the Graph Editor, select the keyframe at frame 10, and try moving it to frame 15. Note
that the breakdowns at frames 20 and 30 move as well, maintaining their curve shape with
respect to the keyframe being moved. This is what is meant by breakdowns being bound by
keyframes.
You can open the Set Driven Key window from the Channel box, Attribute Editor, or Animate menu
(select Animate Set Driven Key Set ). Its function is to link attributes to each other in a
master-slave relationship. The attributes that influence the other attributes are called driver
attributes; the ones that are influenced are called driven attributes.
Let s try a simple tutorial to see how this works. For this example, we ll use three spheres to
represent finger joints and have one of the sphere s rotation drive the other two spheres rotation
(whenever nurbsSphere1 rotates in the X axis, nurbsSphere2 and nurbsSphere3 also will rotate in
the X axis).
Translate (0, 3, 0)
Scale (1, 4, 1)
Sections 1
Spans 1
2. Select Move, then press Insert to get into the pivot mode. X+drag the pivot to the origin. Your
torus should look something like the one shown below.
3. Duplicate the torus twice. Move one copy to (0, 9, 0), and the other to (0, 15, 0).
4. Create three spheres. Place them at (0, 0, 0), (0, 6, 0), and (0, 12, 0). We ll pretend this is
actually a finger, with the spheres being the finger joints.
5. Select All in the modeling window, then select Modify Freeze Transformations. In the
Hypergraph window, group the objects into the hierarchy shown below (note that the torus s
pivots match the spheres pivots).
6. Drag to select all the objects in the modeling window. Then, in the Channel box, select any
attribute and RM choose to open the Set Driven Key window.
7. Click Load Driver and Load Driven. All the toruses and spheres are loaded in both the Driver
and the Driven lists. We want nurbsSphere1 to be the driver, so select that in the Driver list.
You see the default keyable attributes appear in the box on the right.
8. Ctrl+click nurbsSphere2 and nurbsSphere3 in the Driven list to be the driven objects. The
default attributes representing both spheres appear in the box on the right.
9. Select rotateX in the Driver and the Driven lists, as shown below, then click Key.
Notice that the nodes for the two driven spheres are now diagonal shaped, indicating they have
animation. But there are no red ticks showing in the time slider, because there are no explicit
keyframes. If you select either one, you will see in the Channel box that Rotate X field has
become shaded as well.
10. Select nurbsSphere1 and rotate it in X 90 degrees. Rotate nurbsSphere2 100 degrees in X.
Rotate nurbsSphere3 90 degrees in X. Click Key in the Set Driven Key window again. Now
select nurbsSphere1 and try rotating it in X. You will see the other two spheres rotating as well.
11. Select nurbsSphere2 and nurbsSphere3 and open the Graph Editor. You will see curves
representing the way nurbsSphere1 drives the other two spheres, as shown below. Because
the values before the first key and after the last key are constant by default (as explained
earlier in the chapter, in the section about using the Graph Editor), when you rotate
nurbsSphere1 to a negative value or a value greater than 90 degrees, the other two spheres
will remain at zero, or at 100 and 90 degrees, respectively.
12. If you want the driven sphere values to keep changing when the driver sphere values become
less than zero or greater than 90, select the curves in the Graph Editor and select Curves
Pre Infinity Linear. Then select the curves and select Curves Post Infinity Linear. Now
when you rotate nurbsSphere1 in the X axis to any value, the driven spheres will update
accordingly.
As you can see from this tutorial, using Maya s Set Driven Keys feature is not difficult at all. In our
example, one driver sphere was driving two spheres.
1. Continuing with the scene we were working on in the previous section, select nurbsSphere1
and set the rotations to (0, 0, 0).
2. Create another sphere and translate it to (0, 18, 0). Its name should be nurbsSphere4. Group it
under nurbsTorus3 in the Hypergraph window, as shown below. Keep it selected, and select
nurbsSphere3 as well.
3. Open the Set Driven Keys window. Click Load Driver and Load Driven. Select nurbsSphere4 in
the Driver list and nurbsSphere3 in the Driven list. Select rotateX for both. Click Key.
4. Select nurbsSphere in the modeling window and rotate it 90 degrees in X. Do the same with
nurbsSphere3. In the Set Driven Key window, click Key again.
5. With nurbsSphere3 still selected, go to the Graph Editor. You can see two curves under the
nurbsSphere3 attribute for Rotate X. These are the two driver attributes from nurbsSphere1
and nurbsSphere4. Select the nurbsSphere4.rotateX curve and assign linear extrapolation for
the pre-infinity and post-infinity curves.
6. Select nurbsSphere1 and rotate it in X 50 degrees. Then select nurbsSphere4 and rotate it to
100 degrees. Notice how the rotation value of nurbsSphere3 changes as it averages its two
driven values and rests at 50 degrees in X. The finger is ready for snapping.
Summary
In this chapter, we covered the basic concepts of keyframe animation and the tools Maya offers for
creating and editing keyframes. Some of the interfaces are more challenging than others,
especially the Graph Editor if you are not familiar with function curves. It is the Graph Editor,
however, that you will come to love using as you become more familiar with animating in Maya.
The next few chapters are going to be quite challenging, so take a break before you continue.
Path Animation
Path animation is essentially animating objects along a designated path such as a curve. This type
of animation is ideal for animating things like roller coasters, ships, and moving cameras.
1. Create a curve and a cone, as shown below. Make sure that the time slider range is at 48
frames.
2. With the cone still selected, select the curve as well, then select Animate Paths Attach to
Path . Click Reset to make sure you re using the default settings, then click Attach. You
should see the cone snap to the beginning of the curve. Try scrubbing through the frames (by
dragging the mouse across frames in the time slider) and watch how the cone moves.
3. Under Inputs, you will see motionPath1. Click it, and you will see the U value, which is 0 at
frame 1 and 1 at frame 48.
4. Go to frame 15 and check that the U value is 0.298. MM drag the current time indicator back to
frame 1. The U value should still be reading 0.298. Click the U value, then RM choose and use
Key Selected to keyframe that value at frame 1. Now the starting point has changed to U value
0.298, and the cone travels only about 70 percent of the curve from frame 1 to 48.
5. Open the Attribute Editor and click the motionPath1 tab. Change the settings to Follow and
World Up. Make sure that X is set as Front Axis and Y is set as Up Axis. Scrub the timeline on
the time slider and see how the cone moves differently. Change Front Axis to Y and Up Axis to
Z and see how this affects the cone s movement.
Now that you have an idea how path animation works, we ll try a more complex exercise next.
1. Open the living room scene you created in Chapter 5, and select the chair group node.
Rename it to Chair. Make sure that the cushion is at the bottom of the hierarchy, then select
File Export Selection and save the file as Chair.mb. (You can also find this file on the CD.)
You ve just exported only the chair hierarchy into a new file.
Tip Maya s default Export function exports everything associated with the model(s) being
exported, including its history, expressions, and animation. If you want to export only the
model, turn the other settings off in the option box.
2. Start a new scene, create a NURBS plane, scale it to 100 uniformly, and increase the Patch
UV spans to 30.
3. Switch to the Modeling module. Select Edit Surfaces Sculpt Surfaces Tool and click Reset
Tool. Switch to the Map tab and load in the Wave.tif file from the CD-ROM. You will see the
plane become wavy, but it s not wavy enough. Click the Reload button three more times. Each
time you will see the waves become more pronounced, as the displacement is compounded.
Note If you want to create the Wave.tif file yourself, create a plane and open the
Hypershade window. Assign a blinn material with the water texture, and manipulate the
variables until you see something like the Wave.tif file. Use the Edit Convert
Material to File Texture command, then convert the .iff file to .tif format using Fcheck.
See the discussion of Hypershade in Chapter 19 for details on shading and texturing
surfaces.
4. Go to the top view and create a simple curve near the middle of the wavy plane. Select both
objects and create a curve on the surface by selecting Edit Surfaces Project Curve on
Surface, as shown below.
5. Hide the curve (make it invisible). It s better not to delete anything until you are sure you no
longer need it; in this case, you may want to adjust the curve on surface later when animating
the camera. Import the Chair.mb file into the scene.
6. Set the time slider range to 240 frames. Select the top hierarchy of the chair, then select the
curve on surface. Switch to the Animation module and select Animate Paths Attach to
Path, with the default settings.
7. Open the Attribute Editor and go to the motionPath1 tab. Click Follow and set Up Direction to
Normal. Try different settings for Front Axis and Up Axis until the chair is sitting upright. (It
should be X for Front Axis and Y for Up Axis, but you may end up with different results.) Your
scene should look something like the one shown next.
Warning When you re using curves on surface as the path, using the Normal for Up
Direction setting works well, because it makes the attached object s Up direction
the surface s normal. However, when you re using regular curves as the path, the
Normal setting does not work as well, because a curve s normal will reverse if the
curve s path goes from convex to concave. The attached object, therefore, may
end up flipping as it animates along the curve.
1. Select the top Chair node, and press Insert to show the pivot manipulator. Drag the Y-axis
handle down, and you will see the chair go up. This is because the pivot is constrained to the
path.
2. Press Insert again to turn off the pivot manipulator. Select the node that is one below the top
Chair node and check to make sure its Y rotation value is 0 in the Channel box. Then use Key
Select at frame 1. Move to frame 240, enter 360 for Y rotation, and keyframe it.
3. Now as you scrub the animation, the chair should slowly rotate as it floats along the curve on
surface. Preview the animation to see how the chair moves.
1. In the Perspective window, select Panels Perspective New to create the Persp1 view. This
will be our animated camera.
2. With the Persp1 camera still selected, zoom in to the curve on the surface and Shift+select it.
Select Animate Paths Attach to Path . Check Follow, X for Front Axis, Y for Up Axis, and
Normal for Up Direction. Click Attach.
3. Switch to perspective view and press F to center in on the Persp1 camera. You should see the
camera positioned as on the next page.
4. As you can see, the camera isn t looking exactly where it should be, and it should also be a bit
behind the chair. Click motionPath2 in the Channel box, and you will see the Front Twist, Up
Twist, and Side Twist input variables. Select them one at a time and try MM dragging in the
modeling window to see what effect each has on the camera.
Tip If the Twist attributes are grayed out, you probably attached the camera to the curve on
surface a bit differently. This isn t a problem. Just select the grayed out areas, RM
choose, and select Unlock Selected to unlock the attributes and make them keyable.
5. Return the Front Twist and Side Twist values to 0, and set the Up Twist value to 90. The
camera should now be looking along the curve.
6. Select the curve on the surface. In the Channel box, select motionPath1. This is the path
animation for the chair. Go to frame 60, then MM drag the current time indicator back to frame
1. Select the U value, which should be at 0.247, and keyframe it. If you scrub the timeline now,
the chair should start in front of the camera, as shown in the top picture of the next illustration.
7. Select motionPath2. This is the path animation for the Persp1 camera. Go to frame 200, then
MM drag to frame 240. Select the U value again, which should be at 0.8333, and keyframe it.
Now the camera should finish behind the chair at the end of the animation, as shown in the
bottom picture above.
8. The only thing that remains for us to do is to adjust the height of the Persp1 camera. It s sitting
too low on the surface plane. Go to Four Views layout, and make one window Persp1 camera
view and another one the perspective view.
9. Select the Persp1 camera in the perspective view, select the Move tool, and press Insert to
display the pivot manipulator. Grab the Y-axis handle and push it down to make the camera
move up. You should scrub the timeline back and forth to come up with the ideal height for the
camera. You may even want to move the chair farther away from the camera.
10. When you are satisfied with the camera view, use Playblast, as described in the next section,
to see how everything looks. Save the scene as Wave.mb. You may want to use it again later
to try texturing the water and the sky.
For most of your animation projects, viewing the animation in real-time or near real-time will not be
possible with the Play Control buttons because the scene will be too heavy (built with too much
geometry) for that. Maya provides a quick way for you to view these scenes as movie clips or
picture sequences. Select Window Playblast , click Reset, adjust your time slider range to
about 30 frames for testing purposes, then click Playblast. Maya quickly captures the active window
view for the duration of the timeline and makes an .avi movie clip in your C:\Temp directory. This
movie clip will be deleted automatically when you exit Maya.
Many of the Playblast options are self-explanatory, but a few are not so straightforward:
" The default compressor for the movie player is the standard Microsoft Video 1, which you can
change to suit your computer s own capacity by clicking the Compression button.
" Instead of using the From Window setting for Display Size, you can have a Custom setting set
to 320240 or something similar in ratio, with Scale set to 1.0, to gain more control over the
area of your active window that is captured.
" If you check Fcheck, picture sequences are created instead of a movie clip. The Fcheck setting
enables you to acquire wireframe renders for your model turnarounds in minutes. You can save
the .iff picture sequences into any directory by using the Save to File setting, or convert them to
other image formats using Fcheck s Save Animation option.
Animating Waves
Open the scene you ve just finished. The surface plane is wavy, but is not moving. Let s create
some animated waves on it.
1. Select the plane and choose Deform Nonlinear Wave to apply Wave deformation to it (see
Chapter 12 for more information about Maya s deformers).
2. Translate the waveHandle node to ( 100, 0, 100) and scale it to 300 uniformly.
3. Set the Amplitude wave property to 0.005 and the Wavelength property to 0.1. Leave the other
properties at their default values.
4. Keyframe translate X at frame 1. Keyframe again at frame 240 with the X value at 60.
The waves look more realistic now. The surface still needs smaller ripples, but that s a texturing
matter (see Chapter 19 for details on texturing techniques).
1. Create another simple single span curve above the surface to act as the camera path, as
shown below. Observe carefully where the CVs are placed in relation to the floating chair. The
CVs have been positioned so that the camera will be able to follow the chair from behind and
up at an angle.
2. Select Create Camera . At the bottom of the option box, click the Three for Nodes setting.
Click Create.
3. Select the camera_group node and then select the curve. Use the Attach to Path function with
the Follow and World Up settings checked.
4. Select the chair, then Shift+select the camera_view node, and select Constraint Point. The
camera_view should now be constrained to the chair (constraints are discussed in detail later
in this chapter).
5. Scrub through the animation in camera view. You may find that the upper-right edge of the
surface plane is visible for a few frames. You can fix this by going into the motionPath2
properties and rotating the Front Twist setting.
6. Use the Playblast function to see how the curve moves. You may need to tweak the curve to
make the camera view stay inside the surface plane.
As you ve seen in these floating chair examples, path animation is relatively easy and can be
useful when you want your animation to follow a particular route. Now we will turn to the more
complex techniques of skeletons and kinematics.
Skeleton Concepts
As in the song that goes The knee bone is connected to the hip bone&, everyone knows that
bones are connected and that together they make up a skeleton. A skeleton is a protective
structure that houses the vital organs of animals, maintains their shape, and enables them to move
about. There are no vital organs in a digital character to protect (not yet anyway), but Maya does
provide joints, which enable us to animate characters efficiently and maintain or deform their
shapes properly.
Skeletons are built with bones and joints. Using the Skeleton Joint Tool, you click to place joints
in the modeling window, much as you would edit points for a curve, and the joints are connected by
bones. In building skeletons, it s good to know the kinds of joints you can create:
" A Ball joint can rotate in all three axes, like the neck bone. This is the default Joint tool setting.
" A Universal joint can rotate in two axes, like the wrist bone.
" A Hinge joint can rotate in only one axis, like the knee bone.
It s better to limit the joints you create according to their functions, because it means more
efficiency in your animation and fewer calculations for Maya to perform.
Forward Kinematics
Forward Kinematics works well for free rotational motions such as a character s arms swinging
when she walks or her spine rotating when she turns. Your main concern with Forward Kinematics
is setting up the joints correctly for animation. Let s use the Joint tool to build a human skeleton (a
very simple one, of course).
Building a Leg
We will begin by building our skeleton s leg. We need to place leg, knee, and foot joints.
1. Select Skeleton Joint Tool . Click Reset Tool to set all the options to their defaults, then
check Auto Joint Limits.
2. Go to side view and X+click the joints, as shown below. At any time during the creation of these
joints, you can MM drag to adjust the position of the last joint you created, or you can use the
Up arrow key to go back to other joints as well. (Note that if you go back up a few joints and
click with the left mouse button, you will get another bone branching out of the joint.) When you
ve created all the joints, press Enter to complete the action.
Note You can use the Move tool to move joints you ve created. If you select a joint and
move it using the Move tool, the joints below its hierarchy will move with it. If you select
the Move tool and then press Insert to show the pivot manipulator and move the pivot,
only the selected joint will move. You can also use Maya s other tools to edit the joints
you ve created (or are in the process of creating) to Insert, remove, connect, and
disconnect joints, and even to reroot a skeleton. These are all straightforward,
easy-to-use functions on the Skeleton menu.
3. Name the joints as Lleg, Lknee, and Lfoot (L is for left). We don t need to worry about the last
joint in the chain.
4. Go to the perspective view, select the knee joint, and try rotating it. You ll see that you can
only rotate it in the Z axis, and that there is a limit to the Z rotation. The Auto Joint Limit setting
creates a Hinge joint, which will not rotate past its parent joint or bend away from it more than
180 degrees. It works well here with the knee.
There are a couple of important things to observe here. The bones were created at an angle, not in
a straight line, because the angles between the bones determine which way the bones will bend.
Also, the default joint orientation in Maya is XYZ. This means that when a joint is created, its local X
axis points into the bone, the Y axis points toward the bending direction, and the Z axis is
perpendicular to the bending direction. You can display a joint s local rotational axes, as shown on
the next page, by selecting Display Object Components Local Rotation Axes.
When joints are created with the default setting, Z-axis rotation will always bend the bones, and
Y-axis rotation will rotate them from side to side. A corollary of this is that the window in which you
decide to build the joints is important. You should figure out how you want the bones to bend, then
build them accordingly in the proper window.
Mirroring Joints
Now we can use mirroring to create the other leg. Because joints behave differently from regular
object nodes, we need to use the Mirror Joint function to duplicate the right leg symmetrically.
1. Select the foot joint and open the Attribute Editor. The foot, unlike the knee, can rotate in the X
axis as well as the Z axis. Under the Joint section, for the Degrees of Freedom setting, click X.
2. Move the leg hierarchy to (2, 0, 0). Then select Skeleton Mirror Joint , select YZ as the
setting, and click Mirror.
Note The rotational limit information should copy into the mirrored joints as well, but you
may find that they are not activated. If this happens, go into the Attribute Editor and
activate them the numerical information is already there. If some of the Rotate fields
are grayed out but the joint is still rotating, click twice on the Degree of Freedom boxes
to activate the lock. Also, if you find that the joints are not being mirrored properly, you
can group them under another joint, mirror them, and then ungroup them.
3. Try rotating the left and right knee together. They should be rotating like mirror images of each
other, as shown next.
1. Go to the side view and create the spine chain with the default Joint Tool option settings, as
shown below. The spine joints need to be Ball joints.
2. From the top view, create the left shoulder chain, as shown above. (Remember that we re
creating a very simple skeleton.)
3. Name the spine hierarchy as waist, chest, neck, and head. Name the shoulder hierarchy as
Lshoulder, Larm, Lforearm, and Lhand. We don t need to worry about the last joint in the
chains.
4. In the front view, translate the shoulder chain up until it s a little below the neck bone.
5. In Hypergraph or the Outliner, group the legs under waist, and the Lshoulder chain under
chest. You should see something like the hierarchy and picture shown below.
6. To put rotation limits on the shoulder joints, open the Attribute Editor and select the Lshoulder
joint. The shoulder does not need to rotate in the X axis, so turn off X in the Degrees of
Freedom setting. We want the Larm to rotate like a Ball joint, so don t change its settings. The
Lforearm is a Universal joint that cannot rotate in the Y axis, so turn off Y. The Lhand is also a
Universal joint that can t rotate in the X axis, so turn off X.
7. For these joints and others, you can also set specific minimum and maximum rotational limits.
Let s do this for the Lforearm as an example. Select the Lforearm. In the Attribute Editor, open
the Limit Information, Rotate attribute. You ll see three Rot Limit fields, with Y rotation grayed
out. Put checks in the four Rot Limit X and Z boxes, and the Min and Max fields become
unlocked.
8. In the top view, try rotating the Lforearm in the Z axis. When it s straight, the current degree
reads about 28, so put in 30 for the Min value. When it starts overlapping Larm, the degree
is around 137, so put in 130 for the Max value.
9. For the X rotation, let s assume the palm is facing straight down. In this case, Lforearm should
be able to rotate about 90 degrees to make the palm face front, and about 45 degrees the
other way. Enter those values for the Min and Max fields.
Tip There are limits for Translate and Scale as well, which you may sometimes want to use.
Maya also has Rotation Limit Damping settings, which allow the joints to ease in and
ease out of the rotation limits.
10. Select the Lshoulder joint and mirror it. You should now have a complete, albeit very simple,
human skeleton.
11. Scale, rotate, and translate the spheres to their positions and group them to their respective
joints in the Outliner or Hypergraph. It s not all that important exactly how the spheres are
shaped or where they are placed, as long as they roughly represent the body parts being
controlled by the individual joints. The final dummy human is shown on the next page. Save this
scene as Dummy_human.mb. You can try skinning and animating it later.
To gain precise control over how the joints rotate, you need to know how to reorient joints. In
the skeleton you ve just created, let s say you ve translated the shoulder joint down one
unit using the pivot manipulator. If you display the local rotation axes, you will see that the X
axis is no longer pointing directly into the bone s center. It s off about 24 degrees.
To reorient the X axis, select the Rotate tool and switch to the component mode. RM choose
the question mark button (Miscellaneous) and check Local Rotation Axes, then select the
shoulder joint. You can rotate the Y-axis handle in the front view until you see the X axis
pointing directly into the shoulder joint. You can also enter precise rotational values by typing
in a MEL command in the Command Line field; for example, type rotate r os 0 24
0 to relatively rotate the local axes 24 degrees around the Y axis.
For those interested in MEL commands, there is also the joint e oj xyz zso
command, which reorients the local axes of a joint automatically. But be careful how you use
this command, because it may destroy the mirror properties of symmetrical hierarchies.
Inverse Kinematics
For goal-oriented motions, such as having a character plant her feet on the ground or reach out her
hands and open a door, you need to animate using Inverse Kinematics (IK).
Inverse Kinematics involves IK handles and IK solvers. An IK handle runs through the joints being
affected. The joints being affected are called the IK chain, and a handle wire runs through them. A
handle vector starts from the start joint and finishes at the end joint, where the IK handle s end
effector is located.
An IK solver looks at the position of the end effector of an IK chain and performs the necessary
calculations to make the joints rotate properly, from the start joint to the end joint of the IK chain, in
such a way that the end joint will be where the end effector is. When the end effector moves, the IK
solver converts the translation values of the end effector to the rotation values for the joints, and the
joints update accordingly.
Maya s interface has three kinds of IK solvers: the ikRP (Rotate Plane) solver, the ikSC (Single
Chain) solver, and the IK Spline solver. Each type of IK solver has its own type of IK handle.
Since the ikRP solver is the default setting for the IK Handle tool, let s see how that works first. In
the side view, draw a simple joint chain (as in the inset on the upper left shown below). Select
Skeleton IK Handle Tool , and reset the tool to its default settings. Click on the first joint, then
click on the last joint. You should see that an IK handle has been created. The circle at the top
looks complicated (as in the inset below), but it s actually a fairly simple setup, once you ve
learned what its components are.
The ikRP solver calculates only the positional value of the end effector, which means it ignores the
rotational values of the end effector. The joints are rotated by the ikRP solver in such way that their
Y axes are planar, their X axes are pointing to the center of the bones, and their Z axes are
perpendicular to the bending direction. This is the default local orientation set up for joints. If you do
not see the rotate disc, select the end effector and press the T key to display the Show Manipulator
tool.
The plane along which the joints are bending is represented by the plane indicator. The plane itself
is called the joint chain plane. You can rotate this plane about the handle vector using the twist
disc, which rotates the IK chain. The Twist degree is measured relative to a reference plane
created by the handle vector and the pole vector, which can be translated and keyframed.
Warning At times, the way you want the arm to bend will cause the IK chain to flip with the
default reference plane setting. To avoid this flipping, adjust or animate the pole
vector.
Open the Attribute Editor for the ikRP handle. The Snap, Stickiness, and Solver Enable settings are
discussed in the Switching between Inverse and Forward Kinematics section, following the
discussion of the ikSC handle.
The advantage of using the ikRP handle over the ikSC handle, discussed next, is that you can get
more precise control over the rotation of the IK chain. The disadvantage is that it necessarily has
more components to deal with.
The ikSC handle is simpler than the ikRP handle. To experiment with it, go to the side view and
draw another simple joint chain. Select Skeleton IK Handle Tool as before, but this time, select
the ikSC solver setting, then close the option box. Click on the first joint, then click on the last joint,
and you will see the ikSC handle.
If you press T to display the Show Manipulator tool, you will see nothing, because there are no
extra manipulators for the ikSC handle everything is controlled by the end effector.
Select Rotate and try rotating the end effector. You will notice that only the local X and Y rotate
handles seem to have any effect, and that they snap back to certain angles after you release the
handles. The ikSC solver calculates the rotational values of the end effector and rotates the IK
chain in such way that all the joints in the chain will have the default local orientation for joints. The
joint chain plane exists in the ikSC solver, although you do not see any representation of it in the
handle.
Open the Attribute Editor for the ikSC handle. The ikSC handles can have a Priority assignment
when there are two or more chains overlapping. The handle with the Priority 1 setting will rotate the
joints in its chain first, next the handle with the Priority 2 setting will rotate its joints, and so on. The
Po Weight setting determines the handle s position/orientation weight. If the weight is 1, then the
end effector will try to reach only the handle s position; if the weight is 0, the end effector will try to
reach only the handle s orientation. You should leave this setting at the default value of 1. The
Snap, Stickiness, and Solver Enable settings are discussed in the next section.
The advantage of using the ikSC handle is that you only need to use the end effector to control the
IK chain. For situations where you do not need a great amount of IK chain rotations, this would be
the more economical method of animating.
Tip When you are using the ikSC handle to rotate IK chains, use the Graph Editor to
interactively adjust the rotational values. It produces most predictable results. See
Chapter 10 for more information about the Graph Editor.
1. Go to frame 1 and turn on Auto Key. Without this setting, the process becomes cumbersome.
2. Keyframe the end effector, move to frame 10, and translate the end effector. You should have
another keyframe automatically set.
3. In the Attribute Editor, turn off Solver Enable to locally turn off the ikSC solver for this handle.
4. Select the two joints in the IK chain and keyframe them. Go to frame 20 and rotate the joints.
Go to frame 30 and repeat the action.
5. Select the ikSC handle again. In the Attribute Editor, turn on Solver Enable to turn on the ikSC
solver. You will find that the end effector acquired the keyframes for frame 20 and 30 in the
same positions where the joints were keyframed.
In order for this switch to be possible, you need to have the end effector s Snap setting on and
Stickiness off in the Attribute Editor. If Snap is off or Stickiness is on, then the end effector will not
snap to the end joint when the joints are rotated.
One more thing to be aware of in switching back and forth between inverse and forward kinetics is
that the movements generated by the rotation of the joints and the corresponding keyframes of the
end effector will not always match. They will roughly be the same, but you may need to tweak the
end effector s animation.
1. In the side view, build a joint chain, as shown below. For IK Spline handles, the joints need not
be built at an angle, but the bones should be short to ensure the chain will move smoothly.
2. Select Skeleton IK Spline Handle Tool and check Number of Spans 4. Leave the other
options set to their defaults and close the option box.
3. Click on the top joint, then click on the last joint, and you will see the IK Spline handle.
4. In the Outliner, select the joint chain or the IK handle and try moving the joints. The joints have
become attached to the curve, and the IK handle doesn t show a manipulator.
Note You can also create your own NURBS curve and have the IK Spline handle use that
curve. Turn off the Auto Create Curve setting in the IK Spline Handle option box. Click
on the root joint, the end joint, and then the curve to create the IK Spline handle.
6. Open the Attribute Editor for the IK handle. You ll see the regular attributes and some
specifically for the IK Spline handle. Try typing in numbers for the Offset, Roll, and Twist
settings.
Offset translates the joint chain along the curve, with 0.0 as the start of the curve and 1.0 as its
end. Roll rotates the whole joint chain. Twist gradually twists the chain from the second joint on. If
the Root Twist Mode is turned on, then the twist begins from the root joint. The Root on Curve
setting constrains the root joint to the start of the curve. Turn it off, and you can move the root joint
off the curve, but note that it is still constrained to the curve.
As we have seen, skeletons can be moved and rotated with Forward Kinematics or Inverse
Kinematics to animate various parts of a character. In addition to the IK tools, Maya provides the
Constrain menu in the Animation module. The functions in this menu are often used in conjunction
with the IK tools to set up a character for animation.
Constraints
Objects in real life are constrained in many different ways. For example, if you are holding a
baseball, when your hand moves and rotates, the ball moves and rotates with it, because the ball is
constrained by your hand movements. As another example, consider a tennis player, whose eyes
are always looking at the tennis ball. If you wanted to imitate these actions in Maya, it would be
difficult and time-consuming to try to reproduce the motions of the baseball or the eyes by
keyframing them. Instead, you can use constraints to automate such animation tasks.
Let s briefly go over the constraints in Maya. Under the Constrain menu, Maya has the standard
Point, Aim, Orient, and Scale constraints. In addition, it also has Geometry, Normal, Tangent, and
Pole Vector constraints. All the constraints work in the same way. You select two or more objects,
then select the constraints you want to apply. The first objects you select act as the targets that
constrain, and the last one is the object being constrained. When you select more than one
constraint target, the constrained object is shared between the targets according to their weights.
Point Constraint
The Point constraint makes the center of the constrained object stick to the center of the target
object. When there is more than one target, the Point constraint places the object being
constrained at a point between the targets pivot points, with the placement determined by the
average value of the weights of the targets.
Tip Maya also has a Point on Curve Locator constraint (Deform Point on Curve Locator),
which creates a locator at a selected point on curve or an edit point. This constraint
makes the locator position constrain the curve at that point, without breaking the curve s
tangency.
The Orient constraint causes the rotation values of the object being constrained to be the same as
the rotation of the Orient target. In the example on the right below, the cone has the average
rotation value of the tori.
Aim constraints are especially useful for quickly making a character look at, or focus on, different
objects. Orient constraints are great for controlling joints.
The Scale constraint functions the same way as the Orient constraint. The object being Scale
constrained has the same scale values as the target object, or the average scale values of the
target objects.
The Normal constraint acts much like the Aim constraint. The difference is that the aim vector of the
object being constrained aligns itself with the normal vector of the surface that passes through the
constrained object s center.
The Pole Vector constraint is a Point constraint specifically designed to constrain the Pole Vector of
an ikRP handle (discussed earlier in this chapter).
1. Bring in the file dog_final_model.mb, the final global stitched model of the dog.
2. In the side view, draw the backbone as shown below, starting from the hip area and finishing at
the nose. Draw the tail. Draw the front leg and the back leg with Auto Joint Limits turned on.
Note where the wrist is that is where the IK end effector will be placed.
3. To make the back leg the proper shape, increase the grid division and use X+click. This is
important because we will be using IK with the three joints of the leg. If the bones are not built
symmetrically as in the picture below, they will not bend the way we want them to.
4. Name the joints. The backbone chain should be hip, back, chest, neck, and head. The tailbone
chain should be tail1 and tail2. The front leg chain should be named Larm, Lelbow, Lwrist, and
Lpaw. Finally, the back leg chain should be Lleg, Lknee, Lhock, and Lpad.
Adding IK Handles
Now we re ready to apply inverse kinetics to the puppy, using the Skeleton IK Handle Tool.
1. In the perspective view, move the leg joints to the left side so that they are placed properly as
shown below. Put ikSC handles on them to test how they bend. For the back leg, try to keep
the three bones that will use IK coplanar. Think also of how the skin is going to stretch with the
skeleton as the joints are moving.
2. Mirror the front and back legs on the YZ axis. The ikSC handles should copy as well. Check to
make sure the joint limits are working (see Mirroring Joints, earlier in this chapter).
3. Group the front legs to chest. Group the back legs and the tail to hip. You should have the
joints placed somewhat like below. Name the joints properly, such as Rarm and Relbow. Name
the IK handles Lfront, Rfront, Lbackleg, and Rbackleg.
1. Select Create Locator and scale it down to 0.5 uniformly. Select Lpaw, then select locator1,
and select Constrain Point. The locator should snap to the Lpaw joint.
2. Select Lwrist (make sure you select this joint and not the Lpaw joint), then locator1, and select
Constrain Orient. The locator should rotate to match the rotation values of Lwrist. Name the
locator Lfrontleg.
3. Repeat step 2 for the right side of the leg. Name the locator Rfrontleg. You should see the
locators positioned as shown next.
4. Open the Attribute Editor for the Lwrist joint. Click the X and Y Degrees of Freedom settings.
They need to be activated before the joint can be constrained. Repeat this process for Rwrist.
5. In the Outliner, delete the constraint nodes under the locators. In the modeling window, select
the Lfrontleg locator first, then Lwrist, and select Constrain Orient. Do the same for Rfrontleg
and Rwrist. The rotation attributes of the wrist joints are now constrained to the locators.
6. In the Outliner, group the Lfront ikSC handle to the Lfrontleg locator by MM dragging it to the
locator node. Do the same for the Rfront ikSC handle and the Rfrontleg locator. Now if you try
moving or rotating the locators Lfrontleg and Rfrontleg, the legs should follow pivoting around
the paws.
7. Select the hip joint and group it to itself by selecting Edit Group with the default setting. This
produces a parent node. Name the node Puppy, and group the ikSC handles and the locators
under it. The Puppy node is the top node, which will move the whole dog. In the Outliner, you
should see a hierarchy like the one shown below. Save the scene as puppy_skeleton.
In your own work, it s important to remember that there is no one proper way to build skeletons or
place constraints to set up a character for animation. In each case, you need to consider what the
character will be doing, how the body should deform, how the limbs should rotate. Different
situations call for different solutions. A properly prepared character will move well, have the
necessary range of movements, and be easy to animate.
Summary
In this chapter, you learned how to animate objects and cameras along paths, build skeletons
properly, and create different kinds of IK handles on joints. You were also introduced to using
constraints. Finally, you built a hierarchy of nodes involving joints, IK handles. and constraints to
prepare the dog modeled in Chapter 8 for animation.
In the next chapter, we will cover how to bind the dog to the skeleton, weight it properly, and test it
for animation.
Chapter 12 - Deformers
In this chapter, we will go through several deformers that are indispensable for modeling and
animating in Maya. We will also focus on facial animation, including an in-depth discussion of
advanced facial animation techniques at the end of the chapter.
Chapter 12 - Deformers
Creating Deformers
Maya provides many types of deformers, which work in different ways. All of the deformers can
deform anything with control points, including CVs on curves and surfaces, vertices on polygons,
and lattice points. Many deformers can also deform multiple surfaces, maintaining their tangency
during the deformation process.
All deformers also work as sets, called deformation sets. You can edit the points being influenced
by a deformation by changing their membership in the set using the Relationship Editor, the Edit
Membership tool, or the Paint Set Membership tool (discussed later in the chapter, in the Editing
Deformations section).
All the deformers and editing tools we will be covering in this chapter can be found on the Deform
menu in the Animation module.
Lattice allows you to control the deformation of complicated objects with fewer control points than
you would need if you were deforming the objects directly. Because of this, the deformation is
easier to create and the results are smoother.
Creating Lattices
You can apply Lattice to a group of objects, only some points of an object, or points of a group of
objects. You can even apply Lattice to points of a lattice, as shown below on the right. In the
examples below, the lattice on the left is made up of points from four objects. The shape in the
middle is two tori, with the top torus latticed at the object level and the bottom torus latticed at its
two top rows of CVs.
To apply Lattice, simply select the points or object(s) you want deformed, then select Deform
Create Lattice. You see the influence lattice. The base lattice has also been created, but it is
hidden.
If you are animating the object being deformed, you want the lattice to translate with the object. For
this type of translation, group the lattice and its base lattice under the deformed object. Grouping is
available as an option setting when you are creating the lattice, or you can do it after you create the
lattice.
Lattice has its own local space, which parallels the XYZ coordinate system, called STU space.
When you create or edit a lattice, you can adjust the STU divisions of the lattice, giving it more or
fewer lattice points than the default setting.
Note Lattice also can be used for skinning, which we will do with the puppy in the next
chapter. Skinning an object indirectly with Lattice can be a great way to animate
because Maya s lattice is so efficient, but sometimes you may run into a situation
where an object is being transformed twice from the lattice and skinning. See the
discussion of the Relationship Editor later in this chapter for an example of how to deal
with double transformation problems.
Another way to adjust a lattice is through the Local Divisions setting, which is activated with Local
Mode. When Local Mode is turned on, each point exerts influence according to the Local Divisions
setting, as shown below. The default is 2, 2, 2, which means each point exerts influence up to two
points away in STU space. When Local Mode is turned off, each point in the lattice exerts influence
on the whole area. You usually want to leave Local Mode turned on.
The Freeze Geometry setting locks the object where it is being influenced. With this setting, when
the object transforms, the deformed part of it stays fixed, as shown above. You can activate Freeze
Geometry in the Attribute Editor after lattice creation. You can also move the deformed object
partially first, then turn on Freeze Geometry, and the object will lock where it is.
Tweaking Lattices
To tweak a lattice, pick-mask Lattice Point over it, and you can manipulate its points in the same
way as regular CVs.
You can also manipulate the lattice to fit around an object better by transforming both the influence
lattice and the base lattice. You can select the hidden base lattice in the Outliner. As long as the
two lattices are being transformed together, no deformation occurs. When you are doing this, make
sure that all the control points of the object being deformed remain inside the lattice, or they will not
deform with the lattice.
Tip The lattice is created to fit an object s bounding box. If you find that some points are not
deforming along with the lattice, try scaling up the lattice and the base lattice a bit to
make sure no points will stray outside the deformation.
If you ve been tweaking the lattice points and you decide to start over from the original shape or to
add more STU subdivisions, select Edit Lattice Remove Lattice Tweaks. If you want to undo the
transformations you ve applied to the lattice at the object level as well, select Edit Lattice Reset
Lattice.
Cluster Deformation
Unlike the other deformers, Cluster produces a weighted deformation. When you apply cluster to
an object, it creates weighted points in the cluster set. This is probably the most useful thing about
using clusters.
The default weight of the clustered points is 1.0, but you can adjust their weights by using the
Component Editor or the Paint Weights tool (Artisan). Let s try a simple exercise to see how to
create clusters and adjust their weights:
2. Drag to select 25 CVs at the center of the plane. Select Deform Create Cluster and accept
the default settings.
3. A cluster handle appears as the small letter c. Select the Move tool and pull the c up. You
should see something like the picture shown on the left.
4. Select the surface, and start the Paint Weights tool (from the Deform menu). Apply a bit of
smoothing with low settings around the edges of the clustered points. You should be able to
get a more rounded shape, as in the picture on the right. (See Chapter 9 for more information
about using Artisan.)
5. Select the clustered points and choose Window General Editors Component Editor. Click
the Weighted Deformers tab. Here, you can type in lower weight values to round the cluster
edges.
In general, when you want to have precise control over the percentage of the weighted points and
the points are easy to pick in groups, the Component Editor is a good tool to use. When you want a
more organic look, or if the surface is very dense, the Paint Weights tool (Artisan) is more efficient.
Tip When you are working with clusters, the cluster handle c has a default Select Priority
Level of 2, which means that it is selected along with the surface it s deforming. You can
open the General Preferences dialog box and change the Select Priority Level for the
cluster handle, or you can open the Attribute Editor and check Display Handle in the
Cluster Handle Display section. A handle with the highest Select Priority Level will
appear, which will allow you to select only the cluster.
When you move an object that is clustered, you would expect the cluster handle to move with the
object, but it doesn t. If you want the cluster to stay on the surface as it moves, group it under the
object. First, open the Attribute Editor, click the Cluster tab, and make sure the Relative setting is
on for Cluster Attributes. Next, if the object is at the origin, you can simply group the cluster under
the object in the Outliner or Hypergraph. If not, group the cluster to itself once to move the center to
the origin, then group that node under the object. (Edit Parent will produce the same result.)
Nonlinear Deformations
The six deformers in the Nonlinear submenu all deform in, yes, nonlinear fashion:
These are all simple functions, but they are remarkably effective in creating their intended results,
as illustrated below.
Each of the nonlinear functions can deform just the selected points of objects, just like lattices or
clusters. They can also deform multiple objects and maintain tangency between patches. The
deformations start and finish along an axis line, by default, the 1 and 1 of the local Y axis of the
object being deformed. You can use the manipulator handles to interactively adjust the deformation
attributes (select the deformer in the Channel box Input section to display the Show Manipulator
option).
You can combine any number of deformers. It s easy to create complex shapes by manipulating
the deformer attributes of the different deformers. Note that when you use multiple deformers, their
order of creation is important (see the Changing the Deformation Order section later in this
chapter). You can animate the deformers, and you can also animate the deformed objects.
Let s try some examples with the nonlinear deformers. First, we ll use Bend and Sine to twist an
object.
2. Apply Bend to it (select Deform Nonlinear Bend), with Curvature set to 3. Then rotate the
plane about 15 degrees in the X axis. The plane twists.
3. Add Sine to it (select Deform Nonlinear Sine), with Amplitude set to 0.5. Transform the
plane back and forth in Z. The twisting now seems more random.
4. Group the deformers and the plane. Now you can transform the deformers and the plane
together as well.
You can quickly create a rough jet engine by applying Wave to a sphere (as in the inset picture
after the following exercise; notice the dots for manipulator handle settings). You can also try
creating something as organic as a tree, as follows.
1. Create a cylinder. Increase its sections and spans, and scale it up in Y into a pillar shape.
2. Apply Flare to it. Flare out the bottom and taper the top.
3. Apply Sine to the object. Make the cylinder form about two waves.
4. Apply Sine again with a different wave length and rotate it to make the cylinder wave more
randomly.
5. Apply Wave, setting the Amplitude and Wave Length to about 0.1. Rotate the wave until the
cylinder becomes gnarled like a tree, as shown below.
Sculpt Deformation
Sculpt deformation uses a sphere as a sculpting tool to make round or flat ring-shaped
deformations. It can deform objects in three different modes: Flip, Project, and Stretch.
Note The Max Displacement and Dropoff Distance settings may seem similar, but they re
not. The Max Displacement value determines the amount of strength with which the
sphere can push or pull a deforming point. The Dropoff Distance setting determines
the area of points that can be influenced.
The Project mode is the opposite of the Flip mode. In Project mode, the sphere acts as a magnet,
causing the influenced points to snap to it. A Max Displacement value of 1 causes the points to
snap to the sphere s surface; values between 0 and 1 cause the points to travel a percentage
between their original position and the sphere s surface. Note that the deformation shapes
produced by Flip and Project are quite different.
As with the Nonlinear deformers, Sculpt can be used in many creative ways. Just by sculpting a
NURBS plane, you can easily fashion plant leaves, as shown on the right. Once you ve stretched
the plane, scale out the CVs at the top, tighten the CVs in the middle, and tweak the CVs a bit to
make the leaves asymmetrical.
Wire Deformation
Wire deformation works with an influence wire and a base wire, somewhat like Lattice deformation.
The deformation occurs according to the relative distance between the two wires. Wire deformation
is most useful for creating facial expressions, as you will soon see.
1. Create a NURBS plane. Scale it out to 3, and make its patches U and V 16.
2. Place a circle on the plane, and draw a curve with one span inside, as shown below on the left.
3. Select Deform Wire Tool and accept the default settings. Maya asks you to select shape(s)
to deform. Select the plane and press Enter. Maya then asks you to select wire curve(s). Select
the curve inside the circle and press Enter. If the deformer has successfully been created, the
plane should turn pink.
4. The curve is now called a wire. Note that a hidden duplicate of the wire, called the base wire,
has been created as well. Translate up the wire as shown below on the right. Then try moving
up the base wire. As the distance between the two curves decreases, so does the intensity of
the Wire deformation.
5. Place the wires to their original position, select the plane, and delete history. The Wire
deformer node disappears, but the base wire remains.
Using Holders
Let s repeat the process, but this time, we ll use the Holders option. Holders generally function to
restrict Wire deformation by limiting the influence of the wires.
1. Select Deform Wire Tool and click Holders. As before, select the plane and press Enter.
Then select the curve and press Enter.
2. Maya asks you to select a holder shape or clear selection. Select the circle and press Enter.
Maya now asks you to either select another wire (for more influence wires) or clear the
selection. Clear the selection by deselecting all objects and press Enter to complete the wire
creation. Notice that another invisible base wire is created.
3. Try moving the wire again and note the difference. In the following example, on the left, the
wire influence is overshooting the circle holder area.
4. In the Channel box, select wire1 under Outputs and decrease the Dropoff Distance setting to
0.3. The wire influence is now restricted inside the circle holder, as shown in the middle picture
below. Try moving the circle up to see the difference between having a holder and not having
one.
Tip Group all the wires the influence wire, the base wire, and the holder wire under the
object being deformed so that they will move with the object.
1. Move the wire down nearer to the plane surface. RM choose over the wire and pick-mask
Curve Point.
2. Select a point near the second CV, then Shift+select another point near the third CV.
3. Select Deform Wire Dropoff Locator with the default settings, and you should see something
like the next top-left picture.
4. Open the wire s Attribute Editor. There is now a Locators section, where you ll find sliders to
control the locators positions, their influence percentages, and their twist. The Twist setting
simply twists the deformed points around the curve at the locator point.
5. Change the Locators settings as follows: Percent[1] to 2, Twist[1] to 163, Percent[2] to 2.5, and
Twist[2] to 140. You should see something like the bottom-left picture in the following example.
For all the deformers, there is a general attribute channel called the Envelope. Some
deformers such as Blend Shape and Cluster actually have it as part of their option box. On all
deformers, it can be accessed through the Attribute Editor, under the Deformer Attributes tab,
or through the Channel box Inputs section.
The default value is always 1, but you can change it from 2 to 2. When the value is at 0, the
deformer has no effect. At 1, the deformer produces the opposite effect. At 2, the deformer
s effect is doubled. Such capacity is especially useful for Blend Shape, because its default
sliders in the Attribute Editor or the Blend Shape Editor go from 0 to 1 only. When you
increase the Envelope value to 2, the sliders range essentially increases from 0 to 2.
1. Open the file Child_face.mb from the CD, or if you created one yourself in Chapter 6, open
that file. Pick-mask over the mouth patch and select the edge isoparm, the isoparm at the nose
tip, and the one around the lip area, as shown below.
2. In the Modeling module, select Edit Curves Duplicate Surface Curves. With the curves still
selected, choose Edit Curves Rebuild Curve , set the Number of Spans to 16, and click
Rebuild.
3. The curve near the nose tip will be a holder, and the other two will be wires. Delete history from
the curves.
4. Switch to the Animation module, and select Deform Wire Tool and click Holders. Select
the four patches of the face and press Enter. Select the curve at the mouth patch edge for wire,
and press Enter again. Select the curve near the nose as holder and press Enter. Clear the
selection and press Enter again to complete the wire creation.
5. Repeat the process for the third curve, using the middle curve as a holder curve again. This
time, you only need to select the mouth patch as the object to be deformed.
6. Try moving around a few wire CVs. You ll find that you probably need to lower the Dropoff
Distance for the curves. Once the settings are done, it s quite easy to create subtle
expressions by pulling the wire CVs. You can proceed to animate the CVs, as well as the
curves. You would also want to add at least one more wire to control the eyebrows (as shown
below), and group the wires (including the base wires) to the head.
Blend Shape is especially useful for facial animation. In this type of animation, a group of set
shapes such as certain phonemes or facial expressions need to be readily accessible, editable,
and, as the name suggests, blendable.
1. Create two spheres. Change the first sphere s shape by pulling points, as in (a) in the
following example.
2. Select the first sphere, which will be the target, then Shift+select the second, which will become
the base. Then select Deform Create Blend Shape and accept the default settings.
3. Select Window Animation Editors Blend Shape. An editor opens with a target slider. A
blendShape node is created, and the target slider is an attribute of that node. Slide it to 1, and
the second sphere should morph into an exact replica of the first sphere, as in (b).
4. You can also Blend Shape points. Select the first two rows of the first sphere (target) and the
same for the second (base), then apply Blend Shape. You get something like (c).
5. Notice that there is now another slider in the editor. Repeat step 4, but set the Origin setting to
World in the option box. The blending calculates not only the relative translation of the target
points, but their world space coordinates as well, as in (d). The morphing points of the base
object translate exactly to where the target points are, no matter how the base object is
transformed.
6. Select the middle CVs of the second sphere and delete them, as in (e). The topology of the
second sphere has changed; it now has eight fewer CVs than the first sphere.
7. Apply Blend Shape to the spheres again, Maya replies with the message, Error: No
deformable objects selected. This is because the default Blend Shape setting checks to make
sure the topology of the target object matches that of the base object s. Turn off the Check
Topology setting in the option box. Maya proceeds to morph the base object the best it can.
The result is as shown in (f).
In the picture shown below, the head on the left is the base, and the one on the right is the target.
Notice that the hierarchies in the Outliner are all in the same order. Selecting the top Smile node,
then the top Face node, and then applying the default Blend Shape produces a slider named Smile.
To add more shapes, simply create more shapes, select them, select the base object, and apply
Edit Blend Shape Add. If you get an error message saying you must specify a blendShape node,
click Add in the option box, check Specify Node, and enter the name of the existing blendShape
node, which should be something like blendShape1. Some examples of shapes are shown below.
You also can edit the target values in the Channel box or in the Attribute Editor, where the targets
appear as sliders under the Weight section of the blendShape tab. You can remove the targets
from the blendShape the same way you added them. Select the target objects in order, select the
base, then apply Edit Blend Shape Remove.
Tip Once you are satisfied with all the blendShape targets, you can delete the target objects
to lighten the scene. The blending information remains with the base object, so you can
always recreate a target geometry by copying it from the blended base object.
Chapter 12 - Deformers
Editing Deformations
Deformations depend on the relationships among points and their groupings. The controls you can
use for your deformations include the Relationship Editor, Edit Membership tool, Paint Set
Membership tool, and the Prune Membership function. You can also edit the deformation order.
2. Select the top two rows of its CVs and apply Lattice deformation with the default settings to the
points.
3. Select both the cylinder and the lattice in the modeling window, and apply Cluster deformation
with the default settings.
4. Try moving the cluster. You will see that you have a problem commonly known as double
transformation, which is illustrated below. The points inside the lattice are being moved twice
once by the lattice deformer, and again by the Cluster deformer. To solve this problem, the
cluster should stop moving the points inside the lattice, because you want the lattice to still be
able to affect the points on the cylinder.
5. Select Window Relationship Editors Deformer Sets. You should see the editor with two
deformer sets on the left side: ffd1Set and cluster1Set. Click the plus signs to their left, and you
see a list of all the points that are being deformed by the lattice and the cluster.
6. Highlight ffd1Set and select Edit Select Set Members. You also can highlight the points
inside the set and select Edit Select Highlighted. In the modeling window, the points become
selected.
7. Highlight cluster1Set, and either click the minus sign button at the top of the window or select
Edit Remove Selected Items. The selected points are no longer part of the cluster set, and
they are not transformed twice.
Tip When you are in the Relationship Editor, you can unclutter the right window by RM
choosing over it and clicking Show DAG Objects Only. (DAG stands for Directed Acyclic
Graph.)
1. Use Undo to create the double transformation situation again (or repeat steps 1 through 3 in
the previous section to recreate it).
2. Select Deform Edit Membership Tool. Maya asks you to select a set or a deformer. Our goal
is to remove points from the cluster, so select it. All the points belonging to the cluster become
selected.
3. Ctrl+click or marquee the points you want to remove. (If you want to add points to a deformer,
you can Shift+click or marquee the points.)
The Paint Set Membership tool works in the same way as the Edit Membership tool. To use it in our
example, you would select the cylinder, select Deform Paint Set Membership Tool , select
cluster1Set as the set to modify, and choose the Remove operation. The advantage of the Paint
Set Membership tool is not readily seen in this instance. However, because it gives you a color
feedback telling you which points belong to which deformer, it can be very useful when you are
editing rigid skinned objects (see Chapter 13 for more information about skinning techniques).
Pruning Membership
With Lattice, Cluster, Sculpt, and Wire deformers, Maya provides a quick pruning function. The
Deform Prune Membership function removes all the points of a deformer set that, at the time of
the pruning, have not been moved from their undeformed positions.
While pruning can lighten a scene by reducing deformer calculations, you may remove points that
seem unnecessary from sets, but later find that they need to be deformed after all. In such cases,
you can always add those points to the deformer set again, using the editing tools described in the
previous sections.
2. Copy the cylinder. Translate it out and deform it to look something like the one in (a) below.
3. Apply Blend Shape to the original cylinder, as in (b) below. Set the Blend value to 0, and delete
or hide the copied cylinder.
4. Apply Sine to the original cylinder, with an Amplitude setting of 1. You should see something
like (c) below.
5. Increase the cylinder s Blend value to 1. You no longer see (b) but rather something like (d). If
you want to see the cylinder morph into a shape like (b) again, you need to change the
deformation order assigned to Sine and Blend Shape.
6. With the cylinder still selected, click the List of Operations button (adjacent to the Make Live
button) and choose Complete List. You can also RM choose over the cylinder and select Inputs
Complete List.
7. In the Complete List window, notice that history of the node chain starts from the bottom. MM
drag the Non Linear node down to the Blend Shape node until you see a box appear around it,
then release the mouse button. The nodes placements have switched. Now when you
increase the cylinder s Blend value, it overrides the Sine shape, as shown below.
Chapter 12 - Deformers
You may also want a tongue, its tip clustered, to strike the back of the upper teeth for what the
linguists, if not the dental experts, call the alveolars (s, z, t, d, n, l), or to the bottom of the upper
teeth for the th sounds. An example is shown in (b) below.
Another necessity is the oral cavity. A good way to proceed is to offset two or three curves from the
boundary isoparms of the lips so you can maintain a procedural connection with the mouth shapes,
create copies of those offset curves, translate them into the throat area, and loft (see Chapter 6 for
more information about lofting). This is illustrated in (c) below. You may want to wait until you have
finished building the face before creating the oral cavity. It should become a morphing part of all the
mouth targets.
Tip Creating the inner mouth parts can be tricky and time-consuming. If you are not going to
have close-up shots of a character s mouth, it may not be worth the effort. As an
alternative, you can create a textured plane, curve it, and position it inside the mouth.
Setting up well-thought-out mouth targets may take longer, but it will save you much more time in
the long run, especially if you will be using the character repeatedly. Using Blend Shape for
lipsyncing and Wire deformation for fine tweaking and facial expressions probably will offer the best
results. Below is a sample list of blend shapes for lipsyncing.
The ah and oo shapes are absolute necessities ah because it opens the mouth and lowers the
jaw, and oo because it can also be the shape for sounds such as ch, sh, and w, not to mention
kissing and whistling.
You can get by using one shape for oo and oh, but they really are different shapes. The jaw drops
for oh, creating a hollow space inside the mouth, whereas for oo, everything pushes up. The ee
shape shown above is an extremely strong shape, which can double as an expression of anger or,
combined with ah, screaming. For unaccented ee shapes, you may want to use the
H(horizontal)_stretch instead.
For H_stretch, Frown, and Face_lift, you could separate them further into Left and Right targets. If
you do, then be careful not to disturb the few middle CVs of the face, or you will get the
double-transformation effect (described earlier in the Editing Deformations section).
For many of these shapes, if you build the targets carefully, you can also use their negatives.
Below are the negatives of some of the shapes.
Note The sounds are not accurately-spelled phonetic sounds. They ve been spelled out like
regular words here. For proper phonetic spelling, you should follow the IPA
(International Phonetic Alphabet). Different dictionaries use slightly different spelling
methods, but ah would generally be listed as [a:], oo as [u:], ee as [i:], and so on.
Letters such as c are represented differently depending on how they are used. A soft c
is [s], whereas a hard c is [k]. For more information about phonetic spelling, refer to a
linguistics book.
In the example shown below, Blend Shape was applied not to the top Face node, but to the
Eye_area and Mouth_area nodes. There are also two blendShape groups: one for the mouth area
and another for the eye area. The two targets, Ah and Eyeclose, are working well with the base
object. The two shapes are independent of each other, so that when the eyes close, the mouth
area is not affected, and vice versa. The third shape, smile, is actually a combination of two target
shapes: the Sm_eyes and Sm_mouth shapes. In the bottom-right picture below, both shapes are at
their maximum target value.
However, there is a problem with the smile shapes in the example below. When the Sm_mouth
slider is moved, creasing occurs as shown below. This is because the Sm_eyes slider did not move
with the Sm_mouth slider. We can solve this problem by making the Sm_mouth slider a driver for
the Sm_eyes slider.
RM choose over a numeric input field in the Blend Shape Editor to pop up a menu. Select Set
Driven Key. You can select the blendShape node in the Blend Shape Editor by clicking the Select
button. Specify Sm_mouth as the driver and Sm_eyes as the driven. Key them at 0 and 1.
Sm_mouth should now drive Sm_eyes, as shown below.
" Consonants are greatly affected by the sounds that surround them, which is a phonetic
phenomenon called assimilation. For example, the consonant d in how do you do? and
how did you do? forms two different mouth shapes, because the vowels that follow the d are
different. A good rule to follow is to go through the vowels first, because they will often dictate
how the neighboring consonants will be shaped. Once you figure out the vowels, the
consonants will often naturally fall into place.
" There is also a rule called vowel reduction or omission, which is a specific type of assimilation.
For example, a phrase like how did you do? is often spoken how ju do? . In a case like
this, it helps to unlearn your reading skills; instead of trying to find sounds from the words,
just listen.
" English is an intonational language. It s rhythmic, with regular beats of accented and
unaccented syllables, and a few strong emphases punctuating different parts of sentences. You
should listen to these emphases and figure out where the beats are falling. You can then skim
through the unaccented segments and concentrate on nailing the accented syllables.
" For animation, you should be concerned only with what will be seen. If a character s back is
toward you, for goodness sake, don t animate her face! If that seems obvious, then in the same
way, you don t need to animate what goes on inside the mouth. Consonants such as s, z, t, d,
n, and j, among others, can often be shown as just a slight up and down movement of the
mouth. Consonants such as k, g, ng, and h matter only in that they fill time between vowel
shapes. The th sounds (as in thing and they ), too, are indistinguishable in terms of
shapes, and should be treated as one sound.
Tip For many animators, lipsynching is not such an important part of facial animation. Far
more important is creating proper facial expressions, especially in the eye area.
There are various methods of keyframing mouth shapes. You can use the Channel box, the
Attribute Editor, or the Blend Shape Editor. It is generally not a good idea to keyframe individual
shapes, because the shapes that are not keyframed may end up floating between their
keyframes. A much more efficient method is to keyframe all the shapes, then tweak them
individually in the Graph Editor.
Tip You can lock certain targets to exclude them from being keyframed if you know you won
t be using them for a specific scene. For example, you might lock a smile target in a
scene where you know the character isn t going to smile.
In order to use the Channel box, you need to have the mouth selected. The Attribute Editor has the
Copy Tear Off Copy function, which creates a copy window that still remains when the object is
deselected. Another advantage of the Attribute Editor s torn-off copy is that it has sliders. The
Channel box s targets are restricted to a value range of 0 to 1 for the targets, but you can set the
sliders to have a wider range of target values. Just type in numbers like 1 or 2 into the numeric
input field, and the slider range will adjust accordingly.
You can Key All in the Blend Shape Editor and in the Channel box, but not in the Attribute Editor.
One way to get around this is to use the hotkey for setting keys. You may need to adjust the Set
Key options to All Keyable Attributes in order to keyframe blended shapes.
You would usually want to select either one or just a few different targets inside the Graph Editor
and focus on tweaking only those curves at one time. You may also want to turn off Curve in the
Select menu if you are editing only keyframes.
Chapter 12 - Deformers
Summary
In this chapter, you have learned how to apply various kinds of deformers to objects, or parts of
objects. One of the wonderful things about deformers is that they can be combined in different
orders to produce some remarkable effects. In particular, Wire and Blend Shape deformations
allow you to produce high-level facial animation. Lattice can also be a very useful tool for both
smooth and rigid skinning. In the next chapter, we will be covering skinning, as well as building and
setting up a complete human character.
Skinning
We ve already talked about how skeletons can bind objects and deform them properly as they
move. The process through which skeletons do this is called skinning, and the objects that become
bound to skeletons this way are called skins, or skin objects.
Like other deformers, skeletons can skin anything that has control points, such as CVs, NURBS
curves, surfaces, polygonal vertices and objects, and lattices. Although you will most often skin
whole objects, it is worthwhile knowing that you can bind only a selection of points as well.
There are two kinds of skinning: rigid and smooth. Rigid skinning creates a joint cluster for every
joint binding the objects. These clusters can contain points of multiple objects, and you generally
use flexors to smooth the bends. Smooth skinning creates a skin cluster for every object being
bound; this cluster is shared by a set number of joints with different influence percentages. You can
use influence objects, discussed later in this chapter, to manipulate the deformation of smooth
skins. For both kinds of skinning, you can use the Artisan tools to edit set membership and weights
of the skinned points. When you are working with dense organic models, the difference between
using Artisan and using the regular tools can be quite noticeable.
Rigid Skinning
Rigid skinning is called rigid because only one joint can influence a CV. There is no sharing of
CVs as in smooth skinning, and the joint clusters that are created have a default influence value of
100%, which results in a rather rigid deformation when joints are bent. You can edit rigid skins by
using flexors (a special type of deformer) or other deformers, or by changing skin point weights. All
the tools we ll be using, unless stated otherwise, are available in the Skin menu in the Animation
module.
Tip You can also skin selected joints in the same way you would complete skeletons, but you
would do this with different geometries, such as skinning the hand, then the arm, and so
forth. Trying to skin one object separately to two joints brings up some tricky partitioning
problems, and fixing them is usually not worth the effort. Instead, if you have to do
something like that, try creating lattices with the object s control points instead and skin
them to the selected joints.
Tip If you have trouble selecting CVs with a pick mask because the skeleton gets selected
over the CVs, switch to component mode and select them. Skeletons are not selected in
the component mode.
Flexors
The easiest way to make joints bend smoothly is to use a flexor, a special type of deformer that
works with rigid skinned joints. There are three types of flexors: lattice, sculpt, and cluster. You will
usually want to use the lattice.
Joint Lattice Select the skeleton, and apply Go To Bind Pose. The cylinder is no longer deformed.
Select the second joint and, from the Skin menu, apply Edit Rigid Skin Create Flexor. Leave
everything at the default setting and click Create. A joint lattice (or flexor) is created, with its
orientation the same as the joint s local axes. Rotate the joint 90 degrees again, and you ll see
that the bending is smoother the flexor deforms the cylinder around the joint. You can further
change the way the flexor is deforming by selecting it and then editing its attributes in the Channel
box. The next illustration shows how each attribute changes the way the flexor deforms the
cylinder.
Bone Lattice You can also apply flexors to bones, but bone flexors are applied a bit differently.
Their deformation is affected by the rotation of their child joint. Think of biceps and triceps bulging
when you rotate your forearm. To try a bone flexor, select the first joint and apply Create Flexor. In
the Create Flexor option box, turn off Joints and check At Selected Bones. Click Create, and a
lattice is created around the first bone. Rotate the second joint 90 degrees, select the flexor, and, in
the Channel box, change the values for the boneFlexor attributes. Notice that, instead of Creasing
and Rounding, boneFlexor has Bicep and Tricep as the first two variables. You can easily get
something like a) in the next illustration.
You can move, rotate and scale the flexors to adjust the way they are affecting the skin. In the
Outliner, select the lattice group, which selects both the flexor and its latticeBase, and transform it.
You can see the way the skin deformation changes while you are transforming the lattice group: b)
is the result of the lattice group being moved and rotated.
Sculpt Flexor You can also use a sculpt sphere as a flexor. It works just like a regular sculpt
deformer, and there are no automated attribute controls as with lattice flexors. To have those
controls, you need to use Set Driven Key. You can use the sculpt flexor as a bulging upper arm if
you want, or as other parts of the body that regularly stretch with joint rotations, such as chest
muscles. It can be applied as a joint flexor as well, although it is generally used as a bone flexor.
Cluster Flexor Cluster flexors have no options attached to them, and they exist only within joints.
You can manipulate the smoothness of the joint s deformation, as well as the distribution of the
parent and child joints deforming influences. Select the joint with the cluster flexor and press T to
activate the manipulator handle. It shows two rings: one for the child joint, and another for the
parent joint. The center of the rings slide up and down the bones, changing the joints Upper or
Lower Bound values, and the radius of the rings changes the Upper or Lower Value values. Below
are some of the ways you can change the bending with a cluster flexor.
Go To Bind Pose
Do not confuse the Skin Go to Bind Pose command with Skeleton Assume Preferred
Angle. The latter rotates the joints back to their creation positions, which can be changed
with the Set Preferred Angle command. Bind Pose instead keeps track of not just the rotation
but all the transformation values of the joints when the object was skinned.
If you decide to detach and reattach skinned objects, you would want to reposition the
skeletons to their Bind Pose again. In order for Go To Bind Pose to work properly, the joints
must not be locked. Often, however, some of the joints will become locked, because of
constraints, expressions, or keyed IK handles. In such case, you can temporarily disable
these nodes by going to Modify Disable Nodes and selecting the nodes causing the
blockage.
Copy Flexor Copy Flexor function allows you to copy flexors to other joints. This is useful for
creating flexors on the mirrored joints, or creating flexors on finger joints. Simply select the flexor
you want to copy, then select the joint you want it copied to, and apply Edit Rigid Skin Copy
Flexor. If you have many copies of the same flexors deforming something like finger joints, and you
are comfortable using the Hypergraph, you can try setting up the connections so that one flexor
node can drive all the lattice nodes. This would be especially helpful if you had to animate the
attributes for all the flexors.
Note Smooth skin does not work with these tools, because it has only one cluster set. It
uses the Paint Skin Weights tool instead for weighting points.
We are back with the cylinder and the two joints. Delete all the flexors, go to Bind Pose, and apply
Detach Skin. Select the skeleton and the cylinder, select Bind Skin Rigid Bind , turn on Color
Joints, and click Bind. Note that the joints are now colored. Rotate the second joint 90 degrees as
before. Select Deform Edit Membership Tool, and the mouse arrow changes shape. Select the
first joint, and all the points belonging to it are highlighted, as below. Shift + click on the points at
the bend to include them to the first joint, until you see something like the picture on the right side
below.
Select the cylinder, and select Deform Paint Set Membership Tool . In the shaded mode, the
cylinder shows two colors, representing the points that belong to the two joints. You can see here
(and in the Color Gallery on the CD) that because the joints themselves are colored, you can easily
identify which part of the surface is being bound by which joint. Select the second joint, and you
can add points to it with the paintbrush.
With the cylinder still active, select Deform Paint Weights Tool . Set the Operation setting to
Smooth, and select the second joint for the Clusters setting. Now the cylinder s color has changed
again. The cylinder is black, except for the section bound by the second joint. (You can also see
this image in the Color Gallery on the CD.) The smoothing operation actually reweights the points
in the second joint. You should always keep the brush at low settings, and it may take some
practice, but once you get used to smoothing the weights, you can very efficiently smooth out the
bend. Using these Artisan tools (introduced in Chapter 9) is definitely faster than using the
Component Editor.
For fine control over deformations such as bending and bulging, you still need to use flexors and
other deformers, but for simple smoothing tasks, or creating organic weighting around a surface,
Artisan should be used. It creates a lighter scene, without the extra deformer nodes.
Smooth Skinning
For each object being skinned, smooth skinning creates one cluster set of points, which can be
influenced by more than one joint. You can set the number of joints that can actually influence the
points in the Smooth Bind option box, but all the joints in the skeleton can potentially influence the
smooth skin.
The advantage of smooth skinning is that it creates a simpler and (computationally) lighter scene
than rigid skinning. You do not need flexors or the Edit Membership tool to edit points in the cluster
set. If you need that kind of deliberate control over the bends, you can always use deformers or
influence objects, which are deformers specifically set up to work with smooth skinning. Artisan s
Paint Skin Weights tool (Chapter 9) is especially useful with smooth skin. Because there are often
many joints influencing a skin point, weighting dense smooth skins could be quite a challenge
otherwise.
Influence Objects
Let s say we want the biceps and triceps to bulge. We can use an influence object to accomplish
this. Create a sphere and scale it to fit in side the upper arm. Select the cylinder skin, then the
sphere, and apply Edit Smooth Skin Add Influence with the default settings. The sphere
becomes an influence object, like a lattice deformer, with a hidden sphereBase object also created.
You will generally leave the Base object alone, although you can optionally pull points of the Base
object to change the deformation effect of the sphere. You can use Set Driven Key to automate the
bulging by scaling up the sphere when the second joint rotates, as below. The influence sphere and
the sphereBase should be grouped under the first joint.
Warning Do not delete an influence object the regular way, as it will mess up the smooth skin
weighting. Select first the skin and then the influence object, and apply Edit Smooth
Skin Remove Influences.
We used a sphere, but we could have used any object with control points. The biceps and the
triceps above look shapeless. Let s try the Influence object again, this time deforming a torus to
get more definition for the biceps and triceps. Set up a torus as an Influence object with Minor
Sweep at 180 and everything else at the default setting, as below. Select the skin and, in the
Channel box, open the skinCluster and set Use Components to On. An easy way to do this is to
enter 1 in the field. When this is turned on, component-level deformation of the influence object
influences the skin as well. Sculpt the torus until the upper arm takes on the shapes for biceps and
triceps as on the left below. Keyframe the CVs, and move to a different timeline. Rotate the second
joint, and sculpt the torus again until you see bulging biceps and triceps as on the right below. Copy
the bulging torus.
Move back to the frame where the torus CVs were keyframed. You can now delete the keyframe.
Apply Blend Shape to the torus, making the copied torus its target. In the Channel box, open the
blendShape channels, highlight the nurbsTorus target, and RM choose Set Driven Key. Make the
blend shape driven by the joint rotation, as shown here:
1. Open the file you saved as Puppy_skeleton. Create a skeleton layer to control the visibility
of the skeleton, IKs, and constraints. Hide the layer for now. Select the head patches, eyes,
ears, and nose; then go into component mode and select all the CVs, except the last two rows
of the neck area, as shown below. Create a default lattice, and increase its STU divisions to (4,
5, 5).
2. Creating the body lattice is a bit more involved. You have to select rows of CVs from different
patches, and it may help to create a temporary set in the Relationship Editor to contain all the
points for selection purposes. Select all the CVs of the body patches. Select the two rows of
CVs from the neck area. Select the top three rows of the front leg patches. Select the top two
rows of the back leg patches. Finally, select the bottom three rows of CVs of the tail patches.
The following pictures should help.
3. Try moving the lattices to see that none of the points that should be included have been left
out. Select the lattices, the leg patches, and the tail patches. Unhide the skeleton, and include
it in the selection as well. Apply Skin Bind Skin Smooth Bind , click Reset, reduce Max
Influences to 2, and click Bind. Maya starts to create a skin cluster for each of the patches and
the lattices. Open the Relationship Editor and go to the Deformer Set Editing module. You
should see 24 sets altogether. There are two lattice sets and 22 skin cluster sets: 16 for the leg
patches, 4 for the tail patches, and 2 for the lattices. Remember, they are smooth-skinned
objects now as well.
4. We have a double transformation with the lattices. Grab the top skeleton and move it up some
of the leg CVs and the tail CVs are translating further than they should. There is a simple way
to fix this problem. Highlight the body lattice set, apply Edit Select Set Members, and you
should see the CVs for the body lattice get selected as shown next.
Highlight all the skin cluster sets (not the lattice sets) and click on the minus button at the top,
or choose Edit Remove to get rid of the selected items. The offending CVs are removed from
the skin cluster set, and the dog should look normal again. Move the dog down to its original
position.
5. Start weighting from the head. With lattices, you have to use the Component Editor to weight
the lattice points. Rotate the head joints and see how the integrity of the head shape holds up.
The head area should mostly be fine with the default setting. You will probably want to set the
lattice points around the face all to 1 in the Component Editor.
6. Create a cluster on the ears. Select the CVs as below, and apply Create Cluster with Relative
mode on. Weight the points so that the bottom of each ear gets deformed the most. Group and
parent it to the head joint. The ears should mostly deform well enough within the lattice, but in
cases where they are going through the head geometry, you can use the cluster to adjust the
ears.
7. As you are weighting the different parts of the body and rotating the joints, you can always use
Go to Bind Pose. But if you move the IK handles or the constraints, the Bind Pose will not work.
One way to handle this is to keyframe those nodes. After you ve tested them, you can return
them to their original positions, after which the Bind Pose should work again.
8. We can t go through all the lattice weight tweaking here, as it is a time-consuming process. To
give you an idea of what s involved, let s go through a simple example of lattice tweaking at
the chest area. The four points below are being influenced by Rarm, Relbow, Larm and
Lelbow. The elbows, however, shouldn t be influencing the chest area, so punch in zero in the
elbow columns. The arms are each assigned the value of 1 for two points. But the chest bone
should be influencing the chest as well, so assign 0.5 in the chest joint. The value for the arm
joints drops to 0.5 accordingly. As you can see, a lot of weighting actually consists of getting rid
of unnecessary influences and thinking about which joints should be influencing the points,
rather than punching in numbers.
9. You can use the Paint Skin Weights tool for the legs and the tail if you want, but apply them
only if you see the need. In our case, the default skinning has done a fairly decent job of
weighting. Once you are done with weight tweaking, save the file as Puppy_ready. You can
try a four-legged walk cycle with it.
In completing the child model, we will first create a sleeveless shirt in NURBS, which will then be
converted to polygons. Arms will be created to connect smoothly with the shirt, and hands built in
Chapter 7 will be connected to the arms; then we ll create the shorts, legs, and then the shoes.
Create curves on surface with the torso and the plane by using Intersect Surfaces and then Trim.
Duplicate curves from the cylinder, and offset and duplicate curves from the trim edge of the torso,
or a shirt, as in image a) below. Rebuild the curves into uniform 8-span curves and then loft them.
Use the curves to sculpt the arm a bit more, and then you can delete them. Duplicate the
geometries with scale 1, and you will see something like image b).
Tip This has been emphasized already, but build models as simply as you can. You can
always increase isoparms; it s hard to do the opposite. With the arms, you ll probably
insert more isoparms later when we are at the skinning stage; but when you re
modeling, one less isoparm is one less thing to worry about.
The trimmed shirt is converted into polygons, its two halves combined, and separate edges merged
(Note the soft edges in image a) next) except for the side opening. The lofted edge surfaces (b) are
converted and combined, but not merged. The thickness comes with a cost, however; the shirt s
geometry becomes heavier (c). If you wanted still a better-looking shirt, you would also add
thickness to the neck opening as well. The shirt was touched up with Artisan at the end.
Another cylinder is used for the leg, is mirrored for the other leg. Note the bunching of CVs at the
knee area. The shoe is created from a sphere. Several sections are bunched up at the sides to
make the bottom flat, and it is perhaps too simple a shoe, but it ll deform well enough.
Hands
Open the file Child_hand from the CD or the one you ve built. It s a bit big and long for the
child, so scale it down appropriately. There are different ways of attaching hands to arms. You can
build them as seamless NURBS objects, or hide the seams by overlapping their surfaces as shown
below. You can also give the character wristbands, or a watch, or gloves to wear.
Finally, check to see that all the normals and UVs are going in the right direction. Checking this
now will save a lot of hassle when texturing the surfaces later.
IK Setup
We ve already gone through much of the skeleton setup process in Chapter 11. Again, there are
some general rules to follow:
" Choose the window where you will create the joints carefully the bending should always occur
as Z rotations.
" The local rotational X axis should be pointing directly into the child bone.
" Test to make sure the mirrored joints are rotating properly.
Also, this is the last stage where you can readily make changes to your model. In particular, check
for proportions and see whether you need to increase isoparm numbers. When you have the
shoulder chain made, for example, skin just the arm and the hand and try bending them different
ways. You may find that the arms are too short or that more isoparms need to be inserted.
Spine
The spine joints will be moved by the IK Spline tool, which allows us to build it more like the human
spine, as shown below. The joints must have no limitations otherwise, the spline won t work. Note
the start joint is one above the root joint. The curve is four spans, which means it has seven CVs.
Create three clusters the first one containing six CVs, the second containing four, and the third
containing the top two and display their handles. They will serve as three spline control handles.
Parent the clusters to the Root joint, and note that extra group nodes are created for them.
The leg chain should be created from the Side view, since we want the legs to bend back and forth.
Build the joints as in a) next. Once that s done, group the chain under the root joint, and mirror the
leg chain and the shoulder chain. You should see something like b). If you have set limitations to
any of the joints Degrees of Freedom setting, check to make sure they are active on the mirrored
joints.
Hand Cubes We ll use the ikRP Handles option setting, because you can get more rotational
control with it. Start an IK handle at the left arm joint, and end at the wrist joint. Create a polygon
cube, scale it as you see below, V+drag it to the wrist joint, and point-constrain the IK handle to the
cube.
What we will do now is a bit complicated. We want the hand to have an orientation constraint to the
cube so that we ll only need to animate the cube for translating the arm and rotating the hand.
This setup is especially useful when you need to have the character s hands stay planted not only
positionally but also rotationally pushing against a wall while the body is moving, for example. But
we also want to make the wrist joint rotate only in X and the hand joint rotate only in Y and Z. That
way, we can make the wrist joint influence the forearm deformation, while restricting the hand joint
s influence to the wrist area for bending in Y and Z.
Select the cube and then the wrist joint, and select Constraints Orient. If the wrist joint rotates or
flips, go into its Attribute Editor, and adjust its Rotate Axis value for X (the other two don t matter)
under the Transform Attributes section to offset the rotation and get it back to the initial position. Go
into the dependency graph or the Connection Editor and disconnect the rotate Y and Z constraint
from the wrist joint. Apply an orientation constraint again to the hand joint; but this time, disconnect
the rotate X constraint from the hand joint. Check the Color Gallery on the CD to see how things
should look afterwards; the joints that appear in pink there are the arm, the elbow, the wrist, the
hand, and the fingers.
You can proceed to lock all the channels for the wrist and hand joints, except for wrist X rotation
and joint Y and Z rotations. Repeat the same steps for the right arm.
Foot Cubes Setting up the legs for animation isn t as involved as the arms. The problem with the
foot is that it has three pivotal spots: the ankle, the heel, and the ball of the foot. Trying to account
for these pivot points can get very complicated, and for the sake of efficiency you may not want to
bother. The simplest setup will only use one pivot point for the foot, generally the heel, and work
around the other two pivots. We ll try for two here.
First, create an ikRP handle from the leg joint to the ankle joint. Then create another handle from
the ankle joint to the ball joint, as shown next. Snap a cube to the ankle joint, and slide it straight
down to the ground level. The cube represents the heel. Press Insert, and snap the cube s pivot to
the ball of the foot. Group the ankle IK handle under the cube, and the ball of the foot IK handle
under the ankle IK handle. When you translate the cube, the whole leg moves, and when you rotate
the cube, the leg rotates around the ball of the foot.
When you want to rotate just the foot, rotate the ankle end effector as shown below. When you
want to rotate the leg around the ankle, use the ankle ikRP handle s Twist channel. Make the Z
rotation of the ball of the foot joint driven by the X rotation channel of the end effector at the ball of
the foot (also shown below). You should lock the translation channels for the IK handles and the Y
and Z rotations for the ball of the foot IK handle as well. Pivoting around the heel would have to be
simulated by rotating and translating the ankle IK handle.
Hierarchy Setup Group the cubes together and name the top node Child. This will be the node
you will use to translate the entire character, and its pivot should be placed somewhere around the
child s belly area. Group the root skeleton under this node as well, and the skeleton setup is
complete. If you want to, you can also set up set-driven keys for the finger Z rotations. The
geometry should be organized as the following: Under the Face node, you should have all the face
patches, hair, eyes, ears, and teeth (if you created them); and under the Body node, you should
have the head, hands, arms, torso, pants, legs, and feet. The Face hierarchy will be grouped under
the head joint, whereas the Body hierarchy will be skinned. Here you can see the finished skeleton,
with IKs added and constrained, and the Outliner shows the hierarchy you will be using for
animation.
Preserve Skin Groups and Correcting Errors Oops! We ve made a horrible mistake, as so
often happens in real life. We discover when we test the arms that they are too short, and that the
hand joints should be placed closer to the hand. But we ve already skinned the geometry to the
skeleton, and the skeleton has the cube constraints already in place. What do you do? Maya s
Preserve Skin Groups to the rescue.
Let s correct our terrifying mistake at once. Select the skeleton group and apply Skin Edit Rigid
Skin Preserve Skin Groups Detach Skeleton. Select the arm IK handles and in the Attribute
Editor disable the IK Solver. If you ve locked the translation attributes for the joints, you also need
to unlock them. You can now translate the elbow and the wrist joints to lengthen the arm. To place
the hand joint closer to the hand, use the Insert key to move only the hand joint, as shown below.
Move the wrist joint as well. Before you reactivate the IK Solver, you d also want to snap the cube
to the new wrist joint position. Select the CVs of the arm and the hand and lengthen the arm,
keeping the proportion of the CV positions. Make sure the fingers match the finger joint positions.
Select the skeleton group and apply Reattach Skeleton.
Maya may warn you that the bind position has changed for a number of joints. Detaching and
reattaching skinned objects may necessitate some reassignment of point membership. In our case,
because the wrist and hand joints have moved closer to the hand, we need to update the previous
set of membership of those joints and perhaps that of the thumb joint. Everything else should work
just as before.
This was an easy example of correcting a mistake in the setting up stage. In a production situation,
one of the most frustrating things is to discover too late that there s a problem with the character
you ve built. So right now would be a good time to check again what you have done so far for any
potential problems. Once you ve gone through weighting a character, you will not want to weight it
again.
Once you have roughly gone through reassigning the points, you can create flexors to the fingers,
wrist, elbow, and legs. It s a good idea to weight the points as you are creating the flexors. The
finger, for example, has three joints, the second and the third of which take flexors; but the first
joint, which connects the finger to the hand, is not an ideal flexor recipient. Apply the Artisan tool to
the first finger joint, as shown next (and in the Color Gallery on the CD). It s more difficult to
properly weight the palm than the back of the hand when the fingers curl. Fortunately, the palm is
usually not visible when that happens! You would want also to use Artisan or the Component Editor
to weight the forearm so it will twist smoothly. Also weight the shoulder area and the neck. For the
shoulder, you need to test the shoulder joints as well as the arms. For the neck, make sure the
head area is weighted at 100% so that it will stay with the face when the neck joint rotates.
The crotch area is another difficult area to weight. You need to lift the leg up to the front and to the
back to see how the pants stretch and fold, and also how it takes the ikRP handle twisting (shown
below and in the Color Gallery on the CD). The joints at the ankle and the ball of the foot are other
bending areas you should weight. As you go through these and other areas, it s crucial that you
move the joints to get the character into different poses. What seems to be deforming smoothly in
one pose may go berserk in another one.
Cleaning Up
Assuming that the model s been textured as well, which we ll get to soon enough (in Chapter 19),
there are little things you can do to aid you in animating efficiently. Have the Child hierarchy set up
in a Hypergraph window you can access while animating. Use layers to convert the geometry into
reference objects now that you don t need to select them. You can hide the geometry if you d like
and work only with the skeleton. Display selection handles for the root joint and the cubes so you
can pick them in the window. The selection handles can easily be offset in the Attribute window.
You can also create eye constraints if you want (so you won t have to rotate the eyes), by using
Aim constraints. Delete anything that you no longer need, whether it s geometry, curves, history,
or empty nodes. Save the file as Child_ready.
Summary
In this chapter we ve covered rigid skinning and smooth skinning, using the puppy as an example
of the latter. We learned how to edit point set membership and weight the points. The chapter also
went through an advanced-level character setup, during which we tried to create a
production-quality character and ready him for animation, covering a lot of important topics along
the way. And that s it. No more tweaking CVs, applying IKs, or constraining. We are now ready to
animate the child, and that is what we will do in the next chapter.
When creating a walk cycle, you should be aware that there are two different types. The first type is
a stationary walk where the ground seems to be moving under the character; this is the simplest
kind of walk cycle. The second type is a more realistic walk in that the character actually moves
forward. This second type is a bit more complex than a stationary walk but involves the same
principles. We will be doing the simpler stationary walk. (You can see an example in the Color
Gallery on the accompanying CD.)
Animation is a very iterative procedure. You can try to animate everything at once, right from the
beginning, and some people do work like this. But usually you end up working at a much slower
pace, and then you can easily lose sight of the forest for the trees lose your perspective on how
the character is animating overall because you are bogged down on translating and rotating so
many control nodes.
It s much better to key in rough poses one or two nodes at a time, working on different parts of the
character in stages, much like painting or sculpting. For the walk cycle, the workflow will be as
follows. Animate the left leg first; then transfer and offset the animation to the right leg. Then
animate the root and the spine joints, including the head. Animate the arms last. Once the rough
animation is done, you can tweak and refine the function curves and change subtle details of the
walk to give it more personality. At every stage, you would want to do simple playblasts to see how
the keyframes move in real time.
To begin animating the left leg, set the animation speed to 30 fps (frames per second) by going into
Options General Preferences Units, and changing Time to NTSC (30 fps). We ll do a fairly
brisk walk and make the cycle 24 frames. This is an easy number to deal with, as it gives us 12
frame halves and 6 frame quarters. In the modeling window, translate the LfootCube (left foot cube)
in X to 1.5, and animate the LfootCube and the Lball_ikHandle (which rotates the toe area of the
foot) together. Start out with an extreme pose, where the legs are widest apart at frame 1. The heel
is just touching the ground, and the toes are curled as in the figure below. Copy the keyframe at
frame 25 by MM dragging the current time indicator. Go to frame 13, and translate and rotate the
cube and the toes to the back.
At frame 16, the foot is actually farther back than at frame 13 because it takes time for the ball of
the foot to press down to the ground and kick up. But it covers more distance between frame 16
and frame 20 as a result. This kind of delay and recovery in the foot s motion creates the
appearance of weight. It also makes the movement snappy. If there was no keyframe 16, and you
keyframed only 13 and 20, it wouldn t make a lot of difference, but that subtle extra kick would
be missing. Try playblasting both, and see if you can notice the difference. If you were to ignore
keyframe 20 as well, the leg might appear to be floating more than walking, a common mistake a
lot of beginners make. Floating usually happens when a keyframe is missing from where it should
be and the computer automatically calculates the in-betweens.
It s important to achieve realistic motion here. When a client or audience criticizes an animation,
lack of weight or snap is a common complaint; and the reaction that a character just floats is
usually the death knell for the animation.
The next step in the walk cycle is animating the hips and the upper body of the child. The pelvic
area, or the root joint, must be animated first, and then the upper body, because the upper body
rotation values are dependent on the pelvic movements.
Tip Walking is often referred to as a continuous falling. When you walk, your body is pushed
by the leg in the back position, and then the body leans and falls forward. If it weren t for
the back leg speeding ahead of the body to break the fall, your body would actually fall to
the ground.
For the up-and-down movement, there are a couple of things you need to keep in mind. First,
contrary to what you might think, frame 1 is not when the body is the lowest; that occurs around
frames 3 or 4. At frame 1, the front foot touches the ground, preventing the body s fall, but the
weight of the body still makes it sink before it can spring back up. The heavier the body, the longer
this recoiling will take. Then, around frames 7 or 8, the body reaches its highest position. If the
recoiling process takes longer, the steps become a heavy, serious walk. If the body hangs in its
highest position a bit longer, then the steps become a light, bouncy walk. Try both styles, and
playblast to see the difference.
The Graph Editor here shows the root joint s Translate Y function curves for different walks. Just
by looking at these curves, you should be able to tell that the first one is a fairly bouncy walk, the
second is an extremely bouncy walk, and the third is a heavy walk. Notice how fast the body goes
up in the extremely bouncy walk and how slowly the body goes up in the heavy walk.
One of the corollaries of a character (or anything) having weight is a principle called squash
and stretch. In classical animation, this is considered one of the cardinal principles. In our
preceding example of the body sinking to its lowest recoil position around frames 3 or 4, the
character is being squashed by the force of gravity and the resistance of the ground.
When it bounces up, the body stretches to its highest point. What is a subtle movement in
real life often becomes greatly exaggerated in animation. Especially in cartoonish animation,
squash and stretch in characters can become extreme.
In order to use the squash-and-stretch principle properly, you have to always apply it as a
consequence of weight. Weight is force times mass (remember high school physics?), so
something that has more mass will squash more; it will also squash more if more force is
applied. This principle, however, needs to be balanced with another factor called rigidity.
In real life, rigid bodies such as tables or chairs do not squash or stretch at all, or so little as
to not be noticeable. In animation, especially in cartoonish animation, this physical reality is
often overlooked, and you will see objects such as an anvil or a boulder being squashed and
stretched as if they were made of rubber. But the fact is that the more rigid a thing is
supposed to be, the less it should squash and stretch. Carelessly applying squash and
stretch to what is supposed to be a rigid object (or character) can undermine its believability.
A steel hammer, for example, even if it walks and talks, should stay mostly rigid if we are to
believe that it is made up of steel, that it is a hard object. If it squashes and stretches like
some soft, rubbery substance, then its characteristics as a hammer are undermined.
When applying squash and stretch, another factor to keep in mind is consistency of volume.
When a water-filled balloon is put on a hard surface, for instance, gravity causes the mass of
the water to exert pressure on the rubber, meaning, of course, that the balloon squashes. But
as it flattens, it also stretches out sideways because the volume of the water hasn t
changed. Even cartoon characters need to have a sense of volume, and once a character s
form becomes easily recognizable, that sense of volume must be maintained.
The face should always be facing forward as shown in the preceding graphic, which means that the
neck bone should be rotated to counter the Roll and Twist of the Spline handle. Note the neck joint
s Rotate X curve in the preceding graphic. You could change this later to add more personality to
your character.
Arm movement follows the shoulder specifically the shoulder rotation transferring the translation
motion like a wave starting from the shoulder and moving down to the fingers. First, you need to
lower the shoulder joints about 10 degrees in Z. Because the shoulder-bind position is for
outstretched arms, when they come down so should the shoulders. (Don t worry about the fingers
for now.) Move and roughly rotate the LhandCube, as shown next.
The cube follows the shoulder rotation about four frames behind; it reaches its extreme position at
frame 4. This is called follow-through or overlapping action in classical animation. Loose limbs such
as the arms do not stop when the object they are attached to comes to a stop but rather continue to
move for a few more frames, perhaps dangling a bit, before stopping. So when the shoulder
rotation changes direction, the arms follow through and alter their movements a few frames later.
This is also called overlapping action because the change in the direction of the shoulders overlaps
with the change in direction of the arms. The following curves illustrate this animation principle (you
ll find a better view in the Color Gallery on the CD):
Once you are satisfied with the way the arms are moving back and forth, rotate the hand to make it
follow through the arm movement about three frames behind. It may help to get rid of the rough
rotations you had keyframed and start over from frame 7. The hand rotation in real life is usually
nonexistent or very subtle. In animation, however, you may want to exaggerate the rotation to make
it more noticeable. Examine the following poses and the overlapping curves (you ll also find this in
the Color Gallery on the CD).
You may choose to animate the fingers as well, making them overlap the hand rotation by just a
frame or two, but you ll probably want to just curl up the fingers a bit and keep them that way.
Fingers generally do not move when you walk. Now we can transfer the animation we created on
the left arm to the right arm by using the copy and paste functions in the Edit Keys submenu.
Copy the animation from LhandCube to RhandCube with an offset of 12 frames, change the X
translation to its negative value, and cycle both cubes. The hands will now sway correctly, but the
rotation values of the right hand are wrong. To correct this, keep the same X rotation values but
mirror (scale to 1) the Y and Z rotations. Go to the Graph Editor, and select the Rotate Y and
Rotate Z curves. Select Edit Scale , set the Value Scale to 1, and click Scale Keys. Now the
hands should rotate correctly. Save this file as Walk_regular.
A sad or dejected walk is usually much slower, so RM choose Select All, select Edit Keys
Scale Keys , set Time Scale to 2, and click Scale Keys. Now the walk is half the original speed.
You will want to adjust some keyframes for the feet so they won t seem to be moving in slow
motion. All the rotations are scaled down the hip rotations, the shoulder rotations, and the arm
rotations. The arms should generally be drooping at the front, and the spine should be hunching
forward, head downcast. The bounce should disappear, and when the back leg is coming forward,
the knee shouldn t go up as high. (The happy and sad walks are illustrated on the next page.)
Start out with the front foot just touching the ground, as frame 1 of the next image shows. The child
here is in full pose, but if you are going through this yourself, remember the rule about working on
one or two control nodes at a time; you should concentrate on the feet and the hips first and then
move on to the rest of the upper body. The foot translation and rotation as well as the hip rotation
generally have to be worked out together because the hip rotates more in a run, and it s hard to
accurately extend the leg when the hip hasn t been properly rotated first. The arms are kept more
bent, and the body generally rotates and leans forward more. At frame 1, the body is coming down
for recoil (squash and stretch), but it s more efficient if we move on to frame 7 for the opposite
pose first and then come back to deal with the recoil. Go to frame 7, select the hand cubes and the
root joint, and then move them forward. The left leg should translate forward by a significant
amount ahead of the left foot cube, as in frame 7 of the next image.
Click to expand
Translate and rotate the foot cubes and the root joint until you have the same pose as in frame 1,
except with the opposite leg, as shown in frame 7 below (and in the Color Gallery on the CD). You
don t need to punch in exactly the same values for the cubes in frame 7 as for their counterparts in
frame 1 because later on you will edit the function curves anyway, but also because you should get
into the habit of trusting your eyes as well. You then need to select the root joint and open the
Graph Editor. Select the Translate Z curve, and apply Cycle With Offset. We now have a fixed rate
of distance being covered by the run. Go to frame 13 and the body should automatically move
forward. Make the child get into the original pose he was in at frame 1 and keyframe the pose.
Select the root joint again, and in the Graph Editor, select and cycle all the curves except the
Translate Z curve (which is cycling with offset). If you see that some of the curves are not cycling
properly, move the keyframes to make them cycle smoothly. You should see curves like the ones
below. Repeat this cycling procedure for the other control nodes as well.
Go back to frame 3, where the body is at the lowest position and is being squashed. For a regular
run, the front foot will be flat, as seen in Frame 3 of the next picture; for a sprint, the weight of the
body should be on the ball of the foot. Frame 5 shows the stretch; the body is lunging forward and
is at its highest point, with back arched, the back leg stretched, and the front knee raised and bent.
You also should raise the shoulders a bit at this point.
Repeat the squash and stretch for frames 9 and 11. When you are done with the footsteps and the
arms, cycle all the joints except the Z translation. The Translate Z function curves are cycled with
offset. Afterwards, select the LfootCube and the root joint, and look at their Translate Z function
curves. If you see them branching out like those in the top two lines in the next picture, it means the
Lfoot Cube translate node should be modified. The correct cycle should keep the Z translation
values between them roughly parallel, like those in the lower two lines in the picture. Do the same
for the hand cubes as well.
Arcing is another important classical animation principle; in order to imitate life, you need to
show motion as arcs, or waves. Nothing in this world moves in a totally straight line. Nature is
comprised of arcs and waves, including all motion that occurs within it, as Tai Chi
practitioners like to point out. We are told that even something as apparently straight as a ray
of light is not perfectly straight. A run cycle, such as the one we just covered, is all wave
motions, as you can readily see in the Graph Editor.
But it s one thing to create wavy function curves and quite another to show them as wavy
motions. Consider the often-used example of head-turning. Although the motion itself is an
arc, depending on the angle from which you are looking at the head, the head-turning can
appear as a straight-line motion. In order to show it as an arc movement, you need to either
change the view or dip the head as it turns and then bring it back up. When you have roughly
animated your character, get into the habit of going to the camera view and checking the
lines the character s motions are creating. If you see a lot of straight lines even though the
motions themselves are arcs, perhaps the camera view needs to be changed.
This brings up yet another important animation principle called staging. No matter how great
the action in a scene is, it has to be seen clearly in the first place. Staging a character
involves making sure the character s actions are being accurately transmitted to the
viewers. The run steps above, for instance, were shown in the side view because it best
staged the motions of the body. If the same steps were captured in the front view, you would
have a much harder time grasping what is going on. Classical animators will often only look
at the silhouette of a character to determine whether the character s actions are being
staged properly.
Staging also involves making sure that only one principal action is being presented at one
time. If you want to show a character getting up from a chair and also flashing a smile, it
would be poor staging to have her do both at the same time; it would be much better to have
her stand up first and then flash a smile, or vice versa.
Performing a Somersault
The way the hierarchy has been set up for the child model s joints, IK handles, and control cubes,
you should only use the Child node for translating the whole character, the root joint for the body,
and the four cubes for arms and legs. But there are situations where you may want to change the
hierarchy of the set-up to fit your animation purpose. Let s say you want a character to somersault
over a table. If you rotate the top hierarchy node, the legs rotate with the body, which is what you
want, but the arms rotate with the body as well, which is not what you want. You want the hands to
stay fixed on the table while the body is somersaulting. You can do this by restructuring the
hierarchy.
Remove the hand cubes from the Child node by dragging them in the Outliner or Hypergraph. (You
could also create another group node to include all the other nodes under Child, but, for our
purposes, taking out the hand cubes is simpler.) Place the hand cubes on the table (cube), as
illustrated below. Move and rotate the Child node to move both the body and the foot cubes, and
rotate the root joint to bend the body. When the arms are going over the shoulders as in this case,
you need to rotate the shoulder joints up and forward. Also, use the IK handle s Twist attribute to
prevent the arms from twisting, and rotate the cubes so the hand will be ready to hit the table with
palms down.
It s always a tricky business to have a character s arms do things over their head, especially if
you have to keep their hands planted in a fixed position, because the joints tend to twist and cause
unnatural deformations in the shoulder area. It s important, therefore, to rotate the shoulders and
the IK handle s Twist attributes properly at the right moments. The elbows should be pointing
outward during the somersault as well.
Placing the hands on the table and making them stay there would be a difficult endeavor if they
weren t orient-constrained to the cubes. When the wrists get rotated as extremely as in our case, it
s easy for the hands to flip. Adjusting the IK handle s Twist values usually gets rid of the
problem. If you find that the hands are still flipping even after you ve adjusted the IK handle s
Twist value, try placing the palms in such a way that the fingers are pointing inward.
When the child hits the table, there is a squash (see below), a bending of his arms for recoil, and
then a push-off (stretch) about four frames later. His forward momentum (Z translation in this case)
shouldn t be slowed down if you can help it. Because the foot cubes are under the Child node,
when you move and rotate the Child node, the feet move and rotate with it. You should animate the
Child node first to get a rough sense of the somersault, and then you can animate the feet
separately for folding and stretching. You should also rotate the root joint and the IK Spline clusters
to make the child bend his waist and arch his back. You can find a complete version of this
animation on the accompanying CD.
Create a ball (sphere) scaled to 1.5 uniformly, and group it unto itself, creating a parent node. Apply
Modify Center Pivot to make sure the parent node s pivot point coincides with the ball s. Place
the child s hand on a table (cube), as demonstrated below. Create a locator, scaled to 3 uniformly,
group it under the RhandCube, and place it somewhere near the hand (see the left picture below).
Position and Orient-constrain the ball s parent node to the locator, and the ball should snap to the
locator positionally and orientationally, as in the middle picture below. Move the locator closer to
the hand, and rotate the fingers to make it look as if the hand is holding the ball. Keyframe the
finger joints and the cube at frame 15, as in the right picture below. This is how the hand will be
seen as grabbing the ball.
Select the ball s parent node and you will see pointConstraint and orientConstraint attributes in the
Channel box. Select the Node State, where it should say Normal for each attribute, and keyframe
them at frame 15. In the Graph Editor, you can see that a value of 0 is created. Go to frame 14, in
the Channel box click in the Node State field to open the submenu, and select Block; keyframe that
for both attributes. You should then see a value of 2 created in the Graph Editor. (Note that the
curve created is a stepped curve.) Try moving the cube and you will see at frame 14 that the ball is
not constrained to the locator. Keyframe the ball where it is (at frame 15) just to make sure the ball
will be at that spot when the hand grabs it. Now you can animate the cube and the finger joints,
starting from a distance at frame 1 and then swooping in to scoop the ball at frame 15, as shown
next. (You can find a complete version of this animation on the accompanying CD.)
Throwing a ball is essentially the same thing as grabbing a ball except that you are working
backward. Start out at frame 25 with the ball constrained to the hand. Swing the child s arm as if
he were throwing the ball, and reach the point of release at frame 30. This means he should be
flicking his wrist between frames 30 and 32. Finish the throw at frame 35. Once you are satisfied
with the throwing motion, go back to frame 30 and keyframe the ball where it is. Go to frame 31,
select the ball s parent node, and, in the Channel box, change the Node State setting to Block for
the Position and Orient constraints. Then, at frame 35, translate the ball to the direction where the
ball has been thrown, and keyframe. Now, when you move the time slider, the ball seems to be
thrown from the hand at frame 31 and then shoots out from there, as shown below. (You can find a
complete version of this animation on the accompanying CD.)
Summary
In this chapter on animation, we went through a simple walk cycle step-by-step, and then we
examined a few advanced-level animations such as running, somersaulting, and grabbling and
throwing a ball. We also discussed a few of the more important animation principles. In the next
and later chapters, we ll be switching gears in a major way. So relax and take a break; we ll soon
be getting physical.
Before you begin this chapter, you should be familiar with Maya s basic interface (Chapter 2) and
how to create and move objects around the scene (Chapters 1 4).
Fortunately, Maya has the answer for you: rigid body dynamics, or simply rigid bodies. Using rigid
bodies is pretty straightforward: you create one or more rigid bodies; create one or more fields that
influence it, such as gravity (if you wish); give the rigid bodies an initial position, velocity, and
impulse (if you wish); and play back the animation. Maya s dynamics engine does all the
calculations to make the body behave realistically, based on your initial information; you don t
need a degree in physics, just a bit of practice with the settings you have available.
Note Maya also uses its dynamics engine to create particle effects. See Chapters 21
through 24 to find out how Maya works with particle dynamics.
Rigid bodies come in two flavors: passive and active. Passive rigid bodies are not affected by
fields, and cannot be moved by collisions though they can take part in collisions. Passive rigid
bodies are keyframable (so you can move them around). Active rigid bodies are affected by fields,
and will be moved by collisions. They are not keyframable (so you can t move them around on
your own).
Generally, a passive rigid body would make up a floor, wall, or other object that is fixed to the
world, while an active rigid body would be any kind of falling, moving, or colliding object (a
basketball or a coin, for example). Although it would seem a great disadvantage that active rigid
bodies cannot be keyframed, you can convert rigid bodies from passive to active at any time in an
animation, allowing a rigid body to be passive for a time, and then to become active (we ll get to
an example of this in a moment).
Let s begin with a simple example to see how rigid bodies work.
Rigid bodies are not significantly different (to the user, at least) in version 2 than they were in
version 1 with one exception: A new Rigid Solver menu allows you to create multiple rigid
body solvers, assigning different rigid bodies to different solvers. Assigning different
(non-interacting) objects to different solvers allows Maya to solve rigid body equations more
quickly and efficiently than it could in version 1.
Start by creating a new scene in Maya. Create a NURBS plane and scale it out to about the size of
the Maya grid. Now make a NURBS sphere with a radius of 1 and move it above the plane.
Now select the plane and choose Bodies Create Passive Rigid Body from the Dynamics menu.
The plane is now a passive rigid body.
Next, select the sphere, and choose Bodies Create Active Rigid Body from the Dynamics menu.
The sphere is now an active rigid body.
To allow dynamics simulations to play back properly, the playback rate has to be set to Free, so
that the physics engine can calculate what it needs to before going on to the next frame. Either
select Options General Preferences and choose the Animation tab, or click the Animation
Preferences button at the lower right of the screen to bring up the same window.
In the Animation Preferences window, choose Playback Speed: Free from the Playback area.
Warning You must rewind any animation that contains dynamics otherwise, the animation
will not play back properly! You also cannot scrub through an animation by
sliding the time marker back and forth. All dynamics data is calculated frame by
frame, so if any frame is skipped, the calculations break down and the animation
goes berserk. If this happens, just rewind the animation and start over all will be
well again.
Tip To rewind, either click the Back button on the playback controller (located in the
lower-right corner of the screen; it looks like a VCR control) or press Ctrl+Shift+V on the
keyboard. To play the animation, either click the Play button on the playback controller or
press Ctrl+V on the keyboard.
Nothing very interesting happened, right? Even though you have made two rigid bodies, you have
not created any animation yet because you have not added any fields or initial motion. Let s create
a gravity field to make things a bit more interesting.
From the Dynamics menu, choose Fields Create Gravity. Now open the Dynamic Relationships
window (Window Animation Editors Dynamic Relationships), choose the nurbsSphere name in
the Outliner on the left side of the window, and make sure gravityField1 is highlighted in the
selection window on the right if not, be sure to click gravityField1 to highlight it.
Tip If you select the sphere before creating gravity, the two will automatically be connected.
(If there are other active rigid bodies that you haven t selected, they will be unaffected by
this force.)
Now rewind and play back the animation. You should see the ball fall toward the plane and bounce
off it. If the animation is cut off too quickly to see this, increase the number of frames in the
animation to 200 frames or more (type 200 in the text field under the time slider).
Now let s examine the rigid body settings for our objects. In the Channel box, you ll see
rigidBody1 (or 2, or whatever) listed under the shape node for the object you pick. For now, pick the
plane and then click the rigidBody1 text.
Several text fields will pop up, giving you more control over the rigid body than you probably want.
For now, just look down to these items: mass, bounciness, damping, static friction, and dynamic
friction. Change the bounciness to 0.9 and replay the animation (remember to rewind first!). On the
first bounce, the ball should bounce nearly as high as the height from which it was dropped, and it
should take longer to settle to rest as the animation plays on. Now try setting the bounciness to 1.5.
What happens? The ball bounces further up each time, soon disappearing from view talk about a
super ball! In our virtual world, not only do we get to simulate reality, we get to break the rules if we
want.
Try playing with some other settings, like friction and damping and remember to play with the
settings for both the ball and the plane. You can also play with the mass settings, but a passive
rigid body is defined to have an infinite mass (so the setting won t matter). Changing the mass of
the ball won t make much difference at this point because gravity is a universal force, affecting all
objects in the same way. Later, we ll see where mass can be used more effectively.
Note Playing with the numbers is a great way to learn how rigid bodies work. Don t be
afraid to try different settings for each of the channels of each rigid body try to guess
what your changes will do before playing back the animation.
Now move the insert point of the cylinder all the way to its right.
Tip To move the insert point, select the Move tool, press the Insert key on your keyboard
(which will change the Move tool s handle from one with arrows to one without), and
move the new handle around. Don t forget to press the Insert key again when you re
done, or you ll stay in insert mode!
Once you have this set up correctly, add a sphere of radius 1 and place it on top of the left end of
the cylinder:
Now select the plane and the sphere, and make them passive rigid bodies. In the Hypergraph or
Outliner, MM drag the sphere onto the cylinder, making the sphere the child of the cylinder (so
they will rotate together). Now set a keyframe at your first frame on the cylinder s rotation
channels (select the rotation channel names and RM select Key Selected), move the time slider to
about 15 frames, rotate the cylinder so it is close to upright, and keyframe this new setting.
Tip Setting the auto keyframe button to On will make Maya automatically set a new keyframe
whenever some channel changes after you manually set the first keyframe for that
channel.
Play back the animation. You should see the cylinder (and its attendant ball) rotate up in a few
frames, then stay still.
Now let s shove this ball out of the nest and let it fly! Select the sphere and, in the Channel box,
find the Active channel (or attribute), located toward the bottom of the rigid body attributes. It should
currently have a value of Off. Select the name of the channel (Active), set the time slider to around
12 frames, and RM select Key Selected while pressing on the Active name. This will set a key (with
a value of off, or false, or 0) on the Active channel. Now move forward one or two frames, click in
the text next to the Active name, and type On in the Channel box. If the Autokey function is on, you
ll automatically generate a keyframe; otherwise select and manually keyframe this channel.
What you have done here is forced the sphere to become an active rigid body just as the sphere is
being pitched up in the air by the cylinder. This timing allows us to take advantage of some clever
programming by the Maya developers; the sphere will inherit speed and rotation from the
movement of the cylinder, meaning it will fly away from the cylinder the moment it becomes an
active rigid body.
To test this, rewind and play back the animation. The sphere should go flying off to infinity. Of
course, to finish this simulation correctly, we need to add gravity once again. Select the sphere and
then choose Fields Create Gravity (it should automatically connect to the sphere). Now play back
the animation. The ball should (depending on how fast your cylinder rotates) either shoot or plop
off the cylinder. If the ball flies off the catapult too slowly, try rotating the cylinder further at its last
keyframe, or shorten the number of frames over which it rotates up. If the ball flies off too quickly,
rotate the cylinder less at the last keyframe, or lengthen the number of frames over which it rotates
up.
We ve already played with the numbers on the rigid bodies in the last example. This time, let s
play with gravity itself. (Be careful that you don t get motion sick!) In the Outliner or Hypergraph,
select the gravity node you just created. In the Channel box, you ll see several settings for gravity,
including Direction and Magnitude. Direction defaults to 1 in Y, or down, as gravity in the real
world pulls down a negative value on the Y, or vertical axis. Magnitude defaults to 9.8 (that s 9.8
meters or 32 feet per second squared, the force of earth s gravity). Let s make things a bit
heavier. Try setting gravity to, say, 200 or so. Now, when the ball comes off the cylinder, it should
drop like a very heavy stone. Or try a value of 2 now we re on the moon!
Although the geometry in this scene is simple, the results are not: This same trick could be used as
a character throws a ball at a can or bottle, creating a very nice mix of keyframed character
animation and realistic physics.
First, let s add some wind. Select the sphere, then select Fields Create Air . The Options
(Create) window opens, giving you several ways to adjust the air field.
You ll see three buttons at the top (Wind, Wake, and Fan) that are simply preset options you can
use to create the effect of wind, wake (like leaves moving in the wake of a car), or a fan. You can
click all three buttons to see what settings are changed with each one, but in the end, click the
Wind button, and then the Create button, and close the window. A new field, called airField1, will
appear in your Outliner or Hypergraph.
Now play back the animation again. You should see the sphere get shoved right off the end of the
plane (as the wind, by default, pushes in the positive X direction). Try changing the X component of
the wind to 0 and the Y component to 1. Now the ball should fall more gently (like a beach ball).
Next, increase the magnitude from 5 to a large number like 200. The ball will now blow up into
the air, as the wind force is stronger than gravity. Set wind back down to a reasonable number like
5 or 10.
Note As another experiment with fields, try turning the wind on and off by keyframing its
magnitude.
Now let s add turbulence. Select the sphere and choose Fields Create Turbulence. Play back
the animation. With the default magnitude of 5, the effects on the motion of the sphere will be very
subtle. If you set the turbulence field s magnitude to 50, you will see the sphere move about in
random ways as the turbulence field affects its motion. Try different numbers for the channels of
the turbulence field and see what results from making these changes.
Note You can also add fields to objects using the Fields Add Item menu options. All fields
will travel with their parent object, and can therefore be used to create a wake or
turbulence as the parent object passes rigid bodies or particles.
Tip With rigid bodies, fields, and particle dynamics, it is a very good idea to take a simple
animation and experiment with what each channel does by changing the numbers and
watching the results in the animation. It is only by this kind of experience that you can see
how Maya s physics engine really works.
We ve seen how different fields can change a rather humdrum animation into something more
interesting. Now let s make the simulation engine work a bit harder by creating more complex
shapes.
Let s look at the solver in action. Create another empty scene, add a plane and a sphere (at some
height above the plane), and make the plane a passive rigid body and the sphere an active one.
Add gravity and test the animation to be sure the ball bounces on the plane as it should.
Now let s make the shape a bit more complex. First, increase the U and V isoparms to 16 or more
each (on the makeNurbsSphere1 node). Then take the sphere and mold it into some bizarre,
angular shape something like this:
You can create this shape quite easily using Maya s Artisan utility (Edit Surfaces Sculpt
Surfaces Tool ). If you are unfamiliar with Artisan, see Chapter 9, or just pull individual CVs out of
the sphere.
When you play back the animation this time, Maya will probably go just a bit slower this time, it
has to keep track of a lot more surfaces! If you play back the frames one at a time (and look under
the plane), you ll probably also be able to see a few points when some of the sphere s surfaces
poke through the plane.
At full-speed playback, you probably won t notice these errors, but there are times when you might
wish to correct these problems or perhaps speed up playback for a particularly complex
simulation. In these situations, you can use the Rigid Body Solver menu to adjust how Maya
calculates its rigid body simulations. Essentially, the Rigid Body Solver gives you some control over
the way Maya s dynamics engine handles the mathematics involved in the movement and
interaction of rigid bodies. As you ve just seen, complex shapes interact in complex ways, and
adjusting calculation options via the solver is useful when the result of using Maya s default
settings isn t accurate enough or fast enough to look realistic.
You can get access to the Rigid Body Solver in one of two ways: either choose Solvers Rigid
Body Solvers, or select a rigid body and open the Attribute Editor (Ctrl+A) and select the Rigid
Solver tab in the Attribute Editor window. Either way, you get a window that allows you to adjust the
solver to meet your needs.
Notice the Rigid Solver States section of the window. Here you can turn most major functions on
and off. For example, turn on the Display Velocity check box, and play back the animation. You will
see an arrow that points in the direction of the sphere s velocity, with a length that represents the
speed of the sphere. If you turn off the State check box, the animation will do nothing, because
turning off this check box turns off the solver (this is a good way to quickly eliminate dynamics so
you can concentrate on other elements of an animation). If you turn off the Dynamics check box,
the sphere will fall, but it will no longer bounce, as dynamic interactions no longer work. Try turning
off each of the check boxes in turn and see what effect this has on playback. When you re
finished, reset the check boxes to their default state.
You ll also see a section of the window called Rigid Solver Methods. There are three choices here,
though normally you would use the default method, Runge Kutta Adaptive. If you have a very
complex simulation, however, and either wish to view it more quickly in interactive playback or don
t care about the accuracy of the simulation for your final rendering, you can (temporarily) set the
method to either Runge Kutta or to Midpoint. Midpoint is the least accurate but fastest. Runge Kutta
is a compromise between the two extremes. For your dented ball, you probably won t see much
difference between the three methods.
Note The Runge Kutta and Runge Kutta Adaptive options are named for the Runge Kutta
solution, a mathematical method of solving an interlocking system of differential
equations using first-order derivatives. In Maya, time is broken down into discrete
steps (referenced through the Step Size field), and the integral of the equations is
approximated at each step. Though the technique is mathematically complex, it is fast
and accurate enough for most applications. (If you are interested in the subject, a
number of books and articles are available on the Runge Kutta solution methods.)
The top and most useful section is called the Rigid Solver Attributes section. Using Step Size,
Collision Tolerance, and Scale Velocity, you can alter the way in which the solver simulates rigid
body dynamics. Let s look at each option:
Scale Velocity is useful only if you have checked the Display Velocity check box in the section
below the Scale Velocity slider lets you scale the arrow that sticks out from the rigid body,
making it fit within your window.
Step Size defines the chunk of time (measured in fractions of a second) the solver divides
the timeline into. A smaller step size means more calculations per second of animation, but it
can also mean a more accurate simulation. If you have troubles with rigid body interpenetration
errors (meaning that two bodies have pierced each other, as in our example), reducing the
step size is a good place to start.
Collision Tolerance tells Maya how carefully to evaluate frames where collisions take place. A
large collision tolerance will speed up playback but can become very inaccurate.
Try making the collision tolerance 0.8 and playing back your animation. You will notice that the
sphere doesn t bounce correctly on the plane. Now set the tolerance to 0.001 (the smallest
possible value). If you saw frames at which the sphere s points stuck through the plane before,
they should no longer appear.
Experiment with different step sizes and collision tolerances, and see how the changes affect the
simulation. Often you can get away with making either the step size or collision tolerance very
large, as long as you keep the other element small. Finding a compromise between speed and
accuracy for a complex simulation is often the key to using rigid body dynamics effectively.
Let s see how this works by making some changes in the deformed sphere scene you created in
the previous section. (If you no longer have that scene, just create a ball and a plane, make the ball
an active rigid body and the plane a passive rigid body, and then create gravity. Play back the
animation to be sure the ball bounces off the plane.)
Now we re going to create a second Rigid Body Solver and assign the ball to it. Choose Solvers
Create Rigid Body Solver. This creates a new solver, which will be called rigidSolver1 (or 2 or 3,
depending on how many others you have created).
Set the new solver as the default (so that all new objects will be assigned to this solver): Solvers
Current Rigid Solver SolverX, where SolverX is the solver you wish to establish as the default.
Since we have already created both of our rigid bodies using the same solver, we need to assign
one of the two bodies (the ball) to the new solver rigidSolver1. Unfortunately, there is no button to
do this, but you can do it with a quick bit of MEL (Maya Embedded Language) scripting.
In the scene window, select the sphere, then in the command line (accessed by pressing the ~ key
while you re in a scene window), type the following:
rigidBody edit solver rigidSolver1;
This command tells Maya to edit the rigid solver for whatever objects are selected in the scene.
Now play back the animation again. This time, the ball should pass right through the plane.
Although the plane and ball are both still affected by gravity, they no longer interact with each other,
as they live in different solver states.
If you wish to edit the settings of your new rigid solver, be sure it is selected (in Solvers Current
Rigid Solver), then select Solvers Rigid Body Solver. This will bring up the Attribute Editor with
the rigidSolver1 selected.
Finally, with rigidSolver1 selected, you can create a new plane (or other object), make it a passive
rigid body, and play back the animation. As both the ball and the new plane share the same solver,
they will collide properly.
First, create a sphere with a radius of 25 units and name it planet scale your view out so you can
see it clearly. Now, create a cone (named rocket) and scale it so it looks this size on the sphere:
It really doesn t matter how big the cone is, just so it looks good to you (I just left it at its default
settings).
Note Be sure you place the cone a little above the surface of the sphere, or you ll get rigid
body interpenetration errors, like those we saw earlier.
Now make the sphere a passive rigid body (Bodies Create Passive Rigid Body) and make the
cone an active rigid body (Bodies Create Active Rigid Body).
We could add a simple gravity field to these objects, but gravity pulls everything in the same
direction. What we need here is a field that s centered on our planet; we ll use the Newton field
(named after Sir Isaac). The Newton field creates a gravitational well in the planet that will
attract all other rigid bodies to it, its force depending on how far from the planet the object is.
Select the planet and choose Fields Add Newton. In your Outliner or Hypergraph you will now
see a Newton field parented to the planet. Choose the cone and open the Dynamic Relationships
Editor (Windows Animation Editors Dynamic Relationships). In this window, click on the
Newton field to highlight it this connects the cone to the Newton field.
Set the frame length to 1000 or more, and play back the animation. The rocket should fall and land
on the surface of the planet, bounce a bit, and stay there. If not, try turning the magnitude of the
Newton field down to 5 or 6 and see if that helps.
Now we ve got gravity; what we re missing is the thrust (or impulse) every rocket uses to escape
the bounds of gravity. With the rocket selected, click the rigidBody2 tab in the Channel box and set
the rocket s impulse Y to around 5. Play back the animation. Most likely, the rocket will go flipping
around out of control as it rises, just like those ill-fated rockets in the early V-2 tests. The reason is
that the impulse (or thrust) is coming from the bottom of the cone, so any slight error in thrust spins
the rocket. In reality, this is a serious and very difficult aspect of rocket science. But in our virtual
world, we have a quick fix: set the ImpulsePositionY to around 4 or 5, making the thrust come from
atop the cone, and thus making it much more stable in flight. When you now play back the
animation, assuming the rocket has enough thrust, it will smoothly rise and disappear from the
screen.
At present, our rocket has infinite fuel, so it just keeps going. To make a more realistic flight, let s
create a ballistic trajectory, allowing the rocket to rise for a time and then fall back to the planet.
To do this, keyframe the thrust (impulse) on and off. Select the Y impulse name, set the time slider
to the first frame, and RM select Key Selected. Now go out to about frame 15 and set the value of
impulseY to 0 (the impulse will fall off from 5 to 0 over those 15 frames). When you play back the
animation, the rocket should launch, rise, and then fall back to the planet.
Note Getting this sequence to work right will take a bit of tweaking the numbers. It is very
easy to get the rocket stuck on the ground, or flying off at an amazing speed. If you are
completely stuck, try opening the premade project (15orbit.ma) on the CD that
accompanies this book.
We ve now gone suborbital; it s time to get into orbit! To do that, we need to add an in-flight
correction, to make the rocket move sideways as well as up and down. Move the time indicator to
frame 10, and key the impulseX (at 0) on this frame. Now move to frame 11 and key the impulseX
to 2. Move the time to 39 and key impulseX back to 0 (again, you may need to change these
numbers around to get good results). If all worked well, when you play back the animation, you will
see the rocket orbit the planet (in a very scary-looking, squashed orbit, but an orbit nonetheless). If
you didn t give the rocket enough thrust, it will crash back into the planet in a pretty spectacular
manner.
In order to get our orbit a bit cleaner, we need to add yet another in-flight correction. At around
frame 90, set another key on impulseY (at 0). At about frame 95, set a key on impulseY to 1 (so it
pushes down on the rocket). At about frame 115, set another key on impulseY, this time back to 0
again. If these numbers work for you, you should see the rocket following a much cleaner orbital
path.
Note As an exercise, how close can you get the orbit to circular? Can you keep the rocket
from spinning around as it orbits the planet? With all the tweaking involved, you can
see why they re called rocket scientists !
Warning If you may eventually wish to return to your rigid body simulation, save a different
copy of your project before you bake the simulation. You can t go back once the
simulation has been baked!
Select the rocket and choose Edit Keys Bake Simulation. The simulation will run, and when it
s finished, you will have a baked animation (and a mess of keyframes in the time line!).
Let s put this baked animation to good use, getting rid of that nasty rotation around the Z axis that
the rocket developed. With the rocket still selected, open the Graph Editor (Window Animation
Editors Graph Editor). On the left side, highlight the rotateZ channel, and then press F on the
keyboard (to frame the selection). You ll see a curve with hundreds of keyframes on it a few more
than we need for our animation!
To get rid of the cone s Z rotation problems, we could first attempt to simplify the curve. Choose
Curves Simplify Curves from the Graph Editor s menu (or RM select this). Maya will remove
many keyframes it considers unimportant to the curve. Unfortunately, even if you run the Simplify
Curves command several times, the curve is still very heavy and we don t want any of that
motion, anyway! Let s just kill the whole curve.
Select the entire curve and press the Delete key, and away it goes. Now when you play back the
animation, the Z rotation is gone all of it. To get some form of rotation, you ll need to first delete
the rigid body from the rocket (so it doesn t interfere with your setting keyframes). In the Outliner
or Hypergraph, choose Display Show Shape Nodes to reveal the rigid body nodes. Select the
rigid body associated with the rocket and delete it. Now set a 0 keyframe on the Z rotation of the
rocket at about frame 15 (just where it begins to tip over). Go to the end of the animation and set a
keyframe of about 1080 for the Z rotation (this is about 3 revolutions, which matches how many
times the rocket goes around in my 1500 frame animation). To get the rotateZ curve to look right,
you ll have to adjust its shape in the Graph Editor. (See Chapter 10 for more information about the
Graph Editor.)
Note For a finished project, see 15orbitBaked.ma on the CD-ROM that accompanies this
book.
First, build a NURBS plane and stretch it to the size of the grid. Now build a second plane and
place it near the end of the first, at right angles to it.
Now add a cube of about default size, or a little smaller, and name it something like die1.
Tip A cube is actually six pieces, or faces, and it is easy to choose only one of these faces by
accident. A way to avoid choosing only a face is to be sure to name the cube itself (the
parent level) something that you can easily recognize (like die1, in this case).
Add a second cube and name it die2. You can add a checker 2D texture to the dice to make them
stand out better if you wish. (See Chapter 19 for information about basic texturing and other
rendering techniques.) When the dice are textured and placed at the front of the table, it should
look something like this:
Select both of the planes and choose Bodies Create Passive Rigid Body. Next (in the Outliner or
Hypergraph), choose the top level of each die (remember, this must be the top level, or you will get
very strange results!) and choose Bodies Create Active Rigid Bodies. Be sure both dice are still
selected (or select them again) and choose Fields Create Gravity.
When you play back the animation, you should see both dice fall and bounce off the table. If the
dice break apart, you have created the rigid bodies on the sub-faces of the cubes, not their top
levels, so you ll need to go back and try again. If you get stuck, try opening the file 15dice.ma on
the CD.
To make life a bit more interesting, we need to give the dice some initial motion. Select one of the
dice, click on the rigid body name in the Channel box, and set the initial velocity to, say, Z to 15 or
so. Repeat with the other die, but give this one a slightly different velocity. When you play back the
animation, both dice should travel down the table and bounce off the far wall (if they don t,
increase their velocities). You will notice, however, that they stay perfectly upright (that is, they don
t rotate), which is a bit odd looking. Give them an initial spin in X, Y, and Z, or anything you like,
and tweak the numbers until you get a nice-looking simulation. If the dice now bounce off the table,
you can either scale the plane bigger, or increase the plane s dynamic friction, which will make the
dice stick to it more.
Finally, add a positive X velocity (maybe 5) to the left die, and a negative X velocity to the right die,
making them collide in mid-air before hitting the table. You will probably need to adjust their
velocities in both X and Z to get them to collide. Because of the complexity of the collisions
between the spinning dice, you will notice a slowdown when the two collide, making it a bit difficult
to determine if the motion looks good. To get a better idea of how the scene really looks, you can
playblast it, and watch it play back in real time (to playblast a scene, select Window Playblast).
The Playblast tool will record the animation one frame at a time, and when it is finished, you will get
a window with the completed animation in it.
Tip A fully rendered version of the dice throw is available as a QuickTime movie
(15diceFinished.mov) on the CD that accompanies this book.
Create a new scene, add a cylinder (named Bar), rotate it 90 degrees in X, and then scale it large
on the Z axis.
Now create a torus (named EmbeddedLink) and stretch it into the shape of your basic chain link.
Rotate the torus into position below the bar.
Once the first link is in place, duplicate it, rename it Link1, rotate it 90 degrees around Y, and move
it into place. Do this three more times, until you get a link of chains that looks like this:
Warning Be sure there is a separation between each link (so they do not touch each other).
Otherwise, when you create the rigid bodies, you will get an interpenetration error,
and the simulation will break down.
Tip After you make your first duplicate, move it, and rotate it, you can then use the Smart
Transform option in the Duplicate options window to do the rest. Each duplicate will be
rotated and moved into position automatically.
Now select the bar and the first link, and choose Bodies Create Passive Rigid Body. Next,
choose all the other links and choose Bodies Create Active Rigid Body. With all the links still
selected, add gravity to the scene (Fields Create Gravity). When you play back the animation,
you should see all the links fall and then bounce off of one another, finally coming to rest after
about 200 frames.
This is a good first step toward our chain link, but there are a couple of problems. First, the chains
aren t in a resting position at the start of the animation, and second, they bounce all over the
place when playback starts. Let s deal with problem two first.
Our chains really don t need to bounce very much (it s just slowing the simulation down), so we
could either turn all the bounciness attributes down to 0, or take care of the whole thing in one fell
swoop by turning off the bounce state attribute. Choose Solvers Rigid Body Solvers, and in the
attribute window, uncheck the Bounciness check box. This globally turns off all bounciness
calculations, and makes the remaining calculations run more quickly and smoothly. With the
bounciness calculations off, the links should just drop nicely into position when you play back the
animation, coming to rest by frame 20 or so.
To finish our swing, we re going to add a weight to the bottom of the chain links. Create a sphere
with a radius of about 3 (named weightBall), and position it just below the bottom link in the chain
(remember not to allow the sphere to touch the link!). Looks a bit medieval, huh? First select the
bottom link, and then Shift-select the sphere. Now choose Bodies Create Constraint . This
brings up a window that allows you to create a constraint between the two selected objects.
Choose the Pin type of constraint, and leave the other settings at their defaults. When you click
Create, below, the sphere will be made into a rigid body, and a pin-type constraint will be added
between it and the last link in the chain (as if the two were pinned together).
With the sphere selected, go to Window Animation Editors Dynamic Relationships, and
highlight the gravity field (connecting it to the sphere). When you playback the animation, all the
links plus the sphere should drop down (as before).
Now let s deal with the first problem noted above: getting our links and ball into a resting position
at the start of the animation so they will not fall into place to start every animation. Play the
animation forward until the chain comes to a complete rest. Stop the playback, but don t rewind
the animation. Choose Solvers Initial State Set For All Dynamics. This programs the current
state of all dynamic objects into Maya as the initial state. When you rewind the animation now, it
should remain in its current, rest position.
Great! We now have a completely lifeless simulation that does absolutely nothing! Let s make
things a bit livelier. First, try adding an initial X velocity of around 10 to the weight. When you play
back the animation, the ball (and the chain, following it) should swing out to the left, then pendulum
back to the right, slowly settling back to stillness. You can try adding velocity in other directions,
and even a rotation to the ball. When you have experimented a bit, reset all the initial velocities
back to 0.
Instead of an initial velocity, let s now add an impulse of 4 or 5 in the X direction. When you
play the animation back, the ball and chain will appear to be blowing in a wind from the right of the
screen (you could actually achieve the same effect by connecting an air field to the ball). To allow
the ball and chain to fall again, keyframe the impulseX back to 0 after 30 or 40 frames.
You may notice that the ball and chain get kinked up near the bar, and this slows the animation
way down. To compensate for this, you might try adjusting the rigid solver settings. (I set step size
to 0.1 and the solver to Runge Kutta not Adaptive and got acceptable results.) You might also get
interpenetration errors, in which case you might wish to reduce the step size a bit.
Finally, you might notice that the ball doesn t look very weighty in the way it is thrashed around by
the chain. Try increasing the ball s mass to 50 or 100 (and set the impulse higher to compensate),
and see how it looks now.
Note The only real drawback to adding mass to objects is that it drastically increases
calculation times.
Summary
In this chapter, we saw how easy it is (relatively speaking) to get Maya to do the work for us when
simulating real-world events like falling and colliding objects. We also found that rigid bodies can be
changed from passive (keyframable and not affected by fields) to active (nonkeyframable and
affected by fields), and that, when a passive rigid body is made active, it inherits the motion it had
before. This allows rigid bodies to work within a keyframed animation and with keyframed
characters. Finally, we created more complex interactions, and we adjusted the rigid solver to give
us realistic, but faster, simulations.
Part Overview
MEL Basics
While MEL does require a bit of programming savvy, you really don t need to be a rocket scientist
to use it at least at the basic level. If you have had some programming background, MEL s basic
syntax will seem pretty straightforward. If you know the C programming language, MEL s syntax
will seem like second nature.
If you have never looked at a computer program before, MEL will at first seem baffling, but don t
worry. Even if you never intend to do any real programming with MEL, you will find in this chapter
and the next one many nuggets of information that will allow you to use Maya far more effectively
than you may have thought possible.
Before reading this chapter, you should be familiar with basic Maya concepts, like interface
conventions, how to create and animate objects, and how to move around Maya s windows and
menus (see Chapter 2). If you have some knowledge of computer programming, that will also prove
helpful, but it is not necessary.
MEL is Fundamental
MEL (Maya Embedded Language) is the foundation from which you interact with Maya. When you
open Maya, the program first runs several scripts, which actually build all the windows you see
that s right: Maya itself has no interface whatsoever. You can even run Maya from your
operating system command prompt by typing in Maya prompt! Behind nearly everything you see
in Maya is a MEL script.
What does this mean to the average Maya user? Simple: whatever the original programmers did,
you also can do. You can write windows that have sliders, text fields, and buttons in them; you can
create attributes in the Channel box; you can even add menu items to the main menu bar. The fact
that Maya is built on MEL is one of the program s most powerful features.
If you are a real propeller head and like to get into the guts of a program, Maya has its own API
(Application Programming Interface) appropriately enough named Maya API in which you can
create plug-ins for the program itself using the C++ programming language. MEL does just fine for
95% of the things most people want to do, however, and it isn t too difficult to learn.
Note Although the API is outside the scope of this book, you can contact Alias|Wavefront
about developing plug-ins for Maya.
Note The Command line, which we discussed in Chapter 2, is just one input line in the Script
Editor. Type a command in the Command line and you can see it appear in the Script
Editor s History window.
You can bring up the Script Editor in two ways: either select Window General Editors Script
Editor, or click the button in the lower-right corner of the screen that looks like a square with lines in
it.
Notice that there are two windows in the editor. The top window is called the History window; the
bottom, the Input window. With the Script Editor open, create a NURBS sphere (the easiest way to
do this is to click the blue ball on the shelf tab at the top of the main window). Now look at the
History window. The very last line of that window should read something like:
sphere -p 0 0 0 -ax 0 1 0 -ssw 0 -esw 360 -r 1 -d 3 ut 0 -tol 0.01 -s 8
-nsp 4 -ch 1;
What you see in the top window is the command you told Maya to perform when you clicked the
ball on the shelf. Sphere is Maya s command to create a NURBS sphere; all the characters with
dashes before them (-p, -ax, and so on) are flags that tell the Sphere command how to build
the sphere. For example, -p stands for pivot, which is the pivot point of the sphere (since it s 0, 0,
0, the pivot of the sphere is at the origin); r stands for radius (the sphere s radius, in this case, is
1 unit); and ssw and esw are the start and end sweep (in degrees here). Finally, the semicolon
at the end of the line tells Maya the command is finished. (Nearly every line of MEL code needs a
semicolon at the end.)
Note As you can see, more characters will fit into the Input window than we can squeeze
into the printed page, so the semicolon is also your guide to where one command
actually ends and the next begins. (As a further guide, we ve indented the wrapped
portion of these longer lines by about six characters.) As you enter commands from
this book into the Script Editor, you generally need to press the Enter key only after
semicolons.
Create a few more objects (like lights, cones, curves, etc.) and look at what appears in the History
window of the Script Editor. You can see that every command you perform in the interface is
relayed to Maya s core program via MEL commands. For ease of reading, you can clear the top
window. Go to the Script Editor menu and select Edit Clear History. The top window should now
be cleared of all commands.
Now try opening one of Maya s windows (for example, the Hypergraph window: Window
Hypergraph). What do you see in the History window? Probably nothing at all. To keep from
cluttering the History window, Maya s programmers created a filter that blocks from view in the
History Window many of the MEL commands programmers don t commonly need to see.
Sometimes, however, it is very useful to see what s really going on in Maya. Close the
Hypergraph, select Edit Echo All Commands, and reopen the Hypergraph. Now you should see
something like this:
hotBox;
tearOffPanel Hypergraph hyperGraphPanel true;
addHyperGraphPanel hyperGraphPanel1;
HyperGraphEdMenu hyperGraphPanel1HyperGraphEd;
createModelPanelMenu modelPanel1;
createModelPanelMenu modelPanel2;
createModelPanelMenu modelPanel3;
createModelPanelMenu modelPanel4;
buildPanelPopupMenu hyperGraphPanel1;
// Result: hyperGraphPanel1Window //
All these strange words represent the steps by which Maya builds the Hypergraph window for you.
(Actually, nearly all the words above, like buildPanelPopupMenu, are calls to other MEL scripts
in the Maya2.5/Scripts/Others directory. You can look through them to see how the window is
actually constructed.) So you see, even the windows in Maya are created through MEL.
One other note worth mentioning about the lines above: the last line,
//Result: hyperGraphPanel1Window//
is called the result line. The two slashes at the beginning of the line are a comment marker that tells
MEL to ignore the rest of that line (you ll see these comment lines in all well-made MEL scripts).
MEL then prints out for you the result of the operation (in this case, that it created the window as
you asked). If there had been a problem making the Hypergraph window, the result line would have
contained an error message instead of a result message.
Now let s take a look at the Input window (the window on the bottom half of the Script Editor
window). First empty the scene of all objects and clear the History window; then place your cursor
in the bottom window and type in the following:
Sphere radius 1 pivot 0 0 0 name myBall;
Press the Enter key on your numeric keypad (not the one on your main keyboard). You should see
the text disappear from the Input window and appear in the History window (you will also see
another result line, telling you that the command was successfully completed). At the same time,
you should see a sphere appear at the origin of your scene, named myBall. Congratulations, you
have just executed your first MEL command!
Note If you re wondering why you have to use the numeric keypad s Enter key, it s
because the alpha Enter key is reserved for in-line returns. In other words, pressing
the alpha Enter key just creates a new line in the editor window. To force the contents
of the editor window to be evaluated (executed), you must use the numeric pad s
Enter key.
Now try this: delete the sphere from your scene; then triple-click the line in the History window that
you typed earlier (Sphere radius 1 pivot 0 0 0 name myBall). Once you have the
entire line highlighted, copy that line into the Input window (in IRIX, simply MM click in the Input
window; in NT, Ctrl+C (copy) the text, click in the Input window, and Ctrl+V (paste) the line there).
Now hit the Enter key (on the numeric keypad, remember!). You should see the exact same sphere
(called myBall) created at the origin of your scene, meaning that you have copied a command from
the History window and made a mini-script (called a macro) out of it.
This was a very simple example, but consider the power this little cut-and-paste trick gives you: you
can record anything you like from the History window and turn it into a MEL macro (or even a
full-blown script). By storing this little script, you can return to it any time and, at the click of a
button, make all those actions happen.
Note As Chapter 3 details, you can create buttons for MEL commands simply by highlighting
those commands, and then MM dragging the command lines up to a shelf.
2. Create a new NURBS plane object (Create Nurbs Primitives Plane), scale it to about the
size of the Maya grid, and turn on hardware lighting (press the 7 key on the main keyboard).
This plane will help you see how your lights are affecting the scene.
4. Now create and place one or more lights in your scene. You can also set color, intensity, and
name for each of these lights.
Tip Refer to Chapter 20 for tips on best lighting setups. We tend to like a three-light setup: a
key light, a fill light, and a back light (all spotlights).
5. Once you re happy with the lights positions, colors, and other attributes, simply select
everything in the History window and MM drag the highlighted text up to the shelf of your
choosing. A new button will appear that looks as follows:
6. Select all in your scene and hit Delete (or you can actually type in the Script Editor the following
to do the same thing: select all; delete;).
7. Once your scene is empty, go up to the shelf and click your newly made button. After a couple
of seconds, you should see your lights magically appear in the scene, just as you had set them
up.
Not bad for a couple minutes of work and no programming! If you like, you can create several more
lighting setups, each of which creates a different lighting setup for your scene.
One problem you might notice right away is that the shelf buttons all look alike. Fortunately, Maya
can handle this quite easily.
1. From the main menu, select Options Customize UI Shelves. A window will appear that has
three tabs. Let s take a quick look at all three.
2. First, select the Shelves tab. In the window, you ll see listed all the shelves you currently have,
along with buttons to add, delete, or move shelves up and down in the order they appear
onscreen. Click the New Shelf button, and a new shelf appears, titled shelfLayout1. You
can either rename this to create a shelf for you (like myShelf) or click the Delete Shelf button
to remove the new shelf.
3. Now select Shelf1 from the list and click the Shelf Contents tab. In the window, you ll see all
the buttons on the selected shelf listed below. Click the first item in the list (Curves With CVs)
and look at the area below the top window. Here, you ll see the Move Up, Move Down, and
Delete Item buttons, as well as other buttons and fields:
" The Label button contains the text you see in the window above (the internal label for the
button).
" The Overlay Label contains the text you see under the button in the shelf window. (For the
Curves With CVs button, this is blank, so there is no text on the shelf button. Try adding text
and see what happens!)
" The Change Image button allows you to find or create the bitmapped image that appears on
the shelf in the case of the Curves With CVs button, it s this image, stored in the Maya
2.5\Bitmaps folder.
You can also navigate to the Maya2.5\extras\icons directory and browse through many
pre-built icons for your use in creating shelf buttons.
Tip You can also create your own icons. In Windows NT, the icons can be in BMP, JPG, or
XPM formats (BMP and JPG are supported by nearly all NT graphics editing packages).
In IRIX, you must save the image in .xpm format (using Xpaint or another program). The
icons are 32 32 pixels, and you should make your images that size. Note that if you
wish to place text at the bottom of the image, you should leave a blank space to allow
room for it.
4. Now go back to the Shelves tab and select the shelf that contains your new light button.
5. Return to the Shelf Contents tab. Add a label and an overlay label to your button. Now change
the image of the button to one of the images in Maya2.0\extras\icons (if you want text on
your button, a good choice of icons is the UserMenuIcon group in this directory they have
room for text at the bottom of the button).
The final tab, Edit Commands, is for more advanced users. This window actually allows you to
rewrite the scripts for the menu buttons right inside the Customize Shelves window. The script for
whatever item you had selected in the Shelf Contents tab will appear in the main window. You can
then change any commands you wish, or add comments to the script.
To make these changes stick, however, you must press the Enter key on your numeric keypad
(not on your keyboard); otherwise, when you select another tab, all your changes will be lost! For
practice, try adding a comment line like the following to your lights macro:
//This is my macro to make several lights in a scene.
Click another shelf button and then return to the Edit Commands tab. Did your changes hold? If
not, try again, this time remembering to press the Enter key to make your changes stick.
Before leaving the Customize Shelves window, it is always a good idea to click the Save All
Shelves button at the bottom of any of the tabs (assuming you want your changes to stick!). This
button writes all the changes you just made to your Maya\Prefs\Shelves directory, so that the
next time you start up Maya, your shelves will look just as they do now.
In this example of MEL, you have learned to quickly record your actions, save them as a macro,
place them in your shelves, and finally, change the text and image of the button to customize its
look. Next, we will create a small script that will execute when we press a keyboard key.
1. Open the Customize Hotkey menu by selecting Options CustomizeUI Hotkeys. This brings
up a pretty scary looking window like the following:
Fortunately, we really don t have to worry about the top window for now; we only care about the
stuff at the bottom.
Note The window at the top of the Customize Hotkeys window lists all commands Maya has
and whether or not they are mapped to a keyboard command. This means that you
could (should you wish) change, remove, or add hotkeys for any of Maya s
commands. See Chapter 3 for further information about how to do this.
2. Let s query a key to see if it s free for us to use. In the Key Settings box, type N in the Key
field, and check the Alt box in the Modifiers group below. Click the Query key. You should get
the following message:
Alt-n <press> is not mapped to any command object.
This means the key is available for your use (if it s not, try another key). Click OK to dismiss
the dialog box.
3. Now, in the Command Object Settings box on the right, enter something like the following in
the Annotation field (this is the text that will appear in the list above):
Make and move a sphere.
Then, in the Commands window, type the following (you could also paste commands from the
Script Editor):
Sphere radius 4 name ball pivot 0 0 0 ssw 0 esw 360;
Move relative 0 5 0;
4. Click the Create Command Object button. The list window at the top of the screen will now
update, and you ll see your command text listed at the bottom of the window. On the left, next
to your new command, you ll see the word (None), telling you that the command has not yet
been mapped to a key.
5. Return to the Key Settings section, type N in the Key field, select Alt and Press, and click Apply
New Settings. The list window above will update again, reflecting that your command has now
been turned into a hotkey:
7. Now hold down the Alt key and press N. If you did everything right, you should see a sphere
sitting in your window called ball and resting 5 units up from the grid on the Y axis.
Congratulations! You have now written some MEL commands and made them work simply by
pressing a key! As a further exercise, try to take the commands used in the create lights
exercise we did above, and map them to a hotkey of your choosing.
Note If you didn t get what you expected, check the Script Editor to see if there was an
error. If so, go back to the Customize Hotkeys commands and edit the command to
make it work. If the Script Editor doesn t show anything happening at all, check that
you mapped the command to the Alt+N key combination. If you re still having trouble,
try typing the sphere commands into the Script Editor and get them to work properly,
then copy them into the Command window.
Let s say that you wish to move a selected object (or objects) around in different directions simply
by selecting an item from a GUI (Graphical User Interface) list. This is the perfect situation in which
to use a Maya marking menu.
1. First, create a new NURBS sphere (or cone or whatever) at the origin of the grid. Now, in the
Script Editor, type in the following:
Move r 0 5 0;
2. When you execute this command, the ball (or other object) should move 5 units up the Y axis
(remember, -r stands for relative in this case, meaning that the object will move relative to its
current position along the Y axis). To move the ball back to 0, type this:
Move r 0 5 0;
3. Now open the Customize Marking Menus window by selecting Options CustomizeUI
Marking Menus. The following window will appear:
Once again, the top list shows marking menus built into Maya (part of the hotbox that appears
when you hold down the spacebar). But of course you can build your own as well.
4. Simply click Create Marking Menu to bring up a window that will let you build a menu of your
own.
5. Under Menu Name, type in MoveObject. Now RM click the top center yellowish button in the
internal window and select Edit Menu Item.
Note In addition to the eight main marking menu positions (North, Northeast, East, and so
on), there is a ninth position, at the bottom left of the window, called the overflow
menu item. If you add a command to this item, another will be created just below it,
allowing you to make the menu as large as you wish. Also, all menu items can have
submenus, allowing you even greater flexibility in building a marking menu.
This brings up a window in which you add the commands for the button.
6. Under Label, type Move Up, and leave the Icon Filename field blank (you can specify a path
for an image that will appear in this position when the marking menu is accessed). In the
Commands field, type in
Move r 0 5 0;
7. Leave Optional Properties set at Neither, leave the Option Box blank, and click Save and
Close.What you have just done is to create a marking menu item that will move a selected
object up by 5 units.
8. To test how this action works, press the LM button in the Click Here To Test window (select an
object in your scene first!). Whatever you selected should move up by 5 units when you select
the command.
9. Now, edit the East, West, and South marking menu buttons to the following, respectively:
Move r 5 0 0;
Move r 5 0 0;
Move r 0 5 0;
10. Give them appropriate titles and test that they work as they should.
11. Once you re happy with how the menu buttons work, click the Save button and return to the
Marking Menus window.
12. At the bottom of the list, you ll now see MoveObject listed. With this item selected, in the
Settings window, select the Hotkey Editor option (this allows you to make a hotkey for the
menu you just made). Click the Apply Settings button and close the window.
13. Now, in order to use our new marking menu, we have to go to Options CustomizeUI
Hotkeys and make a hotkey for the menu.
14. Scroll to the bottom of the list window and you ll see two new items in the list: MoveObject
(Press) and MoveObject (Release). By mapping these two items, we will create a hotkey that
will bring up our new marking menu (the release key must be mapped for marking menus, or
the menu will just stay up even after the hotkey has been released!).
15. First, let s find an unmapped key. Query the Alt+O key to see if it s mapped (if it is, try
another one).
16. Now, select the MoveObject (Press) item in the list, type O in the Key field, check Alt, and be
sure that the Press radio button is selected. Click Apply New Settings and the MoveObject item
should be updated to show that Alt+O is its new hotkey.
17. Now let s map the Release item. Select MoveObject (Release) in the list, type O, and select
Alt and the Release radio button, and click Apply New Settings. Once complete, the items
should look as follows:
18. Click the Save button and close the Hotkey window.
19. Let s test our new marking menu: select an object in the scene window, press and hold the Alt
and O keys, and press the mouse button down. You should now see your marking menu,
ready for action!
20. Move the object(s) you have selected around the screen to see how the new menu works.
You can take these simple steps and reuse them to create marking menus to do anything you like.
For example, if you created several lighting setups in the work above, you could now create a
marking menu to allow you to select any of these lighting setups very quickly and intuitively. We ve
seen how we can record or type simple commands, and place them on the shelf, in a hotkey, or
even a marking menu. Now let s take a closer look at how MEL can work with the attributes of any
object in your scene.
What s an Attribute?
An attribute (Attr) is any item that lives on a Maya node (a Maya node is anything you can see in
the Hypergraph). This sounds a bit obscure, but it s really fairly straightforward: anything like
rotateX, transformZ, or scaleY is an attribute of an object (more specifically, an object s
transform node).
When you build, alter, or animate an object, you re changing one or more attributes on one or
more nodes in the object and of course, all of these changes are just MEL commands, so you can
make Maya do the work for you.
Note In this chapter, we ll take a quick look at how MEL works with attributes; in the next
chapter, we ll go into more detail about how to build complex scripts using attributes.
You may have noticed when you created the lights in the exercise earlier in this chapter that the
Script Editor was filled with many statements that started with setAttr. The setAttr statement
tells MEL to set a certain attribute to a certain value. Likewise, the getAttr statement gets (reads)
the value of an attribute on a certain object so you can use that value in another MEL statement.
The addAttr statement tells MEL to add a custom attribute to a certain item. Essentially, the
setAttr statement is the same as going into the Attribute Editor window and changing a value in
one of its fields (try changing a value in the Attribute Editor, and note that the Script Editor History
window shows that a setAttr statement has been issued).
The syntax (the rules of what goes where) for an Attr statement are as follows:
Flags, as we ve seen, are any special requests for MEL to complete; the object name is the name
of the item to set the attribute on (like nurbsSphere1); and the value is the value to set the attribute
to. The getAttr and addAttr commands have similar syntax. For example, we could move a
sphere called ball to 10 on the X axis by typing the following in the Script Editor:
setAttr ball.translateX 10;
Once you execute this command, your ball will move from where it is to 10 on the X axis. (Of
course, if you have no object called ball, you will get an error message.)
This is pretty much like giving the move command: move 10 0 0. Unlike the move command,
however, setting the attribute of translateX will not affect the other two attributes (the Y and Z
translate attributes). Also, the setAttr statement is far more flexible than the move command,
which can only translate an object.
As a quick example of how setAttr can work, let s make a ball and manually set several of its
attributes. Type the following into the Script Editor s Input window:
sphere -n ball;
setAttr makeNurbSphere1.radius 4;
setAttr makeNurbSphere1.ssw 20;
setAttr makeNurbSphere1.esw 250;
setAttr ball.rotateY 90;
setAttr ball.translateX -5;
setAttr ball.scaleY 0.7;
Can you figure out what each command does on your own? Try highlighting each of these lines by
itself and pressing the numeric Enter key to execute it.
Tip Using the technique of highlighting one line at a time is a very useful way to figure out
what s happening in a script and to see where things go wrong!
The first line builds a sphere. The next six lines change many attributes, either on the shape node
of the sphere (the makeNurbSphere node) or on the transform node (the ball node). The first
three setAttr statements change the radius, the start sweep angle, and the end sweep angle,
respectively. The last three change the position and scale of the sphere s transform node (named
ball ). The finished product should look as follows:
If, for some unknown reason, you needed to create a flattened half-ball over and over again in
different scenes, you could just MM drag these commands to your shelf and you d be able to
make the object at the click of a button quite a time saver!
In this section you ll find three examples that give you an opportunity to try out the Expression
Editor. In the first, you ll make a cone move up and down by moving a sphere back and forth. In
the second you ll make a ball move back and forth in rhythm as time elapses. In the last example,
you use an expression to devise a way to make a wheel stick to the pavement so it doesn t
slip.
The expressions we ll deal with here are fairly simple; however, if this kind of thing appeals to you,
and especially if you like to work with particles and dynamics, there is a more advanced discussion
on the use of expressions with dynamics in Chapter 23.
Transforming a Cone
Let s begin with a simple example: we re going to make a cone move up and down by moving a
sphere back and forth on the Z axis.
1. First, make a new scene and create a sphere and a cone (call the sphere ball and the cone
cone ). Select the cone, and open the Expression Editor (Window Expression Editor).
translateY = ball.translateZ;
//to save time, you could also just type:
//ty = ball.tz;
Because the cone was selected, Maya knows to apply the transateY command to the cone (if the
object is not selected, just type cone.ty = ball.tz;). Click the Create button. If you entered
the information correctly, the feedback line (or the Script Editor s History window) will show
Result: expression1
If not, you will get an error message. (Note that paired forward slashes are comment markers in
expressions as well as in scripts.)
4. Once the expression is accepted, move the ball back and forth in the Z axis, and watch the
cone move up and down.
Though this is a very simple example, it should indicate how you could solve some very complex
interactions between objects much more efficiently by using an expression than by keyframing.
1. Make a new scene in Maya, and add a NURBS sphere (called ball ).
3. Set your time slider to about 400 frames and play the animation.
You should see the ball moving back and forth in rhythm as time (frames divided by
frames-per-second) goes by. The Sine function takes an input number (the time of the animation)
and converts it into a wave that goes back and forth between 1 and 1. Multiplying the Sine
function by 5 just makes it bigger (increases the amplitude). Starting from 0, the Sine function itself
looks as shown on the next page.
The X component of the sphere s motion just moves up and down (or back and forth) from 5 to 5
as time increases. We can also make the ball go back and forth more quickly by typing in the
following (and clicking Edit in the Expression Editor):
ball.tx = 5 * sin (2 * time);
Here, the ball will go back and forth twice as fast, since time is being multiplied by 2. In general,
you can alter the Sine function s amplitude and frequency as follows:
Amplitude x Sine (Frequency x Value)
The frequency component adjusts how fast the ball goes back and forth, while the amplitude
adjusts how big the motion is.
You can also put the frame number into the expression as well as time:
ball.tx = 5 * sin (frame);
When you play back this expression, the ball will travel back and forth far more quickly than before,
as the number of the current frame increases much more rapidly than does the time.
Now let s make the ball do something a bit more interesting, like move in a circle. Once again, edit
the expression on the ball, this time to the following:
ball.tx = 5 * sin (time);
Here, the ball s X position is controlled by the Sine function, while the ball s Z position is
controlled by the Cosine function. (Remember that the Cosine is perfectly out of phase with the
Sine function. In other words, it begins at a value of 1 rather than 0.) When you play back the
animation, the ball should move around in a perfect circle. How would you make the circle
squashed (an ellipse)? Try changing one of the amplitude multipliers to 2 instead of 5. What
happens when you increase the frequency of one of the positions? Try making ball.tz equal to 5
* cos (2 * time) and see what happens. What if the frequency number is 3 or 5? You can
quickly see how you can make some very complex motion with relatively simple expressions.
As a further exercise in using expressions, try making the ball move around a three-dimensional
circle instead of just on the X-Z plane.
1. In an empty scene, create a sphere with a radius of 1 unit and name it tire.
3. Now move the ball up by 1 on the Y axis so that it just rests on the plane (if you think you re
good, try making the plane and sphere, and then moving the sphere, all using MEL commands
in the Script Editor).
4. Select the tire ball and open the Expression Editor. Name the expression stickyTires and then,
in the Expression window, type the following:
tire.rz = - (tire.tx * (360.0 / (2 * 3.1415)));
This expression takes the translateX component of tire and turns it into an angle for the
rotateZ component. The negative sign ensures that the tire actually rotates the proper direction
when the wheel is moved. The parenthetical expression just converts degrees to radians so that
the two numbers will match up properly.
5. In the scene window, move the ball back and forth in the X direction and watch how the ball
always rolls just the right amount to keep up with how far it moves.
In the next chapter, we ll briefly revisit this tire expression and make it more generally useful and
readable!
As a further exercise, can you make the ball roll properly as it s moved in the Z direction (be sure
to set the X, Y and Z positions back to 0 before you do this)?
Finally, let s use a nice little built-in MEL function called noise to make the tire move back and
forth in the X direction, as it sticks to the ground. The noise function creates random, but
connected, motion paths (as opposed to the rand function, which goes all over the place!).
Compare the following two motion paths.
While the noise function, on the left, is a random motion, it moves from point to point in a smooth
path. The rand function, on the right, however, is very chaotic. There are cases where each has an
advantage; here, we need to use the noise function to make the tire move smoothly back and
forth. In the Expression Editor, type in the following (to modify the expression you ve already been
working on):
tire.tx = 5 * noise (time);
tire.rz = - (tire.tx * (360.0 / (2 * 3.1415)));
As time increases, noise generates a new number for each new time, but each number is
connected to the old one in such a way as to keep them relatively close together. When you play
back the new tire animation, the wheel will move back and forth on the X axis, all the while
sticking to the ground as it rolls. Considering how simple this expression is, it produces very
complex motion that would be difficult to reproduce using keyframes.
Summary
In this chapter, you have learned what MEL is and how Maya is constructed on it, and you have
gained hands-on experience with some basic (yet powerful) ways to take advantage of scripting.
You also learned how to make your scripts quickly available as buttons, hotkeys, or marking
menus. Finally, you learned the difference between MEL commands and expressions, and how to
create some basic expressions that do neat things. (If you are interested in further exploring
expressions and how they are used in dynamics, please see Chapter 23.)
In the following chapter, we will go into more depth about how to use MEL to create flexible
procedures and complex scripts that can even have their own user interface. If this chapter was as
far as you want to go with MEL right now, don t bother with the next chapter. If you re ready to
learn how to really program the pants off Maya, just turn the page!
Chinese Dragon
Created by technical editor Mark Smith as a test animation for a video project called Organix,
this piece was our first attempt at using Paint Effects in conjunction with the iterative replication of
geometry. The gold rib-like appendages are Paint Effects brushstrokes joined to volume-textured
geometry. The animation sequence is quite hypnotic, as the dragon curls and convulses upon itself.
Bingo
Created at Alias|Wavefront, a division of Silicon Graphics Limited, by Chris Landreth in conjunction
with the development of Maya software. The award-winning animated short BINGO was
presented as the grand finale of the Electronic Theater at SIGGRAPH 98. As explained by
Duncan Brinsmead in his conversation with Perry Harovas, included in the Appendix, the
challenges involved in creating the hair for the Balloon Girl helped inspire Mr. Brinsmead to create
Maya software s new Paint Effects" tool. Although BINGO was developed partly to test and
demonstrate Maya software s capabilities, BINGO is more than just a dazzling technical
achievement; you can see from these stills that it is an artistic achievement as well.
Stingray
This image was created in Maya 2 by Michael Leone at Viewpoint Studios. The stingray was
generated from a primitive NURBS sphere with the help of nonlinear deformers and by manually
pushing and pulling the CVs. Nonlinear deformers were also used to create the lifelike motion of
the stingray as it glides through the water. Complex layers of procedural shaders were used to
generate the stingray s skin.
Negative Balance
This piece, also by Michael Leone, was created entirely in Maya 2. The artist s intention was to
create an image that evoked concentration, frustration, and defeat and we think you ll agree that
he succeeded, at least with the first two. The resulting dynamic compositing was achieved by the
careful placement of objects, detailed modeling, particle systems, and raytracing (to provide
realistic reflection).
Hamlet
These four images, created by author Peter Lee, are from To Be or Not to Be, an animation short
shown at the Animation Festival, SIGGRAPH 99. The character recites Hamlet s famous soliloquy
in his own unique style. A short segment is included in the accompanying CD-ROM.
The Child
Created by author Peter Lee, this is a finished rendering of the boy built in stages beginning in
Chapter 6. The head was built in several NURBS patches, the hands were created using polygon
modeling, and the body was bound using Rigid Bind. The constrained and weighted model is
included in the CD-ROM.
The Dog
Created by author Peter Lee, this is a finished version of the dog begun in Chapter 8 and
completed in Chapter 13. This simple dog was built in NURBS patches, using the Stitch tool, and
bound using the Smooth Bind. The constrained and weighted model is included in the CD-ROM.
Created by author Peter Lee, this is the complete living room scene built in stages beginning in
Chapter 5 and completed in Chapter 19. It includes the furniture, the lamp, the letter M, and the
dog. An Env Sky was used as the environment texture, and the glow was applied to selected
shaders.
The Woman
Created by author Peter Lee in 1998 for Alias|Wavefront s Maya contest. All the textures, with the
exception of the eyebrows, were created in Maya 1.
Eden
Created for a direct-to-video film, by author Perry Harovas. This was our first test of Paint Effects
for film, used to give a storybook feel crossed with realism. Every blade of grass casts shadows.
Running a Paint Effects pass at 1800x1350 resolution took only 5 minutes.
Go Play Outside
Created by author Perry Harovas for the cover of this book, with heavy use of Paint Effects. The
tree is casting shadows on the house, and in the animation on the CD-ROM, it gives the impression
of a nice breezy day.
Blinding
Created by author Perry Harovas for a direct-to-video film, this image makes heavy use of light fog,
shader glow, and depth-of-field. You ll find the complete animation on the accompanying
CD-ROM.
Underwater Dance
Created by author Perry Harovas for a direct-to-video film. The caustic effect was created as a 2D
animation, and then applied to a point light located underneath the water. The light was exclusively
linked to the rocks, so that it wouldn t affect the water surface, which was displaced with the same
2D animation, to tie the effects together. You ll find the complete animation on the accompanying
CD-ROM.
Murk
Created by author Perry Harovas for a direct-to-video film. The cave was generated from a heavily
subdivided cylinder, which was deformed with Artisan. The ground plane that makes up the water
intersects a flattened side of the cylinder, which makes up the floor of the cave. Spotlights with
Intensity Falloff were used to good effect for a realistic feel.
Childhood Memories
Created by author Perry Harovas, this stark room tries to evoke the weird memories that seep into
our adult minds from childhood. The ball has a very plastic feel, easily achieved with a specularity
map to break up the highlight.
Yiayia s
Created by author Perry Harovas to bring back memories of your grandmother s house. The walls
are reflected in the table, but the ceiling was excluded because it created too many reflections, and
was a distraction. The bleeding light on the walls mimics radiosity through the use of some point
lights with intensity falloff.
Muffled Scream
Created by author Perry Harovas for a direct-to-video film; this image was used on the cover box.
The beast was created with minimal geometry, evoking fear with the use of motion blur and letting
the viewer s imagination fill in the missing details.
Water head
In this image created by author John Kundert-Gibbs, the pseudopod and head are an example of
several concepts from this book, from facial modeling to blendshape animation to soft bodies and
texturing. This is an enlarged still from the animation available on the accompanying CD-ROM.
Fountain
The fountain, created by author John Kundert-Gibbs, is a marriage of modeling, dynamics,
texturing, raytracing, Paint Effects, and a bit of tricky compositing. Because of the level of
complexity in the scene, the three passes required to create this still image took over two hours of
rendering on a dual 550MHz Pentium III machine. An animated version of this scene is available on
the accompanying CD-ROM.
Fizzing Tablet
Created by author John Kundert-Gibbs, these are two views of the antacid tablet developed in
Chapters 22 and 23. The tablet is a particle emitter, and the bubbles are spherical particles. An
animated version of this scene is available on the accompanying CD-ROM.
Composited Fountain
Created by author John Kundert-Gibbs, this is a still from the fountain animation developed in
Chapters 22 and 23, also available on the CD-ROM. In this composited image, you can see the
beginnings of a production-ready image.
Fire Man
This image, created by author John Kundert-Gibbs, is a still frame from a low-resolution proof of
concept animation for an upcoming made-for-TV movie. In it, John used Paint Effects to paint fire
onto geometry that was matched to the person in the background plate (originally, he had used
particles, but these proved more difficult to control than Paint Effects brushes). The rest of the shot
was done in a compositing package, where different layers of fire, geometry, and the background
plate were combined, and colors were altered in the background plate to indicate the effects of the
fire on the surroundings.
Mary
The mood is meant to be quiet and introspective, like an unspoken prayer. Created from memories
of the priests room to the side of the altar, where the vestments were kept
Although you can benefit from this chapter without any prior programming experience, it will be a
big help if you already have some understanding of a programming or scripting language. If you d
like to try some programming first, you can avail yourself of a wealth of books, classes, and
references for a dizzying array of programming languages. Otherwise, let s dig into the meat of
MEL!
Tip As Maya s syntax is very similar to that of the C programming language, a good primer
on C is your best preparation for MEL. The publisher of this book offers numerous titles
on C and C++, including C++: No experience required, by Paulo Franco (Sybex, 1998),
and Mastering Visual C++ 6, by Michael J. Young (Sybex, 1998).
First, you have Maya s internal Help function. Because there are so many MEL commands and
functions (about 700), the Help function is a very quick and useful feature (you can even type in
help help to get a look at how the help command works).
Here s an example of the type of information available with Help. Open the Script Editor and type
the name of the command you want help with into the Input window (or just type it into the
Command line below the main window):
help setAttr;
Execute the command, and in the Script Editor s History window, you ll see the following result
lines:
// Result:
Synopsis: setAttr [flags] Name[...]
Flags:
-e -edit
-q -query
-av -alteredValue
-k -keyable on|off
-l -lock on|off
-s -size Index
-typ -type String
//
These result lines give you a quick look at the setAttr command: a synopsis of its syntax (or how
to use it) and a list of flags that you can use with the command.
If you re an experienced programmer, this information may be all you need in order to use the
command. If you re just starting out, however, you ll probably want more guidance. In that case,
try typing the following into the Input window:
help doc setAttr;
When you execute this command, Maya will automatically bring up your browser of choice (usually
Netscape Communicator or Microsoft Internet Explorer) and find the right HTML page in your online
documents (contained on your hard drive) that contains the command you want help with. In the
case of the setAttr statement, you get the following display:
Name
setAttr
Synopsis
setAttr
[flags] object.attribute value [value..]
ReturnValue
None.
Description
Sets the value of a dependency node attribute. No value for the
attribute is needed when the -l/-k/-s flags are used. The -type flag is
only required when setting a non-numeric attribute.
There is also a table of flags and what they do (notice that this table is far more complete than the
smaller help text you get inside the Script Editor history window). Finally, you get what we consider
the most useful aspect of the help files several examples of how to use the command:
Examples
// Set a simple numeric value
setAttr transform1.translateX 5;
// Lock an attribute to prevent further modification
setAttr -lock on curve1.translateX;
// Make an attribute unkeyable
setAttr -keyable off curve1.translateZ;
// Set an entire list of multi-attribute values in one command
setAttr -size 6 curveShape1.knots[1:6] 0 0 0 1 1 1;
// Set an attribute with a compound numeric type
setAttr revolve3.axis -type double3 0 0 1;
// Set a multi-attribute with a compound numeric type
setAttr madeUpNode.multiAxis[0:2] -type double3 0 0 1 1 0 0 0 1 0;
As you can see, a few examples can do a lot to clarify how a command is used. Between the
internal Help files and the online help on your hard drive, you can access excellent reference
material very rapidly.
Tip Examining other users scripts as guides for what you wish to do is another great way to
learn more about MEL you can even copy and paste portions of scripts for your own use
(just be sure that you have the author s permission).
While debugging a script is a bit of an art form, there are a couple of ways you can help yourself.
First, check the History window when you execute a script: If the last line of your script is the last
line of the History window, the commands executed without an error. If, however, you get a
comment line like the following:
setAttr tire 5;
//Error: line 1: No attribute was specified. //
you know that there has been at least one error in parsing the script.
Note Parsing is the programming term for the search the script interpreter does through the
script to make sure all the commands are correct.
The Feedback line (at the bottom-right of the screen) will also turn orange-red to indicate that the
MEL interpreter has discovered an error in your code. One way to help you quickly identify where
these errors might lie is by turning on the Edit Show Line Numbers option in the Script Editor
menu. Generally, it s a good idea to keep this option on at all times, as it does not slow Maya
down in any way, and it provides useful information about where errors are occurring.
As you begin scripting, one error that will probably creep in is forgetting the final semicolon at the
end of each line. This can be difficult to spot if you re not aware of the problem. If you are getting
errors in your script that don t make sense, try looking at each line of code to be sure it finishes
with a semicolon.
Finally, since MEL is an interpreted scripting language, you can execute a script one line at a time,
rather than as a whole. This can be a very useful way to figure out where a problem is occurring in
your program. A brief exercise will illustrate:
2. Now highlight the first line and execute it (by pressing the Enter key on your numeric keypad).
You should see hello, world! printed out in the History window.
3. Now highlight and execute the second line. You should see something like the following:
The first line executed properly, but the second had an error in it the print command needs a
string to work with, and you need to include quote marks to identify the string. In a two-line script,
spotting the error would be simple; in a longer script, this method of going through the script one
line at a time can be a great way of uncovering problem spots.
Great. We know how to get help and debug a script now let s get down to business!
Variables
It s actually much easier to see what a variable is than to talk about it. Type the following in the
Script Editor:
string $myVariable;
$myVariable = hi there ;
print $myVariable;
When you execute these commands, you ll see that hi there is printed in the last line of the
History window, indicating that when you told Maya to print $myVariable, it printed hi there.
The first line of the script, above, is called a declaration of the variable: string is the variable s
type (a string is just text contained in quotes), and $myVariable is its name.
vector Three decimal numbers that make a vector number used to represent a point on a
three-dimensional grid, like (26, 31.67, 5.724). A vector number is very useful for
three-dimensional quantities like position (X, Y, Z coordinates) or color (red, green, blue
colors).
array A list of numbers used to store lists of either integers or floats. Arrays are useful for
storing data about many similar items, like the color of each of a group of particles.
Every MEL variable needs to start with the $ symbol, so MEL knows it s a variable. (This is easy to
forget, and it causes strange errors so remember your $ symbol!) The second line is called the
assignment line: the text string hi there is placed into the variable (or placeholder) for future use.
The last line is simply a print statement, telling Maya to print out what s inside the variable,
$myVariable (which, in this case, is hi there ). If we wished, on the following line we could type
in
$myVariable = goodbye ;
which would change the data in the variable $myVariable to the word goodbye. As you can see,
variables can be extremely useful because they can store different data at different times in a
program.
MEL has a convenience feature built into it: you can declare and assign a variable in the same line.
In other words, the script above could be written as follows:
string $myVariable = hi there ;
print $myVariable;
There is no real difference between the two scripts, except for less typing and a bit easier
readability you are free to use whichever method appeals to you (though most seasoned
programmers opt to save keystrokes!).
Looping
Next, let s examine looping. Say you wish to create five spheres in your scene using MEL
commands. You could either do this by typing in sphere r 1 n ball five times, or have MEL
do it for you using the for loop. To build our spheres, type in the following:
int $i = 0;
for ($i = 1; $i<= 5; $i++)
{
sphere r 1 n ball;
}
Voil, five spheres named ball 1 through 5. (However, you ll need to move them away from each
other in order to see them as separate objects. We ll do that in a moment.)
Note MEL supports implicit variable declaration, so the int $i = 0 line is not necessary.
However, in most cases, it is preferable to declare all variables explicitly to avoid
possible complications in the script.
Note that there is no semicolon after the for statement: MEL expects there to be one or more
commands (contained within the {} brackets) after the for statement, so it doesn t need a
semicolon. Additionally, the closing bracket, }, functions as a semicolon, so there is no need for a
semicolon on the last line either. The syntax for the for loop is as follows:
The initial value is what the counting variable is set to at the beginning. The test value is how high
(or low) the number can go before it tests negative and thus how many loops the counter goes
through. The increment is how quickly the counter increases in value ($i++ is a simple way of
saying increase the value of $i by 1 each loop ).
To make this loop do a bit more for us, let s have it move the spheres on top of each other on the
Y axis as it creates them:
for ($i = 1; $i<= 5; $i++)
{
sphere r 1 n ball;
move r 0 (2 * $i) 0;
}
Now as the spheres are created, each one is moved up by twice the value of $i, placing them just
atop one another.
Branching
The last basic program structure we ll look at is branching, a slightly more complex type of loop
that allows MEL to ask a question and decide whether to do some further action given the answer
(the for statement actually contains a branch in its test value statement). Let s use the same
script as above, only this time let s put a conditional statement inside it:
for ($i = 1; $i<= 5; $i++)
{
sphere r 1 n ball;
if ($i<=3)
{
move r 0 (2 * $i) 0;
}
else
{
move r (2 * $i) 0 0;
}
}
What happens when you execute these commands? The first three balls are stacked up on the Y
axis (when $i is less than or equal to 3), and the last two are stacked along the X axis (when $i is
4 and 5, and therefore greater than 3). In abstract terms, the syntax for the if statement is as
follows:
if (test)
{
commands;
else if (test)
{
commands;
}
else{commands;}
The elseif and else statements do not have to exist for the if statement to work. The else
if statement, listed above, allows you to make as many tests as you like (there can be as many
else if statements as you wish in your conditional statement), allowing you to test for multiple
possibilities within one large conditional statement. The else statement must always be last in
such examples and is the default answer if no other conditions are met. Note that all the
commands for an if, else if, or else statement must be enclosed in {} brackets. If we wish, we
could increase the complexity of our create-and-move-ball code with an else if statement:
Here, the balls will stack along the Y axis if $i is less than or equal to 3, along the Z axis if $i is
between 4 and 6, and along the X axis if $i is greater than 6.
Tip If there is only one line of commands below the if statement, you do not need the
brackets however, it s a good idea for readability to always include them anyway.
Now that we have all these time-saving functions at our fingertips, let s revisit a project from last
chapter and make it a bit more useful.
If you don t have the scene saved, open a new scene, create a sphere and name it tire, and make
a plane under it (scaled to about the size of the default grid). We re going to take the expression
we had before, add variables to it, and add a conditional statement to do different things if the ball
is being moved up the Y axis.
One thing we haven t yet discussed, yet is very important to our work, is the reverse apostrophe
the apostrophe that s above the Tab key on the keyboard and looks like this: `. Enclosing a
statement in these apostrophes tells Maya to evaluate the statement inside them and pass the
result on to the variable on the other side of the equation. The statement
float $myVariable = `getAttr tire.radius`;
returns the decimal (or floating point) number representing the radius of the sphere called tire. As
you can probably tell, this ability to get the value of any attribute and read it into a variable is quite
powerful. Just remember that this isn t the normal apostrophe that lives on the key with the double
quote type in that apostrophe and you ll get an error!
The first four statements declare and assign values to variables. $pi is the value of . $deg is the
number of degrees in a circle. Having these variables in the expression just makes reading the
equation below easier. The two variables $radius and $howHi are assigned values by using
reverse apostrophes to enclose getAttr statements. The reverse apostrophes evaluate the
getAttr statements and then read the sphere s radius and Y position into the variables. (Note
that the attribute for radius belongs to the makeNurbSphere node, not the transform node,
which has been renamed tire.)
The conditional statement asks whether the Y position is different than the sphere s radius (!= is
MEL s not equal operator). If so, it places the sphere directly on top of the plane (1 radius
above 0). Also notice that the equation for Z rotation has been modified to take the sphere s radius
into account now (the rotation angle being equal to 2r, you ll recall from high school math
classes). With this equation, no matter how big or small the sphere is, it will always sit right on the
plane and will roll without slipping!
Using variables and a conditional statement, we have reworked the simple one-line expression into
a flexible tool that can be used in varying situations.
We ll return to variables, looping, and branching as this chapter continues, but now let s turn to
creating a GUI in Maya.
Creating a GUI
While typing commands into the Command line or Input window of the Script Editor is very useful
for simple tasks, it is often much more elegant (not to mention user-friendly) to create a graphical
user interface window in your script to give users access to all the script s commands in a familiar
point-and-click environment. While creating these windows can be somewhat challenging, nearly all
high-quality scripts use them, so it is good to learn at least the basics of GUI creation using MEL.
Windows in Maya can be very complex (just look at the Attribute Editor window for an example),
but the basic way to create a window is fairly simple. At a minimum, you need three commands to
make a window:
window title title wh 400 200 myWindow;
some kind of layout;
showWindow;
Executing the window command creates a window with a certain title that appears at its top (the
title flag), optionally a predefined width and height (the widthHeight or wh flag), and an
optional name (the last item in the window command).
The showWindow command makes the window appear onscreen (it will never appear if you forget
this line) this command usually resides at the end of a make window series of commands.
The layout commands specify what sort of layout the window will have. Some common types are
columnLayout, scrollLayout, rowColumnLayout, and formLayout. The column layout
creates a column, the scroll layout makes the window a scrollable window, the row-and-column
layout makes a grid of rows and columns (like a table), and the form layout creates a flexible space
that can be laid out in many ways. These layouts can also contain other layouts nested within them,
creating the ability to make very complex windows relatively easily (the form layout is often the
parent layout, with many other layouts inside it).
Let s create a simple window with one button and one slider in it. Type the following into the Script
Editor:
window -t The Big Window! -wh 400 200 myWindow;
These commands create a window (which Maya knows as myWindow, but which is titled The Big
Window! ) with a width of 400 and a height of 200 pixels. A column layout is then set with a width
of 200 pixels. Next, a button (labeled Click this button and known to Maya as myButton) is
created; then a field-and-slider group is created (labeled Slide this around and known as
theSliderGroup) with a minimum value of 0 and a maximum value of 10. The text command just
puts a space in between the button and the slider group. Finally, we display the window via the
showWindow command. Obviously it s not too difficult to create windows with buttons, sliders, or
other objects in them.
Tip If you make some errors typing in the MEL script, and then go back and try to run the
script again, when you try to recreate the window, you may run into the following error:
Error: Object s name is not unique: myWindow. If you get this message,
you need to delete the window myWindow: even though it doesn t appear onscreen,
MEL has created a UI object named myWindow (Note that the showWindow command is
last, so an object can be created and not shown). Thus, while myWindow doesn t
appear, it can exist in your scene, and it needs to be deleted. To do this, type deleteUI
myWindow. This is a very useful command to remember as you create GUI windows, so
commit it to memory.
Now let s make our buttons do something. Clear all objects in your scene and create a sphere
called ball. Edit your script to include the command and attribute flags, as follows:
The c flag tells Maya to perform the quoted instruction each time the button is pressed. Thus,
when this button is pressed, Maya sets the ball s Y position to 5 units. The at flag in the slider
group tells Maya to connect the slider and text field to the quoted attribute (in this case, the X
position of the ball). When you click the button, the ball jumps up to 5 on the Y axis. When you slide
the slider (or enter numbers in the text field), the ball moves back and forth between 0 and 10 on
the X axis.
Tip You can set the slider and text field to have different minimum and maximum values. The
fmn and fmx flags give the field s min and max values. The smn and smx flags
give the slider s min and max values. This allows the user to enter numbers outside the
slider s bounds, which can be useful.
You can also create radio buttons and check boxes that perform functions when pressed (see the
MEL documentation for more information on these).
Note As an exercise, what command could you place on the button to make the ball move
up 5 units every time the button is pressed?
Now that you ve seen how quickly you can create a basic window as an interface to your scripts,
let s make a script that automatically creates a useful window for you. Make a new scene, and
then create several lights and aim them at an object in the scene (you could use the create lights
shelf button you made in the last chapter to do this for you automatically or you could open a
scene you have already created that includes several lights in it). Now enter the following in your
Script Editor window:
string $sel[] = `ls -lights`;
string $current;
string $winName = lightWindow ;
if (`window -exists $winName`)
{
deleteUI $winName;
}
window -title Lights -wh 400 300 $winName;
scrollLayout;
rowColumnLayout -nc 2 -cw 1 150 -cw 2 400;
for ($current in $sel)
{
text -l $current;
attrFieldSliderGrp -min (-1) -max 10 -at ($current + .intensity );
}
showWindow $winName;
When you execute this script, Maya will automatically create a light board for you, allowing you
to control the intensity of all lights in the scene from one floating window.
The most interesting thing about this script is the first line:
string $sel[] = `ls -lights`;
This line assigns to the variable string array $sel[] the name of every light in the scene. The []
after the variable name tells Maya this variable is an array, or list of variables, starting with the
number 0. If there were three elements in the list, they would be $sel[0], $sel[1], and
$sel[2]. By declaring one array, then, you get three (or four, or however many you want)
variables for the price of one! The ls command tells Maya to list the items that come after (in this
case, -lights means list all lights in the scene ); then the reverse apostrophes tell Maya to
evaluate this command (which returns the name of each light) and read the result into the array,
$sel[].
Next, other variables are declared to store the current item ($current) and the window name
($winName), and the script checks to see if the window already exists if it does, the script kills the
old window (using the deleteUI command) so it can write a new one. This little piece of code is
good to include in all your GUI scripts, to ensure that you don t accidentally generate any errors if
a window by that name already exists. Then a window is created with a scroll layout (so the window
can scroll if it s too small) and a row/column layout (a table). Then the script performs a variation
of the for loop, called the for&in loop. The for&in loop looks through an array (in this case,
$sel[]) and does one loop for each item it finds, placing the value of $sel[number] in the
variable $current.
Note The type of $current must therefore match the type of $sel[] (in this case, they re
both strings).
The loop then prints out the name of the light (in column 1) and makes a field slider group that s
attached to the light s intensity setting (in column 2).
Tip If you only wanted the lights you had previously selected in the scene to be in the
window, you could add the flag -selected to the ls command on the first line.
This little script should indicate how powerful a workflow enhancer MEL can be: in just a few lines
of script, you have created a way to control potentially dozens of lights in a complex scene in a
completely simple, intuitive manner. If you needed to create just the right light levels on twenty
lights in a scene, it could take hours navigating to each light and adjusting it individually. This script
could make the job a 10-minute effort instead!
Note As an exercise, try creating sliders that let you adjust the light s colors as well as its
intensity (hint: there are three attributes, colorR, colorG, and colorB, which
control the red, green, and blue intensities). If you really want to get crazy, try placing
each group of controls for each light in its own subwindow (so intensity, colorR,
colorG, and colorB are all inside a window). You ll need to know about the
setParent command, as well as how to make a frame layout with the flag cll
(collapsible) set to true (to make each window close by clicking its triangle). You could
also add check boxes to turn off each light s visibility, so that you can see the effects
of each light separately. You can find help for these commands in Maya s online
reference documents, and if you get stuck, there is a finished MEL script listed at the
end of this chapter and included on the CD.
In this section, we ll look at procedures and scripts. A procedure is the basic building block of a
MEL script. At its most fundamental level, it s simply another declaration line that tells Maya that
all the contained lines form one named function. A script is just a collection of one or more
procedures.
Procedures
In abstract, a procedure would look like this:
proc myProcedure ()
{
commands
}
Maya will execute all the commands contained in the curly braces every time you type
myProcedure into the Command line or the Script Editor s Input window. MyProcedure is the
name of the procedure, and the parentheses can contain any number of declared variables that
can either be called from another procedure or entered by the user when executing the procedure.
As a simple example, let s make a procedure that will create a user-defined number of you
guessed it spheres.
global proc makeBall (int $num)
{
int $num;
for ($i=1; $i<=$num; $i++)
{
sphere -r 1 -name ( ball + $i);
}
}
Enter ( source ) this text into the Script Editor. Then, whenever you type makeBall into the
Command line or Input window, followed by an integer number, you ll get that many spheres
(called ball1, ball2, etc.) in your scene. Typing makeBall 5, for example, would make five
spheres named ball1 through ball5 in your scene. We ve made this procedure global so
that Maya can reference the procedure from within your \scripts directory (more on this in a
moment).
You know that a procedure is just a bunch of MEL commands contained in braces and given a
name; so how would you turn our series of light board commands into a procedure? If you need a
hint, it would look something like this:
global proc lightBoard ()
{
string $sel[] = `ls -lights`;
string $current;
string $winName = lightWindow ;
if (`window -exists $winName`)
{
deleteUI $winName;
}
window -title Lights -wh 400 300 $winName;
scrollLayout;
rowColumnLayout -nc 2 -cw 1 150 -cw 2 400;
for ($current in $sel)
{
text -l $current;
attrFieldSliderGrp -min (-1) -max 10 -at ($current + .intensity );
}
showWindow $winName;
}
Once you source (enter) this procedure, each time you type lightBoard in the Command line, the
procedure will run and you will get a light board for all your lights.
Scripts
What is the difference between a procedure and a script? A script is just a collection of one or more
procedures. Thus, the lightBoard procedure we just wrote is actually a script as well. A true
script is also saved as an external text file, and given a name, which must end in .mel, and the
name of the script must be the same as the name of the last (global) procedure in the script (plus
the .mel extension). For our lightboard example, we would save the script as lightBoard.mel,
and store it in our AW\user name\Maya\scripts directory (when you choose Save Selected from
the Script Editor s menu, this is the default directory that shows up, so just save it there).
Now let s make a simple script that contains two procedures, to see how that s done.
//Source this script, and then type makeBall <number>
//in the Command line or Script Editor. The
//procedure will make the number of spheres you
//specify, and call them ball1, ball2, etc. .
//Created by: John Kundert-Gibbs.
//Last Modified: May 31, 1999.
//Use at your own risk.
All we ve done with this script is to create a subprocedure that will actually make the spheres. The
main (or global) procedure merely calls the subprocedure (this is often the case with very complex
scripts just look at the end of a script, and you ll often find a very small procedure that simply
calls all the other ones in the script). Note that the last procedure is the one that you call by typing
makeBall 5 in the Command line. This is (and should be) the only global procedure in the script
the makeIt procedure being a local procedure (and therefore not visible outside the script).
A Comment on Commenting
Notice that we have commented the script in the previous section extensively (with all the // lines).
At the very least, you should put in lines at the top of the script about what the script does, what
arguments (inputs) it needs, who wrote (or modified) it, and when it was last modified. We also put
in the use at your own risk line to indicate that some unforeseen problem could arise while using
the script, and that we are not responsible for any mishaps because of the script s usage. It is also
a very good idea to comment the beginning and end of every procedure (so it s easy to read
where they start and stop), and to comment any particularly tricky portions of the script.
You may think these comments are of use only to others and not yourself, and you d rather not
bother with them if you don t plan to distribute the script. But remember that two months after you
create the script, you may need to modify it, and if you can t figure out what you did or why, you ll
waste a great deal of time hunting through the script instead of getting right to your modifications.
Tip Don t get lazy! Always comment your scripts well (even the simplest ones). It s a habit
(and for once, a good one), so get into it!
To begin your journey of discovery, let s take a quick peek at three scripts (they are all contained
on the CD that comes with this book, so you don t have to type them in). So that you get used to
reading commented scripts, we have made our comments about the scripts inside the scripts,
rather than here. First is a reworking of the lightBoard script into a fairly robust tool for the user.
//Source this script; create and position one or more
//lights in your scene. Then type lightBoard in the
//Command line.
//The script will generate a set of collapsible
//windows (one for each light) that control each
//light s
//intensity, RGB colors, and visibility.
//Created by John Kundert-Gibbs
//[email protected]
//Last Modified: May 31, 1999.
//Use this script at your own risk.
check ($winName);
scrollLayout;
rowColumnLayout -nc 1 -cw 1 500 ($main);
setParent $main;
}
showWindow $winName;
}
//end, lightBoard.
The next script is a way to adjust all keyable attributes of a selected set of objects (for example,
joints in an IK body), key each one individually, key all, record a default pose, and go back to
that pose. Like the light-board script, this window can be a real time saver when it comes to keying
complex motion.
//Source this script; select several objects, or
//joints in a character; type in setPose in the
//Command line.
//You will get a window that allows you to manipulate
//all keyable attributes
//on the selected objects. Additionally, you can
//record a default pose
//and go back to that pose. You can also keyframe any
//or all attributes.
//Created by John Kundert-Gibbs
}
}
} //end recDefault
//main procedure.
global proc setPose ()
{
global string $list[];
$list = `ls -sl`;
string $current;
string $Attr;
string $main = mainWindow ;
window -t Set Pose ;
scrollLayout;
columnLayout ($main);
setParent $main;
text ;
}
showWindow;
} //end setPose
The final script revisits the chain of rigid body links we made in Chapter 15. Here, instead of
creating the links by coding MEL directly, we copied chunks of MEL output from the History window
and reworked it into a flexible script that builds the links for you (with a heavy ball at the bottom).
With all that goes on in this script, it appears pretty complex, but remember that we built this script
up in pieces, mostly by modifying MEL output as we performed each command.
//Source this script; and then type makeChain <number of
//links> in the Command line.
//The script will generate a series of linked loops
//(like a swing chain) that are all connected and have
//gravity attached to them.
//It also creates a ball called weight, at the bottom
select -cl;
select -r mainBar embeddedLink;
rigidBody -passive -m 1 -dp 0 -sf 0.2 -df 0.2 -b 0.6 -l 0 -tf 200 -iv 0 0
0
-iav 0 0 0 -c 0 -pc 0 -i 0 0 0 -imp 0 0 0 -si 0 0 0 -sio none ;
for ($i=1; $i <= $num; $i++)
{
select -cl;
select -cl;
sphere -n weight -r 2;
move -r 0 ((($moveNum + $offSetNum) * $num - $offSetNum - 5)) 0 ;
select -cl ;
//now select the last link and the weight ball, and
//make a pin constraint.
select -r ($linkName + $num) ;
select -tgl weight ;
constrain -pin -i 0 ;
select -cl ;
select -cl;
select -all;
displaySmoothness -divisionsU 3 -divisionsV 3 -pointsWire 16
-pointsShaded
4;
//Change some elements of the rigid solver so Maya
//doesn t choke on the data!
showEditor rigidSolver;
setAttr rigidSolver.collisionTolerance 0.0001;
setAttr rigidSolver.bounciness 0;
} //end makeChain
If you got through these last three scripts, and have a good idea what s going on in them, you are
ready to start making scripts of your own! Use the online reference documents, build on other
people s work, and make something really useful for yourself. Even better, share it with others via
a Web site (like www.highend3d.com) or an e-mail listserv.
Summary
In this chapter, we moved beyond the basics to discover just how powerful and complex MEL
scripting can be. We worked with variables, loops, and conditional branches. We learned how to
make custom GUIs for any purpose we wish. Finally, we created and examined full-blown MEL
scripts.
Although big scripts look complex, the secret to writing them is to build them up from small pieces,
and grab chunks of code (either from the Script Editor s History window or from other Maya users
scripts) and modify them for your own use.
Advanced MEL scripting is not for everyone, but if you like this sort of work, and get good at MEL,
chances are you can land yourself a full-time job just scripting for Maya.
Part V - Rendering
Part V: Rendering
Chapter List
Chapter Rendering Basics
18:
Chapter Lighting
20:
Part V - Rendering
Part Overview
Use the Render Globals dialog box, Render View window, and other basic rendering tools
This chapter deals mainly with cameras, render settings, and using Maya s IPR (Interactive
Photorealistic Rendering) tool. Shading and lighting will be covered more thoroughly in the
following chapters.
Rendering an Object
As we ve done in previous chapters, we will explore the process by plowing through an example
from beginning to end. To demonstrate the rendering process, we will use a beveled text letter. We
will light it, texture it, and animate it appearing and disappearing against a textured background.
Then we will render the animation as a video-quality picture sequence.
1. Create a beveled text letter M (using the Surface Bevel function), as we did in Chapter 6.
2. Create another perspective view by selecting Panels Perspective New. Persp1 camera is
created.
3. In the Outliner, rename the view to Cam_1. Open its Attribute Editor and set Film Back
Overscan to 1.1. Open Display Options and check Display Resolution. (You can also turn on
Display Resolution by selecting View Camera Settings Resolution Gate.) The box shows
you the exact area that will be rendered. Check the Display Film Gate setting (just above
Display Resolution).
Note If you see another box overlapping the resolution gate, this means there is an
imperfect match between the width height ratio of the pictures to be rendered and
the ratio of the medium in which the pictures will be presented.
4. Go to the Film Gate setting in the Film Back section and select different mediums, such as
70mm projection, to see how the resolution ratio changes. Change the preset to 35mm TV
Projection, as shown below. This setting has the proper 1.33 width x height ratio for television.
The Film Gate and the Resolution Gate settings should match perfectly.
Note You may want to render at a smaller size as a test render, but still maintain the correct
(larger) aspect ratio, similar to the lock-aspect ratio feature available in Photoshop and
other graphics software. Maya provides a setting for this in the Render Globals dialog
box, discussed in the next section.
5. The default resolution setting is at 320x240, which you can see at the top of the resolution
gate, but you probably will want to render the pictures at a higher resolution. Select Window
Render Globals and open the Resolution section. For our example, set the Render Resolution
to 640x480.
6. Adjust the Cam_1 view, dragging and rotating the camera until you have the proper
composition for the letter M. Then keyframe the Cam_1 attributes. Now you will be able to
switch back to the regular Perspective window and test render the Cam_1 view as you make
changes to the lighting and textures.
As you saw in step 5, Maya provides many Render Resolution presets. If you are working with
television and video productions, the most common resolution setting is CCIR 601, which is
720x486, Device Aspect Ratio 1.333, and Pixel Aspect Ratio 0.9. This means that the image will be
720 pixels wide and 486 pixels high, but it will be shown with a 4:3 width height ratio because the
pixel aspect ratio is not square. The 640x480 resolution that we are using has Device Aspect Ratio
1.333 and Pixel Aspect Ratio 1, and it is considered the minimum broadcast-quality resolution.
Broadcast Standards
There are different broadcast standards in existence in different parts of the world. The PAL
(Phase Alternating Line) and SECAM (Sequential Color And Memory) systems are used in
Britain and in Europe. The NTSC (National Television System Committee) system is used in
North and South America and many Asian countries.
Unfortunately, these systems are incompatible in a number of ways. NTSC broadcasts 525
horizontal lines in a picture; PAL and SECAM broadcast 625 lines. NTSC transmits 30 fps
(frames per second); the others transmit 25 fps. They also have different broadcast channel
widths and types of signals. However, all of these standards broadcast pictures at a 4:3
image aspect ratio.
We render pictures at 640x480 resolution with square pixels, or 720x486 resolution with a
pixel ratio of 0.9, in order to make them fit the 4:3 aspect ratio. Device Aspect Ratio of 1.333
is another way of stating that images are being displayed at a 4:3 width height ratio.
With the coming of HDTV (high-definition TV), these standards are changing. Although there
still isn t a universal standard for DTV (digital TV), the accepted image ratio for HDTV is
16:9, which is the same ratio as the wide-screen format used for films. This ratio translates to
1.777 Device Aspect Ratio. The minimum resolution for the HDTV is 1280x720. For film, 2:1
and 16:9 are currently the most commonly used image ratios.
1. Select Window Render Globals and open the Anti-aliasing Quality section. Set the Presets
option to Intermediate Quality. You can change this setting to Production Quality when you are
ready to render, but for test renders, the Preview or Intermediate Quality settings are usually
good enough.
Tip For production quality or higher quality anti-aliasing presets, Maya automatically turns on
the Multipixel Filtering setting. Multipixel Filtering is good for situations where you see thin
surface edges. If there are no thin edges to anti-alias, it s best to have this option turned
off, because it can slow down the rendering process significantly.
2. Open the Image File Output section and type in a name for the picture sequence you will be
rendering in the File Name Prefix field. If you don t enter a name, the rendered pictures will
automatically be assigned the scene filename.
3. Set Frame/Animation Ext to name.#.ext. The animation settings become activated. If you leave
the setting at name.ext, then only the current time frame will be rendered.
4. Set End Frame to 60, because we will be rendering two seconds of animation.
5. The default Image Format is Maya IFF (iff) picture format. Change it to something more widely
acceptable, like the Targa (tga) format.
6. Set the Camera to Cam_1 to make it the renderable camera. Before closing the Render
Globals dialog box, check to make sure you have the settings shown below.
Formats such as JPEG or GIF are usually not used as image formats, because they do not carry
alpha channel (mask) information, which is often needed for compositing purposes, and they
compress the pixel information of the output, which may lower the picture quality.
Note Regular color pictures have 24 bits of color information for each pixel, stored in three
RGB (red, green, blue) channels. A picture with an alpha channel has an extra 8-bit
channel, which contains the masking information for each pixel of the picture. The
information is stored in the form of a grayscale picture, which often turns out to be the
outline of the objects being rendered.
By default, Maya renders the RGB channels and the alpha channel. You can also render the depth
channel (Z-depth) by checking the Channels box. Z-depth is similar to the alpha channel in that it is
represented as an 8-bit grayscale picture. As its name indicates, it stores the depth information of
pixels to be rendered. As with the alpha channel, it is mainly used for compositing purposes. If the
image format is the default .iff, then the Z-depth information is stored inside the image file being
rendered, like other alpha channel information. If you are rendering in a format like .tga, Maya
creates a separate Z-depth file for every image it renders.
The Renderable Objects setting is set to Render All by default, but you can switch it to Render
Active if you want, which will only render what you ve selected. Using the Render Active option is
useful if you are rendering in layers.
Tip In the Render Globals dialog box, you see Cam_1 as the camera available for rendering.
If you want to render multiple cameras, Cam_1 and persp, for example, open the persp
camera s Attribute Editor, go to the Output Settings section, and turn on Renderable.
Now if you go to the Render Globals dialog box s Image File Output section and look at
the Camera menu, you will see that both Cam_1 and persp are identified as Renderable.
1. Create a default spotlight. Select Panels Look Through Selected, and move the spotLight1
view to something like (a) below.
2. Create another spotlight, and repeat the procedure to look something like (b) below. This is a
very convenient and intuitive way to set lights. You do not need to fine-tune anything at this
point we will be doing that with the IPR tool soon.
You can open any image in the Render View window, but you can only save an image in .iff file
format. Here are some of the things you can do in the Render View window:
" Keep multiple images by selecting File Keep Image in Render View for each picture you want
to keep.
" Take wireframe snapshots of different cameras available for rendering, or select a region to
render only that area.
" Zoom in and out and drag the image in the Render View window by using hotkeys and mouse
buttons, just as you can in a modeling view.
" Use the options on the View menu to change the view. Frame Image shows an entire image,
Frame Region focuses on just the selected region, and Real Size shows an image without any
zooming. You can also see a rendered image as separate color planes, luminance, or its alpha
channel (Mask Plane).
Note The toolbar in the Render View window includes buttons for the most-often used
functions. You can see what their functions are by placing the mouse arrow over the
icons.
Now we will use IPR on our letter M, but first we will get a snapshot. It s always a good idea to
take snapshots before you do any rendering, because it provides a quick view of what you are
about to render. Taking a snapshot also sets the camera you ve chosen as the active camera, and
you can later use the Redo Previous Render and Redo Previous IPR Render icons to render the
same camera view.
1. From the Options menu, turn off Auto Resize and turn on Auto Render Region.
3. Click the IPR button to start the IPR process. Once the letter M has been rendered, select a
region to start IPR tuning, as shown below.
If the image is real size, the marquee box stays green. As soon as the image is zoomed in or out,
the box turns red. Note that the IPR icon in the top-right corner has turned red as well, indicating
that IPR is active. The indicator to the left of the icon shows how big the IPR file is. Now any
change you make to the lighting or texture information relating to the letter M will be updated within
the tuning region automatically.
There are some neat things you can do within the selected IPR tuning region. You can Shift+click
over any pixels within the region to find out which shades and lights are affecting them, and select
those nodes. You also can drag materials and textures onto the objects within the region, and they
will update accordingly. Any modification in the shading information is updated in the region with
speeds comparable to that of a Hypershade swatch update, because the visibility calculations have
already been made. (We will use the Hypershade window in the next section and examine it in
detail in Chapter 19.)
Having the visibility information already stored in the IPR file means that once the file is there, you
can change the camera view and make changes in the surfaces without disturbing the IPR tuning
region. Those changes are not recalculated until you start another IPR. While this allows you to get
more mileage out of a single IPR file as you are editing lighting and shading, keep in mind that if
the changes in the surfaces visibility are significant enough, the IPR updates can go out of sync
with how the surfaces actually look. If this happens, you should create another IPR file.
Next, we ll use the Hypershade window to shade the letter M. As in the Render View window, you
can zoom in and out and move around in Hypershade using the hotkeys and the mouse buttons.
You can also zoom in and out of the Visor panel, a render-centric file browser. This may seem a bit
weird at first, but it allows you to clearly see the swatches and the labels, which is a must when
working with shaders. We will go through the steps to shade and texture our current example,
without much explanation of the settings. You will get a proper introduction to Hypershade in the
next chapter.
1. Keep the Render View window open, and adjust the spotlights until you are fairly satisfied with
the way the letter M is being lit in the tuning region. After you ve shaded the letter properly,
you can come back to this view and fine tune the lighting.
2. Select Window Hypershade. Zoom in to the Visor panel that appears on the left side of
Hypershade. Go to the Create directory, then the Materials folder under it (open the folder if it
s closed), and MM drag the blinn# material onto the Hypershade, as shown below.
3. Go down to the Texture folder in the Visor panel and MM drag the brownian# texture into the
layout and over the blinn material. A list of possible input connections pops up. Connect to
color, and you will see the brownian texture come up on the blinn material swatch.
4. Drag the same brownian texture over the blinn material to see the list pop up again. This time,
connect to bump, as shown below. You ll see the bump effect of the brownian texture on the
blinn material, along with the creation of a bump node.
5. In Hypershade, RM choose Graph Rearrange Graph to sort the nodes, then click the icon in
the top-left corner to hide the Visor panel.
6. With the Hypergraph and the Render View windows close to each other, drag the blinn material
onto the letter M inside the tuning region of the IPR window. Since there are two surfaces
comprising the letter M, you ll need to apply the material twice. The material, along with the
brownian color and bump, should update on the letter M almost immediately, as shown on the
next page.
Tip There are many other ways to apply the blinn material to the letter M. One way is to drag
the swatch onto the object inside the modeling window. Another way is to select the
object, then move the mouse over the blinn swatch and RM choose Assign Material to
Selection.
7. The default bump value is too high for our purposes. RM choose over the brownian texture to
open its Attribute Editor, open Color Balance, and move the Alpha Gain slider down. You
should see the bump on the letter M start to lessen in the IPR tuning region. Adjust the Alpha
Gain value until you like what you see. To adjust the bumpiness in a different way, you can
also try playing with the increment value slider in the Brownian Attributes section.
8. Work in the same way with brownian s Color Gain and Color Offset values to adjust the color
of the texture.
9. Go to the blinn material and adjust Specular Shading by moving the Eccentricity, Specular Roll
Off, and Color sliders. (Specular Shading has to do with how the light is reflected from an
object.)
10. Return to the spotlights and fine tune the lighting, this time adjusting not only the angles, but
also the Color, Intensity, and Dropoff values. You may also want to change the tuning region to
different areas to make sure there are no hidden surprises. The updates we ve made appear
as shown here. (You can also see this image in the Color Gallery.)
If you have been experimenting with the other sliders and fields, you ve seen that some of them
do not affect the letter M at all and that some others should be left alone. It s very easy to play with
the texture, material, and the light attributes and get immediate feedback from the IPR tuning
region. One of the best things about IPR is that it frees you to experiment with the attributes and
think of other possibilities there is less reason for number crunching and more room for artistic
impressions.
If a single image were the goal in this exercise, once you were satisfied with the way everything
looks, you might increase the Anti-aliasing to Production Quality setting, then click the top-left
corner icon, Redo Previous Render, to render a final image. You could then save the letter M
image and convert it to another format using the Fcheck utility. But our example is for a sequence
of images, which requires us to do a bit more work.
1. In the blinn material Attribute Editor, slide up the Transparency value all the way to white. In the
IPR region, the letter s surface disappears, but the specular highlights still remain. Notice that
the alpha channel for the letter also becomes black, which you can check by clicking the
Display Mask button.
2. To make the letter M become completely invisible, you need to turn down the Specular Color
slider all the way to black. At frame 5, RM choose Set Key for Transparency and Specular
Color.
3. Go to frame 15, turn down the Transparency value, raise the Specular Color value, and Set
Key those attributes. The letter M now appears over a ten-frame time interval.
4. Repeat the process in the opposite direction between frames 50 and 60 to make the letter
disappear. Notice that as you move the current time indicator in the time slider, the IPR tuning
region updates the changing transparency and the specularity.
5. Select Window Animation Editors Graph Editor. Here, you can see the blinn material s
keyframed attributes, as shown below. (See the Color Gallery on the CD for the Graph Editor
s color coding.)
6. Select all the curves and apply Tangents Flat to make sure the Tranparency and Specularity
attributes stay constant between frames 15 to 50. The ease-in/ease-out shape of the
keyframes also ensures the smooth appearance and disappearance of the letter M.
1. Select Cam_1 and open its Attribute Editor. Open the Environment section and click the Create
button to create an image plane.
2. Click the Create button beside the Texture field to open Create Render Node and select a solid
fractal texture.
3. Since background textures do not show up in the IPR, you need to render the region to test
how the solid fractal matches up with the letter M. Adjust its Color Gain, Offset, and placement
attributes to get it to look the way you want something like the image shown below.
Tip You can select the image plane in several different ways. One way is to first select the
camera, then click the arrow beside the Image Plane Create button to get to it. Another
way is to go into the component mode and click the question mark icon, which enables
image plane selection. A third alternative is to open the Outliner, RM choose to toggle off
Show DAG Objects Only, then scroll down to select the Image Plane node.
Batch Rendering
We are now ready to render. Before you save the scene, however, let s see where the rendered
pictures will be placed.
1. Select File Project Edit Current. The Edit Project dialog box tells you the location of the
current project. Go to Render File Locations section and look at the field beside Images. If this
field s entry says Images, there is a default subdirectory in the current project called Images,
and the rendered pictures will be placed into that directory by default. If nothing is in the field,
the rendered images will be placed into the current project directory.
3. Open an MS-DOS Command Prompt window (if you are using SGI, open a Unix shell window).
Go to the directory where you ve saved your letter M, and you will see the file listed as
letter_M.mb.
4. Type Render and press Enter. All the options that you can use with the Render command are
listed.
Render s 1 e 60 b 1 rd D:\Sybex\Chapter18\Renders\ n 2
letter_M.mb
The Maya Rendering program will take the file letter_M.mb, render frames 1 to 60 using two
available processors, and put the rendered pictures into the directory listed in the path.
In this example, we used the most common Render command options: -s for start frame, -e for
end frame, -b for by frame or step, -rd for the directory path in which to store rendered images,
and n for number of processors to use. You also could leave out the rd option, render the
pictures into the default render directory, and move the pictures out of that directory later.
Other options, such as mb for motion blur and sa for shutter angle, can also be handy in certain
situations. For example, let s say you ve rendered a run cycle, and while checking the rendered
pictures, you notice that frame 12 is looking very weird because of the motion blur. Rather than
opening the file and fixing this, you can either render just that frame without the motion blur (-mb
off) or reduce the motion blur by typing in a lower shutter angle value (-sa 70, for example).
Once the rendering is done, you can view the rendered pictures using the Fcheck utility. Fcheck
allows you to view a single image or a sequence of images, check their alpha channels, view the
different color planes, and see the Z-depth information. You can also save the images into many
different picture formats. (If you are working with SGI machines, you can use the imgcvt command
to convert images into different formats.)
Note You can reduce the time it takes to render your scenes by using some optimizing
techniques. See Chapter 20 for some render optimization tips.
With any editing software, or with some renaming and renumbering script commands, you can
extend frame 1 forward to frame 5, reverse the animation from frames 5 to 15 to make them frames
50 to 60, and hold frame 15 until frame 49.
We also should have rendered the letter M separately from the fractal textured background. Since
the background remains constant, only a single frame is necessary. Using compositing software,
the letter M could have been composited onto the background.
In a production, the rendering pipeline is often set up to layer render anything that can be layered.
Below is a partial example of how the letter M can be rendered as multiple-layered render passes.
The floor has been added to illustrate the shadow passes. (You can also see this image in the
Color Gallery on the CD.)
Although not included in the sample pictures, there also should be a separate render for the floor,
with the accompanying alpha channel. To create just the shadows on the floor, select the letter M
surfaces, go to the Attribute Editor s Render Stats section, and turn off Primary Visibility. To create
the shadow mask, color the floor black, make the lights black as well, and turn their shadow color to
white. Separating these elements may seem like extra work, but it allows you more control at the
compositing stage, and can ultimately save you time in terms of making changes or corrections.
You can increase or decrease only the specularity or change the colors on the letter M. You can
darken or lighten just the shadows, or sharpen them or blur them. If you have the proper
compositing software, you can even transform and animate the different layer elements. If the
render was being done in one pass, you would need to re-render the whole scene each time you
wanted to make changes to any of these things. However, if you had rendered these items as
separate elements, you would only need to re-render the elements you wanted to change. Whether
these refinements are worth the extra effort depends on your specific production situation, but
having more control at the compositing stage is usually the better way to go.
Open the letter_M file, select Cam_1, and open its Attribute Editor. Go to the Depth of Field section
and check Depth of Field. Its attributes become active. The Focus Distance attribute does what it
says it sets the distance for the camera focus.
It would be useful to have a way of interactively controlling that distance in the modeling window,
instead of punching in numbers. An easy way to do this is to open the Connection Editor with the
Camera Shape loaded on both windows, and connect the Center of Interest output to the Focus
Distance input. This constrains the focus distance to the camera s center of interest, which shows
up as part of the Show Manipulator handle.
In the picture below (also available in the Color Gallery on the CD), the F Stop value may be a bit
too low. Also, the blurring, a post effect, is expensive (meaning it takes longer to render). However,
because it is a 3D blur, it adds much more realism to the rendered image than any post-effect 2D
blur can. If you want more control, or just need to have the camera s center of interest and the
focus distance to be separate entities, you can connect the focus distance to a locator instead.
Go to frame 1, enter 1 in the Frame Extension field, and RM choose Set Key to keyframe it. At
frame 10, enter 10 into the field and keyframe that. Now when you move the time slider, the frames
update. If you open the Graph Editor for the image plane, you can see a linear curve for the Frame
Extension, as shown on the next page.
Loading picture sequences is easy. Camera tracking the live footage, however, is a tedious and
time-consuming affair usually frame-by-frame matching work. Once the tracking is done, matching
up lighting and shading to the live footage is yet another grim task. But as we will see in the next
chapter, using IPR can make even that an enjoyable process.
Tip Maya Live, which comes bundled with Maya Unlimited (the other Maya package that
Alias sells), is tracking software. That program works wonderfully and can save you days
of work. If you re interested, you can search the Alias Web page for more information.
Summary
This chapter introduced you to the many varied parts of rendering. You learned how to create and
set up a camera and how to set the resolution and the format of the output in the Render Globals
dialog box.
We also covered the Render View window and IPR function, one of the more delightful new
inclusions in Maya 2. Then we took a brief look at other topics, such as working with image planes
and batch rendering.
Hypershade and lighting were also introduced. These topics are covered in depth in the next two
chapters.
We also identify objects by their color and texture. Maya has many default textures, such as wood,
rock, leather, and so on. These allow you to quickly create easily identifiable everyday objects.
In this chapter, you will learn how to use these default materials and textures to create
great-looking objects. For examples, we will use the dog, living room, and child models from the
previous chapters. But first, you need to learn how to use Hypershade.
Using Hypershade
Just as you can view and edit nodes and node network connections using dependency graphs in
Hypergraph, you can also work with them the same way in Hypershade. Hypershade differs from
Hypergraph in that it uses swatches, which give a level of visual feedback that Hypergraph lacks.
For viewing and editing render nodes such as textures and materials, Hypershade is indispensable.
Let s briefly go over some of the menu functions available in the Hypershade window. Then we
will see how the nodes and networks work in Hypershade.
The Duplicate command has three options. The blinn1 material with the checker texture in the
picture below forms a simple network.
" Duplicate Without Network produces just the blinn3 node, which copies all the properties of
the blinn1 material, but not the network.
" Duplicate With Connections to Network produces blinn4, which inherits the same upstream
node network connections as the original blinn1 node.
The Convert Material to File Texture function converts a material or texture into an image file, which
then replaces the original as a File Texture with UV coordinates. You can adjust the image size and
turn on Anti-aliasing in the option box. The image will be placed into your current project directory.
You can select material nodes, 2D or 3D textures, or projections for the conversion. If you select
the Shading Group node, the light information will be baked into the image as well.
" The Camera folder contains the camera and image plane nodes.
" The Lights folder contains the four standard light types.
" The Materials folder contains nine material types. When you drag one of them into the layout
area, a Shading Group is automatically created and linked to it.
" The Post Process folder holds the opticalFX, which creates light effects such as glow, halo, and
lens flare.
" The Textures folder contains the 2D and 3D textures, in alphabetical order.
" The Utilities folder contains the Color, General, Particle, and Switch subfolders.
On the Create menu, the Create Render Node command opens a window with tabs. For volumetric
materials such as Env Fog, you need to use the Create menu or the Create Render Node window,
because these materials are not listed in the Materials folder. Also, if you want to apply a texture as
a projection or a stencil, you should use the Create Render Node window to change the setting
from Normal to As Projection or As Stencil.
The Create menu is organized the way it was in previous versions of Maya. The Create
Render Node command opens the tabbed window, which, for most users of earlier Maya
versions, was the primary venue for creating render nodes.
The Visor panel s organization is a bit different, but the render nodes are all the same
nodes. Under the Create directory, the camera and the image plane nodes are now in the
Camera folder, not in the Utilities section. The opticalFX has also been moved from the
Utilities section to its own Post Process folder. The material types can now be changed in the
Attribute Editor, but their settings may get lost during the change.
The Up and Downstream Connection command performs the same function as it does in
Hypergraph, listing the nodes connected to the selected nodes in the layout area. The Upstream
Connection and Downstream Connection commands can be useful when you know which stream
you want to view and edit. They also reduce the clutter in the work area when you are working with
a complex scene.
The Rearrange Graph command cleans up the layout area and reorganizes the nodes for better
viewing.
Other Menus
The Window menu gives you access to the Attribute Editor, Attribute Spread Sheet, and
Connection Editor.
The Options menu s Swatches Keep Fixed Size command keeps the swatch resolution to a
fixed size, so that when you zoom in, the resolution doesn t update. This makes the swatches less
accurate when closely zoomed in but increases their interactive speed.
The Layout menu enables you to switch the layout area to viewing only Shading Groups, Materials,
Textures, Utilities, Cameras, or Lights. It also creates a new layer when you bring a new node into
the layout area. Subsequent nodes that are brought in stay in the same layout area so you can
view their input/output relationships.
Tip If you want to create a separate layer for any node, select Graph Clear View and drag
the node into the work area. A layer is created with the node s name. Subsequent nodes
that are brought in will stay in that layer.
" RM choose over the left-bottom corner. You see a list of the attributes that can be connected
with incoming information, as shown in (a) below.
" RM choose over the right-bottom corner. You see a list of the attributes that can go out to the
other nodes, as in (b) below.
" MM drag a checker texture over the blinn material. The default connection box pops up. In the
example below, labeled (c), this is the triple-channel connection. If the incoming information
were a single-channel connection, a different box would pop up. Also, different nodes have
different channels listed for their input/output connections.
" RM choose over the material node. A box pops up with a list of operations you can perform on
the material node, as in (d) below. The Graph Shader Network function lists nodes that are
connected to the material node. Assign Material to Selection assigns the material node to
selected surfaces. Select Objects with Material selects all the surfaces that have the material
node assigned to them. Frame Objects with Material selects and frames the surfaces with the
material in the modeling window. You can also open the Attribute Editor for the material node or
rename it.
Note You can assign different shading groups to different faces of a polygon object. For
NURBS surfaces, only one shading group can be assigned to a surface.
Below is an example of a fairly simple network, which includes different swatches you will soon
become very familiar with. (It s also in the Color Gallery on the CD.) Working backwards, the
blinn1SG (Shading Group) is getting its shading information from the blinn1 material swatch and
nurbsSphere node. The blinn node is getting its color information from the checker1 node, which is
also outputting its alpha channel information to a reverse node. The reverse node, true to its name,
is reversing the information it s getting and is passing it on to the 2D bump node, which is
connecting to the blinn s bump channel input. The leather and brownian textures connect to the
checker texture s color attributes, and there are placement nodes for each of the textures: a 2D
placement node for the checker texture and 3D placement nodes for the leather and brownian
textures.
Note that everything is arranged exactly the same way as in the Hypergraph node network. Like
Hypergraph, Hypershade lets you move the mouse over the lines connecting the nodes to find out
exactly what attributes are being connected:
" The green lines are triple attributes, such as the RGB color information or the world space (X, Y,
Z) coordinates.
" The light-blue lines are double attributes, such as the UV coordinates of a geometry surface.
" The dark-blue lines are single attributes, such as the 8-bit grayscale masking values of the
alpha information.
To check or change these and other color designations, select Options Customize UI Colors
and open the Hypergraph/Hypershade section.
Tip MM dragging a node over another node opens the appropriate connection list. Ctrl+MM
dragging a node over another one lets Maya choose the default connection automatically.
If you want to use the Connection Editor to connect the two nodes, Shift+MM drag the
node. You can also drag a node into another node s Attribute Editor.
The nodes and networks can also be imported or exported. To bring in a scene, use the File
Import function or open your current project directory in the Visor panel and drag in the Maya scene
you want. You can save specific nodes or node networks by selecting them and applying File
Export Selection. The nodes will be saved as a Maya scene.
Coloring Surfaces
When you create a material and open its Attribute Editor, you can find its default Color attribute in
the Common Material Attributes section. The default is set as a gray color with zero saturation and
0.5 value in HSV, or 0.5 RGB. Maya provides many ways to adjust the color of the material:
" Use the Color Chooser. To access the Color Chooser, click the color box beside the Color
attribute.
" Connect textures or file textures to the Color attribute, typically by dragging them to the Color
attribute in the Attribute Editor. The Diffuse attribute acts as a scale factor to the color values,
with 0.0 being black and 1.0 being the original color values. The default Diffuse setting is 0.8.
" Map 2D textures to a surface as normal UV textures or as one of many types of projections:
planar, spherical, cylindrical, ball, cubic, triplanar, concentric, or perspective.
" Apply 2D textures as stencils image files are more often used as stencils).
" Map 3D textures as if they were solid objects occupying space in and around the surface.
" UV map images as file textures or project them on a surface. They can be single pictures or
sequences of pictures (as you saw in the previous chapter).
" Use Surface Shader for coloring a material node. Although it is stored in the Materials folder, a
Surface Shader has the information for only the color, transparency, glow, and matte opacity of
a material. When you want to use the same color for many different materials or textures,
Surface Shader enables you to have one node control the color information of many nodes.
" Use Shading Map to color a surface. Shading Map is typically used for non-photorealistic, or
cartoonish, shading effects. It takes the colors sampled by a regular shader and replaces those
colors with a simpler color scheme using the brightness and hue of the original colors.
Controlling Shininess
Different materials reflect light differently on their surfaces. Lambert material does not have any
specular highlight. Blinn, phong, and phongE materials have different variables for calculating
specular highlight.
Blinn has the softest specular highlights among the three and is usually the material recommended
for surfaces with bumps or displacements, because it tends to rope or flicker less than the phong
materials. Blinn and phong are called isotropic materials, which means that they reflect specular
light identically in all directions.
New in Maya 2 is the anisotropic material, which reflects specular light differently in different
directions according to its Specular Shading settings. It more faithfully adheres to the way materials
such as hair, satin cloth, feathers, or CDs reflect light unevenly.
Shading Map also calculates specular highlight, but in a non-photorealistic way, as mentioned in
the previous section. The Use Background material s Specular and Reflectivity variables only work
with raytracing. The layered shader does not have specular variables because it creates layered
materials. See the Applying Textures section later in this chapter for more information about
layered shaders.
All the materials with specular highlight have Specular Color, Reflectivity, and Reflected Color
attributes. You can use the Color Chooser to tint the specular color,or map textures or image files
in the same way that you can with material color. In the picture labeled (a) below (also in the
Chapter 19 Color Gallery on the CD), the Specular Color attribute in the sphere with the anisotropic
shader has been tinted blue to match the blue color of the material. In (b), the sphere has a
checker texture mapped to Specular Color. You can also do the same thing with Reflected Color,
and fake reflection in this way, although true reflection only occurs with raytracing. In (c), the
sphere has an Env Sky shader with the floor texture mapped to its Reflected Color. The sphere in
(d) is raytraced; notice the reflection on the floor in that picture.
Raytracing
Raytracing lets you create refractions and shadows through transparent objects. Although
raytracing may be desirable and necessary when you want to create photorealistic images, it
is also more expensive than the regular rendering. When the settings are set high, the render
time can increase very dramatically.
To raytrace, you need to turn on Raytracing under Raytracing Quality in the Render Globals
dialog box. For refractions, you need to open the material Attribute Editor of the selected
surface and turn on the Refractions setting in the Raytrace Options section. To have
raytraced shadows, you also need to open the shadow casting light s Attribute Editor and
check the Use Ray Trace Shadows setting in the Raytrace Shadow Attributes section. You
also can control a surface s visibility in other surfaces reflections by turning on or off its
Visible in Reflections setting, which is in the Render Stats section of its Attribute Editor.
Creating Bumpiness
There are two ways to create bumpiness on a surface:
" Apply a bump map to a surface, which fools the camera into believing that there are bumps on a
smooth surface.
" Apply a displacement map, which actually moves the geometry to create the bumps.
There are advantages and disadvantages to both methods. Bump mapping is much more efficient
in terms of rendering, but it fails at the edges of a surface and cannot create the appearance of
extreme bumpiness. Displacement mapping does a better job of creating bumpiness because it
actually displaces the geometry of the surface, but it takes longer to render. Also, often the
geometry s UV spans or its tessellation count must increase significantly before you see proper
displacement, as shown below.
When you drag a texture over a material node and connect to its bump map, or drag to its Bump
Mapping field in the Attribute Editor, a bump map node is created. If the texture is 2D, a bump2D
node is created. If the texture is 3D, a bump3D node is created. Projection bumps also will create a
bump3D node. The texture s alpha value, which is a single-channel attribute, connects to the
bump node s Bump Value attribute. The bump node then outputs a triple-channel outNormal to the
material s normalCamera attribute, which creates the appearance of bumpiness on the material
surface.
When you connect a texture to a material s Displacement attribute, two nodes are created: a
regular bump node that connects to the material s normalCamera and a displacement node that
connects not to the material, but directly to the material s Shader Group node. Even though a
displacement map actually transforms the geometry it is applied to, you still need a bump map to
be applied with it to give the surface the correct bumpy look. Try deleting the bump node from a
material with a displacement mapping to see the difference.
You can also bump a bump map to add more detail to a bump mapped or displacement mapped
surface. In the example below, we displacement-mapped a bulge texture to a blinn material, which
we assigned to a sphere. We then created a leather texture and connected it to a 3D bump node
(because leather is a 3D texture). Finally, we connected that bump node s outNormal value to the
normalCamera attribute of the bulge s bump node, essentially bumping the bump node. The result
is the picture of the sphere below. (It s also in the Color Gallery on the CD.)
Adding Transparency
Transparency is a triple-channel color attribute, with black making the material opaque, and white
making it transparent. As with color and specular attributes, you can map textures or image files for
transparency, as shown below. Once a material becomes transparent, you can also turn on
refraction for raytracing. The Refractive Index in the Raytrace Options section of the material s
Attribute Editor controls how much the light bends as it passes through the transparent material.
For the refraction to have any effect, there must be more than one layer of surface that the camera
can see through. You can set up a simple example with two concentric spheres with a textured
floor to test how they raytrace with different Refractive Index settings, as shown below (and in the
Color Gallery on the CD).
For true refraction to happen to even a simple thing, such as a glass cup, you need to set the
Refraction Limit to at least 9. The light must go through at least four surfaces just to get to the other
side, bounce back, then travel through the cup to the camera for us to see the other side of the
glass cup. The Refraction Limit setting is in the Raytrace Options section of the material s Attribute
Editor, and it s also listed simply as the Refractions setting in the Raytracing Quality section of the
Render Globals dialog box. Both settings need to be adjusted; the lower of the two values will act
as the maximum refraction limit for the material.
You can also use transparency to layer different materials and textures on top of one another with a
layered shader. For more information about using layered shaders, see the Face Textures
section later in this chapter.
A related material attribute that needs brief mentioning here is Translucence. A translucent object
isn t necessarily transparent, but it does transmit light through its surface. Objects such as sheets
of paper, leaves, clouds, ice, and hair are examples of translucent materials, as shown next. (This
image is also in the Color Gallery on the CD.)
Adding Self-Illumination
You can add self-illumination attributes to materials through Incandescence, Glow Intensity, and
Ambient Color settings.
Incandescence
Many materials have Incandescence under their Common Material Attributes. This attribute makes
the surface with the material appear to give off light on its own. Red-hot metal and neon signs have
a noticeable incandescence.
Incandescence can also be used more subtly in many other surfaces. With an almost unnoticeable
amount of incandescence, a person s eyes seem much brighter, and flower petals and tree leaves
look much more like living things. You also can map textures or image files to Incandescence, as
shown below (and in the Color Gallery on the CD).
Glow Intensity
Materials can glow as well. Incandescence usually works better when it is combined with a bit of
glow. Many materials have a Glow Intensity attribute under the Special Effects section in their
Attribute Editor. When Glow Intensity is at zero, no glow is calculated; when the value is nonzero,
materials start to glow (as shown next and in the Color Gallery on the CD). The Hide Source setting
in the same section allows you to hide the surface with the material and show just the glow. Glow
can be very effective in creating certain atmospheric effects with the surfaces, like a hazy moon, a
warm sunset, or candlelight, as shown below. Halo Intensity works with Glow Intensity in the
shaderGlow shader Attribute Editor to control the way the surfaces will glow in a scene.
You need to be careful when using glow effects because they can get tricky. Unlike the
Incandescence attribute, glow is a post process. It bases its calculations on the amount of light the
surface is receiving from the light sources, including other objects that are glowing. In extreme
circumstances, an object s glow intensity will visibly change when other glowing objects enter the
scene. In such a situation, you need to go to the Post Process folder in the Visor panel, open
shaderGlow shader s Attribute Editor, and turn off its Auto Exposure. You then need to readjust
the Glow Intensity and the Halo Intensity in the Attribute Editor to get the proper glow look for the
surfaces in the scene.
Another thing to watch out for with glow effects is that their intensity can change with changes in
the render resolution. This means when you are test rendering with glow effects, you need to test
them with the same resolution as the final output.
Ambient Color
Materials also have Ambient Color. Ambient Color is similar to Incandescence in the way it actually
lights the surface, but whereas Incandescence illuminates the material, Ambient Color illuminates
the material s color, or its texture. Ambient Color is also different from Diffuse in that Diffuse
brightens the material color in areas where the light is hitting the surface, whereas Ambient Color
lights the whole surface. You could render a surface only with Ambient Color if you wished.
Applying Textures
Maya s Visor panel offers 26 textures: 9 2D textures, 11 3D textures, 5 environment textures, and
a layered shader. The layered shader is included in the Textures folder because it creates layered
textures as well as materials, and it can be used as a texture. With the exception of the layered
shader, all the textures get a placement node when they are created. Most textures also have a
Color Balance section and an Effects section.
Texture Placement
3D textures or 2D projections are placed much like real objects. You transform them in the world
space, and you can shear them as well. They are more expensive to deal with in that rendering
them will generally take longer than rendering 2D textures. You can convert 3D textures or
projections to 2D file textures using the Edit Convert Material to File Texture command in the
Hypershade window, but you may lose some quality in the process.
Because of the nature of 3D texture placements, when the surface with the texture deforms, the
surface will seem to swim through the texture, as shown below. New in Maya 2 is a function called
Reference Object, which enables the 3D textures or 2D projections to deform with the surface.
After you have assigned a 3D texture to a surface, select the surface and select Shading Create
Texture Reference Object in the Rendering module. Maya creates a reference object, translated 5
units in the X axis by default. If you want the same 3D texture placement, either translate the
reference object back to zero in the X axis or translate the 3D texture placement node 5 units in the
X axis. Notice that the texture in the third plane in the graphic below is squashed and stretched with
the surface.
Note Reference objects must be created before any deformation or animation is applied to
the original surfaces. A texture s placement is determined by its relationship to the
reference object, not to the original surface.
A place2dTexture node covers whatever surface it is assigned to exactly 100 percent. The
Coverage determines the percentage of the surface area the texture covers, and Translate Frame
and Rotate Frame transform the texture over the surface in UV. These attributes should not be
confused with the UV Repeat, Offset, and Rotate attributes, which determine the way the texture is
mapped within the coverage area. The examples below show how the various attributes affect the
texture placement.
The Alpha Gain attribute scales the alpha channel and is used for bump or displacement effects.
The default value is at 1.0, which is usually a bit too much for most situations. Below is an example
of the fractal texture, first with the default settings of gray for Default Color and 1.0 for Alpha Gain,
then with Default Color turned to white and Alpha Gain turned down to 0.3 to tone down the
extreme bumping. The fractal texture s Threshold value was also pushed up to 0.7.
In the Effects section, many textures have Filter, Filter Offset, and Invert attributes. The Invert
setting inverts the texture s colors and hue, changing white to black and vice versa. It also inverts
the alpha channel, changing bumps into dents and vice versa.
The Filter and Filter Offset attributes blur textures, and they are useful for when the textures are too
sharp or are aliasing. When a texture is too sharp, you may have shimmer or noise problems with
the surface when the textured surface or the camera is animated. By blurring the texture, or
smoothing it, you can usually make those problems disappear. Filter s default value is 1.0, but you
can lower it to something close to zero. Filter Offset basically adds a constant value to the Filter
attribute, and usually a tiny fractional value is sufficient to correct any excessive sharpness.
Below is the same example of the fractal texture as shown above, but with Invert turned on, Default
Color set to neutral gray, and Alpha Gain moved back to the default value of 1.0. The first
half-sphere has Filter set to 0.01, and it is a bit too sharp and may shimmer with a moving camera.
The second half-sphere has Filter Offset set to 0.005, and the bumps have been noticeably blurred,
perhaps even a bit too much. But that much blurring has made the second surface safe from any
problematic shimmering.
For 3D textures, the Effects section has three extra attributes: Wrap, Local, and Blend (illustrated
below and in the Color Gallery on the CD). Because a 3D texture is placed as a solid cube around
an object, if the object is partially moved outside the cube, that area is colored by the Default Color
attribute, as shown below. Wrap, which is on by default, enables the texture to extend to cover the
whole surface. The Blend attribute mixes the Default Color to the texture color. It only works when
Wrap is turned off. 3D textures are also applied globally, meaning when a texture is assigned to
three surfaces, those surfaces get different parts of the texture. When Local is turned on, the
textures are applied locally, so that the three surfaces get the same texture placement.
1. Select all the patches of the dog, except for the eyes and the nose, and assign a blinn shader.
(You could also assign a lambert or an anisotropic shader, depending on the way you want the
dog s fur to shine or not shine.) Adjust the specular settings until you are satisfied with the
way the material looks.
2. Assign a leather texture as the color. You need to use a 3D texture because a 2D texture will
map differently to the different patches. Adjust the settings and the placement node until your
dog looks something like the one shown below (and in the Color Gallery on the CD). Connect a
solid fractal to blinn s Bump attribute, and make it bump very subtly, as in the picture below.
The Attribute Editor values on the left are only a rough guide. You will want to use the IPR tool
to fine tune the texturing.
Tip Leather is a remarkably useful texture. It can serve as basis for a great variety of
surfaces, such as spots on dog fur, human skin, grunge, plant leaves, or a field of stars,
just to name a few examples.
3. When you are satisfied with the colors and the placements of the spots and their sizes, select
the patches and choose Shading Create Texture Reference Object. The reference duplicate
of the dog is created five units away from the original dog. Translate them back to the origin,
and the texture placement on the dog should be the same as before.
When you re finished, test the dog s legs or head to make sure the spots move and deform with
the surface.
1. Start with a blinn material for the floor, and assign a marble texture to it as its color. Turn down
the specular quite a bit.
2. Create a fractal texture and a brownian texture. Connect them to the Vein Color and Filler
Color of the marble texture, respectively, as shown on the next page (and in the Color Gallery
on the CD). You can adjust the texture settings as you see fit. You may want to also connect
the same fractal texture to marble as a bump map, and turn down the Alpha Gain setting to a
very subtle level.
3. For an old wall, first we need an acceptable wall pattern. Start with a blinn material and apply a
checker texture as color. The placement node for the first picture shown in the next graphic has
a Repeat UV of 32 and 1. Connect a cloth texture to Color1 of the checker attribute, and make
its Repeat UV, 64 and 32. You should see something like the top-right picture in the next
illustration, and we have our wall pattern.
4. To create a worn-out look, you can use a handy technique called smearing. Take a brownian
texture and connect its alpha channel to the Offset U and Offset V attributes of the placement
node for the checker texture, as in the bottom-right picture (and in the Color Gallery on the
CD). Reduce the Alpha Gain value to keep the smear effect from being too drastic. The
bottom-left picture is a good example of a subtle smear.
At this point, the colors themselves are still pretty clean, but there are many ways you can make
the colors dirtier. You can map the Ambient Color attribute of the blinn material, Color2 of the
Checker attribute, tint the lights shining on the wall, or map their Color attributes. If you want to be
able to dirty localized sections of the wall with total control, you can reassign a layer shader to the
wall, make the blinn material part of the layer shader, and start adding more layers, or dirt.
A simple deformed sphere has been added to the floor lamp for the lightbulb. The lamp stand, lamp
shade, and lightbulb need shading and texturing. We will use a ramp texture for the lamp stand, but
first we need to briefly go over what a ramp texture is.
Ramp is basically layers of colors, and it is probably one of the most often used textures. By
default, the ramp texture has three layers of RGB colors, which are called color entries. You can
create additional color entries by LM clicking in the ramp. The circles that appear at the left side of
the ramp allow you to drag the color entries, or you can type in a precise position value in the
Selected Position field. The square boxes at the right side delete the color entries.
As you can see in the examples below (and in the Color Gallery on the CD), you can apply the
ramp along the V isoparms, U isoparms, diagonally, radially, circularly, and so on. The color entries
mix according to a set Interpolation type; if you set Interpolation to None, the color entries will not
mix. You also can distort the ramp with waves and noise, and you can map other textures into any
of the color entries.
1. Assign a blinn to the lamp stand. Add a ramp to its color. Delete one of the color entries in the
ramp texture, and set Interpolation to None. Make the first color entry white and the second
entry blue. Adjust the position of the blue entry until you see the white is covering only the lamp
base and the blue is covering the lamp pole, as shown below.
2. Apply a fractal texture to the ramp s white color entry, and apply a wood texture to the blue
color entry. You could, for added effect, apply a subtle fractal bump on the blinn material. You
can use the same fractal texture for the bump mapping, because you can control its Alpha Gain
value without affecting its color values. Adjust the settings until you see something like the
lamp stand in (a) below. (This image is also in the Color Gallery on the CD.) A little glow was
also added to the blinn.
3. We want the lamp cover to be thin and a bit transparent. Assign a blinn, then a checker texture
as Color. The checker texture for this example has a Repeat UV of 16 and 32. In the blinn
Attribute Editor, increase the Transparency setting a bit, as well as the Ambient Color attribute;
add a tiny bit of Translucence. Glow Intensity should be fairly strong, but not so strong as to
wash out the texture. Play with the values in IPR until you see something like the lamp cover in
(b) below.
4. For the lightbulb, assign a blinn to the bulb, make the color dark orange, and choose a darker
orange for the Incandescence setting. Raise the Glow Intensity setting and turn on Hide
Source. Start an IPR process and adjust the settings until you see something like the lamp
shown in (c) below.
Tip The glow on the materials will change slightly each time you introduce a new element into
the scene, so don t spend too much time fine-tuning the glow until you have all the
elements you want in the final render in the scene.
1. Assign an anisotropic shader to hair, and connect a fractal as the color and bump.
2. Start IPR and set the fractal texture s Repeat UV to something like 32 and 0.8. Reduce its
Amplitude and Alpha Gain, and darken Color Gain, until you see something like the middle
picture shown below.
3. Go to the settings for the anisotropic material, and adjust the specular variables until you are
satisfied with the way the hair is shining.
Tip If you want more photorealistic hair, try scanning real hair and using it as an image file,
and instead of having one surface, put layers of strips as hair. Using this technique allows
you to animate strands of hair independently of the surrounding patches.
Shoe Textures
The shoes are made from simple spheres. We will need to do some fancy texturing work to make
them look acceptable.
1. Assign a blinn to the shoes, and connect a ramp to the color and bump. Get rid of one of the
color entries, and set Interpolation to None.
2. Start IPR and play with the position of the second color entry until it looks like (a) on the next
page (and in the Color Gallery on the CD). Connect a checker texture to the bottom color entry.
Set its Repeat UV to 32 and 4. Change the colors to look like the shoe in (b).
3. Add more color entries to create a lighter section in the middle of the shoe. Again, adjust the
color entry positions until you see something like the shoe in (b).
4. Map another ramp to the lighter color entry in the middle, set the Type to U ramp, and set
Interpolation to None. Insert color entries and set their positions to be like the shoe in (c) below.
5. Create a leather texture, change Cell Size to 5, and change the colors to something like the
shoe shown in (d) below. Map the texture to the blue and yellow color entries on both the V
ramp and the U ramp. You may want to perform a Convert Material to File Texture operation
with the leather texture if you are concerned about the texture swimming, but that probably will
not be necessary. Test to see how the texture looks as the shoe deforms.
Face Textures
For our example, we will work on the mouth and eyes. However, before we get started on the
mouth, it s a good idea to create a skin shader, which we can apply to all parts of the body.
Leather usually makes a decent skin.
1. Start with a blinn material, increase Eccentricity to 0.4 and decrease Specular Roll Off to 0.15.
Apply a leather texture as the color. For our example, a simple leather texture is being used as
skin, but you may want to map other textures into the leather Cell and Crease. (Another
common technique is to map an image file specifically for specularity.) In the next graphic (and
in the Color Gallery on the CD) are the settings for the leather texture used, but you should
experiment with the IPR to get the exact look and feel of the skin you want.
2. Assign a layered shader to the mouth. Layered shaders function essentially to allow multiple
layers of materials or textures on surfaces. A green and half-transparent layer is there by
default. Change the Compositing Flag to Layer Texture.
Note The default mode, the Layer Shaders mode, composites a bit differently from the Layer
Texture mode, and it is usually less efficient in the way it calculates the layers being
composited. The Layer Texture mode is the recommended setting for most situations.
3. Drag the skin material to the Layered Shader Attributes box, and MM drag it to the default layer
s right side. The skin shader has now become a layer under the default layer.
4. Select the default layer and assign a blinn material to it by either dragging a new blinn material
to its Color attribute or by clicking the Create button beside the Color attribute to open the
Create Render Node window.
5. Decrease the Eccentricity value of the blinn to about 0.15 and its Specular Roll Off setting to
about 0.4. Then assign a ramp to its color and bump. Set the Type to U Ramp, and create color
entries to demarcate the lip area and a subtle light-pinkish area gradually starting just below
the nose and ending before the edge. The lips should be a dark-reddish color, and the areas
around the mouth and the edge should be white, as in the next graphic (and in the Color
Gallery on the CD). The ramp will be used as a mask as well.
6. Connect a fractal texture to the color entry for the lips. Set its Repeat UV to 1 and 64 and
change its Color Gain and Color Offset values to make the fractal look like vertical strips of
dark and darker magenta. The lips should look textured, as shown below.
7. Select the layered shader, select the top blinn layer, and drag the ramp to the blinn layer s
Transparency attribute. The lighter parts of the ramp becomes a mask, masking out those
sections of the ramp texture and revealing the skin material underneath. The lip color becomes
lighter as well because it is doubling as a mask. You may want to readjust the fractal Color
Gain. (This image is also in the Color Gallery on the CD.)
Note This kind of layered shader and ramp work we did for the mouth is pretty much what
we would need to do to place the eye brows, which are typically image files.
8. You can create good-looking eyes made of simple spheres and textures. In our example,
however, the eyes are made of two spheres: an inner sphere for the pupil and the iris textures
and an outer sphere for specularity. Start with a layered shader, create a blinn shader layer,
and assign it to the inner sphere.
9. Start an IPR process, make the blinn color light gray, decrease Eccentricity to about 0.1, and
set Specular Roll Off to about 0.4.
10. Create another blinn material to be the pupil layer over the first one. Make it black, decrease its
Eccentricity to 0.05, and increase Specular Roll Off to 1. Then push up the Specular Color s
HSV value to 2.0. This will make the pupil shine with a tight and bright highlight. Put a ramp
into the transparency and softly mask the area around the pupil, as shown in (a) below (and in
the Color Gallery on the CD).
11. Create two more layers for texturing the iris area. Create another blinn material over the pupil
layer, and map a fractal to its color and bump. Make the fractal s Repeat UV 0.1 and 1, and
increase its Alpha Gain to 2.0 to intensify the bump. Put a ramp into the layer s Transparency
attribute and position the color entries so the ramp won t cover the pupil or too much of the
eyeball area. It should look something like (b) above.
12. Create yet another blinn layer over the third layer. But this time, turn down its specular to zero,
map a fractal just to its color, and make the fractal a bit darker. Put a ramp into its
Transparency attribute so it will show up only at the edge of the iris, blending with the first
fractal texture. You should see something like (c).
13. Assign a blinn to the outer sphere and make it totally transparent. Decrease Eccentricity to 0.1,
increase Specular Roll Off to 1.0, and push the Specular Color value to 2.0. The outer sphere
basically serves to make the eyes brighter with softer specularity, as shown in (d) above, and
shows the convex shape of the eye lens.
Clothes Texturing
Let s design a shirt for the child model.
1. Assign a layer shader to the shirt and the shorts, create a blinn layer, and assign cloth to its
color. Below (and in the Color Gallery on the CD) are the cloth settings and the resulting
pattern. Start the IPR process and experiment to see how the patterns change as you slide the
cloth attributes back and forth.
2. Create another layer on top of the cloth layer, and assign a ramp texture to the Color and
Transparency attributes. Materials and textures can mix on layered shaders. Set the ramp s
Type to Box Ramp and Interpolation to None. Get rid of one of the color entries. The top color
entry should be white, acting as a mask, and the bottom color doesn t matter for now,
because we will be mapping to it soon. Experiment with the placement node s Offset until you
get a box placed on the shirt and the shorts, as shown below. (This image is also in the Color
Gallery on the CD.)
3. If we assign a checker to the ramp s bottom color, we get something like the second picture in
graphic above, which is fine. But let s say we want to have a different checker color for the
shorts. We can use a switch utility. Instead of assigning a checker texture to the ramp s
bottom color entry, open the Switch folder inside the Utilities folder in the Visor panel, drag the
Triple Shading Switch node into Hypershade, and assign it to the ramp s bottom color entry.
4. Open the Attribute Editor for the Triple Shading Switch node. You see two empty columns. The
InShape column lists the surfaces being affected by the switch utility, and the InTriple column
lists the triple-channel information connecting to the surfaces through the utility. Click Add
Surfaces, and the shirt and short geometry names appear in the first column. Assign a checker
texture to the shirt, either by dragging the checker texture from Hypershade into the
appropriate row in the second column or by RM choosing over the row and opening the Create
Render Node window.
5. Assign a different checker texture to the shorts, and change the color of the checker texture.
The shirt and the shorts now share the same layered shader, the same ramp, but have
different checker textures (as shown in the previous graphic).
Summary
In this chapter, you learned how to use the Hypershade and work with render nodes. We also
covered materials and textures, their various properties and attributes, and how to work with them
in shading a dog, parts of the living room scene, and parts of the child.
Shading and texturing, as we have seen working with our examples, can take the simplest objects
and make them look good. But in creating these sample pictures, one essential part has been
intentionally omitted from the discussion. In the next chapter, we will learn all about this other half
of the equation in creating great-looking pictures. This aspect is lighting.
Chapter 20 - Lighting
Chapter 20 - Lighting
Types of Lights
You can light surfaces using ambient light, point light, directional light, or spot light. Usually you will
use a combination of different lights to get the effects you want. You can create any type of light
from the menu by selecting it in the Lights menu in the Rendering module, or by dragging it from
the Visor panel in the Hypershade. Below are each type s icons in the Hypershade and in the
modeling window.
Ambient Light
Ambient light can shine, as its name suggests, everywhere uniformly bathing all the objects in the
scene from all directions. You can get similar effects from a material shader by controlling its
ambient color. But ambient light can also behave as a simple point light, which shines from a
specific point to different directions. These two contrasting properties of ambient light,
omnidirectional and directional, can be mixed using the Ambient Shade in the Attribute Editor.
When the Ambient Shade is set to 1, the Ambient light behaves exactly like a point light. Ambient
light also casts shadows like point light, but only when raytraced. Below (and in the Color Gallery
on the CD) you can see examples of different Ambient Shade values. The third picture is raytraced
with Use Ray Trace Shadows turned on.
Ambient and directional lights do not have Decay Rate attributes, whereas Point and Spot lights do.
Spot light also has Cone Angle, Penumbra Angle, and Dropoff attributes as well. We will look at
these and other light properties next.
Tip You can change a light from one type to another in the Attribute Editor. When you do
that, however, only the attributes common to both types will be retained. Other attribute
settings will be lost.
Light Properties
For all types of light, you can control the basic properties of color and intensity. You can also
control the linkage between lights and the objects in a scene. For point and spot lights, you can
vary the intensity over distance by controlling the decay rate. Spot lights have additional properties
and attributes you can control. All these controls can be accessed in the light s Attribute Editor.
Tip A shadow mask is used in compositing to put shadows into a scene when objects in the
scene are rendered separately. It is especially useful when computer graphic elements
are being added to live footage. The shadow mask allows the compositor to blur the
shadows if necessary, and adjust the HSV (hue, saturation, and value) settings of the
shadow to match the shadows in the live footage.
Intensity values usually stay below 1 or 2 when the Decay Rate is set to None, but they can go up
much higher when Decay Rate is turned on, as you can see here (and in the Color Gallery on the
CD).
You can also control the intensity value of any light by mapping textures to it, which produces
results similar to mapping texture to color. Below (and in the Color Gallery on the CD) are
examples of a default grid texture mapped to the Intensity attribute of different lights with default
settings. Note how the grids are translated to intensity values differently for each of the four lights.
Note For spot light only, you can also create Intensity and Color curves to control their
values with respect to distance from the light source. To create the curves, click on the
Create buttons under the Light Effects section of the Attribute Editor. You can then edit
the curves in the Graph Editor.
Decay Rate
You can make the intensity of Point and Spot lights decay over a distance by turning on Decay
Rate. There are three decay rates to choose from: Linear, where intensity decreases proportionally
to distance; Quadratic, where intensity decreases proportionally to the square of distance (distance
distance), which is how light intensity decays in the real world; and Cubic, where intensity
decreases proportionally to the cube of distance (distance distance distance). Below (and in
the Color Gallery on the CD) you can see examples of each Decay Rate. Note how the intensity
value shoots up accordingly to light the sphere. You can hardly tell the differences in the sphere
itself, but the differences are noticeable on the floor.
Tip The Decay Rate begins to affect a light s intensity only at distances greater than one
unit from the light source. Inside the one-unit radius, no decrease of light intensity is
possible.
Tip The default light, with the Illuminates by Default setting turned on, is also called inclusive
light. When the setting is off, the light is said to be exclusive.
You can link lights and objects, or sever the links, from the Lights menu in the Rendering module.
Select the object(s) and light(s) in question. Select Lights Make Light Links to link them, and
Lights Break Light Links to sever them. Another method is to use the Relationship Editor. You
can either use what Maya calls a light-centric mode and link objects to a light, or use an
object-centric mode and link lights to an object. Below is an example of using a light-centric
Relationship Editor to link objects to lights. Of the three spheres in the first picture, the second and
third spheres have been severed from pointLight1. In the second picture, the second sphere has
also been severed from pointLight2.
Note The Lights menu also offers the Select Objects Illuminated By Light and Select Lights
Illuminating Object commands. When you select a light and apply the first command all
objects linked to that light are selected. When you select an object and apply the
second command, all lights linked to that specific object are selected.
Dropoff is similar to Linear Decay Rate, but instead of decaying over a distance from the light
source, it makes the intensity drop off from the center of the cone to its edge. Its results are often
similar to the Penumbra Angle with a negative value. Below (and in the Color Gallery on the CD)
are examples of different Dropoff values and their effects on the spot light.
Chapter 20 - Lighting
Shadows
The default light setting in Maya produces no shadows. This is because shadows can be very
computationally expensive and, in general, you want only one or two main lights to be casting
shadows. All lights can be set to produce either Depth Map Shadows or Ray Trace Shadows, with
the exception of Ambient light, which can only produce Ray Trace shadows. To activate shadows,
go to the Shadows section of a light s Attribute Editor, where you can check Use Depth Map
Shadows in the Depth Map Shadow Attributes section, or check Use Ray Trace Shadows in the
Raytrace Shadow Attributes section.
Color
The default Shadow Color setting is black, but you may want to lighten it or tint it with other colors,
or even map textures to it, depending on the look you want. Mapping into color can also be a good
way to fake transparency. Depth Map shadows do not recognize transparent objects; only
raytraced shadows do. But for simple situations, you can often get away with clever use of Shadow
Color, as in the examples below (and in the Color Gallery on the CD). In the first example, a
darkened version of the marble texture was connected to the Shadow Color; in the second
example, a ramp was used to create the more transparent upper area of the shadow.
Dmap Bias controls how much the shadow is offset from its source. It should generally be left at its
default value, except for situations where the shadow placement seems off, as in the left image
below.
Switch the setting to Reuse Existing Dmap(s), and the extra settings become active. The default
Dmap Name is depthmap, and the Dmap Light Name is checked, which means that when the
depth map is saved to disk, it will be assigned the name depthmap plus the name of the light
generating the depth map. For example, for a spotlight named Spot, a depth map file named
depthmap_SpotShape1.SM.iff is created. The first time around, Maya looks for a depth map in
the current project directories; and when it doesn t find one, it creates the depth map and places it
in the current project directory, under the \depth directory. The next time Maya renders, it uses
the depth map to shadow the surfaces, thus reducing rendering time.
In cases where the distances between the light and its linked surfaces do change over time, if you
will be rendering them more than once (as often happens with test renders) you can still create a
sequence of depth maps and reuse them by checking Dmap Frame Ext.
The other Disk Based Dmaps setting, Overwrite Existing Dmap(s), overwrites any existing depth
maps. If you have made positional changes to a light or any of its linked surfaces, you would want
to overwrite the existing depth maps. Once you ve rendered and created new depth maps, change
the setting to Reuse Existing Dmap(s) again.
Raytraced Shadows
For many situations, you would not want to use raytraced shadows because you can get almost
exactly the same quality with depth map shadows but with much more efficient render times. But
when you are creating shadows for transparent objects, for example, with reflections and
refractions, and photorealistic accuracy is needed, raytraced shadows are the only way to go. To
use raytraced shadows, you need to turn on Use Ray Trace Shadows in the individual light s
Attribute Editor, and also Raytracing in the Render Globals.
When Use Ray Trace Shadows is turned on, Shadow Radius becomes active for ambient light,
Light Angle for directional light, and Light Radius for point and spot lights. These different attributes
all affect the softness of the shadow edges. Zero, which is the default setting, gives you sharp, hard
shadow edges, and as the values go up, the edges become softer. The value range is different for
different lights.
As the shadow becomes softer, the edges at the default setting become grainier, as in the first
picture below. The Shadow Rays setting blurs the graininess of the edges. Shadow Rays is
render-intensive, so it is best to keep the values as low as you can.
Tip Soft edge shadows can be much more efficiently created with depth map shadows.
Raytraced shadows are more useful for creating sharp, crisp shadows.
Ray Depth Limit sets the maximum number of times, minus one, that a ray of light can be reflected
or refracted and still create a shadow. If the value of the Shadows attribute in the Raytracing
Quality section of the Render Globals is lower than the Ray Depth Limit value, that lower value
becomes the maximum limit. In the illustration shown next (and in the Color Gallery on the CD), a
Ray Depth Limit of 1 isn t showing the shadow behind the transparent sphere. By contrast, a Ray
Depth Limit of 3 shows it.
Chapter 20 - Lighting
Light Effects
In addition to the properties we ve looked at so far, Maya offers various special effects you can
apply to lights. These include fog and various optical effects such as glow, halo, and lens flare. You
can access these effects from the Light Effects section of a light s Attribute Editor.
Light Fog
Light Fog can be applied to Point and Spot lights. Point light fog is spherical, whereas the spot light
fog is cone shaped. When light fog is applied, a separate fog icon appears along with the light icon,
which you can transform to create the size and shape of the fog you want. On the next page (top),
you ll see examples of point light fog and spot light fog with different scales.
The Fog Type and Fog Radius attributes are only available for point light fog. Under Fog Type, the
Normal setting lets the fog intensity remain constant regardless of the distance from the light
source. The Linear setting decreases the fog intensity as the distance from the light source
increases, and the Exponential setting decreases the fog intensity as the distance increases
exponentially. Fog Radius determines the size of the spherical volume of the fog. On the next page
(bottom) are examples of point light s fog types, and different fog radius settings.
Fog Spread is an attribute available only for spot light fog. It functions very much like spot light s
Dropoff attribute. It determines the decrease in fog intensity as distance from the center of the cone
increases, as in the examples below. The decrease in intensity as the distance increases from the
light source is determined by the spot light s Decay Rate setting.
You can go to the lightFog node and adjust the Color and Density attributes of the light fog, or
combine light fog with light glow (discussed next) to produce a combination effect. When using light
fog, you will often also want to map textures into the light s Color attribute to imitate smoke or
bigger dust particles. The example below (and in the Color Gallery on the CD) has a solid fractal
texture mapped to the color attribute of spot light and point light.
OptiF/X
Maya has an optical light effects node (called OptiF/X), which can produce glow, halo, and/or lens
flare effects for point light and spot light. The light effects are useful in imitating different camera
filters, stars, candles, flames, or explosions. The light sources have to be inside the camera view
for the light effects to show, and the effects are all post processes, meaning they are applied after
all the regular rendering is done. In the Light Effects section of a spot light s Attribute Editor, click
on the box next to the Light Glow section, and an opticalFX node is created. The effects turn on
when the Active box is checked, and Glow Type and Halo Type are set to something other than
None. For Lens Flare, you also need to check the Lens Flare box separately. Below are examples
of these three light effects.
Glow and Halo have the same color and intensity attributes as regular lights, and you can change
their sizes through the Spread attribute. Halo Attributes are limited to those illustrated. Glow,
however, has the additional Stars and Noise attributes.
Working with glow effects can get a bit confusing because these additional attributes are scattered
in different sections of the Attribute Editor, with three of them in the Optical FX Attributes section,
and some of the others in the Noise Attributes section. The pictures below (and in the Color Gallery
on the CD) have glow beam effects with various settings. Starting from the top left, the Star Points
setting determines how many regular beams will come out of the light source. Their sharpness, or
width, is determined by the Glow Star Level setting, and randomness in the beams is introduced by
Glow Radial Noise. Once the Radial Noise setting becomes nonzero, you can adjust the frequency
of the random beams, and their width, by using the Radial Frequency attribute. The beams can be
rotated with the Rotation attribute. The two last pictures show more combinations of different
possible glow settings.
Noise attributes produce a fractalized look you can use to imitate a variety of effects such as fog or
explosions, as you can see next. Glow Noise produces the fractalized glow, which should always
be adjusted together with Glow Intensity and Glow Spread (among other settings) to achieve the
desired look. The Noise section enables you to adjust the noise threshold, its vertical and horizontal
scale and placement, as illustrated below (and in the Color Gallery on the CD).
Lens Flare
Lens Flare re-creates the effect of physical imperfections in an optical lens, which become
particularly apparent as the lens is trained toward a light source. Color in Lens Flare works a bit
differently from the regular color attribute in that lens flare color is a spectrum of colors, the range of
which is determined by the Flare Col Spread attribute. Flare Num Circles determines how many
circles (hexagons if Hexagon Flare is turned on) will show in the lens flare beam, and Flare Length
determines the length of that beam. The Flare Min and Max Size attributes limit the sizes of the
smallest and largest circles, and Flare Focus can blur or sharpen the flare circles. Lens Flare beam
doesn t rotate but is placed in different positions with Flare Vertical and Horizontal controls. Shown
next (and in the Color Gallery on the CD) are examples of lens flares with different attribute
settings.
Tip As you ve seen, lights in Maya can have many different properties and effects to
manage, and a complex scene may have numerous lights. Chapter 17 shows how to
build a MEL script that creates a graphical interface window for controlling all the lights in
a scene.
Chapter 20 - Lighting
Lighting Techniques
The art of lighting is another whole world unto itself, and studies in painting or photography will
certainly be of great help. We will be able to cover only the basics in the remainder of this chapter.
On the other hand, lighting is always an artificial endeavor. Stages and movie sets use many
artificial lights to create the best possible lighting environment, setting the proper atmosphere and
making sure the characters will be lit well. This often involves cheating reality, such as flooding
characters with bright blue light for a night scene when in reality the light would be much darker, or
creating a strong rim light (see the picture in the next section) on a character for a close-up, when
the setting doesn t have any such strong light source coming from the character s backside.
Good lighting often means that the dramatic needs of storytelling will override reality. But computer
lighting also has the additional burden of making the overall result look the same as if real lights
had been placed in the same spots, such as making sure the shadows look proper, that bounce
lights exist, or that colors don t get washed out. You also have to worry about issues like rendering
time, lighting transparent objects, linking lights only to specific objects that need the lights, and so
on.
Three-Point Lighting
When it comes to lighting a person, there are no hard and fast rules to good lighting different light
setups can serve different purposes, and experimentation is often the only sure rule. Generally
speaking, however, Rembrandt lighting is considered a good starting point. It is basically light
hitting a subject from an angle so as to bring out the contours of the subject, as in the first picture
below (and in the Color Gallery on the CD), creating a triangle of lit area on the dark side, as can
be seen in many of Rembrandt s paintings. This light is usually called a key light. In our example,
Spot lights are being used; but Point lights will work just as well. Another light is then placed to
shine on the dark side of the subject, as in the second picture below, usually from the side and
lower in intensity. This light is called fill light, because it fills the dark shadowy parts of the surface
with light. The general rule is that if the key light color is warm, the fill light color should be cool, and
vice versa. The third light is usually placed at the back and shining down on the subject, creating an
outline of the head and shoulders. Its intensity can vary from soft to very intense, the latter creating
a glow. This light is called back light, and it s good for separating the foreground character from
the background. Some people use the term rim light to describe this light as well. These three lights
make up what is known as three-point lighting, a standard lighting setup in photography. As Maya
does not automatically generate the bounce lights from these three lights, you may want a fourth
light to act as a low intensity, second fill light shining from the front to soften the dark areas
between the key light and the first fill light, as in the fourth picture below.
Tip A good technique for placing lights is to select the light and then, in the modeling window,
select Panels Look Through Selected. This lets you view the scene from the light s
point of view. Then, as you move and rotate in the modeling window, the light position
adjusts accordingly.
While three-point lighting will always give you a satisfactory setup to work with, don t fall into the
trap of making it the rule for all situations. Especially with lighting, the best examples are the ones
that break the rules (of course, the same can be said of the worst examples). Below are some
examples of extreme lighting setups. As a general rule, you do not want the key light to be shining
directly from the front, as it makes the subject look flat, but it can produce a good live video camera
effect if the intensity fall off is carefully handled, as in the first picture. Hard light shining down as
key light, or having two back lights as key lights, can also produce good dramatic effects, as in the
second and third pictures. And there s always the I-am-the-spawn-of-hell lighting, the key light
shining almost vertically up from under the subject, as in the fourth picture.
You ve read through the rendering information in this book, and you ve set up your scene
carefully. You ve put in only the lights you really need, and you ve set shadow casting for
most of the lights. But your render times per frame are still through the roof! What s going
on?
Most likely, the problem is that the render settings have not been optimized. There are many
ways to do this, and modelers have their own ideas on where to compromise quality and to
what extent. However, it s possible to optimize rendering without reducing the quality of your
work. Here, we present some production-tested ideas to help make your scenes renderable
in your lifetime.
First, and most important, you should link lights to the surfaces they will be illuminating.
Linking lights causes the renderer to calculate only the rays necessary to illuminate the linked
object and any shadows that are being cast by that linked object. The other objects in the
scene are ignored.
For example, this technique might be helpful when you have a directional light illuminating
your objects. If this light is also raytraced, the light will cast shadows from everything, which
could take a while (to say the least). An alternative would be to create a duplicate of the
directional light, exclusively link it to the objects that will not be casting shadows (don t link it
to the floor, either), and make this copied light non-shadow casting. Now link the original
raytraced light only to the objects that will be casting shadows (plus the floor). The result will
be a faster render, with raytraced shadows for only those objects that need it.
Another way to optimize this scene would be to eliminate shadow casting for the floor itself,
since we will never see the shadows it casts (which fall below the floor itself). Also, lowering
the tessellation of far objects will help conserve memory. Remember that a floor (unless
curved) does not need to be highly tessellated!
Maya has the ability to selectively raytrace objects and surfaces (parts of objects), which you
should use.
One of the best ways to reduce render times and give yourself more flexibility is to render in
layers with alpha and depth channels. Then, if you need to make adjustments later, you only
need to re-render the particular objects on a specific layer, not everything else, too. The real
power comes later, during compositing, because you can tweak colors, lighting (to an extent),
contrast balance, layer order, and so on. These things would take far too long to adjust and
test in a full-scene render, but this isn t the case with a few intelligently rendered layers. You
could render separate passes for the shadow, highlights, ambient color, reflection, and so on.
Then later, in the composite, you can interactively tune these parameters to your specific
needs. This takes some time to set up and initially results in longer render times. However,
huge time savings can be earned when you are tuning a scene in real-time, changing the
amount of reflection, highlight size, shadow color, and opacity all in a compositor, not in the
renderer. An excellent example of this can be found at Jeremy Birn s Web site,
http://www.3drender.com/jbirn/ea/Ant.html. (Although this rendering was done
in a program other than Maya, the principle applies to any 3D application.) Here are some
other render-optimization tips:
" Reduce bump maps, especially on objects far enough from the camera to not be noticed.
An intelligently created color map, added to the base color map of your object s texture,
can suffice to simulate the bump map from a distance, and it will greatly reduce render
times.
" Only model what viewers will see. This is especially important if you are going to be
raytracing too much geometry to raytrace (in reflections and shadows on floors) will grind
your render to a halt. The other reason to do this is to reduce the time you spend modeling,
so that you can have more time for rendering! Don t spend time doing amazing things
backstage where the audience can t see it.
" Limit your shadow map light s field of view to encompass only the objects casting
shadows. This reduces the amount of computations Maya must perform and allows that
savings to be applied to a larger shadow map.
" Check that only your surfaces that are supposed to be reflecting are set to have some
amount of reflectivity. If the shading group was created as a phong, phongE, blinn, or
anisotropic shader, these surfaces might be set to the default of 50 percent reflectivity.
" Selectively tune the render attributes of each object. Turn off Shadow Casting if you won t
be seeing the object s shadow. Turn off Visible in Reflections or Refractions if that
visibility isn t needed for the object. Turn off Motion Blur if the object doesn t move too
fast (and if the camera doesn t fly past it too fast). Turn off Double Sided for enclosed
objects that have no transparency.
" Test your render with the render diagnostics script. In the Render View window (Render
Render into New Window), select File Render Diagnostics. This will alert you to any
problems immediately, and it s always better to know about problems sooner than later.
" Use environment reflection maps whenever possible. They should be a size that is divisible
by 2, such as 256256. These maps also don t need to be very high resolution, if the
pixels that are reflecting don t take up much screen space. You can create animated
environment maps if those are needed, since the render times wouldn t be that long for
each frame at the small resolution. You also can simulate blurred reflections, by running
the frames through a blur filter in a compositing program first.
" Use texture maps whenever possible, because they aren t as render-intensive as
procedurals are. Procedurals don t take up as much memory as image files do, but this
shouldn t make a huge difference if you keep a close eye on your texture map file sizes.
Don t apply texture maps bigger than you need. This is especially true for output to
television, because the color space and ultimate resolution are limited to begin with.
" Render frames with motion blur and not fields whenever possible. The hit you take with
motion blur will rarely exceed the hit you take with rendering another whole field (or frame if
you are going to interlace them later in a compositor).
" Use 2D motion blur whenever and wherever you can. It is smoother than 3D motion blur,
almost as accurate (as far as the human eye can tell), and the render times are a fraction
of those of 3D motion blur at the same quality level.
" Last but not least, read the release notes. They can warn you of problems or slow areas of
the renderer before you start pulling out your hair!
Chapter 20 - Lighting
Summary
In this chapter we have gone through the four lights available in Maya and their properties, the two
ways of creating shadows, and the fog, glow, halo, and lens flare effects available for point and
spot lights. We have also discussed, though briefly, how to light characters in a scene using the
standard three-point lighting setup. And we ve discussed how to optimize rendering in relation to
lighting and similar issues.
This chapter completes the coverage of all the basic stages of producing character animation in
Maya, starting from the interface in Part I, and continuing through the discussions of modeling
techniques (Part II), animation (Part III), the MEL scripting language (Part IV), and rendering (Part
V), of which this is the last chapter. In Part VI, we will move into advanced effects in Maya, namely
particles and dynamics.
Appendix: Interviews
Part Overview
Understand the Basics of Particle Dynamics
Although we will show you how to use particles using relatively simple examples, particles are a
difficult area for most animators to grasp. Be prepared to spend some time working through the
examples in this chapter and experimenting on your own.
Note We will cover using collisions and fields with particles in this chapter. Expressions,
render types, and soft bodies are discussed in the next chapters.
Like (active) rigid bodies, particles themselves cannot be keyframed (although their parent emitter
object can). If particles are not keyframable, and you need to use numbers to alter their behavior,
why bother? As you will see, particles are a great way to create random or very large-scale
behavior that would be nearly impossible to produce the traditional way. Items ranging from rocket
exhaust, to dust, to human hair can be simulated using particles. If you need a plasma cannon or a
fountain (our first two projects), particles come to the rescue.
Because particles (like rigid bodies) depend solely on their attributes, you need to bring along a
sense of adventure to your work with particles. The best way to get to know how to do things with
particles is to play (and play and play) with the numbers in the Channel box or Attribute Editor.
Oddly enough, although particle simulation is based on science, it is really an art to get the particles
to do what you want.
Creating Particles
Before we begin making things with particles, let s figure out how to create the particles
themselves. There are a couple of basic ways to make particles: You can simply draw them into the
scene using the Particle tool, or you can create an emitter to shoot them onto the scene. In the brief
examples in the following sections, you ll try both methods.
In this option box, there are settings for creating single particles, multiple particles, random
particles, and particles in grids. Let s see how they work.
1. Leave the Particle tool s default settings and click anywhere in the scene. You should see a
red cross indicating where you have just created a particle. Click a few more times to create
several particles in the scene (you can rotate your view to get the particles in different places),
then press the Enter key to turn this bunch of particles into a group. Particles in a group all live
on the same node and will share the same fields, collisions, and render types.
2. Let s create clumps of particles instead of individual ones when we click. Delete all the
particles you just created. In the Particle tool option box, set the number of particles to 10, and
set the maximum radius to 5. Click in the scene. You see clumps of 10 particles created in an
imaginary sphere 5 units in radius. If you continue to click, the new clumps will be part of your
current particle node. If you press Enter between clicks (and then Y to return to the Particle
tool), you will create a new particle node each time.
Tip The easiest way to delete particles is to drag over them using the Select tool (Q on the
keyboard or the arrow in the menu) and then press Delete. You can also RM choose
Select All and delete them, but the particles must be unselected first.
3. Now try sketching particles in a line. Delete your particles once again. Click the Reset Tool
button to return to the default Particle tool settings. Then check the Sketch Particles box. In
your scene window, drag to create a line of particles. Then open the Particle tool option box
and reset the Number of Particles to 10 and Max Radius to 5. Sketch in the window again. You
see a kind of tube of particles, created with a radius of 5.
4. Finally, let s have Maya create a grid of particles for us. Delete the old particles and reset the
Particle tool. Check Create Particle Grid (you can adjust the spacing between particles here as
well, if you wish). Click once in the scene window, where the lower-left corner of the imaginary
box around this grid would be, and then click again in the upper-right corner. You get a
two-dimensional grid that looks something like the one shown below (and in the Color Gallery
on the CD). If you would rather have a 3D box of particles, click the With Textfields radio
button in Particle Options and enter the XYZ coordinates of the corners.
You now know how to create groups of particles by placing them with the Particle tool. The other
technique for dispersing particles is through an emitter, as described in the next section.
Tip To see the difference between one particle of many parts and several smaller particle
groups, try selecting one particle only. If you have created one giant particle node, all the
particles in the scene will be highlighted. If you created several smaller particle nodes,
only those in that particle s group will be highlighted.
Emitting Particles
Now let s see what a particle emitter does.
2. In the Emitter option box, select Directional for Emitter Type. In the Emission Direction section,
change DirectionX (the direction the particles will be emitted) to 1. In the Emission Speed
section, increase the Speed setting to 5. Then click Create and close the option box.
3. You see a small ball in the scene window and attribute options listed in the Channel box. Play
back the animation. You should see a line of dots extending out from the particle emitter, as
shown below.
Warning To play back an animation, use the VCR-like controls at the bottom-right of the
screen, or use Alt+V to play (and stop) the animation. But remember that you must
always rewind your animation before playing it when dynamics are involved.
Because all dynamics simulations are calculated based on information from the last
frame, failing to rewind (or also scrubbing through the animation) will result in
bizarre playback behavior. To fix this, simply rewind and play the animation from the
beginning. Use the Rewind button on the Playback bar or Alt+Shift+V to rewind the
animation.
4. To see the individual particles a bit more clearly, try turning down the Rate attribute in the
Channel box from its default 100 to about 10 or so. Now you should see little peas shooting off
into the distance.
Now that you ve tried both methods for creating particles, let s see how to use them in your
projects.
1. If you don t have an emitter from the previous example, create one with emission DirectionX
set at 1, Rate at 10, and Speed at 5.
2. To make our cannon, we re going to keyframe the emitter on and off, making the particle
stream pulse, rather than emit particles continuously. With the emitter selected, set Rate to
0 in the Channel box (or Attribute Editor), and be sure you are at the first frame in the timeline.
3. With the word rate (to the left of the number field) selected in the Channel box, RM choose
Key Selected to set the first key for the rate (at a rate of 0, which means emit nothing ).
Move to about frame 10, and key another frame at rate 0.
Tip If you set the Auto Key function on (click the button at the lower-right corner of your
screen, so it turns red), Maya will automatically create the keys for you as you go after
you manually create the first keyframe.
4. At frame 11, set a keyframe for the rate at 50 (or more, if you want a thicker stream). At frame
18, set another keyframe at 50. At frame 19, set a keyframe at 0 again (turning off the emitter
again).
5. Rewind and play back the animation. You should see a pulse of particles move away from the
emitter.
6. To make the cannon pulse on and off, select all the keyframes you have made and copy them
down the timeline several times. You should see a pulsed stream of particles, as shown below.
(If you don t see the particles playing back properly, remember to set your playback speed to
Free in the Animation Preferences dialog box.)
Tip To copy keyframes, Shift+select the keyframes in the time slider, then RM choose Copy.
Move the time marker to another frame (like 25 in this case), and RM choose Paste.
7. Let s give these pulses a bit of spread, so they re not all lined up perfectly. With the emitter
still selected, set the spread attribute to 0.05 (a spread of 0 is a straight line; a spread of 1 is
everywhere in a sphere around the emitter). You may also wish to increase the rate of particle
emission for your keyframes to make a thicker cloud. Now when you play back the animation,
the particles should look more spread out.
8. You will notice (if your window is large enough and if your frames are set high enough) that the
particles appear to go on forever. As any true science fiction fan knows, a plasma cannon
creates blasts with limited lifetimes (in other words, the particles must die off after a time). To
make this happen, you must select the particle shape node itself (not the emitter). Play back
your animation for a few seconds, until you see particles. Now select the particles themselves.
9. With the particle shape selected, open the Attribute Editor. In the Add Dynamic Attributes
section, click the Lifespan button, check Per Object, and click Add Attribute. In the Render
Attributes section, you see a new lifespan attribute. Set this to 2, and play back the animation.
Now the particles should die off 2 seconds after they are emitted from the emitter.
10. Although we have created a fully functional plasma cannon, let s improve it by having it emit
streaks of light rather than just particle specks. Select the particles (not the emitter) and open
the Attribute Editor. Near the center of the window, there is a Render Type pop-up menu that
allows you to select how you want your particles rendered. Choose MultiStreak, which makes
each particle into a clump of streaks instead of a single point.
11. In the Current Render Attributes section of the Attribute Editor, click the Current Render Type
button. This adds controls for new attributes associated with the MultiStreak particle type.
Adjust these numbers to get a satisfactory looking streak of particles. In the example below, the
settings are Line Width = 2, Multi-Count = 12, Multi-Radius = 0.165, Tail Fade = 0.5, and Tail
Size = 10.5. (We also colored the particles orange, so they would stand out better, as you can
see in the Color Gallery on the CD).
12. Save this project (name it plasmaCannon1.ma if you can t think of anything more original).
We will use it again in the next chapter.
As you saw in step 10, there are many choices for particle styles. We will use some other types in
the next examples. For a full discussion of the various types, see Chapter 22, which addresses the
topic of rendering particles.
1. Create a new scene in Maya. Create an emitter. In the Channel box or Attribute Editor, set the
emitter s Rate to 500, DirectionX to 0, DirectionY to 1, Spread to 0.3, and Speed to 10. When
you play back the animation, you should see something like the image on the next page.
2. You will notice that this image lacks an important element to make it look even remotely like a
fountain: gravity. To add this element, choose Fields Create Gravity. Then select Window
Animation Editors Dynamic Relationships. In the Dynamic Relationships Editor, select the
emitter on the left and be sure Gravity is highlighted on the right. Now when you play back the
animation, the particles will fall, as in a fountain.
Tip If you select the particles (not the emitter) before creating gravity, the two will be
connected automatically. In this case, you do not need to go through the extra step of
connecting them through the Dynamic Relationships Editor.
3. Add a plane across the grid. You see something like a fountain in a pool of water. To get a
slightly better look for the water, change the render type of the particles to spheres (select the
particles, open the Attribute Editor, and choose Spheres from the pop-up menu in the Render
Attributes section of the window). Make their radii about 0.5 (so the spheres are smaller).
4. This is looking better, but everything is too smooth. To fix this, let s add a turbulence field to
the fountain. Select the particles (spheres) just grab any of the particles, and all of them will be
selected. Then choose Fields Create Turbulence.
5. In the Channel box or Attribute Editor, set Magnitude to 10, Attenuation to 0.5, and Frequency
to 60. Now when you play back the animation, the spheres should move in a more random
pattern.
In this example, we set three of the attributes for the turbulence field:
" Attenuation sets the falloff of the turbulence field as particles get farther from its point of origin.
You should experiment with the settings for these attributes and discover how changing each one
affects playback.
1. Move the emitter (not the particle shape node) just a bit above the surface of the plane
(otherwise, the spheres will be trapped in the plane and not emit properly).
2. Now select the particles (not the emitter) and Shift+select the plane. Choose Particles Make
Collide. This creates a collision connection between the particles and the plane (in the Dynamic
Relationships Editor, you can see and break if you wanted to this connection under the
Collisions radio button). Play back the animation. The spheres should bounce off the plane
now.
3. We have a collision, but we need something more interesting for our splashes. We need to
create a bunch of smaller splash particles. Choose Particles Particle Collision Event. As
shown below, set All Collisions on, Type to Emit, Random # Particles on, Num Particles to 5,
Spread to 0.5, Target Particle to particleShape2, Inherit Velocity to 0.5, and Particle Dies on.
Then click the Create Event button.
4. We now have a second group of particles, called particles2, which will emit when the first
particles hit the plane (between 1 and 5 will be created for each collision). Set the second
particle group s render type to sphere, and set its scale to 0.25 or so (so these particles are
smaller than the spheres in group 1). Connect the gravity and turbulence fields to the second
group of particles (see step 2 in the previous section).
5. When you play back the animation, you will see the second group of particles created, but they
will simply fall through the plane. We need to create a collision event between these particles
and the plane as well. Open the Dynamic Relationships Editor, select the second group of
particles on the left, click the Collisions radio button, and highlight the plane in the right window.
6. Once you have connected the collision, go back to the Particle Collision Events dialog box and
set the particle2 event (be sure particle2 is highlighted) as shown below. Most options are set
as they were for the first particle group, but the number of particles will only be 3 and the
Target Particles will be particle3 this time.
7. Return to the Dynamic Relationships Editor and connect the new particles you ve just created
(the particle3 group) to gravity, turbulence, and the collision with the plane. Note that here we
can leave the render type as Point these are the little splashes.
8. You could continue adding collisions and new particles, but you ve probably noticed by now
that playback is getting very slow because of all the calculations Maya needs to do for so many
particles. Let s just make one more collision event to kill all the particles in group 3 when
they collide with the plane. In the Particle Collision Events dialog box, select particle3 and
check the Original Particle Dies box in the Event Actions section at the bottom. At the top of the
Event Type section, turn off both Emit and Split (this makes sure no more particles are
created). When you play back the animation, it should look something like the picture shown
below.
9. Save this project (as fountain1.ma, or something like that). In the next chapter, we ll make
the particles look a lot more like water.
This example should give you a basic idea of how to create effects with particle collisions. Just
keep in mind that we used multiple collisions and did the following for each collision:
" Created a collision event that either created new particles or killed the old ones
As long as you take these steps one at a time, it s really amazingly simple to create incredibly
complex simulations with particles. As usual, you should play with the settings in the Particle
Collision Events dialog box and watch what happens in your scene.
As became annoyingly apparent in our fountain example, playback can get really bogged
down as you add elements, especially those that require calculations. You may want to
increase playback speed, even if it sacrifices some degree of accuracy. The most obvious
way to speed the playback of our fountain example is to change all the render types to simple
points (you can change it back to whatever shape you wish just before you do a render). This
will save a great deal of time, because Maya doesn t need to calculate the shapes of the
particles.
Short of changing particle render type, there are a few other things you can do to speed up
playback. If you would like your fountain to be going full force at the beginning of the
animation, play it back until it is going at full volume, stop it, and type in that frame number in
the Animation Start Time text field in the far-left corner of the screen (below the time slider).
When you rewind and play now, you do not need to wait to see the fountain run-up to its
full-volume state. However, you do need to start your animation at that frame.
To set the state of the objects at the current frame so you can rewind to the beginning of the
animation and have them retain their current condition, select Solvers Set for Selected (or
All Dynamic). This will set the current state of the selected objects (or all dynamics objects) to
be their initial values when you rewind the animation to frame 1. The one problem with this
method is that you can t undo it.
A better solution especially for scrubbing is to enable scene caching (Solvers Scene
Caching Enable). It may take a while to cache the frames, but once they are cached, you
can scrub back and forth in the timeline and play back the animation at much faster speeds.
This solution is especially useful if there are other elements in the animation. For example, if
the fountain is a background element in a character animation, not having Maya calculating
the fountain s state at every frame can be a real time saver.
You can also (temporarily) disable all dynamics calculations in a scene, thereby speeding up
playback of other scene elements. Simply select the particle object you wish to disable and
turn isDynamic off in either the Channel box or Attribute Editor.
If you wish to see your spheres flowing, but don t want to wait for the slow speed of Maya s
playback, you can try to adjust the tessellation factor to speed up playback. Select any
particle shape, then select the GeoConnector tab in the Attribute Editor. Change the
tessellation factor from its default of 200 to something low, like 10 or so, and see if it makes
any difference in your playback speed.
1. Create a new scene in Maya. Create a large cylinder (the water glass) and a smaller, squashed
one (the tablet). For the glass and tablet cylinders, choose Create Nurbs Primitives
Cylinder . To cap the ends of the cylinder for the tablet, choose the Cap Both radio button.
For the glass, select the Cap Bottom button.
2. You can make the glass bluish and the tablet white if you wish. At the least, set X-ray mode on
by selecting Shading Shade Options Xray. (For information about texturing objects, see
Chapter 19.) Your two objects should look like those shown below (and in the Color Gallery on
the CD).
3. Before we add our bubbles, let s animate the tablet falling into the water. Place the tablet a
distance above the glass and keyframe all translate and rotate channels. At frame 15 or so,
place the tablet just where the water starts (or at the top of the glass) and keyframe all values
again. At about frame 55, place the tablet near the bottom of the glass and rotate it about. Feel
free to tweak this animation as much as you wish, but at least get this basic motion. (For
information about how to create a keyframed animation, see Chapter 10.)
Tip If you don t want to bother with this animation, you can get an already animated file
(glassAnimate1.ma) on the CD that accompanies this book.
4. Now we ll add (instead of create) a particle emitter to the top surface of the tablet. In the
Hypergraph or Outliner, be sure Show Shapes is enabled, then, from the shape nodes below
the tablet shape, select the revolveTopCap2 node and choose Particles Add Emitter . In
the option box, change the settings to a Rate of 100, a Speed of 1, a Normal Speed of 1, and a
Tangent Speed of 1.3, as shown below. Then create the emitter and close the window.
5. By adding a surface emitter to the top of the cylinder, the entire surface of the top of the tablet
will act as an emitter. When you make the tangent speed of the surface emitter greater than 0
(1.3 in this case), the surface will emit particles parallel to the tablet s surface, rather than just
straight out from it. (Try playing with the settings in the Channel box, and watch the results.)
6. Select Spheres as the particle render type, with a scale of about 0.25 (for small bubbles).
Note You can add emitters to the side and bottom of the tablet as well. However, for this
example, emitting from only the top surface will suffice. To add emitters to all surfaces
at once, you can drag-select all the tablet s surfaces and add particle emitters to them
using Particles Add Emitter.
7. If you have already played back the animation, you probably noticed that the particles emit very
slowly and mostly just hang around. To make them rise a bit faster (as if they were air bubbles
escaping from water), we ll create a weak gravity field that actually pulls the particles up
instead of down. Choose Fields Create Gravity. Assign the gravity field to the bubble
particles in the Dynamic Relationships Editor, and set the gravity s strength to 1 or 2 (from
9.8). Make its direction in Y +1 instead of 1 (so it pulls the particles upward).
1. Select the particles, go to the Attribute Editor, and choose Lifespan from the Add Dynamic
Attributes section. Choose Per Object and create the new attribute.
2. Before we adjust the particles lifespan, let s make sure that we start emitting the particles
after the tablet has fallen into the water. Select the emitter (not the particles), and set a
keyframe on its rate to 0 at the start frame. Create another keyframe a little after the tablet
enters the water and set it to 0 as well (don t have the particle begin emitting just at the frame
where it enters the water the tablet needs time to begin dissolving). Then, at frame 35 or 40,
set the rate to about 100, so the tablet is bubbling at full strength by then.
3. If you play back the animation now, you will see the particles begin emitting at the right time.
However, they come shooting out of and around the glass! First, let s take care of those pesky
bubbles that are escaping from the sides of the glass by making a collision between the glass
and bubbles. Create the collision link between the particles and the glass, as described in the
Using Collisions to Make a Splash section earlier in this chapter.
4. By creating a collision connection, we keep the bubbles inside the sides of the glass. However,
they bubble right out of the top of the glass talk about a head on your root beer! To keep the
bubbles from popping out of the glass, we need to keyframe the lifespan of the particles.
Because the lifespan of the particle controls how long it lives, adjusting the lifespan will change
how far the particles can rise before they disappear. Getting the lifespan keyframed just right
will take a bit of doing. Try the following keyframes as a starting point:
Note Unless you copied everything exactly, your mileage will vary, and you ll need to adjust
your keyframes to get a good result. If you get stuck, a finished version of this particle
animation is available on the CD-ROM that accompanies this book,
(glassFizz1.ma).
5. Save this animation (as glassfiz.ma) for use in the next two chapters.
After you finish adjusting the lifespan of the bubble particles, you should have a fairly nice
animation, although it s by no means perfect yet. Fear not, however; over the course of the next
two chapters, we ll turn our fizzing antacid tablet into a really nice-looking sequence. For example,
in Chapter 23, you will learn how to create a much more accurate individual lifespan.
1. In a new scene, make a plane, scale it out to about grid size, and rotate it 90 in the Z axis (so
it stands upright).
2. Create an emitter that is directional, with a speed of about 10 and a spread of about 0.2. When
you play back the animation, it should look something like the next picture. It doesn t look a lot
like a hose, but it s good enough for our purposes.
Note If you just used Add Particle Emitter to create the tablet particles, you probably need
to go back to that option box to create the new emitter; otherwise, you ll get an error
that a surface emitter cannot be created without geometry.
3. Make the plane a rigid body (select it and choose Bodies Create Active Rigid Body). When
you play back the animation, it still won t show any interaction between the plane and the
particles. That s because you must also create a collision event (just as in the fountain
example) before the two will interact.
4. Select both the plane and the particles (not the emitter), and choose Particles Make Collide.
During playback, you now see the particles ricochet off of the rigid body. This would be great,
except that the rigid body isn t moving.
5. There is one last switch we need to throw before the rigid body will react to the particles. In
the Channel box (with the plane selected), open the Rigid Body section and set Particle
Collision on. When you play back the animation now, the plane goes shooting off with the first
particle.
6. In order to reduce the motion of the plane, we need to do a few things: reduce the number of
particles emitted, reduce the emitter s speed, and increase the mass of the rigid body. In the
Channel box for the emitter, set the speed down to 1 or 2, and reduce the rate to 40. With the
plane selected, change the mass to 1000 to make it heavier. Play back the animation, and you
will see that the plane rotates but does not move away as quickly.
Tip Because playback of these animations can be slow, try using playblast to see your work
in real time (select Windows Playblast).
As you can imagine, in addition to creating something like a fire hose, particle/rigid body collisions
also can be useful for many other simulations for example, space ships reacting to fire or meteors
striking buildings (the buildings being made up of many smaller rigid bodies). We will use particle
collisions again in Chapter 24.
Tip If you don t wish to build and animate this scene, just load ufoAnimate1.ma from the
CD-ROM that accompanies this book.
1. In a new scene, create a cone, flip it on its side, and squash it a bit (or use any UFO model you
have handy). Next, place a plane a little way beneath the UFO.
2. Animate the UFO to make a flight path across the plane. For good measure, throw in a loop
and a few up-and-down moves.
3. Create a grid of particles that will be blown around by the UFO s speedy rush through the
desert. Open the Particle tool option box (select Particles FR Particle Tool ), check the
Create Grid box, and set the particle spacing to 10 (adding any more particles really slows
down playback later).
4. Choose the top scene view and scale out so you can see the whole plane. Click the lower-left
and upper-right corners of the plane and press Enter. You should get a grid of particle points
across the plane.
5. Click the Current Render Type button and set the point size to 10 (so the particles are easily
visible), then move the particle grid up on the Y axis until the particles are above the plane.
Note If you have a very fast computer, you can increase the density of particles in your grid.
Be aware, however, that very dense grids can choke Maya, so save a backup copy of
the program.
6. Now we have our UFO and particles. All we need to do is make a field to help the two interact.
Select the UFO, then choose Fields Add Air .
7. In the Add Air option box, click the Wake button, then try the settings shown below. Setting
Direction X, Y, and Z to 1 enables the UFO to interact with the particles in all directions. Setting
Inherit Rotation on allows the curving motion of the UFO to suck up particles. Increasing
Magnitude to 10 allows the field to influence the particles, and increasing Max Distance to 10
allows the field to displace particles farther away from it. As always, try playing with these
numbers to see what happens.
8. To connect the field to the particles, use the Dynamic Relationships Editor. Then play back the
animation, and the dust particles should move around after the UFO.
9. To make this simulation look a bit more realistic (or at least appear as realistic as giant blocks
moving around can), we need to add a gravity field and allow collisions between the particles
and the plane, so they don t just fall through the plane. Select the particles, then choose
Fields Create Gravity. You will need to drastically reduce the effect of gravity here, so the
particles float back to earth as if they were light. Try setting gravity to 2 and see what happens.
10. Select the particles, and then Shift+select the plane. Choose Particles Make Collide , and
set resilience (or bounciness) to 0.2 and friction to 0.5. The frictional force will make the
particles stop moving when they collide with the ground. If all worked well, you should see the
dust whirl after the UFO as it passes by. (Also see this image in the Color Gallery on the CD.)
Note Finding the proper settings for gravity and the collision friction and resilience took quite
a bit of tweaking. Try experimenting with the numbers and see what happens
(remember to save a clean version of the project first).
11. Save your project (as UFO1.ma) for more work in the next chapter.
If you notice that the particles initially bounce off the desert floor and then settle, you may wish to
set the initial condition for the particles to be after they have come to rest on the plane. First, turn
off the air field (set its magnitude to 0), then run the animation until the particles have settled onto
the plane. Then choose Solvers Initial State Set For All Selected.
If you want to get a better look for the dust, try setting the render type to MultiStreak, increasing the
number of particles (the Multi Count), and increasing the Multi Radius. The neat thing about streaks
is that they only exist when they are in motion, which means that they disappear back into the
desert when they collide with the floor. This can make for a much nicer animation, although it s a
bit hard to see (this effect is too subtle to be seen as reproduced in print; to see the flying dust in
action, check out 22UFO.mov on the accompanying CD-ROM).
Note As an exercise, try making a jet trail of particles for your UFO. Will it be affected by
wind and gravity? How fast will it go? Will it be constant or pulsing?
With particles, it is often very useful initially to create sparsely packed particles that are big and
blocky. This saves a great deal of time in setting up an animation. When you are ready to render
the particles, simply increase the particle density and make them look more presentable.
Summary
In this chapter, we worked with particle dynamics, getting to know how to create and emit particles.
You learned how to change the look and lifespan of particles, how to get them to interact with
fields, how to get them to collide with objects either standard objects or rigid bodies and finally,
how to attach fields to objects that then affect particles.
At this point, you know most of the basic elements of creating and using particles in your work.
Over the next two chapters, we will take the work we started here (plus some other examples) and
learn the intricacies of rendering them, as well as how to add expressions to them. So save your
work and get ready to go it just gets better from here!
Because of the special nature of hardware-rendered particles, this chapter will also touch on
compositing techniques, although that discussion will be limited. If you have not read the previous
chapter on particle basics, you should be familiar with creating and using particles in a variety of
situations before proceeding with this chapter. If you are not familiar with basic rendering
techniques using Maya, you should first read Chapter 18.
One thing to keep in mind throughout this chapter is that rendering is truly in the eye of the
beholder. You should always tweak your materials until you get a rendering you are satisfied with
even if it is quite different than our suggested material. What pleases our collective eye may not
please yours, and vice versa.
When you work in Maya s workspace, you use your computer s built-in graphics card, which
supports flat shading in real time. But when you tell Maya to render into a new window (Render
Render into New Window) or to batch render (Render Batch Render), you are launching a
separate module of the program that will render shadows, reflections, and refractions, and will
generally produce a smoother, more realistic image all at the cost of often-lengthy rendering times.
In general terms, unless you are a game producer, you work in Maya s workspace (hardware
rendering) and then produce your final images in the rendering module of the program (software
rendering). In the preceding chapter, we examined how to create particles; this chapter will take
particles to the next step of creating images that are suitable as final products.
While these questions may indeed seem confusing, take comfort because there is a reasonably
simple explanation. Software rendering is the type of final rendering you are already familiar with
(i.e., rendering with the full power of Maya s rendering module); hardware rendering may be less
familiar: it uses the power of your computer s graphics card to create flat-shaded images of your
particles quickly. The main problem with understanding hardware rendering is its name, because
you don t use only hardware to render the particles; you use a combination of Maya s (and the
graphics card s) software and the processing power of your graphics card to create the images.
Perhaps it s easier to think of this type of rendering as hybrid rendering. It s a bit of a cross
between the default shading you see in your workspace and the images Maya s batch-rendering
module produces.
To hardware render, Maya first creates a flat, shaded image of your particles (taking into account
your preferences for rendering), and then it actually performs a screen capture to grab the
image it just created. Because of this nifty trick, hardware-rendered particles can often be rendered
in near-real time, whereas software-rendered particles can take a very long time to render.
Warning Because hardware rendering uses a type of screen capture to create its images,
you must not allow anything to come in front of the render window (including a
screen saver). Be sure not to move any windows in front of the render window, and
also be sure to turn off your screen saver if you are about to start a potentially long
rendering.
The primary difficulty with hardware rendering is that you need to know and use a compositing
program (like Alias|Wavefront s own Composer for IRIX, or Fusion or AfterEffects for Windows
NT) to combine software and hardware renderings. This, however, can be a big advantage once
you understand the technique, because you can control how your particles look independently from
the way the rest of the scene looks. Compositing is such an effective and time-saving way of
working with 3D animation that we often also render our software particles separately from our
scenes. We will discuss some basic compositing techniques later in this chapter (see Hardware
Rendering and Compositing ) to give you some insight into how powerful this technique can be.
Hardware Rendering
Let s now take a closer look at hardware rendering, using as an example the handy plasma
cannon that you created in the last chapter.
Tip If you don t have a finished copy of this project from the last chapter, you can use the
one on the CD-ROM that accompanies this book instead: plasma1.ma.
Open your saved project (or the one included on the CD-ROM), and play the animation until
reaching a frame where you can see some of the particles. Now open the hardware rendering
window by going to Window Rendering Editors Hardware Render Buffer. The Hardware
Render Buffer window, showing the current frame from the workspace, will load, and you will have
several menu options to choose from. The Render menu has options for test and final renderings;
the Cameras menu lets you render from any camera in the scene (including an orthographic
camera); and the Flipbooks menu allows you to choose or clear any flipbooks you create.
Note A flipbook is just Maya s term for a hardware-rendered sequence of images that are
created in the projectName\images directory by default. Remember to set your
project directory before you begin rendering images or you won t know where your
images are going.
Give the hardware renderer a whirl: select Render Test Render, and you should see your
particles (probably in default gray) against a black background.
Now let s adjust the render attributes for the hardware render buffer. Select Render Attributes;
the Attribute Editor will open, and you will have several options for modifying your rendering.
For now, we will only look at the first section of the Attribute Editor: Image Output Files. Here, just
as in the Render Globals window for software rendering, you can set filename, extension
numbering (including the number of zeros in the name), start and end frame, image file type, and
resolution. You can also set your alpha channel information here; you can choose None (for no
alpha channel), Hardware Alpha, Luminance, or any of the RGB channels. For now, you can leave
Alpha Source set to Off (the default), but be sure to turn it on (that is, use one of the other settings
such as Hardware Alpha or Luminance) for final renderings that you wish to composite later.
Alpha Channels
An alpha channel (also known as a mask or matte channel or layer) is an outline of the
rendered elements of your scene. Everything inside the outline is visible in the final image,
whereas everything outside the outline is invisible (there are also semi-transparent parts at
the edges of the outline, which partially show those pixels). You can think of an alpha
channel as a cookie cutter that slices out the rendered pixels of an image, allowing you to
place the cut image on top of another image in a compositing program. You can learn more
about alpha channels in your compositing program s documentation.
If you can, use Hardware Alpha for your renderings. In the Hardware Render Buffer window
(Window Rendering Editors Hardware Render Buffer), select Render Attributes and
set Alpha Source to Hardware Alpha. If your graphics card doesn t support Hardware Alpha,
you will see an error message in the feedback line when you try to select this option. In these
cases, you will generally want to set Alpha Source to Luminance to create your alpha
channel.
Note You can also write the Z depth (or distance from camera) into your images. You can
use this information to help you composite images, but the method is complex and
beyond the scope of this book. See your compositing program s user manual for
information about whether it supports Z depth compositing and how this technique
works.
Be sure to set your start and end frames to the start and end frames of your animation, give your
rendering a filename, and then choose Render Render Sequence from the Hardware Render
Buffer window. In the window, you will see your particle animation run, and when the sequence is
finished rendering, you can play back your animation in a separate (Fcheck) window by choosing
Flipbooks from the Hardware Render Buffer window and then selecting your animation name. (See
Chapter 18 for a quick look at the Fcheck utility.)
Tip If you wish to stop the hardware rendering before it is complete, simply press the Esc key
on your keyboard.
Upon watching the animation, you might discover that the particles are the wrong color or that they
are moving too slowly or too quickly. To remedy these problems, tweak your animation for speed,
tail size, and color. When the particles are moving too slowly, select the emitter, and change the
speed to something like 20 instead of 5. To compensate for the resulting longer tails, change the
particle s tail size to a bit shorter length by selecting the particles, changing to the Attribute Editor,
and setting the tail length to 2 or so. So far, so good; the particles should now have a bit more zip
to them. You can try re-rendering in the hardware buffer for verification, and, of course, tweak it
some more if you are not happy with the results.
With speed and tail size under control, you can now modify the color. Make sure the particles are
still selected. In the Add Dynamic Attributes section of the Attribute Editor for the particle shape,
click the Color button and add a per-object color. Once you have added particle color attributes,
they will be listed in the Render Attributes section. For this example, you will see Color Red, Color
Green, and Color Blue listed along with the other attributes that pertain to the currently selected
Particle Render Type. Try changing the color boxes (Red/Green/Blue) to suit your tastes. (For
example, we liked a fiery orange, with values of 0.9, 0.2, 0.1, respectively. You can find this image
in the Color Gallery on the CD.) Then you can re-render the sequence to see if you like what you
have done.
Tip If you keep your image sequence name the same, Maya will write over your last
sequence for you, saving disk space. If you wish to keep a sequence for later use,
rename your rendering something else in the Attribute Editor.
You may have noticed that you did not need a light in the scene. If you do not have any lights,
Maya provides a default light for you to light the particles. Of course, you may prefer to use your
own. From the Hardware Render Buffer window, select Render Attributes. In the Attribute Editor
s Render Modes section, you can set Lighting Mode to Default Light, All Lights, or Selected
Lights. Feel free to play with some lighting setups and see how or whether they affect the plasma
cannon s appearance. (You may find that it makes no difference what lights are used with a
particular particle or streak rendering type.)
Tip If you didn t complete or save the UFO project in the preceding chapter, use
UFOParticles.ma on the CD-ROM.
You then need to open the hardware render buffer by going to Window Rendering Editors
Hardware Render Buffer. Specify a filename for the image sequence in the Attribute Editor, set
your beginning and ending frames, and run a test sequence. You will get an image sequence that
essentially looks like a cleaner playblast rendering. (If your geometry is not included in the
rendering, the Geometry Mask box is probably checked.) In this situation, however, it is best to
have a software rendering of the geometry (the plane and UFO) rather than a hardware rendering
of the entire scene. In order to do this, you will have to render out two individual sequences for the
animation a hardware rendering of the particles and a software rendering of the rest of the scene
and then composite them.
Tip If you do not have a compositing software package, you can still follow along until the last
step.
With the Attribute Editor still open and set to the default hardware render globals, go to the Image
Output Files section. Set your alpha channel (Alpha Source) to either Hardware Alpha (if your
graphics card supports this) or Luminance. In order to mask out the geometry (so you can use a
software rendering for it), in the Render Modes section, check the Geometry Mask box. When you
now render the sequence in the render buffer, the geometry will no longer appear; only the particles
will appear.
Note Although it is not obvious in this sequence, the geometry will still mask the particles,
even though it does not appear in the rendering. If, for example, the particles pass
behind an object in the scene, they will be blocked out and not rendered. This feature
is very useful for later compositing.
One thing you may have noticed previously in testing particle and streak rendering types is that the
particles and streaks are very sharply defined. For our desert dust being blown around by the UFO,
it would be better to have a slightly more diffuse look to the particles. Fortunately, Maya has two
features that can help here: multi-pass rendering and motion blur.
When Maya does multi-pass rendering, it renders out a number of frames in between the frames of
the animation, based on the number you select. If, for example, you select 3, the render buffer will
render three in-between images for each frame and then average them together. This makes for
a much smoother and subtler particle rendering, but it also takes much longer to render (three
times as long for three rendering passes, five times as long for five, and so on).
Motion blur simulates the period of time a camera shutter is open during a picture s exposure,
producing a blurring in quickly moving objects. The larger the Motion Blur number (between 0 and
1), the more blur there will be. It is often useful to keep this number small when rendering and then
add a bit more blur when compositing.
To try out these options, go to the Multi-Pass Render Options section of the Attribute Editor, and
check the Multi-Pass Rendering checkbox. Below it, a pop-up menu with a number (3, by default)
will be enabled, allowing you to select how many Render Passes to make for each frame. Choose
a fairly low number here (like 5) and also add a bit of motion blur (like 0.1 or 0.2).
Now when you do a test render, you may find the dust to be too subtle an effect (i.e., it is very
difficult to see). You can adjust the number of passes, the color of the dust, the transparency of the
dust, or the motion blur to make the dust stand out more, or you can make the particles highly
visible and make the final adjustments in your compositing package a much faster and more
versatile method of tweaking your rendering. We often find we have to rework our renderings to
make them a bit bolder in their rendered look to provide more choices when it comes time to
composite, as one can easily reduce the visibility of a layer in a compositing package, but it is
extremely difficult to make a layer more visible. When your test renders look good, select Render
Render Sequence to render out an image sequence to your images folder. You can then import
these images into your compositing package and combine them with your software-rendered
sequence (see below).
Once your hardware render sequence is finished, you need to render your geometry out in a
separate, software rendered image sequence. Open the Render Globals window (for software
renderings), set your start/end frames, set your Image Format [Maya IFF (iff) is the default] to be
the same as your particle rendered sequence, and then batch render the sequence.
Warning Do not give your geometry render sequence the same name as your particle render
sequence (e.g., UFORender), or else your geometry render will erase the particle
render image sequence.
Note If you are not comfortable with software rendering, see Chapter 18, or read further in
this chapter for more on software rendering.
Once you have your hardware and software render sequences, import them into your compositing
package, but be sure to place the particle layer (with its alpha channel) as the top layer of your
composition. Then, with the compositing package, you can adjust the brightness, opacity, or
transform mode of the particles (and geometry) to get a high-quality final product. Save this project
(as UFOParticles, perhaps) for use in the next chapter.
Note For a finished example of this UFO sequence, see 22UFO.mov on the CD-ROM. (For
visibility s sake, the dust has been somewhat exaggerated.)
Tip Instead of the sphere rendering type, you can also use the cloud (software) rendering
type. If you wish, you can experiment with this rendering type to see how it compares
with the sphere type.
Rendering the glass, tablet, and bubbles is a bit more complex than the UFO project because the
glass is supposed to be semi-transparent; thus, using the geometry mask will not work. Fortunately,
there is only one extra step to this process to make it work properly: hiding geometry selectively.
Before doing that, let s first perform a little trick to save some time in the rendering process.
Rewind to the first frame of the animation, select the tablet, and choose Display Hide Hide
Selection (this hides the tablet). You should next change your render globals to whatever you
intend to use for your tablet rendering. For example, in the Resolution section, set Render
Resolution to 320 240 (the default), in the Anti-aliasing Quality section set Edge Anti-aliasing to
Medium Quality, and in the Motion Blur section, turn Motion Blur on. Then set your start and end
render frames to 1. Now batch render the sequence (actually just one frame), naming it
something like glass. By rendering only one frame with the glass (which doesn t move during the
animation, and which takes quite a while to render), we can save a great deal of time and disk
space when we need to composite the elements of the tablet sequence.
Note If you are unfamiliar with the method for creating software renderings, see Chapter 18,
or study the software rendering section later in this chapter.
Now we can take up the process of hiding geometry selectively. Reopen the Render Globals
window, and leave everything the same except for the end frame, which you should set to the final
frame in your animation. Close this window, select Display Show Show Last Hidden to make
your tablet visible again, and then highlight and hide the glass by selecting the glass and choosing
Display Hide Hide Selection. With only the tablet now showing, batch render the complete
animation, calling it something like tablet. You now have your software-rendered sequences, and
it s time for the bubbles.
From the Hardware Render Buffer window, select Render Attributes. In the Image Output Files
section, set Alpha Source to Hardware Alpha (if your computer supports it) or Luminance, and
name the sequence something like bubbles. In the Multi-Pass Render Options section, turn
Multi-Pass Rendering on (creating a multi-pass rendering will smooth out the bubbles just a bit),be
sure Geometry Mash is on, and render the sequence.
Once the rendering is finished, import all three pieces of your project (glass, bubbles, and tablet)
into your compositing package. Here, you have many options for combining your pieces. We chose
to place two copies of the glass into our composition one on top (set to low opacity and with some
color adjustments) and one on the bottom (the more visible version of the glass). We then
sandwiched the bubbles and the tablet between the glasses, with the bubbles above the tablet to
allow them to be visible. The bubbles opacity (or visibility) can be reduced to make them less
solid looking. You can also create an opacity ramp for the bubbles so that they fade out as they rise
through the water. A finished version of the animation is available as the 22glass.mov file on the
CD-ROM, and you can see a still image from it in the color section of this book.
In combining Maya with your compositing package, you will surely encounter a number of problems
both artistic and technical. While it is very difficult in the context of this book to be specific about
compositing Maya renderings (as there are a number of different software packages out there that
perform this function, and all of them work a little differently), there are a few rules of thumb we can
lay out here:
" Test single frames of your animation in your compositing package early. This way, you only
have to render one frame for each composition layer to test whether the composition will work,
saving you time in renderings.
" Always use alpha channels, even for those layers you don t expect to need them for. It s
better to be prepared than to have to re-render.
" Render particles to be highly visible in Maya rather than going for the subtler look you intend to
get in the end. Having more data (visibility) to work with can only help in the end, and it s very
easy to blur or reduce the opacity of particles in your compositing package as a last step.
" Never alter your render camera once you ve started final renders! If you move the camera
between renderings, your particles and geometry will not match up and things will look very bad.
It is often a good idea to create a separate camera (not the default perspective camera) to use
for renderings. Using a separate camera reduces the chance of accidentally moving the camera
as you work.
" Be sure to test-render some images in the resolution of your final project. Often things will look
great at 320 240 pixels, only to look terrible when you do your final compositing at 640 480.
" Don t be afraid to try new ways of combining layers in your compositing package. Just as in
Maya, you may discover a much more interesting look by doing a bit of experimentation.
Although multiple renderings and compositing may at first seem a confusing pain in the neck, once
you begin to see how creatively (and often easily) you can alter the look of a particle-rendered
sequence, using Maya in conjunction with a compositing package for particle sequences (and in
general) will likely become your preferred method of working.
Tip Save this project (as glassFizz2, perhaps) for use in the next chapter.
Software Rendering
Now that we ve covered hardware rendering, let s take a look at the types of particles that Maya
software-renders, and where they might be useful. In general, Maya uses hardware rendering for
speed when rendering simple points and shapes; however, when it comes to complex render types
like clouds, water, or fire effects, Maya sacrifices speed for the power of the software renderer to
produce photorealistic images.
Tip Software rendering can be very slow. While doing the work for this section, you may wish
to reduce the quality and size of your renderings in order to keep times reasonable. It can
also be very useful to temporarily reduce the number of particles emitted while adjusting
particle properties, as a few particles will give a good idea of what the final product will
look like without overlong rendering times.
Note Remember that IPR renders (discussed in Chapter 18) do not at present work with
particles, even software particles. You must re-render each image (or section thereof)
manually while adjusting the look of software-rendered particles.
The three software render types are clouds, blobby surfaces, and tubes. Tubes, of course, are
tubes they can have differing beginning and ending radii and can be rendered with several special
effects added to them. Tubes can be useful for everything from laser beams to hair (see the Color
Gallery on the CD for a better look at this image):
Blobby surfaces are known as metaballs, spheres that blob together like drops of mercury.
Blobbies can be used for water, lava, or a range of other liquid materials (again, see the Color
Gallery for a better look):
Clouds are blobby surfaces that are blurred or semi-transparent. They are very useful for airy
effects such as clouds, fire, and smoke (again, see the Color Gallery for a better look):
As an exercise, let s see how blobby surfaces can be used to create the effect of water. First,
either open your fountain project from the previous chapter or use the fountain1.ma project on
the CD. You may wish to reduce the number of particles (currently spheres) being emitted by the
fountain emitter, as blobby surfaces render slowly enough with even a few particles. We found a
rate of about 200 to be sufficient for the purposes of experimentation, although using more particles
allows for a smaller radius for each particle and increases the watery look. Whatever you find is a
good compromise between speed and final quality is just fine.
After adjusting the particle emitter, select the particles emitted (the particle1 group, which the
emitter directly emits), and change its render type to blobby surface in the Attribute Editor or
Channel box. In the Attribute Editor for the particle shape (particleShape1), in the Render Attributes
section, set Particle Render Type to Blobby Surface (s/w). Next, click the Current Render Type
button to add blobby surface attributes to this section. The two controls you have over blobby
surfaces are the Radius attribute (the size of each individual surface) and the Threshold attribute
(which controls how the spheres blob together). The two controls work complementarily: as you
increase the threshold from 0 (no interaction the spheres just act like spheres) to 1 (complete
meshing spheres that are not connected will disappear), you will need to increase the radius, as
the apparent size of the particles will decrease.
Tip Setting the threshold of blobby surfaces to 0 is a good way to produce software rendered
spheres, allowing you to adjust materials and transparency much more carefully than
hardware-rendered spheres. Slower rendering times are the price you pay for
software-rendered spheres.
Like almost all other areas of Maya dynamics, a good deal of experimentation is required to get the
right effect for blobby surfaces. After some tweaking, we were satisfied with a radius setting of 0.6
and a threshold of 0.9 for the particles; your tastes may vary, so try out some different settings.
Another element of blobby surfaces (like any geometry) that greatly affects the quality of the
rendering is the surface type. To get something approaching a watery appearance, we used a
phongE shading group, made it a very unsaturated blue and transparent, and gave it a small but
very bright specular highlight. A version of the project that includes this texture is on the CD-ROM
(fountain2.ma).
For the second set of particles the fountain produces (the particles that appear after the first particle
group s collision event), open the Attribute Editor with the particles selected, click the Current
Render Type button, and set the render type to Blobby Surface (s/w), then try a radius of 0.3 and a
threshold of 0.8 for these particles for starters. You can then use the same material you created for
the first set of particles for the second one or make up a new one if you prefer.
You may remember that we set the third group of particles (those emitted when the second group
collides with the plane) to be points. You can either leave them like this and then composite them in
later (or leave them out entirely), or also change their type to blobby surface and then render them
all together. We found the small-looking splashes created by a multi-point particle to be a nice
contrast to the blobbies of the other two-particle types, so we composited them into the final
rendering, producing the 22fountain.mov movie on the CD-ROM. (A still from this animation
also appears in the color section of this book.)
Note As an exercise, try redoing your plasma cannon project using a Particle Render Type
setting of Tube (s/w). Adjust the radii (that is, the Radius0 and Radius1 attributes,
which are added after you click the Current Render Type button) to make the blasts
grow in size as they move away from the emitter.
As with hardware rendering, there are countless ways to tweak and perfect software rendering.
Although you can quickly achieve decent results with software-rendered particles, getting just the
right look with them can be a very tricky and time-consuming affair, especially if you are not
experienced at creating them. As you probably already know from attempting the fountain example,
even minor changes to a particle s attributes or an emitter s rate often result in very
different-looking renderings. Additionally, the interaction of textures, particle types, emitter rates,
and so forth create a complex chain of interrelated variables that can prove frustrating to even an
experienced user. Apply two rules to get your software particles to do what you want:
" Be patient with yourself. While you want the best results, give yourself the time and freedom to
make mistakes.
With a critical eye and a bit of experience, you can get excellent results out of Maya s software
particles. Feel free to experiment with the Clouds and Tubes render types now that you have an
understanding of what software particle rendering can do. Try creating a fuzzy beam of light with
tubes, or a dissipating puff of smoke with clouds. If you have difficulty understanding one of the
settings, don t forget that Maya s electronic documentation (under Dynamics) is an excellent
source of information.
Save this project (as fountain3.ma, perhaps) for use in the next chapter.
Tip Don t forget: it s often very useful to render software particles in a separate pass, just
as is recommended for hardware particles. This way, you have a great deal of control
about how the particles interact with the rest of the scene when you composite.
Note We will discuss how to map image sequences to sprites in the next chapter.
As an example of how to use sprites, we ll revisit the UFO project this time changing our streak
particles to sprite images of leaves that the UFO can blow around. To begin, open your UFO
project or UFOParticles.ma from the CD-ROM. In the Hypergraph, select the particle group, and
then, in the Render Attributes section of the Attribute Editor, change the Particle Render Type to
Sprites. There are several attributes for the sprite render type, which are accessed by clicking the
Current Render Type button in the Attribute Editor. For our purposes, check the Use Lighting box,
and then set the Sprite Twist (or rotation about the Z axis) to 90. This will lay the leaves on their
sides. If you desire, you can also change the Sprite Scale X and Sprite Scale Y values, altering the
size of the sprites in the scene.
Once we have created the sprites, which appear as little black boxes right now, we need to create
a texture for them. First, create a lambert shader group. (Lambert shaders have no specularity (or
shine) to them, so they work well for sprites.)
Note To create a lambert shader in the Hypershade, open the Hypershade window (Window
Hypershade), and then, from the menu bar (or RM select), choose Create
Materials lambert. Click anywhere on the right-hand side of the window to place the
new material group.
Select the lambert materials group, and open the Attribute Editor (Ctrl+A). In the Common Material
Attributes section, click the button that looks like a checkerboard to the right of the Color swatch
and slider, and then in the Create Render Node window, under the Textures tab (the default), click
the File button in the 2D Textures section. This creates a texture that places an image you specify
on whatever object the material is applied to. Once you close this window, the Attribute Editor will
be focused on the file1 texture, with an Image Name text field and a browse folder icon button
under the File Attributes section of the Attribute Editor. Click this button, find the 22leaf.tif file
from the CD, and choose it for your file texture. You should see the following in your Attribute
Editor.
Tip You can also create your own image(s) for the file texture. Just be sure you include an
alpha channel in your image in order to cut it out from the background. If you don t, you
will be able to see the edges of the sprite rectangle when you apply the lambert shader to
the sprite.
Now that we have a shader and a sprite, we need to connect the two. In the scene window (or
Hypergraph), select the particle group; then, in the Hypershade, highlight the new lambert shader
you just made. Click just below the image of the material, and RM select Assign Material to
Selection, as shown here (and in the Color Gallery on the CD).
If all went well, you should now see a bunch of leaves spread across your desert floor (also check
out this image in the Color Gallery on the CD):
If you now play back the animation (or, depending on how high you have placed your particles, by
just looking at the first frame), you will see that the leaves fall halfway through the plane before they
stop. This is because the sprites detect a collision with the plane only when their center points hit
the plane (i.e., when they are halfway through the plane).
To get around this problem, we just need a bit of trickery. Select the plane that is the current floor,
and duplicate it (Edit Duplicate). Now move the duplicate plane up just until it covers the top
edges of the leaves. With the duplicate plane selected, shift-select the particle shape (using the
Hypergraph or Outliner is easiest, as the duplicate plane covers the leaves in the scene window).
Now make these two objects collide (Particles Make Collide).
The last step is to deselect the plane so that only the leaves are now selected, and move the
leaves up until their middles are just above the new plane. Finally, select the duplicate plane, and
hide it by going to Display Hide Hide Selection. The leaves will now collide with the new
(invisible) plane and will, therefore, stay above the visible plane.
Tip You may have noticed this same problem when rendering the sphere particle type for the
tablet-and-glass animation. The same solution will work for that situation as well.
When you now run your animation back, the leaves should blow around in the wake of the passing
UFO. You can either render this project out in hardware or just create a hardware rendering of the
leaves blowing. (In the Rendering Editors Hardware Render Buffer window, select Render
Attributes. In the Image Output Files section, be sure Alpha Source is set to Hardware Alpha or
Luminance, not to Off. In the Render Modes section, be sure Geometry Mask is on.) You can use
this new image sequence with your old UFO software rendering to make a new animation, saving
the time and disk space of another rendering. A final composite movie is available on the CD-ROM
as UFOSpriteSpin.mov. Save this project for use in the next chapter.
Note As an exercise, can you use sprites for the antacid tablet project? Try to create an
image of a bubble (with alpha channel), and map this to your particles. Does this
method work better for this animation?
Note If you are not familiar with using MEL scripts, refer to Chapters 16 and 17 for more on
using and creating scripts.
You probably ran into a problem when you tried to composite your particles on top of your
software-rendered sequence, especially if you used the Luminance alpha channel: the particles
were probably close to invisible in your composition. The reason for this is that Luminance alpha
takes as its alpha value the brightness (or luminance) of each particle. This is fine when the
particles are very bright, but when they are darker, the alpha channel will be mostly dark too,
making the particles very dim. Although it s a bit of a pain, there is an old and very effective trick to
solving this problem. First, make a new copy of your scene so you won t mess up your good
version. Next, create a new (lambert) shading group, and assign it to all your hardware-rendered
particle groups. In the Attribute Editor, change the lambert group s color to pure white, and
increase its incandescence to full. The sample should show all white.
Tip If you are using sprites, create a file texture for the sprites with the alpha channel copied
into the RGB channels of the image. (Call this something like spriteImageWhite.tif.)
This step, combined with the complete incandescence of the shading group, will produce a
good alpha channel for a sprite group.
The particles assigned to the new shading group should now all be pure white. When you render
out a new hardware rendering, using luminance to create the alpha channel, you will get a
rendering with white particles in exactly the same places as your colored particles from before. (Be
sure to name the two sequences with different names!) Finally, in your compositing package, use
the newly rendered sequence as an alpha matte for your other, colored particle layer. (See your
compositing software s manuals for more on how to do this.) You will now have a much more
visible set of particles to work with!
Note The UFO sprite animation and still shot shown previously, as well as most of the other
compositions shown in this chapter, use the white render trick to do their magic.
Summary
In this chapter, you took the first steps toward creating finished animations using particles. Using
either hardware or software particles and employing many different techniques (and a few tricks),
we were able to produce high-quality renderings. We also used multiple renders for hardware and
software particles to separate out different elements of an animation, so that we could then
combine them in a composting package. Although it s certainly not exhaustive, this chapter should
give you a good start into the difficult-but-rewarding area of particle renderings.
In the next chapter, you will learn how to use expressions and ramp generators to create complex
per-particle (rather than group-level) effects. So save your work from this chapter, and let s move
on!
The tools for doing this are expressions and ramps. We ve worked briefly with both of these in
earlier chapters. As we explored MEL in Chapter 16, we saw how the Expression Editor allows us
to define mathematical formulae that control the way objects behave. Ramps, introduced in
Chapter 19, are akin to the gradients you may have created in a program like Adobe Photoshop.
While these tools often overlap in functionality (and thus you can often choose your favorite method
for dealing with particles), each has its strengths, as you will see during the course of this chapter.
After a general introduction to particle expressions and ramps, we ll try out various modifications
of these basic techniques, though the sample of their uses presented here isn t exhaustive. While
the complexity of particle expressions and ramps can at times be daunting, the power and control
they bring to particle systems makes them truly worth the effort to learn.
Note To create an emitter, select Particles Create Emitter . In the Emitter Options
(Create) window, set Emitter Type to Directional. In the Emitter Attributes section, set
Spread to 0.3. In the Emission Direction section, set directionY to 1, and set directionX
and directionZ to 0. This ensures that the particles will shoot straight up along the
workspace s Y axis. In the Emission Speed section, set Speed to 1 or 2 for a fairly
slow speed. If you aren t comfortable yet with these steps for particle creation, please
go back and work through Chapter 21 before you continue with this chapter, as we will
move rather briskly.
To make our emitter a little more interesting, we will vary the particles lifespan by using an
expression, and we ll vary their velocity in an unusual manner by using a ramp.
To see the difference between a per-object lifespan and a per-particle one, let s first create a
per-object lifespan for our particles. Run the animation forward until particles come out of the
emitter, then select the particles (not the emitter). In the Attribute Editor (Ctrl+A), go to the Add
Dynamic Attributes section and click the Lifespan button. In the Particle Lifespan window that pops
up, choose Add Per Object Attribute, click Add Attribute, and close the window. Back in the
Attribute Editor, under Render Attributes, a new Lifespan field will appear, so you can control all the
particles lifespans. Enter a time of 2 (seconds) or so in the Lifespan field, and then rewind and
play back the animation. All particles should die after the same amount of time, as if they are
disappearing behind some invisible wall.
For some effects, this can be a good thing, but for a more random look we need& well, something
more random. Return to the Attribute Editor s Add Dynamic Attributes section, and click the
Lifespan button again. In the Particle Lifespan window that opens, this time choose Add Per
Particle Attribute and click the Add Attribute button.
In the Render Attributes section of the Attribute Editor, the Per Object lifespan field will now be
grayed out, and below, in the Per Particle (Array) Attributes section, there will now be a new field,
labeled lifespanPP. If you play back the animation at this point, however, the particles still die at 2
seconds. Why? Because we have not yet defined an expression or ramp to control how long the
particles live, so Maya just uses the per-object lifespan instead.
Tip As you experiment with particle lifespans, you might decide at some point to override the
per-particle lifespan calculations and use the per-object value again. To get back to the
per-object lifespan calculation, simply uncheck the Use Lifespan PP checkbox in the
Render Attributes section.
In the text field next to lifespanPP, there are two types of expressions we can choose to build: a
creation expression and a runtime expression. What s the difference? A creation expression runs
once for each particle (on its birth frame); a runtime expression runs for every frame (except the
birth frame) for each particle. When a particle is first created (when its age is 0 frames or its
creation frame), you can have an expression that will execute once for each particle, but only for
that frame. In other words, if a particle is created at frame 21 (its frame 0 or birth frame) and you
have a creation expression for it, the creation expression will run for that one frame, and then the
particle will go on its merry way. If you make a runtime expression, it will execute for that particle for
each frame except the birth frame (it will execute starting at frame 1 for the particle, or frame 22 in
our example). In some cases, as in lifespan, it is better to just run the expression once at the
particle s birth (so it just has one lifespan value). In other cases, it is better to use a runtime
expression. In yet others, you must use both a creation and runtime expression. We will see more
of how these two types of expression work together as we proceed.
Enough theory let s get down to business. RM choose Creation Expression from the lifespanPP
drop-down list.
The Expression Editor will open up, ready for you to create an expression to control the lifespan of
each particle. (This context-sensitivity is a convenient feature you may not have noticed when we
worked with the Expression Editor in Chapter 16. Because we re launching the Expression Editor
from the particle array section of the Attribute Editor, it automatically loads the proper object
(particleShape1) in the Objects window.)
Tip Also notice that the Expression Editor has two radio buttons for Particle that allow you to
select either creation or runtime expressions. You therefore don t need to close and
reopen the Expression Editor to create each type of expression.
In the bottom (Expression entry) section of the Expression Editor window, type in the equation
lifespanPP = rand(1,3);
and then click the Create button at the bottom of the Expression Editor. If you entered the
expression correctly, you will see the following message in the feedback line (or Script Editor):
Result: particleShape1. If you see an error message instead, examine your expression for
errors. The rand (or random) function just tells Maya to assign a random value between 1 and 3 to
the particle s individual lifespan attribute. Thus, instead of each particle dying at the same time,
they will all die some time between 1 and 3 seconds after their birth, creating a much more random
or real look to the simulation. The rand function takes either one or two arguments. If you just
use one number like rand(3) the function assumes you mean rand(0,3), and produces a
decimal number between 0 and 3. For more on the rand (and other mathematical) functions, see
Maya s online help under the MEL Command Reference: By Function.
Note Each time you rewind and play the animation, the sequence of random numbers will be
different. However, you can also generate a sequence of random numbers that is the
same whenever you rewind and play by using the Seed function. You might want to do
this so that the animation looks the same every time you play it. By giving the Seed
function a single value (like 15), you can force Maya to calculate the same sequence of
random numbers each time you play back the animation. For more information, see
Using Maya: Expressions in the Maya documentation set.
If you reopen the Expression Editor after creating your expression, you will see that Maya has
updated the expression to read
particleShape1.lifespanPP = rand(1, 3);
Because you had previously selected the particleShape1 node before opening the Expression
Editor, Maya knew that this was the node to apply the lifespanPP expression to. If you had not
selected the particleShape1 node first, you could still create the expression, but you would have to
use the full name of the attribute (such as particleShape1.lifespanPP).
Tip If you don t see the expression text in the Expression subwindow, choose Select Filter
By Expression Name and click the name of the expression in the Expressions
subwindow.
Now return to the Attribute Editor, and, in the rampVelocity text field, RM select Create Ramp .
The options window that pops up allows you to control how and where the ramp is applied.
We ll use the default options (Input U set to None, Input V set to Particle s Age, and Map To set
to New Ramp), but you should be familiar with the options available here, in case you wished to
map the ramp to a different set of attributes. After checking through the various settings, close the
window by pressing OK. Return to the Attribute Editor and RM select ArrayMapper1.outColorPP
ArrayMapper1.outColorPP Edit Ramp. This will focus the Attribute Editor to the ramp you have
just created.
Note If you used the Ramp Editor in version 1 of Maya, you will see that the editor is now
contained within the Attribute Editor, instead of in a floating window.
In the top section of the Ramp Editor is the name of the ramp (currently ramp1), along with a
texture swatch that updates as you change the options in the section below. The swatch should be
set to a ramp between red, green, and blue. For velocity, position, and acceleration values, don t
think of red, green and blue as colors, but as values on a given axis: red is the X
direction/velocity/acceleration, green is the Y value, and blue is the Z value. (The scene window
uses these colors to represent the X, Y, and Z axes.) As the particles age, their lifespan values
move up the ramp, going from red (out the X axis) to green (up the Y axis) to blue (out the Z axis).
If you play back the animation right now, the particles will move to the right, then up, and finally
toward you, and then die. To change how quickly all this happens, set the lifespan value to a
greater or lesser value.
Note If there is no lifespan per object attribute set, you will not get correct behavior out of
your ramp. You must have a per-object or per-particle lifespan set in order for them to
age properly, and thus move up the ramp.
To make the particles travel in a circle, we ll need to change the default ramp, but first we must
remap the array, because currently no particle can travel less than velocity 0 (no negative values).
In order for our particles to travel in a circle, they must be able to go in a negative as well as a
positive direction on the X and Y axes. From the menu at the top of the Attribute Editor, choose
Focus ArrayMapper1. This focuses the Attribute Editor on the mapper the part of the ramp
group that tells Maya how to interpret the gradient. The Min Value field tells Maya what the
minimum value for the ramp will be. For our purposes, let s make this value 1, so the particles
will travel at a velocity of 1 when a certain ramp color value is 0. Leave the Max Value set to 1, so
the particles will travel at a velocity of 1 when a color value is 1. Because of this remapping, a value
of 0.5 for any color will translate into a velocity of 0 (halfway between 1 and 1). This remapping
may be a bit confusing, but stay with us here; things should be a bit clearer when we edit the ramp.
Now that the ramp has been remapped, it s time to edit the ramp. From the Attribute Editor s
menu, choose Focus ramp1, to return to the ramp. Set the first color swatch to RGB values of
0.5, 1, 0.5, by first clicking the green dot at the bottom left of the gradient, then changing to RGB
(instead of HSV) mode in the color chooser, and finally entering the above values in the R, G, and
B channels. The particles will now start life moving straight up the Y axis (remember that 0.5 on the
color ramp equates to a 0 velocity, so there will be no motion in the X or Z directions). To make a
circle, we need five points on our ramp, so, somewhere between the bottom and middle points,
click in the ramp to create a new point. With the new point selected, change the Selected Position
to 0.25 (one fourth of the way up the ramp), and then change the R, G, and B values of this point to
0, 0.5, and 0.5, respectively. At this point (one fourth of the way through the particle s life) the
particle will be travelling in the negative X direction. Now click the middle point, be sure its Selected
Position is set at 0.5, and set its RGB colors to 0.5, 0, and 0.5 (travelling straight down). Next, click
above the middle point in the ramp to create a new point, set its Selected Position to 0.75, and set
its RGB values to 1, 0.5, 0.5. Finally, pick the top point and set its RGB values to 0.5, 1, 0.5. When
finished, your ramp should look as follows (see the Chapter 23 Color Gallery on the CD for a better
look).
When you now play back the animation, the particles will travel around in a circle a pretty neat
effect! You can, of course, play with the ramp values to get different effects. Also try randomizing
the lifespanPP values so that all particles do not have the same age. As you can see, the ramp
mapper allows you to create some very interesting effects in a graphical (rather than mathematical)
manner.
Tip You can also move points on the ramp by dragging the circle (on the left side) up and
down. To delete a point, uncheck its box on the right side of the ramp.
With this introduction to particle expressions and ramps under our belts, we ll devote the rest of
the chapter to trying out various modifications of these basic techniques. Sometimes we ll use one
technique or the other, but often we ll use both together. The common thread in all of these
exercises is that we ll be using the power of Maya to achieve more realistic or at least more
interesting animation. The sample of uses of ramps and expressions this chapter contains is
meant more to introduce you to the range of effects these two controls can produce than to be
exhaustive. While you work through these examples, consider what other effects you might be able
to produce with ramps and expressions, and then using what s in this chapter as a guide try to
create what you envision.
Open your saved plasma cannon project from the last chapter, or use the original plasma1.ma
project from the CD-ROM. If you prefer, feel free to use the emitter we created above. Let s first
use the same basic expression we created above to give each particle a random lifespan from 2 to
4 seconds.
Note As an exercise, try to make the expression to make the lifespanPP of the plasma
cannon range from 2 to 4 seconds on your own. If you get stuck, the steps are the
same as described in the section above.
Once you have particles that die off randomly, the plasma cannon should be getting close to
production-ready. Only one thing is still missing: as the energy of the blast lessens, the color of the
particles should fade from a bright blue-white to a duller orange. A ramp is a great way to
accomplish this. With the particles selected, click the Color button in the Attribute Editor, check the
Per Particle checkbox, and add the attribute. Next, create a ramp for the newly created rgbPP
attribute, and edit the resulting default ramp (follow the steps above if you get lost).
Let s change the colors, starting at the bottom. First, click the round button to the left of the
gradient (the orange one); then click the orange color swatch below it to bring up the color picker.
Choose a nearly white blue color (or whatever you wish) for your first color. Choose the next point
up, and make it a yellowish color, then make the top color a darker red. One point is still missing
add a point between the yellow and red points (by clicking in the gradient), and make it orange.
When you are finished, you should have something resembling the following (see the Color Gallery
on the CD for a better view).
Play back your animation. You should see the particles change color as they shoot across the
screen (also see this image in the Color Gallery on the CD).
Advanced users may note that, because particle lifespans are random, many of the particles
will not cycle through the complete color ramp. To force all particles, regardless of their
lifespan, to go through a complete color range, you can use the following expression for both
the creation and runtime expression for rgbPP instead of a color ramp (copy this expression
into both the creation and runtime expressions):
$howOld = smoothstep (0, particleShape1.lifespanPP,
particleShape1.age);particleShape1.rgbPP = <<1.5 - $howOld,
$howOld/1.2, $howOld/1.5>>;
The smoothstep function creates a smooth ramp from 0 (at time 0) to 1 (at time lifespan) for
each particle. The rgbPP components (red, green, blue) are then assigned values between 1
(1.5 actually) and 0, based on how old the particle is compared to its full life expectancy. The
numbers (1.5, 1.2, and 1.5) are just ways of adjusting the colors to make for a nice transition.
(You can also find this image in the Color Gallery on the CD.)
We are now going to create an expression that ties the position of the emitter to the radius of a
particle. First, we need to create a lifespanPP attribute and a radiusPP attribute for the particles. To
create both attributes, click the General button in the Add Dynamic Attributes section of the
Attribute Editor.
In the window that pops up, select radiusPP, click Add, and close the window. Now open the
Expression Editor window by RM choosing Creation Expression from either the radiusPP or
lifespanPP fields. In the creation expression, type in the following.
particleShape1.lifespanPP = rand(4,10);
particleShape1.radiusPP = emitter1.ty/10;
These two lines do two completely separate functions. One creates a random lifespan for each
particle; the other gives each particle a radius based on where the emitter is at the moment of
creation (the radius equals the Y position of the emitter, divided by 10). When you play back the
animation, you should get something like the following image (which also appears in the Color
Gallery on the CD).
To see the difference between creation and runtime expressions, cut the second line (Ctrl+X) from
the creation expression, and then click the radio button to select Runtime instead of Creation. Next
just paste the line you cut from the other expression into this new one and click the Create button.
When you now play back the animation, you will see the radii of all particles increase as the emitter
moves up the Y axis. (You ll get a better view of this image in the Color Gallery on the CD.)
Because the runtime expression is evaluated at every frame (except the first one), the particles
radii will constantly increase in sync, no less as the emitter rises.
Note If you are unfamiliar with the Sine function, see Chapter 16 (or a trigonometry book) for
more information on what it is and how it works. (The Maya 2 manual also contains an
explanation and several examples of using the Sine function see Using Maya:
Expressions, Chapter 7.)
First, create an emitter that emits roughly five particles per second (about one for each five frames),
make the render type Spheres, and set the velocity to 0. Using an expression, we re going to
place the spheres in a position based on their age, and, by virtue of the properties of the Sine
function, the position of the particles will form a moving spiral. In the Attribute Editor (with the
particle shape selected), RM choose Runtime Expression in the Position field. Copy the following
expression into the Expression subwindow.
$pX = 15 * sin(particleShape1.age);
$pZ = 15 * cos(particleShape1.age);
particleShape1.position = <<$pX, particleShape1.age, $pZ>>;
This expression first declares the variables $pX ad $pZ (for position X and Z), and then assigns
them a value based on the Sine of their age (which starts at 0 when they are born, increasing from
there).
Because Sine function values range only between 1 and 1, we multiplied the function by 15 to get
a bigger number range (from 15 to 15). You will note that $pZ uses the Cosine function instead of
the Sine function. This is because the Cosine is perfectly out of phase with the Sine function (that
is, it is 0 when the Sine is 1, and vice versa), and, when the two are combined this way, they will
make the particle travel in a circle on the X-Z plane.
The final statement of the expression does all the real work: it assigns to the X, Y, and Z positions
the value of $pX, the age of the particle (forcing the spheres up in the Y direction as they age), and
$pZ. As all these values change on every frame, so the particles move in a nice spiral.
You may notice that there is a flickering at the origin as you play your animation. This is the sphere
being created (at 0, 0, 0) on its first frame of life because the runtime expression does not work for
a particle s birth frame. To get rid of this annoying problem, simply cut and paste the runtime
expression into the Creation Expression window (switch over using the Creation/Runtime radio
buttons in the Expression Editor).
As a last step, see if you can figure out how to make the spheres colors change as they spiral up.
(This is shown below and in the Chapter 23 Color Gallery on the CD.) You can use the same Sine
(and Cosine) function to do this as well.
If you get stuck, try looking at this code to help you out:
$pX = 15 * sin(particleShape1.age);
$pZ = 15 * cos(particleShape1.age);
$cX = ($pX + 1) / 2.0;
$cZ = ($pZ + 1) / 2.0;
particleShape1.position = <<$pX, particleShape1.age, $pZ>>;
particleShape1.rgbPP = <<$cX, 0.5, $cZ>>;
The new variables ($cX and $cZ) reset (more properly, they renormalize) the $pX and $pZ
variables to between 0 and 1 (they originally ranged from 1 to 1). The rgbPP statement just
assigns these variables (plus 0.5 for green) to the spheres red and blue color channels. Here,
with just a few commands, you can create an animation that would be next to impossible to make
using traditional keyframe methods.
We will use the event attribute (which is a per-particle attribute, even though it doesn t end in PP)
to test how many collisions each particle has been through; then we ll use an if else if else
statement to assign a different color to the particle, depending on how many collisions it has been
through. To add the event attribute, you have to create a particle collision event (select the particles
not the emitter then choose Particles Particle Collision Events, and click the Create Event
button). The event attribute itself will not be listed in the Channel box or the Attribute Editor, but it
will be listed in the Expression Editor s Attributes box.
Note If you are not familiar with if statements, please see Chapter 17 (or a basic
programming text) for more information.
Note In the Maya documentation, see Using Maya: Dynamics for more information about
creating particle collision events (Chapter 4, Particle Collisions ) and the event
attribute (Chapter 13, Advanced Particle Topics ).
RM select a runtime expression for the rgbPP of the particles, type the following expression into the
Expression Editor, and then click the Create button when you are finished.
if (event == 0)
rgbPP = <<0,1,0>>;
else if (event == 1)
rgbPP = <<1,0,0>>;
else if (event == 2)
rgbPP = <<0,0,1>>;
else rgbPP = <<1,1,1>>;
This expression executes on every frame (except the birth frame) to see how many collisions each
particle has had. If the number is 0 (no collisions), it assigns a green color to the sphere. If the
number of collisions is 1 (after the first bounce), it assigns the color red to the sphere. If the number
is 2 (after the second bounce), it assigns the color blue to the spheres. In all other cases (i.e., the
particle has bounced more than twice), it assigns a white color (all 1s) to the sphere.
Note Note that the test condition is specified by a double equal sign (event == 0), not a
single equal sign. A single equal sign tells Maya to assign a value to the left-hand side
of an equation (like rgbPP = X); a double equal sign tells Maya to test whether the two
sides of the equation are equivalent.
Note You can also use a switch command for cases like the expression above. A switch
and an if-else statement perform the same function, but in a slightly different way.
For more information about the switch command, see Using Maya: Expressions in
Maya s online documentation.)
Play back the animation and watch each sphere; you will see that the individual particles change
color each time they bounce, ending with a white color after it has bouncing more than twice. (The
Chapter 23 Color Gallery shows the image below to better effect.) You may also notice that the
spheres are emitted as completely black objects this is (again) because a runtime expression is
not evaluated on the birth frame of the particles. To solve this problem, simply copy and paste the
expression into a creation expression for the rgbPP of the spheres.
First, open your project from the last chapter (or, if you don t have that project, open the
glassFizz.ma file on the CD-ROM). For a little different look, let s change the bubbles to
software rendered ones. In the Attribute Editor, set the particle type to blobby surfaces, and set the
threshold to 0. (Remember that setting the threshold of a blobby surface to 0 makes the spheres
noninteractive and, thus, just spheres. For bubbles, this is exactly what we re after.) With particles
selected, add a per-particle radius attribute to the bubbles, then create and edit the ramp of
radiusPP to look something like this.
You ll probably find the bubbles created with this ramp ranging in size too much, overall, so remap
their sizes using the Array Mapper (RM choose radiusPP arrayMapper1.outvaluePP
arrayMapper1.outvaluePP Edit Array Mapper). A min value of 0.1 and a max of about 0.3 give a
much subtler effect.
Note The bubbles in this image have a material attached to them a phongE material with
high specularity and low opacity. This, of course, improves the look of the bubbles
tremendously.
Emitter Expressions
We have created several ramps and expressions for particles, but it is also possible to create
expressions for particle emitters. You can either create a default emitter for this example, or open
your fountain project from the last chapter. It s easier to see the effects of the expression in a
simpler project, so it might be advisable to first create a simple emitter and then, after you see how
the expression works, copy it into the fountain project.
Tip If you don t have the fountain project from the last chapter, use the file fountain3.ma
on the CD-ROM.
Although emitters are random in their particle output, they tend to produce a constant
randomness (a kind of even spread) over time. To get the emitter to create a varying number of
particles and a varying amount of spread, we could keyframe these values or we could simply
create a two-line expression using the noise function.
Note We could also use the rand function, but noise produces a more connected
randomness (as opposed to the rand function s jumping from value to value), which
looks more like the varying water pressure we might see in a fountain. For more on the
noise function, see Chapter 16.
With the emitter (not the particles) selected, open the Expression Editor and type in the following
expression.
emitter1.rate = ((noise (time) + 1) * 200) + 20;
emitter1.spread = ((noise (time) + 1)/4) + 0.1;
In essence, each line of this little expression tells the emitter to vary its rate (or spread amount)
according to a random amount as defined by the noise function, which uses time as its input to
create its numbers. The rest of the numbers are just a way to get the value output by noise into a
good range for each attribute. Because noise varies between 1 and 1, we added 1 to both lines
so the result would vary between 0 and 2. For the rate, we wanted the value to range between 20
and 420, so we multiplied the results of noise by 200 (giving a range of 0 to 400) and added 20.
For the spread, a good range seemed to be between about 0.1 and 0.6, so we divided by 4 (giving
a range of 0 to 0.5) and added 0.1. As your results should show, the noise function is a very
powerful way to create a more live look to your particles.
The result of this expression applied to the fountain project is on your CD-ROM
(23fountain.mov). If you compare this to the previous fountain movie (22fountain.mov), you
can see the dramatic way the fountain looks more real (like one of those shooting fountains) in our
new movie.
Note As an exercise, try varying the speed of the particles in the fountain as well. What
range looks best to you? Hint: to speed up the process of experimentation, try using
playblast to test your motion (instead of test renders, which will be long with blobby
surfaces). Also, 23fountain.mov uses variable speed, so look at it for hints as to
how the final product might look.
With the particles selected, create a per-particle opacity attribute; then open the Expression Editor
and type in the following simple runtime expression.
if (particleShape1.velocity != 0)
particleShape1.opacityPP = (particleShape1.velocity / 2.0);
else
particleShape1.opacityPP = 0;
All we do here is test whether the velocity is not 0 (the ! sign in front of a comparison operator
means not ). If the particle is moving, then its opacity is based on its speed (we divided by 2 to
get a more gradual opacity fadeup you can try other numbers if you like). If the particle is at rest
(the else statement), its opacity is defined as 0, or invisible. Thus, when the dust is resting on
our desert floor, it is invisible. As the UFO picks it up and moves it around, it becomes visible; then,
as it crashes back into the ground, it becomes invisible again. A movie of this new UFO sequence
is on the CD-ROM: 23UFOFade.mov.
The essence of this expression is the same as the last one: if the velocity isn t zero, rotate the
leaves. Some of the details have changed, however. First, we created a variable (Note that it is a
float) called $speed, which receives the magnitude of the particle s velocity.
Note The velocity variable is a vector quantity (with X,Y,Z values), but $speed is a scalar
(just one number). When Maya sees an assignment operator (a single equal sign), it
always forces the value on the right to fit that on the left if it can. In the case of a vector
being converted to a float, Maya takes the magnitude of the vector (the square root of
each element squared and added together), which is a single number, and assigns
that number to $speed. Whew enough math lessons for one day!
The next line checks whether the sprite s velocity is not 0; then, if that s the case, it changes the
spriteTwistPP of the particle by the value of $speed. The multipliers (noise and 2) are there to
make the motion of each leaf different from the others essentially, the value of $speed is
multiplied by a randomly changing number between 2 and 2, making the leaves spin in both
directions by varying amounts. You will notice that there is no else statement here: if the leaf isn t
moving, its rotation should just stay where it is, not suddenly jump back to some other number (like
90 degrees). A movie of the leaves is available on the CD (23UFOSpriteSpin.mov).
Select the lambert shader that controls the sprite shape (the one with the leaf on it) and, in the
Attribute Editor, click the focus button next to color (the triangle in a square) to bring up the file1
attributes. From the CD (or the directory on your hard disk where you ve saved the
Working_Files directories), open the LeafSequence subdirectory (you will see about 50 files in
the sequence), and be sure to check the Use Frame Extension box below. This will assign the first
leaf in the sequence to the shader.
Tip For faster response time (and just to be a better user), you can copy the leaf files into your
project s sourceImages folder and select them there for your shader.
Now, in the Hardware Texture Cycling Options, set the Start Cycle Extension to 1, the End Cycle
Extension to 50 (for leaf1 and leaf50, respectively), and the By Cycle Increment to 1. The By Cycle
Increment controls how many images are skipped before the next one is shown. For an animation
(of, say, a bird flying or a rendered animation sequence you had previously made), you would set
the increment to 1; for a choppier look (skipping some of the images, thus producing a more stop
motion look as the sequence plays), an increment of 2 or 3 would work.
Tip You might realize at this point how useful sprite sequences can be: you could play back a
movie (saved out as an image sequence) in sprites, creating a dazzling array of moving
images in your final scene.
If you play back the animation now, you won t see anything different. That s because we have to
write an expression to alter the look of each sprite. First, add a new attribute: spriteNumPP (click
the General button in the Attribute Editor and add it). Then RM choose a new runtime expression
and type in the following:
particleShape1.spriteNumPP = (frame % 50) + 1;
The % sign is the modulus (or remainder) function whatever number remains from dividing the
frame number by 50 is returned (plus 1 so that the number is never 0, for which no sprite is
defined). For example, on frame 1, 1 % 50 returns 1 (the remainder of 1 / 50). The second frame
returns 2, and so on. At each frame, a different spriteNumPP is defined. We could also write a
noise function to get each sprite to randomly change colors, instead of all of them doing it in
synch. In either case, we get all the changes of fall colors in very short order!
Note As an exercise, try creating a new emitter that produces different colored leaves that
then stay the same the rest of their lives. You ll need to use a creation expression this
time, instead of a runtime expression. If you get stuck, see the file
differentLeaves.ma for a clue.
Summary
In this chapter, we have discovered how to unlock the power of particle dynamics by using ramps
and expressions. Using ramps, we can produce large-scale effects be it radius, color, or even
velocity that occur over the lifetime of each particle. We learned that expressions, on the other
hand, are best at breaking down groups of particles into their constituents, and allowing us to
control each particle in a different but related manner. While none of the expressions were more
than a couple of lines long, they produced very impressive results, ranging from positioning
particles based on the Sine curve to varying their opacity based on how fast they were moving.
If you have a fairly good grasp of the past three chapters, you are now ready to create very
difficult-looking effects in (most importantly!) a relatively short time. The next chapter, on soft
bodies, is the final chapter on particle dynamics. You ll see that the term soft bodies is a slight
misnomer, as they are actually collections of particles that act as bodies. While soft bodies are one
of Maya s most complex and difficult features, the past three chapters have given you a very good
primer for these powerful objects. When you re ready, turn the page to begin exploring soft bodies!
If you have not used soft bodies, you might wonder if the trouble of learning how to use them is
worth it. Our advice is to do just one of the example exercises in this chapter. You ll discover that
the animation effects you have steered clear of in the past because of their apparent difficulty will
now be within easy grasp. The ability to use soft bodies to create flexible, fluid objects is indeed
one of Maya s most powerful features.
Maya 2 brings with it numerous changes to soft bodies, from their creation options, to how
springs are applied to them, to many under the hood changes in how their dynamics are
calculated. If you have used soft bodies before, you will find the new interface and workflow a
huge improvement over the old. Options are now more clearly available and labeled, and
springs, especially, are a far more powerful and predictable tool than in the previous version.
Note If you used Maya 1, you will notice that this options window has changed significantly
(and for the better) in Maya 2.
That s about it! You have just converted your original geometry (the sphere) into a soft body. You
will see what looks like your original sphere, surrounded by a cloud of points (or particles) that
actually define the shape. The number of particle points is determined by the number of isoparms
(or polygon faces) in your original geometry. If you want more points (higher resolution effects),
create your original shape with more isoparms. To see how this works, select the
makeNurbSphere1 node and change the number of spans (or sections) to 8. You will see the
number of soft body particles change to match.
The highlighted nodes (nurbsSphere1Particle and nurbsSphere1ParticleShape) are your new soft
body transform and shape nodes that have been attached to (and replace) your old sphere. If you
highlight the nurbsSphere1ParticleShape node and look in the Channel box (as shown on the next
page) or the Attribute Editor, you will see that the attributes listed there exactly match the attributes
you d find if you created a standard particle shape. When you finish examining the structure of
your soft body, close the Hypergraph.
Warning Remember that you always have to rewind a particle animation before playing it
back. If you do not, the results will look bizarre .
Select the sphere, Shift-select the plane, and then choose Particles Make Collide. Now, as
gravity forces the soft body to fall, the particles that make up the soft body will collide with the
plane. When you play back the animation, you should see something like the following.
Note You will notice that the soft body collision is different from a rigid body collision. First,
rigid bodies (the ones using the same rigid solver) will automatically collide with one
another; for a soft body as with standard particle groups you have to define the
collision. Second, each particle not the solid surface as a whole collides with the
plane at a different time, giving rise to the sphere s distortion.
As when you created standard particle collisions (in Chapter 21), you have control over how the
soft body collides with the plane. Both the soft body shape and the plane (in its geoConnector
node) have controls for resilience (bounciness) and friction (how much the objects stick when
they collide at an angle) for the collision. You cannot directly animate the soft body s resilience
and friction; they are constrained to be the same values as that of the plane s geoConnector. To
see how resilience works, try changing the plane s resilience attribute to a number larger than 1
(such as 1.2). When you play back the animation, the particles will bounce higher and higher (as,
on each bounce, they rise 120 percent of their last height impossible in our world, but not Maya
s). If you decrease resilience to 0, the particles will simply stick to the plane when they strike it.
Tip Maya 2 supports negative resilience. With a negative value, your soft body will move
through the plane and then bounce back toward it from underneath. If you use this
feature with gravity, however, the particle will continue to fall (as gravity continues to pull
on the object). To counteract this problem, you can keyframe gravity to change directions.
Now move resilience back to 0.8 or so and be sure that the friction value is 0.6 or so. If there is no
sideways movement to the particle (no movement tangent to the plane), you will see no difference.
Try, however, adding a bit of shear to your gravity; make the directionX value of gravity 0.2 or so
(select the gravity node at the center of the Maya grid or in the Hypergraph, and set directionX to
about 0.2). When you play back the animation, you will see the ball move sideways under gravity
; then, as it collides with the plane, it will slow on each collision. If the ball slides off the plane, just
make the plane bigger (or enjoy the spill!). If you set friction to a large value, such as 4, the ball
particles will actually bounce backward when you play back the animation because friction is
greater than 100% (which is also impossible in the real world). If you make friction negative, the ball
particles will surge forward on each collision.
Tip If you try to keyframe the ball s motion, you may run into a nasty little problem called
double transforms. You will see the particles jump out ahead of the ball shape. To
counteract this problem, simply group the soft body to itself (select the shape, and then
press Ctrl+G), and keyframe the position of the ball using this new node (called group1
by default).
Tip Generally, you want to hide the original geometry (by selecting that check box in the
Create Soft Body options window). Here, we re leaving it visible so that we can see how
the soft body and original geometry interact.
Play back the animation. You should see the sphere sag, and then bounce back into nearly
spherical shape. What s happening here is that soft body particles are being pulled down by
gravity, but they have a goal to stay as close as possible to their original shape the original
sphere. Thus, they sag a bit and then try to bounce back to their original shape. We can alter how
strongly attracted to its original shape a particle is simply by adjusting its goal weight. Select the
particle node (you may need to do this in the Outliner or Hypergraph), and find the goalWeight[0]
and goalActive[0] attributes listed there. They should be set to their default 0.5 (or 50%) and on
settings, respectively. If you turn the goalActive attribute to off (by typing that in the text field),
the soft body will fall away from the sphere when you play the animation, just as in our first
example. Why? Because turning that attribute off tells Maya to pay no further attention to the goal
weight. Now turn goalActive[0] back on.
Tip GoalActive[0] can be keyframed, meaning that you can animate whether or not the soft
body will attempt to match its original shape or simply follow the forces applied to it. The
[0] for goalActive and goalWeight is a note that these attributes are for the first element in
the particle array (they thus apply to the whole group). You can also alter goal weights on
a per particle basis.
For more subtle control of goal weights, you can adjust the goalWeight[0] from its default 0.5. If you
turn the goal weight up to 1, the soft body will no longer sag; it will now perfectly match the original
shape. If you turn the goal weight down to 0, the soft body will fall away from the sphere; this is the
same as turning off the goalActive attribute. Low numbers will make the soft body react strongly to
gravity; high numbers will make it hold its original shape well. Try changing goalWeight s numbers,
and then see how this changes playback.
Change the scale of the original shape back to 1, and then keyframe a Z rotation to the original
sphere (try rotating it about 500 degrees in 40 frames). Now, as the animation plays back, the soft
body shape will balloon out because each particle is being forced away from the original shape
by centrifugal force. When the original sphere stops rotating, the soft body shape will oscillate until
it adjusts back to the goal shape. (You ll find a color version of the following image in the Color
Gallery on the CD.)
By now, you should start to see how powerful a tool soft bodies can be, so let s kick things up a
notch. Not only can you adjust the soft body s goal weight as a whole, you can do it on a per
particle basis. First, set your object goal weight (goalWeight[0]) to 1. With the particle node
selected, in the Attribute Editor s Per Particle (Array) Attributes section, you will see a new per
particle attribute called goalPP. This attribute controls the goal weight of each particle individually,
just as the other per particle attributes do.
Tip Because goal weights are now treated like other per particle attributes, you can use the
methods you learned in the previous chapter to create goal weight ramps and
expressions to control goal weights. You need to set your object goal weight to 1 because
the object goal weight is multiplied by the particle goal weight (if a particle goal weight is
0.5 and the object goal weight is 0.6, the final goal weight of the particle will be 0.3). If the
object goal weight is not 1, there will be some play in the entire object, and you will not
see the results pictured in the next graphic.
Note To change to Select by Component Type, select the Component Type button on the
top toolbar (a cube with an arrow pointing at it). To turn off all types except points,
choose All Components Off in the pop-up menu next to the button, and then click the
Points button next to the menu (the black square).
Your sphere should have a cloud of blue-purple points around it. Select half the points on the
sphere (the top, say), and, under the Particles tab, select all the goalPP column, and change them
all to a value such as 0.2. When you play your animation, the top half should spin away from the
original sphere while the bottom half stays put. (You ll find a color version of the following image in
the Color Gallery on the CD.)
As an exercise, can you use your knowledge gained from the previous chapter to create an
expression that randomizes the goal weight? If you can t figure it out, see the next section.
In a new scene, create a nice, long, skinny cylinder (our tentacle), be sure that it has about 20
spans, and animate it to move back and forth on the X axis (try to make the motions happen at
different speeds, including some very rapid motions). Then make the cylinder a soft body, this time
hiding the original object and setting the goal weight to 1. (Note that, for space reasons, this and
other images of the cylinder have been rotated sideways.)
When you play the animation, the (invisible) cylinder will move, forcing the soft body to follow.
Because the soft body s goal weight is currently 1, it will move in perfect synch with the original
shape not very exciting yet. Now let s create an expression to alter the goal weights based on
where each particle is. RM choose Creation Expression in the text field next to the particle s
goalPP attribute. In the expression window, type the following:
float $scaling = 0.9;
float $offset = 0.1;
copyOfnurbsCylinder1ParticleShape.goalPP = ((($posY + 1) / 2) *
$scaling) + $offset;
Most of the components of this expression are simply variable definitions. The one line that actually
does something (the last line) tells Maya to assign each particle its goal weight based on how high
up it is on the cylinder. The first two lines define a scaling and an offset constant. These variables
adjust the range of values that the bottom equation will produce (in this case, 0.9 adjusts the range
of goal weights to 0 to 0.9 instead of 0 to 1), and the offset of the values (in this case, the range will
go from 0.1 to 1.0 instead of from 0 to 0.9). The next two lines read the (vector) particle position
into a variable, $pos. This variable s Y component is then read into another variable, $posY.
Tip You cannot directly read a single element (such as the Y component) of a vector attribute
such as position into a scalar (float) variable. Thus, you have to first read the value into a
vector variable and then take that variable s Y component and read it into another,
scalar, variable.
The final line of the equation grabs the relative position of each particle (which is always between
1 and 1) and renormalizes it to a range of 0 to 1. The scaling and offset values are then used to
further refine the range of goal weight values. When you run the animation, on the first frame, each
particle is assigned a goal weight between 0.1 and 0.9, and then, depending on your cylinder s
animation characteristics, the tail will waggle more the farther down the cylinder you go.
Tip You can also paint goal weights directly onto objects like this tail using Artisan s Paint
Attribute Tool. For more information on this tool, see Chapter 9, Working with Artisan.
If your Component Editor is still open, you can look at the value of each particle by highlighting it (in
component mode) and then clicking the Get Attribute button to see its value. We could, of course,
have manually adjusted all the goal weights using the Component Editor, but it s sometimes nice
to have Maya do the math for us. In this case, it would probably be just as fast to use the
Component Editor to change the goal weights, but our expression gives us the ability (via the
$scaling and $offset variables) to quickly play with the numbers to get the characteristics we want.
Additionally, given a more complex shape with more points that are closer together, the above
expression would be far faster than adjusting goal weights by hand. In short, use whichever way
will prove faster and more flexible for your situation.
Use your project from the last section (or, if you re not happy with that project, open the
24tail.ma file on your CD-ROM). Select your soft body shape in the scene window, and then
choose Bodies Create Springs to open the Spring Options dialog box.
In the Spring Methods section, set Creation Method to All (all particles are connected). You can
leave all the other areas of this dialog box in their default state. Click the Create button, and then
close the window.
Tip You can create per spring (PS) attributes for stiffness, damping, rest length, and end
weights. If you don t create per spring attributes, Maya uses per object attributes, just as
with particles. Though we won t discuss modifying springs on a per spring basis, the
method is the same as for per particle attributes, and the results can be extremely subtle
and beautiful.
Note The new wire walk length setting controls how much structure there is to your object. A
walk length of 1 sets springs to each particle s closest neighbors on all sides. A walk
length of 2 sets springs between the 2 closest neighbors on all sides. At higher settings
the object will have more structure, but there will be an added calculation cost, as a
result of the higher number of springs.
You will see a huge mess of dark dots (springs) covering your cylinder. As you play the animation,
you will see the springs stretching and contracting to keep the cylinder moving in a more natural,
connected motion. Once you get a look at the springs, you may want to hide them to prevent
screen clutter.
Note Spring calculation times have been dramatically reduced in Maya 2. Though they can
still be slow in complex objects, they are now far more usable than they were in
version 1.
With springs selected, you can (in the Channel box or Attribute Editor) adjust the stiffness of the
springs (how resistant to bending they are) and their damping (how quickly they come back to rest
after they ve been moved). Although very low stiffness and damping values make the tail play
back as if no springs are attached, increasing stiffness and damping can often create the rigidity
that makes an object like ours appear to have a constant length. Try moving the damping up to
about 0.4, and set the stiffness to 1 or a bit higher to get the tail to bend a bit more stiffly and not
stretch as much. If you re lucky, you ll see your animation play back as it should. If not, you ll
see the simulation go out of control.
This bizarre behavior happens because Maya can t calculate the solution given its sampling rate
(1 time per frame is default). The solution is to increase the sampling rate to allow Maya to better
calculate the motion of the springs. From the Dynamics menu set, choose Solvers Edit
Oversampling. The Attribute Editor opens with one option: Oversampling Rate (which should
currently be set to 1). Try setting this number to 2 and see if that fixes the simulation. If not, move
up to 3, and so on.
Warning Increase the oversampling rate slowly it will severely affect your playback times!
The number you put in the field is how many times longer the simulation will take to
play than if the rate were set to 1, so increase by 1, and see if the simulation works;
if not, increase by 1 again, and so on. Generally, very high values for stiffness and
damping are not desirable anyway, so alter these numbers slowly as well.
As you can see, springs can really contribute to more realistic motion for soft bodies, so keep them
in mind when your soft bodies look a bit too much like stretched taffy!
Faking a Bounce
Because of the new structure of dynamics in Maya 2, you can now create a soft body that has a
rigid body as a goal a nice new feature that was missing in Maya 1. However, there are times
when, for control and accuracy (not to mention playback speed!), creating a bit of dynamics on your
own can be advantageous.
Tip The method for creating a soft body with a rigid body goal is the same as the one
outlined earlier, except that you have to check the Duplicate Upstream Graph check box
in the Create Soft Body Options dialog box. If you don t do this, the soft body will just go
along for the ride, as if it had a goal weight of 1.
Create a new scene with a ball and a plane, and then type the following expression for motion into
the Expression Editor (or just use the 24bouncerAnimated.ma file on the CD).
This equation makes the ball bounce (using the cos, or Cosine, function) lower and lower, until the
ball comes to rest (using the linstep function).
Tip The linstep function is useful. You give it a starting and ending value (frames here) and
the unit it will be using (frames again), and then the function moves between 0 and 1
over that range. In this example, the value output by linstep increases from 0 to 1 over
the range of 0 to 300 frames. (The smoothstep function performs the same function as
the linstep function, except that it produces a smoothly varying curve instead of a
straight line.)
Now we have a bouncing-ball motion. Let s add a soft body, adjust its goal weights, add some
springs, and see what happens. First, add a soft body and set its goal weight to 1. Next, using the
Component Editor (or the expression for goal weights given earlier), set the top points of the sphere
to have a goal weight near 0.5, and set the bottom points to have a goal weight near 0. Keep
playing with the values until you get a look something like this. (You ll find a color version of this
image in the Color Gallery on the CD.)
In playing back the animation, you should see the ball (the bottom especially) jiggle quite a bit.
Although this could be a useful effect by itself, let s add some springs to it to give the whole ball a
more connected look. Select the soft body sphere and add springs to it (you might try increasing
the walk length to 2 here to give the ball more structure). When the ball bounces now, it reacts
more connectedly, its sides moving in as the ball bounces away from the plane (thus imitating real
life by preserving volume). Additionally, the ball now wiggles much less, because the spring
dampens the extra motion of course, this is adjustable via the damping and stiffness controls.
(You ll find a color version of the following image in the Color Gallery on the CD.)
One last thing to check out with these springs is using the rest length setting (available in the
Channel box or Attribute Editor). First, be sure the restLengthPS setting is off, and then try
adjusting the rest length. If you set the number to 0, the ball will shrink dramatically; whereas if you
set the value to 5 or 6, the ball will expand. The rest length tells the springs how far apart they
should be when resting (in other words, when they re not being moved by forces or collisions),
so the larger the number in the field, the bigger the distance between springs (and thus points), and
thus the larger the sphere.
Tip One great new feature is the ability to place springs between standard particles (not just
soft bodies). You can connect a stream of emitter particles to form an interacting group,
enabling you to produce anything from a simulation of molecules in a room to a blob
that can shoot across the screen. For more information on adding springs to standard
particles, see the Springs topic in the Maya 2 online reference. Also see
23cloud-srping.mov in the CD for an example of particles using springs.
Open a new scene and create a sphere with about 32 spans and sections (so that the soft body will
have lots of points on it). If you wish, you can stretch the sphere up a bit, since no one ever heard
of a perfectly round asteroid!
Save this project now as a separate file, because we ll use the sphere again when we create an
asteroid using a particle emitter. With the sphere selected, choose Bodies Create Soft Body . In
the Soft Options dialog box, set the Creation Options to Make Soft.
Note Choosing Make Soft tells Maya to convert the object to a soft body (there will no longer
be any original geometry). Because there is no goal object, there is no goal weighting
for this type of soft body.
Now, with the new soft body selected, choose Fields Create Turbulence , set the magnitude
(force of the turbulence) to about 5 and the frequency (the number of waves of turbulence) to
about 20, and create the field. As you play the animation, you will see the sphere distort under the
influence of the turbulence field. Since there is no goal weight to bring the sphere back, the sphere
will distort too much if the animation plays back too long. Try a few settings for magnitude and
frequency, and stop the animation at a frame where you like the look of your new asteroid. (You ll
find a color version of the following image in the Color Gallery on the CD.)
Now that you have the shape, getting it to be a permanent model is as easy as duplicating the
shape. With the soft body selected, choose Edit Duplicate . In the options window, be sure
Duplicate Upstream Graph is off, and then duplicate the object by clicking the Duplicate button.
Voil, one ready-built asteroid!
Note If you were to duplicate the upstream graph (the input connections), Maya would
create another soft body that would then change with the turbulence field. By turning
this option off, the model will be a standard node with no history.
Tip If you see a group of points when you move your duplicate copy (the duplicate soft body
points), you can simply delete them.
You can now either delete the original shape or alter its shape and the magnitude and frequency of
the turbulence field to make a few more asteroids.
Note You can also turn lattices into soft bodies. As an exercise, try adding a lattice shape to
your original sphere, turning the lattice into a soft body and then adding a turbulence
field to the lattice. How does this alter the way the distorted sphere looks? You might
like the results better.
Now that we ve used a field to convert a sphere into an asteroid, let s try using an emitter plus a
field (emulating lots of little meteorite collisions) to do the same thing. Open your original sphere,
and make it a soft body, using the Duplicate, Make Copy Soft option, checking the Make Non-Soft
a Goal box, and setting the goal weight to 0. Next, create an emitter that shoots particles at a rate
of about 50 toward the sphere.
Select the particles (not the emitter), and choose Fields Add Air (be sure you choose Add, not
Create). In the options window, click the Wind button, and then set the Magnitude to 20, the
Directions X, Y, and Z to 1, 0.1, 0.1, respectively. Be sure Use Max Distance is on, and set it
to 1; then click Add and close the window. You will now have a wind field that is owned by each
particle (the air icon will move along with the particles if you play the animation). Because the Use
Max Distance setting is on and because the distance is only 1 unit, each particle will create a little
ball of wind around it that will affect any object connected to it. What we need to do now is
simply attach the sphere s particles (not the emitter s) to the wind field, and the field will distort
the surface of the sphere.
Select the soft body sphere, and then open the Dynamic Relationships Editor (choose Window
Relationship Editors Dynamic Relationships). On the right side, highlight the airField1 text, and
then close the window. Because the particles now strike the sphere, it will distort probably more
than you want it to! Never fear we re going to use a little trick from earlier in this chapter to fix that
problem. With the soft body again selected, open the Expression Editor and type in the following
expression:
goalPP = rand (0.3, 0.6);
This expression simply sets the goal weights of the soft body s particles to a random number
between 0.3 and 0.6. Now, as the particles (plus their air field) pass through the sphere, different
parts of the sphere will react in differing amounts to the air field, creating a more interesting look to
the distortion.Try adjusting the numbers for different effects.
Note You will need to be sure that the per-object goal weight is set to 1 for this effect to work
properly. Also, you will need to increase the magnitude of the wind field to about 500 to
see results.
To get an even spread of dents, try rotating the sphere around its Y axis twice (720 degrees) over
about 200 frames (select the sphere, and then key its Y rotation value between 0 and 720).
One last adjustment we can make is to force the particles to collide with the sphere. You may have
noticed that, now, the particles pass through the sphere and dent it outward on the far side of the
object not what a meteorite collision would do! Select the emitted particles first, Shift-select the
sphere, and then choose Particles Make Collide. Now, when the particles strike the sphere, they
bounce off, creating only dents, not stretches in the sphere.
Tip You can make a couple of adjustments to fine-tune your collisions: (1) try increasing the
magnitude of the wind force to about 1000; (2) change the value of the resilience for the
collision, and see what different values produce. A low resilience will keep the particles
around the sphere longer, creating deeper pits.
Although playback can be a bit slow with fields and collisions turned on, you can do millions of
years of damage to your asteroid in just minutes! You ll find a color version of the following image
in the Color Gallery on the CD.
To create a permanent model from your new asteroid, simply stop on a frame you like and
duplicate the object, as we did earlier. As you can see, soft bodies can be a fast way to create
organic, or beat-up, shapes.
Warning Creating the large number of particle collisions in this project can be
time-consuming. If you don t have a fast computer, you might want to just read
through this section or just attach an air field to the first group of particles.
Open your fountain project from the previous chapter (or use fountain3.ma on the CD-ROM).
Select the plane, go to makeNurbsPlane1, and then increase the U and V spans to about 50 so
there will be more points for the soft body you will create. For a more accurate simulation, you can
increase this number, but remember that Maya will slow to a crawl on all but the fastest computers,
even at this setting. It s going to have to do a ton of calculations for each point on the grid!
Once your plane is subdivided, make a soft body out of it, using the Duplicate, Make Copy Soft
option and setting the goal weight to 0.4. Once the plane is a soft body, you need to add an air field
to particles 1 and 2 (and 3, if you want even longer render times!). Select each particle group, and
then add (not create) an air field, just as we did in the previous section. Set the magnitude to about
500, the X and Z directions to 0.5, and the Y direction to 1. Be sure the Use Max Distance check
box is on, and set the max distance for particle1 to about 1; set the max distance for particle2 (the
smaller ones) to about 0.5 so that they will make smaller splashes. Once the air fields are
created, link them to the soft body plane (choose Windows Relationship Editors Dynamic
Relationships; then highlight the air fields).
You can now (attempt to) play back your animation. You will probably find, however, that the
playback speed is so slow that it is difficult to see the motion of the particles and waves. To
compensate for this, either playblast (choose Windows Playblast) or hardware render the scene.
When you can view the motion of the plane, you should see reasonably good results. Each collision
dent, however, simply exists on its own; the waves don t connect and move. To solve this, we
need you guessed it springs (as if playback weren t slow enough already). Here is where the
real compromises begin. It would be ideal to create springs between all particles, using a large walk
length (such as 3 or 4); however, unless you have a beastly computer with lots of RAM, this will not
be possible, because the process of creating springs will generate a memory error (there is not
enough memory to create all the springs needed). Instead, try creating springs with a wireframe
setting and a walk length of 1 (so that each particle is connected only to its nearest neighbor).
Tip If you have a fast computer with lots of RAM (512MB or so), try using a Min/Max setting,
with a minimum spacing of about 0.1 (or just 0) and a max of about 2. This will produce
better results, because more particles are connected, but it will be slower than the
wireframe choice.
The waves will not propagate outward fully now, but the effect will still be better than it was. Set the
damping value of the springs very low (at 0.05 or lower) so that the waves continue moving after
the collision, and set the stiffness to a middle value such as 0.6. When you look at your playblast or
hardware render of the scene, notice how the waves interact with one another and with the
particles. If they don t look good enough to you, try adjusting spring stiffness and damping, as well
as air field magnitude and max distance. With some patience (for the renders!) and
experimentation, it is possible to get good-looking results. A final render of this scene is available
on the CD-ROM (24fountain.mov).
When creating complex dynamics simulations involving soft bodies and especially springs the art
of a successful project is often a compromise between the best settings and those that aren t quite
as accurate, but will get the job done on deadline. If, for example, this fountain was a background
element of your scene, it would make no sense to create such a time-consuming, accurate
simulation. Simply make the plane a soft body, and add a turbulence field to simulate ripples. If, on
the other hand, the fountain will be the center of attention, it is probably worth the effort to create
this effect, because the inaccuracy of a simple turbulence field will call attention to itself. You, the
artist, must decide where perfection and efficiency meet in these situations.
Let s now use some blend shapes to alter the face s expressions (two blend shapes are built into
the CD-ROM file). As the face moves through the tube, shut its eyes, and give it a neutral
expression. When it stops (after about frame 160), have it go through two or three more
expressions, and then return it to neutral by the end of the animation (about 400 frames).
Tip If you want your file complete with blendshapes and lighting, use the
24abyssBlended.ma file on the CD-ROM.
Now for the soft body stuff. We re going to turn the whole pseudopod into a soft body, adjust the
goal weights on it, add a turbulence field to it, and then animate the goal weights to make the face
pop out of the pseudopod. First, drag a selection marquee around the entire body; then make it a
soft body with Duplicate, Make Copy Soft, and a goal weight of 1 (we ll adjust individual goal
weights later). Test the soft body to be sure it animates properly (if not, go back to the saved
version and try again). Because the goal weight is currently set to 1, the animation should look
pretty much the same as before.
This is where things get tricky (it s an advanced tutorial, after all). Because the head is constructed
of several (eight, to be exact) objects and because we need to vary the goal weight, we need to
control all of them via an expression that we ll cut and paste into each particle shape s goalPP
attribute. First, however, find the two long cylinder pieces, and change their global goal weights to
0.5. They will be at this goal weight constantly, so we don t need to do anything further with them.
Now, type the following into the Expression Editor, and copy it so that you can paste it into all eight
goalPP runtime expressions.
float $goalStart = 0.6;
float $goalUp = (0.6 * smoothstep (181, 190, frame)) + 0.25;
float $goalDown = (0.6 * (1 - smoothstep (361, 385, frame))) + 0.25;
if (frame <=180)
{
goalPP = $goalStart;
}
else if ((frame >180) && (frame <=360))
{
goalPP = $goalUp;
}
else goalPP = $goalDown;
This expression sets the goal weight of each particle based on which frame it is in the animation.
Early on (during the pseudopod s motion), the goal weight is lower. In the middle, during the facial
expressions, the weight is higher, rising using a smoothstep function. At the end, again, the weight
is lowered back down using a smoothstep function.
Tip You could also control the goal weight for each segment of the face by keying the per
object goal weight. This technique is more intuitive, but requires keyframing eight objects.
Use the method that seems easier to you.
Now that the goal weights are animated, let s add a bit of turbulence. Drag-select all the soft
bodies, and then choose Fields Create Turbulence . Set Magnitude to about 60, Attenuation to
0, Frequency to a high number such as 100 or so (this will make for smaller waves), leave Phase
as-is (at 0), and set Use Max Distance to off. As a final touch, we parented the air field to one of the
head soft bodies so that the turbulence would travel along with the form. You might like the
turbulence to stay in one place while the figure moves through it; try both ways and see which you
prefer.
If you like your animation, all that s really left is to create and apply a water texture. Try creating a
phongE shader with a pale blue color (almost white), slightly roughened, but tight and bright
specular colors, and a good deal of transparency (only the highlights of water really show well).
You might also add a background image or geometry and set the shader to have a refraction and
reflection so that it looks more like water. A finished movie is available on the CD-ROM as
24waterHead.mov, and you can see a rendered still in the color insert.
Note For more on how to create materials, see Chapter 18, Rendering Basics.
This animation (and the fountain we developed earlier) should take you a good deal of time to get
right. Work like this is the culmination of your understanding of the entire Maya dynamics package,
so, when you do finish, congratulate yourself on a job well done!
Summary
In this, the final chapter on Maya dynamics, you learned what soft bodies are, how to create them,
and how to use them for everything from simple animation effects, to modeling, to adding the final
touch to complex projects. As a group of particles that act as a whole, soft bodies are a unique
blend of form and motion, allowing us to create effects that would otherwise be so difficult to do
correctly that we probably wouldn t. Although this chapter indeed all the chapters in this section
only begin to reveal the power of Maya dynamics, we hope that you now have enough knowledge
and the confidence to continue experimenting and working on your own. Think of something you
always wanted to animate that has clouds of dust or jiggling, organic figures in it. Now go on and
create that animation!
In the final chapter, we will look at Maya 2.5 s new Paint Effects module, which provides a
different way of creating organic, variable effects. Although it is not directly related to particles,
Paint Effects use of tubes, expressions, and random variability should be much easier to grasp
now that you have a solid understanding of how Maya s particle system works.
With Paint Effects, however, the rules have changed. Paint Effects is a brush-based paint program
that lets you paint textures onto 2D objects (like the default canvas) or a texture map for a 3D
object. (Its interface will feel similar to the Artisan brushes you used in Chapter 9.) More uniquely,
you can paint 3D objects into your scene, fully textured and animated all at the drag of your mouse
or graphics tablet! You can paint hair, trees, grass, cornstalks, pasta, or many other default Paint
Effects brushes into your scene, or you can get really creative and start making your own brushes,
either using the included brushes as templates or designing them from scratch. If you paint a 3D
object into your scene and wish to change its parameters (its texturing or how much it blows in the
wind, for example), you simply select the node in your scene (Paint Effects brushes are
node-based, just like the rest of Maya) and change whatever attributes you wish! It s hardly an
exaggeration to say Paint Effects will change the way you work and even the way you think about
CG work; more importantly, it will give you a huge edge over your competition, who will have to pick
up their jaws off the floor when they see your work!
We introduce Paint Effects tools in a gradual, logical manner in this chapter, building your
knowledge of this new feature step by step. This method will give you an excellent basic knowledge
of Paint Effects, but you may wish instead to read the chapter out of order, skipping ahead to
sections you are most interested in first. Feel free to read the chapter sections in any order you
wish, and, most of all, play with Paint Effects as much as you can while you read this chapter. You
will discover that a bit of guided interaction with a particular brush is your best instructor.
Note The forces you apply to Paint Effects brushes are not actually calculated by Maya s
dynamics engine, but are in fact expressions applied to the brush tubes. This means
you can animate several trees, or the hairs on someone s head, with very little penalty
in interactivity or rendering.
Paint Effects takes advantage of the depth buffer to do its rendering magic. The Paint Effects
renderer uses the depth (or Z) buffer, in addition to six other buffers, to figure out where paint
strokes should be placed in the 3D scene, then it splats the objects there, fully anti-aliased and
rendered. The Paint Effects renderer is not a scan line based rendering pass, it is actually a post
process, meaning that all geometry is rendered first, and then the Paint Effects elements are added
into the render. While Paint Effects is a post process, however, it allows things like transparency
(which is traditionally not possible in depth buffer effects), out-of-order draw, glowing paint strokes,
depth of field, and motion blur (both 2D and 3D). The strokes are tubes that can be fully drawn
along their length and separated by gaps, and nearly all Paint Effects elements (or attributes) can
be keyframed or animated or both.
If Paint Effects sounds groundbreakingly, earth-shatteringly fantastic, just wait until you see how
easy it is to use. After reading just a few pages here, you should be up and running with this
feature, which is worth the price of admission to Maya 2.5 Complete all by itself. But enough
superlatives, let s get painting!
Strokes
Strokes are the basic element that underlies all that Paint Effects does. They are, in essence,
curves drawn in real time by your mouse or graphics tablet, and they can take the form of curves
on a canvas, on a 3D surface, between surfaces, or even on the Maya grid plane.
Wherever they are placed (or painted on ), strokes are the curves that either define the shape of
a brush directly (as in a stroke of air-brushed paint) or emit brush tubes from them (as in grass
blades or entire trees). While brush strokes are not particles, if they are set to emit tubes from their
base curve, they can grow these tubes as you paint, the blades of grass, hair, or branches of a
tree sprouting up from the stroke curve. In the case of trees, for instance, the strokes can emit a
base branch, then sprout further branches and sub-branches, then sprout leaves, buds, or flowers.
Alternatively, if you have already created a curve, you can convert it into a Paint Effects stroke, and
your selected brush will be applied to the curve. If the stroke uses only the base curve you draw,
paint will be applied to the curve itself. If the stroke emits tubes, the original curve will render
invisible, and the paint will be applied to the tubes emitted from the curve.
Tip Because tubes are emitted and grow (over time) from a Paint Effects brush, their growth
can actually be animated, along with their other features. Thus you can create a field of
flowers that grow up from the ground, or make a model s hair grow longer while the
animation plays. You ll learn more about how to create this effect later in this chapter.
Brushes
Brushes are a set of growth and render options (or attributes) you set for a given curve; more
simply, they are the paint you choose to paint with. Thus, while strokes define the shape of the
curve you paint (as in a painter s brush strokes), brushes define the look of the paint.
There are nearly four hundred built-in brushes, including tube-shaped animals (snakes), animal
elements (flesh, hair), natural phenomena (clouds, lightning, stars), traditional brushes (oil, felt
pens, air brushes), metals and glass, plants of all varieties, and food (pastas, hamburger, corn). As
you would expect from Maya, all these preset brushes are infinitely adjustable and animatible,
allowing you to modify the built-in brushes to your fancy and save these new brushes for later use.
Brushes are stored in Maya2.5\brushes (on NT, the path would likely be
C:\AW\Maya2.5\brushes) and are accessible in Maya in the Visor window (Window Visor) or
in the Visor subwindow of Hypershade (Window Hypershade). On opening the Visor (or
Hypershade), scroll down to the bottom of the window, and click to twirl down the spin arrow next to
the Maya2.5\brushes text. This allows you quick access to Paint Effects thirty-plus folders of
brush presets.
Open any folder, and inside will be brushes you can select simply by clicking on an icon. If you roll
the mouse over an icon, the name of the brush will appear. Select a brush (say, Delphinium from
the Flowers folder) and note that your mode is now set to the Paint Effects tool in the toolbar and
that your cursor has changed to a pencil icon with a red circle under it (again, similar to the Artisan
cursor).
Click inside your Scene window and paint a stroke or two. You will see the outline of several
flowers appear. As soon as you release the mouse button, the flowers will reduce to a rudimentary
outline, and you will see the base curve (the actual curve you drew) highlighted on the scene grid.
You may also notice that the flowers are painted on the Maya scene grid; this is because the Paint
Effects tool defaults to painting on the scene grid (or the X-Z plane) if no other objects are selected
and set to be paintable.
Note In order to keep the scene responsive to your input, Maya automatically reduces the
complexity of the curves and tubes it draws with the Paint Effects tool. You can adjust
this reduction to your liking (see Animating Brush Strokes later in the chapter).
You may wonder why your brush strokes, while interesting, look nothing like a fully rendered flower.
The answer is that, in order to see what your brush strokes will look like, you must paint in a special
Paint Effects window, rather than in the default Scene windows. You can define this window to be
either a 2D canvas or to mimic the perspective (or other) camera in your scene. We will begin with
painting on a 2D canvas in the next section, and then move on to painting in a 3D environment later
in this chapter.
Painting on a 2D Canvas
At its simplest level, Paint Effects looks a lot like traditional paint programs (MetaCreations
Painter, for example). You simply paint on colors or alter colors already present and create a
painterly image in two dimensions.
Start with a new Scene window (or erase the strokes you painted previously choose Edit Delete
All by Type Strokes), and then choose Window Paint Effects to open the Paint Effects window.
You will probably see what appears to be your perspective view with a new set of icons at the top
of the window. This is, in fact, the 3D environment for painting in Paint Effects. For now, we wish to
paint on a canvas, so choose (from the panel menu bar, or RM choose) Paint Paint Canvas. You
will now see a large white canvas on which to paint, with a set of new icons at the top of the
window.
Tip To switch from your Scene view to the Paint Effects window and back, just press the 8
key on your keyboard (not on the number pad). As you will likely switch back and forth
from the Paint Effects window to the Scene window(s) many times in a project, it is a
good idea to memorize this shortcut. When you are in the Paint Effects window, you can
momentarily access the Scene window (to pick an object, say) by holding down the Ctrl
key and clicking in the window.
First, try painting on a few brush strokes. If you ve been painting and have a brush still selected,
you will see that brush painted on the canvas. If you have just opened a new session of Maya, you
will see a black brush stroke (the default brush) painted on the window.
Note In the 2D view, you have just one level of Undo, and it can only be accessed via the
panel menu (Canvas Canvas Undo) not by the usual Z key. You can assign this
function to a hot key (like Ctrl+Z) via the Hotkey Editor (see Chapter 2 or 16 for more
on assigning hotkeys).
Once you have painted a few brush strokes, you may wish to clear the canvas, so you can paint on
new strokes. To do so, choose Canvas Clear, and the Canvas will be reset to its initial color
(probably white). To change the background color of the canvas, choose Canvas Clear , and
choose a new color for the canvas from the Clear Color color chip.
Clear your canvas, choose a new brush from the Visor, and paint something interesting! You may
find that on a traditional canvas like this, the more traditional brush types (oil paint, pens, air
brushes, and such) look better than the organic brushes, but it s your canvas, so you get to
decide. If you have a graphics tablet, you will find that many brushes have a built-in dependence on
pressure, changing everything from color to size as you press harder with your stylus. You will also
notice that as you move your cursor faster, many brushes will segment, not following your strokes
in a continuous manner; this is because the brush strokes are merely a collection of stamps that
the program places as you drag your mouse or stylus over the canvas. Thus, if you paint fast
enough, you can outrun the spacing of the stamps and produce blank spaces in between.
Sometimes this effect might be useful and sometimes not, so remember that Paint Effects is
actually responding to the speed you draw your curves.
After you experiment a bit, clear your canvas once again (Canvas Clear) and turn on horizontal
and vertical Wrap. You can choose Paint Effects Paint Effects Globals Canvas and toggle on
Wrap H and Wrap V, but it s simpler just to click the Wrap icons in the Paint Effects window
toolbar.
Now that you have Wrap on, try painting a brush stroke that goes beyond the edges of the canvas.
You should see the stroke continue on the other side of the canvas, as if the canvas were wrapped
into a ball where all sides meet together, like the canvas shown on the following page. This effect
is, of course, extremely valuable for creating seamless tiles you could use as repeating textures in
your Maya scene.
If you wish to see how the edges of your canvas look for this, or any set of brush strokes, you can
roll the canvas in any direction using the Canvas Roll <item> commands. You can, for
example, roll the canvas halfway horizontally (by selecting Canvas Roll 50% Horizontal) in
order to see the vertical seam in the middle of the canvas. Another roll of 50% Horizontal and your
image is back to where you started.
If you have a texture that is not currently seamless (or just for other effects), you can change the
brush mode from Paint to Erase, Smear, or Blur, and alter the paint that is currently on the canvas.
Choose Paint Effects Template Brush Settings (from the Rendering menu set), or click the
paintbrush icon in the toolbar to bring up the Paint Effects Brush Settings window, which allows you
access to all of the brush s settings. For now, just change the Brush Type pop-up to Erase (or
whatever you prefer) and paint over your image. You will see that the brush stamp is now painting
on an erase (or smear or blur) effect, which can make for very intricate effects, as illustrated on the
next page.
To save your image (if you wanted to use the image as a texture file, for example), you can either
click on the Camera (Save Snapshot) icon, or choose Paint Save Snapshot, and name the file.
You can further modify the image in another program (like Adobe Photoshop) or use the file as a
file texture on a scene object (see Chapter 19 for more information on using file textures).
Tip You may wish to scale your brush up to see the strokes better. To do so, just use the
same hotkey as the outer brush radius for Artisan: the B key. By holding down the B key
and dragging your mouse left and right, the brush stamp size will interactively change on
the canvas, allowing you to see how large your brush will be.
For the Putty brush, you will only see two color chips and sliders in the toolbar (one pinkish, which
sets color, the other a dull gray, which sets transparency). Change the pinkish color to something
else by clicking on the color chip; then paint a few strokes to see your new brush in action. Next,
increase the transparency (the gray color) by moving the slider to the right and paint some more.
Your new strokes should look less solid (or more transparent) than before.
Note You may have noticed that changing a brush setting will not affect your old brush
strokes. Paint Effects strokes are each stored on a separate node (or, in the case of
2D work, they are just painted pixels), and thus will not automatically update when the
brush profile is altered. In 3D scene painting, you can select and change old strokes,
as we will see below.
If you like the brush you have created and wish to use it again in future work, you ll want to save
the profile so you don t have to make the same changes over again. You can either save the
brush to a shelf or in the Visor. To save the template, choose Paint Effects Save Brush Preset. In
the Label field, name your brush (Blueputty, perhaps); in the Overlay Label field, type in any letters
you would like to have printed on the icon overlay (this will only be visible if the brush is saved to a
shelf). Choose either To Shelf or To Visor in the Save Preset box and, if you wish to save the brush
to the Visor, type in the path to the directory where the brush will be saved. Finally, you can capture
an image of the brush as an icon by clicking the Grab Icon button and then drawing a marquee
around some strokes your brush made.
Note Although Paint Effects is still a young program, most users already seem to prefer
saving brush presets to a new shelf tab rather than to the Visor. This way, you can
have ready access to different brushes in a convenient shelf. Of course, the choice of
where to save brushes is completely up to you! For more information on creating
shelves, see Chapter 2.
Blending Brushes
For broader brush control than is available through the color and transparency sliders, you can
easily combine two or more brushes into a third brush that shares the qualities of both parents.
Reload your basic Putty brush by selecting it again in the Visor. Now let s combine this brush with
something natural, like the fernOrnament brush in the Plants folder. Be sure the Putty brush is
selected first, then roll your mouse over the fernOrnament brush and RM choose Blend Brush 50%
(you will see several other blend modes, which you can play with as well). Now when you paint
strokes onto the canvas, you will see that your brush has become a sort of hybrid between the
putty and fern brushes. If you continue to RM choose Blend Brush 50% from the fern brush, you
will continue blending the brush toward the fern look, and your strokes will look more and more like
the basic fern preset.
For even more control over the blending of shapes and shading between two brushes, choose
Paint Effects Preset Blending, and adjust the two sliders for shape and shading. If you then
choose another brush preset, it will be blended in with the other brushes according to the
percentages you set. This way in just a few minutes of experimentation, you can create completely
new, unique, and fun brushes for your own use. Try some blend of ferns, grass, and hair, and see
what you come up with! To remove the blending effect, simply close the Brush Preset Blend
window, and the next brush you pick will be loaded at 100%.
Tip If you need information about a specific setting, look in Using Maya: Paint Effects, which
was included with the manuals that shipped with Maya Complete. You may also find that
simply altering the setting and examining the resulting look of the brush will give you
enough feedback about the purpose of this setting that you need look no further.
Instead, let s take a look at a few settings, and you can experiment with others as you go. It is no
understatement to say that getting to know the Brush Settings window is paramount to becoming a
skilled Paint Effects user. This window is where all the action is, and you need to understand
enough to make intelligent changes to the settings in this window to control how your brushes will
look.
Let s start with a simple brush. Choose the markerRed brush (in the Markers folder). Paint a few
strokes to see what the marker looks like in its default setting, then clear the canvas. Open the
Brush Settings window (either click the paintbrush icon in the toolbar or choose Paint Effects
Template Brush Settings) and twirl down the Brush Profile settings. From this group of controls, you
can set, for example, the Brush Width, Softness, and Stamp Density of the brush (how frequently
the brush creates a new stamp of its image as you drag your mouse). Try setting the Brush Width
bigger, the Softness very small, and the Stamp Density to a large number (like 10). You should end
up with something that looks like a bunch of interconnected circles a very different-looking brush
from the default marker! The Stamp Density placed the circles very close together, the Brush Width
(obviously) increased the size of the stamp, and reducing Softness created sharply defined circles
instead of a blurred stroke.
Under Shading, you can adjust the color, incandescence, and transparency of the marker brush.
Illumination allows you to light the strokes (when Illumination On is checked), choose the light s
direction (the Real Lights setting will not function in Canvas mode), and add effects like specular
highlights to the brush. By setting Fake Shadow to On under Shadow Effects, you can add either a
2D offset shadow (a drop shadow) or a 3D cast shadow (the 3D cast often works best in scene
painting mode). Under the Glow tab, you can set several Glow attributes. You can set Gaps in your
brush, so it appears more like a dotted line than a continuous curve, via the Gaps sub-menu.
Finally, under Flow Animation, you can actually animate your brush strokes (more on this under 3D
painting). Experiment with any or all settings and see what your brush ends up looking like. The
next illustration shows a sample of a modified brush with gaps, and you can see a color version of
this in the Color Gallery on the companion CD.
Tip If you have a graphics tablet and want to map brush properties to stylus pressure, go to
the Paint Effects Tool Settings window (Paint Effects Paint Effects Tool ). In this
window, you have control over any three attributes you wish to map to pressure. Simply
pull down the mapping pop-up, choose an attribute to map, and set the min/max values.
Now let s try a tube-based brush, to see how we can actually alter the attributes of the tubes that
grow from a brush like this. Select the fernOrnament brush from the Plants folder, draw a few test
strokes, and then open the Brush Settings window. You can, of course, alter any of the color,
lighting, shadow, and other settings we discussed above, but here let s look at the Tubes
attributes. Twirl down the Tubes settings, and then twirl down the Creation sub-menu. If you set the
Tubes per Step very high (like 7 or 8), you will no longer get individual fern fronds, but a mass of
fern-looking things.
While interesting, this density is calculation-intensive, so reset the Tubes per Step to a low value
(like 0.2). Just a sample of the controls you have in the Creation section includes making your ferns
very long by adjusting the Length Max setting, changing the tube start and end widths by adjusting
the Tube Width1 and 2 settings, altering the number of Segments for each tube (more segments
means more of a flowing curve) and, of course, randomizing several of the settings, so each fern
doesn t look identical to its neighbor.
Creation is just the start, however; under the Growth settings, you can turn any of the following on
or off, and adjust settings for them as well: Branches, Twigs, Leaves, Flowers, and Buds. The
default fern only has leaves and buds turned on, so try turning on branches, twigs, and flowers, and
see what happens. Without even changing the default settings, just turning on these options
creates a rather interesting shrub-like brush, shown in the following illustration (there s a color
version of this image in the Color Gallery on the CD).
Inside each of these Growth sections, you have control over how many items will be created, at
what angles they split off from their parent tubes, whether all tubes will have children (the Dropout
rate), whether the new tubes will twist (and how much), how large they will be compared to their
parent tubes, and several specialized settings for each element. As an experiment, let s create
something that looks like a flowering wild rose tree. Our leaves and flowers are obviously too large
for a tree, so we ll have to modify our Growth settings. The settings we chose for different aspects
of the brush were done mostly by trial and error; we made adjustments and painted strokes until we
were happy with the look of the tree. Table 25.1 lists a collection of settings that produces the rose
you ll see below.
Tip Be sure to experiment with all these settings as you go, and draw on the canvas to see
how your changed settings are affecting the brush.
Middle Branch on
Twig Angle 2 45
Leaf Flatness 1
Num Flowers 5
Of course there are a multitude of possibilities here; we can t cover the effect of all of these
options. To choose two examples, Twig Start sets how high up the tree the twigs will begin
appearing; and Leaf Start determines how high up a tree its trunk and branches are bare.
Experiment with all of the settings, and refer to Using Maya: Paint Effects if you want to read about
a specific setting.
For the buds, choose a color that stands out from the branch color. You can also change the two
base leaf colors and how the two colors are randomized try setting the randomization values very
high and see what happens. When you are finished, you should have a shrub-like tree with large
reddish flowers on it. The color version of the following illustration can be found in the Color Gallery
on the CD.
Note Because tubes are drawn using recursive, fractal algorithms, where each layer of
tubes depends on the settings for the previous layer, all tube sizes, lengths, and such
are relative measures, not absolute ones.
Note In addition to color, you can actually map texture files onto flowers, leaves, and the
main object tube itself. To map the main tube, go to Shading Texturing, set Texture
Type to File, and choose an image to map in the Image Name text field (to browse
textures, click the folder icon to the right of the field). For Leaves and Flowers, first
uncheck the Leaf (or Flower) Use Branch Tex(ture) check box, then choose an image
under Image Name. See the birchBlowingLight texture in the Trees collection for a
demonstration of texture mapping colors on a brush.
Next, open the Hypershade (or Multilister), create a new material, and assign a file texture to it.
(For more on how to create textures, see Chapter 19.) From the Hypershade, first MM drag the
material onto your scene object (to assign the material to it), then MM drag the file texture onto the
Paint Effects canvas. A dialog box will appear, allowing you to assign the name and size (in pixels)
of your texture.
Click Apply Texture to File, choose Yes to save the file, and save it in your sourceImages
directory. Before painting on the canvas, choose Canvas Auto Save and turn on Save After Each
Stroke. When you release the mouse button each time, you will see your texture updated on the
scene object(s) to which the material is being applied. Try painting with several brushes onto the
canvas and see how your texture map updates. Remember, you may wish to turn on Wrap
Horizontal and Vertical to allow your map to be seamless as it wraps around the object(s) in your
scene. The next illustration shows how Wrap appears on your canvas, and can be found in the
Color Gallery on the CD.
Note The current version of Paint Effects has a feature in it that can cause a few
headaches if you re not aware of it: if you choose Canvas Clear while painting a
texture map, the canvas will become disconnected from the material, and you will have
to assign the texture to the canvas again. To erase a canvas, then, you need to use
the Erase feature of Paint Effects (under the Template Brush Settings) to erase
unwanted strokes. (The reason for this feature is to keep people from accidentally
erasing their file textures: with Save After Each Stroke on, clearing the canvas
automatically erases the file texture, which apparently upset some Paint Effects beta
testers.)
Painting in a 3D Scene
Now that we understand strokes and brushes, and how to use them in 2D, let s get on to the really
interesting aspect of Paint Effects: painting in three dimensions. As all Paint Effects brushes are 3D
curves that can (optionally) create tubes, you can paint in a scene as easily as on the canvas. If
you open a new scene, choose a Paint Effects brush, and start painting, you will automatically paint
on the scene grid (as we noted at the start of this chapter). This can work very well if you wish to
paint trees, grass, or other elements on the ground. If you wish to paint on an actual scene
object, however, you need to select that object (or objects) and then tell Paint Effects that the
object(s) is/are paintable.
In a new scene, create a NURBS Cylinder (be sure to cap the cylinder). In the Scene window,
select the object and choose Paint Effects Make Paintable (remember, holding down the Ctrl key
in the Paint Effects window momentarily enables the Scene window so you can select objects). If
you are still in Canvas mode, choose Paint Paint Scene, to toggle on display of your scene.
We could choose to paint some hair on this object, but we ll wait on this until the tutorial later in
this chapter. Instead, let s paint some other brushes on, like one of the grasses, an oil paint, and a
waterfall (under the Liquid folder). Remember that you can alter the scale of the brush by pressing
B and dragging the mouse.
Tip Many of the Paint Effects brushes require real lighting to appear, so you may need to add
one or more lights to your scene to see your brushes in all their splendor.
Note Because painting on an object simply creates curves on the object s surface, you can
select, move, modify (alter individual CVs), or offset these curves from the surface,
giving you a great deal of control over the look of each curve.
If you tumble the Paint Effects window, you will notice that the brushes revert to an outline of their
fully rendered selves in order to speed up redraw, so you don t have to wait for the full effect of the
brushes to render each time. To change how Paint Effects simplifies the display of your strokes
(not the actual strokes themselves), go to Template Brush Editor Tubes Creation Simplify. If
you choose Tubes per Step, the redraw will remove many of the initial tubes from display (this is
good for elements like hair). Choosing Segments removes portions of each tube object, but retains
the initial tube for each one (this is good for trees, flowers, and the like). Choosing Tubes and
Segments will (of course) reduce display of both. You can also force Paint Effects to redraw the
entire window each time you move in the scene (Stroke Refresh Rendered), but this will slow
your interaction with Paint Effects down a great deal. To force a redraw of the window after you
have painted many strokes, click the Redraw Paint Effects View icon in the toolbar.
After some painting, your cylinder will probably look a great deal more interesting than it did in the
first place! A color version of the following illustration can be found in the Color Gallery on the CD.
While painting in the Paint Effects window is great for getting the look of brushes down, it is often
far more interactive to paint in the Scene view for large-scale jobs. When you switch over to the
Scene window, you will be limited to painting in wireframe, but the painting will go much faster. One
workflow example might be to create an interesting look for a tree brush or two in the Paint Effects
window, then switch to the Scene window and paint a forest of these trees. When you create the
forest, you already know what the trees look like you just wish to paint them into the scene quickly
and interactively, and the Scene window is better suited to this than the Paint Effects window.
Tip If you wish to delete the last stroke you made in 3D paint mode, the normal Undo feature
works fine. To delete selected strokes, simply select them (in the scene or the
Hypergraph) and press the Backspace or Delete key. To delete all strokes in one fell
swoop, simply choose Edit Delete All by Type Strokes, and all your brush strokes will
magically disappear!
Take some time now to play with different brushes (altering them as you wish, or just using different
defaults) and get a feel for how various brushes act in a 3D scene as opposed to a 2D canvas.
Tip If you wish to create a curve first, and then attach a brush to the curve, select the curve in
your Scene window and then choose Paint Effects Curve Utilities Attach Brush to
Curve. In this manner, you can multi-purpose curves for brushes and other functions
within your scene.
As an example, let s choose one of the strokes you created on your scene object and modify it.
You can try to select a curve via the Select tool, but you will likely choose many curves at the same
time; the Hypergraph is a better way to choose an individual curve (you can also zoom in very
close to a stroke and select it that way). When you open the Hypergraph, you will see dozens of
nodes named stroke<item><number>, where <item> is the name of the brush and <number>
is the number of that brush s stroke.
Choose one of the Grass strokes, then open the Attribute Editor (Ctrl+A). Under the grass<type>
tab (the furthest right), you will have access to all the settings that were available via the Template
Brush Settings window, only this time the changes will be made to the existing stroke. Try adding
some flowers to the grass (under Tubes Growth), and change the color of the grass to something
other than green (Shading Tube Shading). As you can see (this illustration can also be found in
the Color Gallery on the CD), you have complete control over your brushes, even after you create
them!
If you have several strokes that you wish to vary all at once, you can elect to group them so that
they share one brush setting. This way, as you make adjustments to one brush, all the strokes will
update simultaneously a real time-saver. To accomplish this, select all the strokes you want to
have share one brush. These strokes can have any brush attached to them, but be sure to select
the one with the brush shape you want last, as the last stroke selected supplies the shared brush.
Next, choose Paint Effects Share One Brush to make them all share the same brush settings. If
you now open the Attribute Editor and change the attributes of the current brush, all the strokes you
had selected will update together. If you had chosen, for example, to share the vineLeafy2 brush (in
the Plants collection), you could change the default brush settings to include twigs, and all your
strokes would come out looking something like the following (a color copy of which can be found in
the Color Gallery on the CD).
Tip To remove sharing between strokes, simply select the strokes, and then choose Paint
Effects Remove Brush Sharing.
Note Paint Effects brushes actually don t use dynamics (as do particles and rigid bodies)
but use recursive expressions on the tubes nodes. While expressions aren t quite as
wide-ranging as Maya s dynamics engine, using them was a very clever trade-off
between speed and natural motion. Using Maya s built-in dynamics engine, even a
single tree could take minutes per frame to update, whereas the expression solution
allows for very fast updates, and even allows you to scrub the animation back and
forth, which dynamics simulations cannot handle.
To see how to add dynamics, let s create some grass that blows in the wind. In the Visor, select
the grassClump brush (in the Grasses folder), and, using the Paint Effects Template Brush Settings
window, change the grass s Length Max (under Tubes Creation) to about 4, so there s a lot of
grass to blow around. (There are, of course, preset grasses that include wind, but by starting with a
grass that has no forces applied to it, you can build your own.) If you play back the animation now,
you will see that the grass stays perfectly still as the animation plays. While you could adjust your
brush settings in the Brush Settings window, and then paint a new stroke each time, it is easier to
simply select the current stroke and go into the Attribute Editor and make changes. Your sample
stroke will then update as you make changes, allowing you to see the effects of what you are
doing.
With a stroke selected, click on the grassClump1 tab in the Attribute Editor, and open the Tubes
Behavior subwindow. There are several menus under this: Displacement, Forces, Turbulence,
Spiral, and Twist (Paint Effects is a deep program with lots of controls!). Feel free to play with any
of these behavior modifiers, but we will concentrate on just a couple as examples.
First, twirl down Forces and adjust the Gravity setting. You will notice that the blades of grass bend
over as if they re growing heavier and heavier as you adjust this setting. Due to the relatively few
segments on the grass blade, the grass will bend at sharp angles when gravity is applied (of course
you can change this by altering Tubes Creation Segments to a higher number, like 20). You
can also make the grass stretch under gravity by setting the Length Flex to a number greater than
0. While a heavy, stretchy look might be great for some items, it s not particularly appropriate for
grass, so set the Length Flex back to 0. Still, we can make the grass a bit heavier by setting gravity
to about 0.12). As all Paint Effects brush behaviors are based on expressions, you can either type
a value for most attributes, or create an expression or a Set Driven Key to control that attribute. To
create an expression or to set keys, RM choose Create New Expression (or Set Key) for an
attribute; in the case of an expression, you would then write an equation that alters the value of
said attribute. Try this simple equation to make the grass do the wave. RM choose Create New
Expression, then, in the expression window, type in the following:
Gravity = sin (time);
When you play back the animation, your grass should wave up and down.
Note Several of the other controls in this block (like Path Follow and Attract) will be
discussed in the tutorial section at the end of the chapter.
Now let s add some wind to our grass. First, delete the gravity expression from the expression
editor, or RM choose Delete Expression over Gravity. Twirl down Turbulence, and choose Grass
Wind from the Turbulence Type pop-up menu. Leave the Turbulence Interpolation set to Smooth
over Time and Space (or feel free to experiment with the other settings), and try adjusting the
Turbulence, Frequency, and Speed settings while your animation plays back. At their default
settings, the grass will wave back and forth a bit, fairly quickly. To make it wave more slowly, set
the Turbulence Speed to a small number. To make the grass blow more strongly, change the
Turbulence slider to a large number. Turbulence Frequency controls how much space the
turbulence field will vary across. In other words, setting the Turbulence Frequency to 0 will make
every blade of grass blow just the same, while setting Turbulence Frequency to 1 will make them
all blow independently. If you now go back and adjust the Forces Length Flex to 1, you ll get
grass that stretches as it blows an interesting, if unrealistic, effect.
Tip If your playback speed is set to Free, you may find your animation runs too quickly, giving
the illusion that your objects are moving around much faster than they will in the final
render. To compensate for this, you might try setting the playback rate to Normal
(Options General Preferences Animation tab) or, if your scene is complex (slowing
down playback) or depends on Free playback for dynamics, just playblast the animation
(Window Playblast) to get a better idea of its output speed.
Finally, once you get just the brush you were looking for, you will probably want to save it for later
use. With your brush stroke still selected, choose Paint Effects Get Settings from Selected
Stroke, and then save the brush to your shelf or the Visor.
Note The barn image included on the book cover, as well as the animation 25barn.mov on
the accompanying CD-ROM, depends heavily on Paint Effects. The center color insert
and CD also contain a still and an animation, respectively, of a more production-ready
version of the fountain we created in the last several chapters; this fountain includes
Paint Effects trees, grasses, moss, and other modified brushes (25fountain.mov).
These animations (and the stills from them in the color insert) show off just a small
portion of the possibilities Paint Effects opens to your modeling and animation
endeavors.
To begin with, we need to change the simplification mode of the flowers (so we can see them better
as we animate their growth). With the stroke selected, click the flowerTallRed1 tab in the Attribute
Editor and, under Tubes Creation, set the Simplify method to Segments. Now twirl down Flow
Animation to get at the settings for animating brush growth. Set the Flow Speed to a number
greater than 0 (drag the slider, or, if you wish, you can set a value greater than 1 by typing in the
number field). Next, check the Time Clip box, set the start time to 0 and the end time to a large
number (the default is 1,000), and play back the animation. You should see all your flowers rise out
of the ground at the same time, growing to full height over 40 or 50 frames.
Note Setting the start time to a number greater (or less) than 0 allows the objects to begin
growing after (or before) the animation starts. Setting the end time to a small number
(like 1 or 2 seconds) will make the objects decay after that much time: they will
disappear, starting at the roots. While this effect isn t quite right for flowers, it could be
used in other instances (as in water drying up at its source of fireworks) to good effect.
Having all the flowers appear at once may not be what you re after. If, instead, you would like the
growth pattern to follow your brush stroke, simply click the Stroke Time check box to enable the
brush to remember the direction of your strokes. With both Time Clip and Stroke Time enabled for
various brush strokes, you can create a field of grass and trees, or grow hair on a model s head,
just as easily as drawing the curves! These flowers are growing at different rates:
Rendering
While Paint Effects is a very deep program with a great many controls, rendering is a relatively
transparent process. To render a scene with Paint Effects brushes in it, all you need do is batch
render (or test render into the Render View Window) as you would normally. When a render
including Paint Effects brushes is launched, Maya first renders all the geometry in the scene, and
then, in a post-render process, adds the brushes, fully rendered. Though Paint Effects rendering is
a post-render process (after all geometry), the renderer is intelligent enough to place Paint Effects
brushes properly in 3D space. In other words, a brush that is partially behind some geometry (like a
cube, for instance) will render with that portion hidden from view. This way, though Paint Effects
rendering is done after geometry rendering, you don t normally have to deal with the difficulties of
masking and compositing the two elements together; Maya does this for you. The tutorial below
covers the issue of partially occluded Paint Effects brushes in more detail.
Note There is an exception to the rule that Maya precomposites Paint Effects brushes with
geometry renders: refractions (for semi-transparent objects) and reflections. If you
render a raytraced scene with refractions or reflections, you will not see the Paint
Effects brushes in the objects that are refracting or reflecting. In order to circumvent
this problem, you must render out your geometry and the Paint Effects brushes in
separate passes and composite them together in a compositing package (such as
Maya Composer, Maya Fusion, or AfterEffects). The fountain animation for this chapter
(on the accompanying CD-ROM), as well as the still from this animation in the center
color insert, use compositing to get the appropriate reflections and refractions in the
water.
While most of the controls in a Paint Effects brush that have to do with rendering are fairly
self-explanatory (color, textures, illumination, and so forth), two items are worth noting here. First,
there is a Translucence setting for brushes (high translucence allows diffuse light to pass through
an object), which can be very useful for plants, tree leaves, and hair. Second, you have two choices
for shadowing: a 2D offset shadow (the drop shadow we discussed earlier in the chapter) and a 3D
cast shadow. The 3D cast shadow is a fake shadow and thus might need some adjustment to
produce proper size and density in your scene. The following tutorial discusses this issue further.
A few exceptions notwithstanding, rendering Paint Effects brushes is a very painless (and quick!)
experience. With your understanding of the principles of rendering in Maya, you will find yourself
producing great-looking images right from the start.
Start by opening one of your head models, or the included scene file hair.mb. The included
project defaults to a close-up of the child s bald head. You ll notice that the rest of the child s
body and IK system is hidden. We will make them visible later, but for now they would just cause
unnecessary screen clutter.
Bring up the Side window fullscreen. You should be in shaded, textured mode. The hair is not very
graphics-intensive, so we will be able to run at a fairly high window-display setting. This is good,
because we will need the fine details to decide how and where to paint the hair. Select the head
object and press the 3 key to increase the display quality.
In the Visor, go to /AW/Maya2.5/brushes/ and open the Hair folder. Select the
hairBlondeNoShape brush. Now, since the boy actually has black hair, we will blend the shading of
the eyeBrowBlack brush at 100%. With your mouse over the eyeBrowBlack icon, RM choose Blend
Shading 100%.
With the head still selected, choose Paint Effects Make Paintable. Now let s try a few strokes;
click and hold down the mouse while drawing a line on the head. You will instantly see hair
sprouting from the head, although it will probably not be long enough to give the impression that
this child has much of a hairstyle. We need to change the brush size.
Interactively resize the brush with the B key (as shown previously in this chapter). You may have to
experiment to get a size that works for you. Try painting different brush sizes, and once you get the
hair size you want, delete all the strokes to start fresh (Edit Delete All by Type Strokes). You
now have a clean head and a properly sized hair brush. The next step is to decide how the hair will
be added to the child s head. There are quite a few ways to actually accomplish this. As is true
with most of this book and Maya in general, the way that you should do something isn t limited to
what we tell you. In fact, we encourage you to try many different ways and let us know if you find a
better way. For this tutorial, many options were explored for getting hair on the head. It turns out
that the most obvious, in this case, seemed to work the best for us: just paint the hair following the
topology of the head model from front to back.
So, with that in mind, let s start giving this poor boy something to comb. You will notice that the
included scene file contains two additional Orthographic cameras: Back and LeftSide. These are to
make it easier to paint those areas of the head, since at press time Paint Effects did not have a
mirror brush option as in Artisan.
Select the Side camera. We will start here, on the right side of the boy s head. Start your first
stroke from the sideburn area and paint up and around the ear, to where the hair would naturally
stop growing. The reason for starting here is that the more hair we add, the harder it will become to
see the strokes as we make them. The area around the ear is the most critical (as it has to match
the boy s sideburn and ear line), so we begin here.
Tip If you are painting a huge model, or one with very intricate curves, you can select your
brush and, before you paint, select Paint Effects Paint Effects Tool, and change the
Display Quality to 0. You will still see the hairs as you paint them, but when you lift your
finger from the mouse button to get another stroke ready, they will disappear. You will be
left only with the curves on surface visible, showing you where you painted without
slowing your work down. Remember, this setting only affects the display, not the
rendering of the strokes.
Now draw one stroke from the front to the back, but no more. Why? Because we are now going to
set things up so that from this point on the hair will be shaped to the head as we paint.
Note The brush actually isn t shaping itself to the head, as much as following the direction
of the curve that we are painting.
With the hair brushstroke still selected, open the Inputs for this brush in the Channel box or
Attribute Editor, and scroll down until you find the attribute named Path Follow. Path Follow defaults
to 0 for this brush because hairBlondeNoShape is controlling our hair s shape, while
eyeBrowBlack is in control of the shading, but we need something a little different, so change the
value to 0.7.
Now you will notice that the hairs that are already on the model s head have nicely aligned
themselves to the shape of the head. Feel free to play with values in this field to get different
results.
After you have a shape you like for your hair stroke, select Paint Effects Get Settings from
Selected Stroke. This will ensure that as you paint each new stroke, the settings you have changed
on the stroke you already have painted will be used for each subsequent stroke. Give it a try. It
makes painting the hair and designing the shape of the hair style much more intuitive.
Note If you also change the value of Path Attract to a non-zero number, the hairs will tend to
lean towards the curve as well as follow its direction. This can be particularly useful
when you paint braided hair and you want the hairs to be more compressed to the
head in evident rows. You can also enter a negative number, to repel the hair and get
an Einstein look.
Now start working your way up the head, drawing slow, even strokes from the front of the head
towards the back. You should end up with somewhere between 10 and 15 brush strokes, which
can be seen as curves on surface and show up in the Hypergraph as strokeeyeBrowBlackShape1,
strokeeyeBrowBlackShape2, etc.
Now switch to the Orthogonal camera LeftSide and repeat the process for this side of the head.
Our boy now looks as though he has a premature case of male pattern baldness, because we
weren t able to paint the hair exactly on top of the head from the either of the side views. (The
lines on the inside of the head model are the hairs slightly piercing the inner surface of the head.
They won t be seen when the face is visible, so ignore them.)
Switch to the Top camera and start at the forehead, painting towards the back of the head. Show
caution here that your strokes don t touch the skin on the boy s back, as the brush will jump to
that section, continuing the stroke but giving him some unwanted body hair! Finally, switch to the
Back camera and finish the job.
Now, do a test render. Notice anything wrong? More than likely, the specular highlights on the hair
strands are very blown out. This can be controlled for the entire head by selecting Edit Select All
by Type Strokes. With all the strokes selected, go to the Channel Box and open up the Inputs for
the brushes. Change the following settings, to affect the specularity: Specular to 0.085 (this sets
the brightness of the specular highlight, based upon the specular color settings) and Power to 10
(this is the size of the specular highlight, where a larger number means a tighter highlight).
Do another test render. Much better! However, the hair is looking a little gray, so change the Color
1 and Color 2 settings to the following: color1 R, G, and B to 0.01 each; color2 R, G, and B to 0.02
each.
Now with another test render, you should notice more natural-looking hair color and specularity.
You will find that different lighting conditions may warrant changing these settings, so feel free to
experiment with them.
There still seems to be something missing here, though; the boy looks like he received a fairly
cheap hair-transplant. This is because the default settings for density on the original brush weren t
high enough.
To change this, select all the strokes and, in the Channel box under Shapes, change the Density
value to 5. This will give you a thicker head of hair, as the brush stroke is more densely populated
by hairs along its path. Now make everything visible on the boy model and do a test render.
Tip For even more control of the hair shape, change the number of segments for the tube
(under Inputs for the stroke) to a higher number. The hair shape will not only look more
realistic, but act more predictably as you paint.
If you look closely at the render, you will notice that the hair is also casting nice fine shadows onto
the boy s head. These are fake shadows, caused by Maya placing additional black strokes on the
surface of the head to simulate shadows. It guesses where the surface is in 3D space, and draws a
shadow paint stroke where it thinks the surface lies. This method isn t perfect, but it allows nice
fine shadow details when it works. To prevent the hair from casting shadows onto other objects, or
to give yourself another type of shadow option when the fake shadows aren t working, set Fake
Shadow to None in the Paint Effects Brush Settings window.
Note Alternatively, you can also change the shadow setting to 2D offset, but this is for
creating a drop-shadow effect. While it works well for ferns that are painted on the side
of a brick building, it isn t very good for hair on a curvy surface like a head.
With Fake Shadow set to None, scroll up to the top of the Inputs section and check Cast Shadows
to On. Make sure your light is set to cast Depth Map Shadows. The Cast Shadows setting only
works with Depth Map Shadows, as none of the Paint Effects elements can be raytraced. Compare
the various shadow types shown next.
On the other hand, all Paint Effects brushes can be motion-blurred, both in 2D and 3D. Most people
will opt to use 2D motion blur, as it s usually faster and smoother than 3D. Also note that there will
probably be some visibly chunky lines near where the stroke (hair or otherwise) is occluded by the
geometry. This is because the hair is rendered into place using the Depth Buffer, and therefore
there can be no anti-aliasing of the edge where they meet; depth is either true or false for a given
depth. As Duncan Brinsmead (co-creator of Paint Effects) stated, We don t have the notion of an
anti-alias for the depth. It s an on or off thing. It s either at that depth or it s at a different depth
for that whole pixel in the Depth Map. You must therefore take steps to compensate for this
problem if it is apparent in your renders.
To alleviate this edge, we suggest you render your geometry first without the Paint Effects
elements, then render the Paint Effects elements without the geometry. Using various compositing
tricks, such as blurring and shrinking the elements slightly, you should be able to eliminate these
chunky lines. They are really only a problem in very close shots, or when there is little to no motion.
Another quick way around aliasing problems is to use 2D motion blur, which we found almost totally
hid these areas.
Tip A quick way to create your two renders is to first render only the Paint Effects elements,
by choosing Windows Render Globals Renderable Objects Render Active while
nothing is selected. As Paint Effects is a post-render process, it will still render, while no
geometry will. Then, to render the Geometry without the Paint Effects strokes, in the
Render Globals Paint Effects Rendering Options turn off Enable Stroke Rendering.
Now that you have given your model a full head of hair with shadows, take away some of his
dignity and have some fun with your brush. Select all the strokes and, in the Visor, RM choose the
Daisy brush, then choose Apply Brush to Selected Stroke. Do a test render. O.K., you can stop
laughing now. Have fun with these experiments, and try applying several different brushes to you
strokes to see what they look like.
Summary
While there is no way to fully explore the depths of Paint Effects in just one chapter (that could be
the subject of another book!), this introduction should enable you to grasp the underlying elements
of the Paint Effects tool set, and you should now be comfortable enough with this feature of Maya
that you can experiment intelligently, using the built-in presets, or creating your own unique
brushes. You have learned how to paint in both two dimensions (on a canvas) and three (in a
scene), how to interactively create texture maps, how to animate your strokes, and what many of
the Paint Effects options do. Furthermore, you went through a real-world example of using Paint
Effects to create hair on a head a process you might repeat often in a production environment.
You should also have an appreciation of both the depth of Paint Effects and how it can help you
accomplish tasks that were heretofore too difficult or time-consuming to attempt.
Paint Effects is a great deal like Artisan: you will likely need to experiment with it creatively for a
while before you will feel comfortable. However, you should now have enough knowledge to use
simple Paint Effects elements in your scenes right away, and to understand how to experiment with
the package to create even more complex and interesting effects in the future. With Paint Effects
and Maya as a whole you should have fun recreating reality, or creating anything you can
imagine. You now have the power to let your ideas take shape in the virtual world of illusion: Maya.
Appendix - Interviews
Appendix: Interviews
Overview
This appendix features four interviews with luminaries from the digital graphics world. Authors Perry
Harovas and John Kundert-Gibbs spoke with Mark Sylvester, Ambassador, Alias|Wavefront;
Duncan Brinsmead, Principal Scientist Alias|Wavefront; Russell Owen, member of the
Alias|Wavefront User Interface Team for Maya 1.0; and Habib Zargarpour, artist for Industrial Light
and Magic.
In 1995 Wavefront merged with Silicon Graphics and Alias Research, and Mark now serves as
Ambassador for the new organization, Alias|Wavefront. In this role, he works closely with the
development organization and the product marketing teams as a liaison between customers and
the company, ensuring a close relationship between artists and developers.
Before founding Wavefront, Mark was a private chef and helped to build several restaurants in the
Santa Barbara area, where he lives with his family. Mark gave us an incredible amount of his time
to try to give readers a deeper understanding of Alias|Wavefront, and the tools that make up Maya.
Perry Harovas What was the reason for creating Maya, and what were your most important goals
for its first release?
Mark Sylvester Maya is the result of an effort that was undertaken immediately upon the merger
of Alias and Wavefront. At the end of 1994, Alias Research was in the midst of a next-generation,
very secret product development. Wavefront, in conjunction with TDI, because we had merged with
TDI three years earlier, were in the midst of a next-generation product development ourselves. The
code bases at that time were about ten years old and in dramatic need of complete ground-up
rewrites. Things that we did in the very beginning were a result of only being able to run on 64MB,
not even that, 16MB systems with limited graphics capabilities. The operating environment of Unix
at the time and the graphics library environments caused us to do a lot of different tricks that we
didn t really need anymore, so we were suffering from the inefficiencies at an architectural level.
That is why we had started those rewriting efforts. Because of the merger, we were faced with a
couple of issues. One was a business problem which was, can we continue to effectively support
and put research and development dollars into the Advanced Visualizer, which was Wavefront s
product line; Explore, which was the TDI product line; and PowerAnimator, which was the Alias
product line? Management at the time said, You know that really doesn t make sense because
not only would we have those three lines, we have a next-generation effort at Wavefront and a
next-generation effort at Alias. So that s really several teams that are working, and that s painfully
expensive. Let s figure it out. The president at the time challenged the technical team to come
up with a unified product agenda that would unify the requirements of the Wavefront users, the
Alias users, and the TDI users into one next-generation product that we could deliver in a year.
Absolutely overly ambitious, but I believe our heart was in the right place.
So you had this really interesting challenge because the Alias developers really knew how to think
along the lines that they had been accustomed to thinking for 10 years as was the same with
Wavefront developers and the Parisian developers. The first year was really spent understanding
the requirements of the various installed bases because they were all very, very different. We also
spent a great deal of time learning how to work together, across continents and language barriers.
It is somewhat interesting that three graphic systems were all started within three months of one
another in 1984. They all had modeling, animation, rendering and display capabilities. They all
attracted a certain kind of user. There was the Californian approach; there was the Canadian
approach; and there was the Parisian approach. They had their own zealots who felt that their
given approach was the right way to do it. Yet, at the end of the day, we all made pictures and got
pixels up on the screen.
Mark Sylvester My role at the company has always been interesting. At the merger, the
management was predominantly Alias management and they did not believe in titles for people.
So, at the merger, we found out that there would be no titles; no one would have a title. I was going
to Japan two weeks later to head up a delegation that was going to assure all of our customers in
the Pacific rim that everything was going to be fine and the merger was going to be good for them;
just to kind of calm them down. I said, Listen, I cannot go to Japan without a title. It s not
acceptable. They will not know how to deal with me. It s a culturally significant issue. They said,
OK, that s fine. So they called me one day and said, We think we have got a title. How does
Ambassador sound? And instantly, it hit me chemically. I said, That s it. That s absolutely
it. And while we were on the phone I jumped on the Net and looked up the definition of
ambassador and in reading it, I thought that s a perfect job description for me because it would
allow me to exercise the kind of mission that I ve always had, which focuses more on back
channel kind of relationships. A role that is clearly focused on customers. My favorite line was when
I was meeting with a vice president at NBC. He likes to walk me through [the facility] and as he
introduces me, he loves to give my title and he says that I am the only guy he knows that outranks
an entire room of vice presidents.
Perry Harovas What area of Maya do you think doesn t get enough attention?
Mark Sylvester Wow, that s a great question! Boy, that s a hard one. My first thought is the
dynamics. I think that that s the most unexplored territory. I think people naturally gravitate toward
particle system work and they re starting to understand the soft body dynamics more. But I think
the whole area of dynamics gives a look to modeling that there s no other way to achieve; and it
gives a feel to standard key frame animation that s exquisite and can produce effects in the
renderer that are impossible any other way, yet none of it is readily apparent. It does take
experimentation and so I m very sensitive to the fact that most users don t have a lot of time to
experiment they re busy! They re busy getting work done and it s hard enough to learn what
the software does as it s designed to do, much less to say, what would happen if I did this; if I
hooked up this emitter to the transparency feature in a shader? You know, that kind of thing.
What would happen; what if? That s the part of the software where I spend most of my time; I
like to get in and play with the dynamics almost exclusively. I just think you can get to
unusual-looking images quicker than any other way. I see myself artistically as a surrealist, not a
photorealist.
Perry Harovas Are there tangible results from relationships with places like ILM, Pixar, and Santa
Barbara Studios?
Mark Sylvester Oh, absolutely. The relationship that we have with these customers is what we
call Design Partnerships. It goes beyond beta testing and it precedes beta testing by at least a
year. We work with customers, not just in film but video, game development, and industrial design,
to help us understand what the new requirements are that they re starting to see from their
customers. Remember, we re tool builders, and the best tool builders are the ones that have
forged strong relationships with the people who use the tools. They re the ones that are sitting in
the meetings with the visionaries and the directors and the avant-garde designers and the game
developers saying, Wouldn t it be cool if we could do this? And then they look at the software
to determine whether they can do that or not.
It takes a long time to develop software, and places like ILM are going to want to be able to
respond to their own customers requirements as quickly as possible. Now, they can come back to
us and say, We need to be able to do this, whatever it is and we will take that under
advisement, as we do with all requests, and we can produce those requests at a given speed a
given rate of innovation. That s where open architecture comes in and that s where an API that
s extremely robust and touches all aspects of the code becomes probably the single most
important feature for those customers. Because it allows the customers to add these features
themselves, especially if they do not have time to wait for us.
I think it s the most important aspect of Maya for the high end of the market. It s certainly not the
most important part to the low end of the marketplace. The high end of the market wants to be able
to open the hood and fine-tune the engine. The lower end of the market just wants to get in the car
and go to the store. They don t want to understand the ignition system, they just want to turn the
key and go.
Mark Sylvester Exactly! I would say we probably have an order of magnitude of work to do in the
ease-of-use, ease-of-learning piece of Maya in the next couple of years.
Perry Harovas What do you see as the single most important thing next to tackle?
Mark Sylvester I m going to say ease of learning. I think that continuing education in a software
package is extremely underrated as to its importance. Software is not static, and so once or twice a
year you get a major update of software and you have a challenge in front of you, which is to be
able to assimilate that technology into your pipeline, your workflow, into the way that you produce
images. We don t produce gratuitous features. We produce features that are specific to solving
problems, and yet we ll find that once someone gets a version update, they tend to load the CD
into the computer, the software gets loaded, the manual goes onto the bookshelf and sometimes
doesn t even get opened. Maybe the release notes will get read. But to be able to assimilate that
newly installed software takes an investment of time in what I call continuing education. You
constantly have to be thinking about improving your skills and learning more about the software
that you already have. So, given that condition, I think that s the next major area that has to be
resolved.
I d like to also say that the other area that I think is ready and it s one of our goals is to create
Synthespians. Jeff Kleiser coined that term 10 years ago. We have created photorealistic humans
and creatures; we ve created surrealistic humans and creatures, aliens and the like, and they
move realistically and they look realistic, but they re dumb as rocks! I think there is a real
opportunity to build intelligence into these characters that would absolutely help our ability to tell
stories if we didn t have to worry about hand-animating walk cycles. Yet, you want to have the
individuality that every organic creature has. Nothing walks the same or flies the same.
So you can t really solve this problem with motion capture and you can t really solve the problem
with procedurally generated motion, and I don t really know how to solve the problem. I think that
s one of the great things about audacious goals is that you don t really know how you re going
to solve it, but I would love to have directable characters. I would love to be able to feed a script
into the system and be able to direct the system by voice much as a director would and not have to
be concerned as much with hand animating walk cycles.
Perry Harovas Yet one of the difficult things for artists is changing the way they work, especially
when it comes to doing the same thing they have always done, but approaching it in a vastly
different way.
Mark Sylvester Yes. That is very hard. It takes openness and willingness, and people are very
resistant to change. That is a core human condition. No matter how high-tech we envision
ourselves, no matter how advanced and cutting edge we think we are, we don t like to change.
This whole ability to just have your eyes opened to the idea that there might be another way of
doing it. And again, I don t know how to do that yet. I m looking at it. I m trying to figure out how
can I help capture the little stolen moments in a day and use those for education. While you re
waiting for a render to happen or you re waiting for a file to load, could you get a little 3-minute
lesson on lighting or could you listen to someone during lunch? Could you download a ten-minute
brown bag lesson by some lighting director? I think it s an area that we haven t spent as much
time as I think we need to, and I know for sure that Alias|Wavefront is devoting a tremendous
amount of time now into this whole area of continuing education. It s clear that we re not
completely meeting the needs of the broader professional market until we have a level of ease that
will show users how to learn online, quickly and easily.
Perry Harovas It s very interesting that applications like 3D Studio MAX and Lightwave, which
are obviously very complex programs in their own right although compared to Maya, a percentage
of Maya s complexity have all this education out there to explain them! Then you have all these
users of Maya that are scratching their heads saying, I don t know what I m going to do next; I
guess I m out here on my own trying to figure this out. A main sour point with Alias|Wavefront
has always been the Web site and the amount of information that s on the Web site to help
people. Recently the LISTSERV has been probably the most fertile ground for some of this stuff,
but I think there needs to be something else.
Mark Sylvester The importance of continuing education; the importance of ease of use and ease
of learning is one of the number one priorities for the Maya team. We will not have the success that
we need in a broader professional market and with casual users and with this coming tidal wave of
new users unless we address this specific issue. These users, they know all the features are there
but like you said, it s access to help, access to information, access to tips and tricks, that kind of
stuff. We know that historically we ve not been as successful in this area, so I expect that to
change, probably not dramatically at first, but with real strong incremental steps along the way.
Perry Harovas Well that s good to hear. Who do you see as your primary competition in the 3D
world?
Perry Harovas So, was that what you had up on your bulletin board when you were developing
Maya?
Mark Sylvester No, at the beginning it was SoftImage. I think neither Alias nor Wavefront had
strong character animation tools. SoftImage did, and as the trend toward character animation grew,
so did their business. So that was one of the principle areas that we wanted to focus on in 1.0,
which we did the whole character building-character modeling, IK, puppetry, the digital puppets, all
of that stuff. All of it was to be able to respond to the needs that our customers had, which was for
strong character animation tools. We wanted to break the paradigm of model in Alias, animate in
Soft, render in Renderman. That had to go away. So now many shops are strictly Maya. We want
to be able to have the entire workflow be within Maya. So that was one goal. I think after 1.0 we
absolutely hit that target dead on. And consequently Softimage is not the main competitor anymore.
Now we have a challenge that there are thousands of MAX users out there and they, for a long
time, really gave Maya a hard time saying, Well, I can do 80% of it for 20% of the cost. Well,
now with Maya Complete being $7500, less than the cost of comparable Studio MAX with the
plug-ins to bring it up to the functionality of Maya, it s easy for them to switch; very easy for them
to switch. So now it s a matter of getting out there and appealing to the Max users who would
really love to have Maya and felt it was out of reach and I don t think we did a very good job with
letting people know we were not $50,000, but that we re $7500.
Perry Harovas Because that was a huge change, and you re right, there was not a lot of press
about that.
Mark Sylvester Huge! So that s another thing that we re going to work on changing is that
whole perception.
Perry Harovas I think everybody was really angry for a long time that they were paying a lot for
what could be considered in MAX, a plug-in. But now with the price drop, people started saying, I
can t believe they finally did that. It looks like they ve taken what we ve said seriously.
Mark Sylvester We have, we have. We were doing a lot of things that weren t effective. We read
the LISTSERV, we get the mail, we know. We re out there talking to customers all the time.
Perry Harovas In terms of specific tools, what would you like to see Maya do better, as a user?
Mark Sylvester My personal weakness is in modeling and so anything that we can do in the area
of making it easier to do will be appreciated. I think that one of the goals as a visual artist is to
create very complex worlds, with scenes and environments that tend to require lots of detail. Look
what Paint Effects has done. I mean, try modeling a palm tree and try modeling it within a year. It s
a lot of work to make it look real. Yet, we can do a palm tree in what amount of time with Paint
Effects? Two seconds, three seconds with dynamics on it even! So tools that help us model
complexity are very important because to make things visually interesting, they ve got to have a lot
of detail in them and that can be very, very time-consuming, especially for someone who is not real
gifted as a modeler, and that s certainly me!
Perry Harovas I ve always said, I don t know if it s the Moore s law of 3D graphics I haven t
come up with a name for it yet but this is the core idea: once you get a new tool that lets you do
something that you ve never been able to do before, all of sudden you re excited and then you
re interested in doing things which you never would have attempted, and it becomes voracious
and you start to attempt things that slow down your system again and you work towards the point
where you can actually get back up to functionality. The systems come up to speed again and then
another tool is introduced which bogs you down again. And I don t think with the complexity of
what we re trying to do as artists, we re ever going to have the computing horsepower to achieve
everything we can see in our heads.
Mark Sylvester Right. Absolutely! It s the same with disk space; you never have enough. I had
thought that one of the things that we could invent that would be really helpful would be a, I don t
know what you would call it, but it would be a Complexity Meter that you could have turned on, and
as you are doing things the Complexity Meter starts to rise so that you know that that thing you just
did just added 33% more to the render time, for instance. You put the shadow button on in a shader
and this meter goes up another 50% or whatever.
This is something that I ve talked with our broadcast clients about. They would like to be able to
say, I need to get something done in an hour&just bam, bam, bam get it done! Now I want to
turn up the quality knob by another 50%. What does that mean? Now I can use this level of
shaders; I can add this much more geometry and this many more lights and now&because it
doesn t have to be ready until the 6 o clock news, I can turn the quality meter up again. It s
going to be something that s going to go on a weekly event that s going to happen and I ve
three or four more days so I can turn that quality knob up even more.
How many times have you just start working, you re doing this, doing that, and all of sudden you
ve got a one-hour render and you re like, Oh-h-h! As I was working had this, whatever that
meter was, had it shown me as I was glibly adding more and more complexity, that s where I think
we can help users. That isn t on the planning boards anywhere. But it is a great idea and would
really be helpful. Especially to help us in the case where you are bidding a job to be able to say
that I can complete this job and keep my quality meter on at 2 and be able to deliver it at so many
dollars a second. And if the budget goes up I can crank, crank, crank it up and now I know I can
add volumetric clouds or hundreds of lights and still make my budget.
Perry Harovas Well, it becomes very easy to do things like paint in complexity with Paint Effects
where it s casual. It s kind of going back to the other statement I made where you would never
even think that you could paint a field of grass, yet I ve done at least six animations of fields of
grass, with trees and every blade of grass casting shadows. I mean&
Perry Harovas I would have laughed in your face if you would have even suggested it to me and
now you just casually do it, so you keep adding complexity to it and now all of a sudden you re
surprised when you see an hour-long render! Look at things like radiosity. People want to have
radiosity or global illumination and don t care how long it s going to take if it s a choice between
a long render time or not having it at all. Of course they d rather have less render time and the
feature, but they don t want to be limited at all. That must be very difficult for you when you decide
what features to put in there; when you have to balance it against how much time and money it s
going to take to develop this and how much return on our investment you are going to get.
Mark Sylvester Correct. That s absolutely correct. When we look at any given release there s
three big audiences that have to be appeased. One of them is our own developers. There are
things that need to be done in any given release that are architectural or are things that are done
under the hood that never show up on a list of new features added. And there are things that you
didn t get done in a prior release or things that you know that you need to do to get ready for the
next release. Or it s just under-the-hood kind of stuff that if you ignore, it will come back and bite
you bad in a release or two down the road. Because you will have no flexibility. That s very
important, to listen to those engineers when they say, We ve got to do this.
The second group is the marketing group. They re out there talking to new customers about things
that need to be in the software that aren t there. They re looking at the competition; seeing what
the competition is doing; what they re working on; what their future stuff is going to be; to make
sure that we re competitive on a check list basis and that we don t lose business because we don
t have the key features for given markets that we re trying to grow into. If you don t grow your
business, you go out of business and then no one is happy.
The third group is customers. And customers are just users me and you. Our needs and our focus
are all on what we re doing right now, today, our current projects and the projects in our immediate
future. That s really what our whole field of view is, really focused on the job that we re doing day
to day. We re the ones that are going to report bugs because we re the ones that are using the
software most aggressively. We re the ones who probably use competitive packages as well and
can say, Well, I really like the way this package handles this particular problem.
So, you ve got that group s advice and suggestions as well, but you can t listen to any one of
those groups exclusively or to the exclusion of the others. The trick is to come up with a balance
and a good balance so that you add new features, fix bugs, put things in to remain competitive,
and also work on your architectural underpinnings. This becomes a real balancing act because you
have to add a business wrapper on that whole topic and say, OK, that looks good. Now how
much of that can we do in a short enough time to continue our momentum, and not so long that we
get out of phase?
So, that s one of the hardest things to do as a software company is to figure out what do you do
now, what do you do later. What do you put on the list for later? How do you make your dates?
Making your dates or not being late is something that we ve intermittently been very good at and
very poor at. I think we are much better at time commitments now than we ve ever have been in
the past. I think it s due to maturity in the team and a commitment to keep our commitments. So, it
will be the case that not everything gets in but releases get out on a regular basis.
Perry Harovas I think you as a company need to let the users, the people on the LISTSERV who
are very vocal and maybe are or are not coming from an informed view, know your struggles and
why certain things are in there and why certain things aren t. Why you re making these
engineering leaps and they re under the hood, as you say, and nobody even knows about
them. I think people s assumptions are that the majority or all of your work is spent on new tools.
So naturally they start to say Why isn t tool X in this new release of Maya? I think there is a
lack of that knowledge for the casual users. ILM certainly is aware of it, but Joe Animator doesn t
know what your challenges are as Alias|Wavefront and what you have to do day in and day out, so
that might be an area to work on.
Mark Sylvester Maybe you can help by getting a little bit of that flavor in the book.
Perry Harovas I would love to. Just to give them an idea, and not to shut them up, certainly, but
just to get them more informed so that&
Mark Sylvester Yes, exactly. Don t shut them up at all. That s where we get our best ideas! But
we get our ideas lots of different ways. That s what is important. If I just listened to one guy, then
what do I do about my guys at NASA? What do I do about my guys at NBC? What do I do about
my guys at Pixar, or the ones that are just a few guys in a garage working on feature films?
That s the deal. And how do we keep it up? Even though we ve gotten to be a pretty good size
company, I don t want to lose that kind of interaction. We re actively listening to customers. We
re paying attention to these kinds of things. I hope that we never get too big where we don t
have that personal touch. We can t get out and get to every customer, but I know that we are
extremely proactive in going out on customer visits in all areas of the company. And that once we
do have a chance to have these kinds of conversations, people will come away with a strong
appreciation for the challenges we have and a respect for the way that we go about running our
business. At least, I hope so.
Perry Harovas Where did the impetus come from for you to start down this path which resulted in
Paint Effects?
Duncan Brinsmead Well, actually, I got into doing Paint Effects when I was working on the
Balloon Girl s hair in Bingo. I had an old paint system I d written long ago that did 2D where you
could brush trees and other objects, but it was in 2D. I had an anisotropic shader that I wrote for
Maya, and with that shader, I wanted to have texture maps of hair that gave not only Alpha and
brightness but also direction to the hair. I rewrote some routines in my paint system to produce
some images that had 3 dimensions they kind of encoded the twist and the direction of the hairs,
right? So I kind of coded and colored it all in one image, which looked kind of nutty, but then I could
take that texture and use it to control the anisotropic direction on the surface so that it matched the
hairs and all the different parts worked together.
Then I started to realize that while I can paint these hair streaks, I wanted to get a little more
elaborate I wanted it to be 3D and coming out at you so that I could encode not just the 2D
direction of the hair but the 3D, and use that for texture maps. You could have hairs curling around
or twisting under each other and get the correct highlights on them. I wrote a little stand-alone to
help me do that, and then as I was writing the stand-alone, I thought, Well, gee, you know, to
actually draw the hairs, I could use the line renderer I used for the PowerAnimator toon shader,
which essentially could paint anti-aliased lines in three dimensions so that foreground fat lines will
occlude lines behind them and have a nice anti-alias on the edge. I just modified that so then it
would work properly with the perspective camera, and I then realized, well, Gee, I can draw the
lines now I don t just have to draw them in kind of a 2D sense, I can really draw them coming off
an object. And so it kind of started from that and kept snowballing and I kept adding more and
more. Which is usually actually how most ideas kind of go with me, I ll start something and then
just keep adding on bits incrementally.
Perry Harovas Do you try to do as much animating as possible to try to figure out what the
problems that need solving are?
Duncan Brinsmead Yeah. I think that s one of the reasons that people seem to like the stuff I do
as much as they do. Since I tend to use it, not quite the same as in a production environment, but it
provides more flexibility and gives me more time than a production environment would. I tend to be
after a particular effect, and I ll create some new parameter. When it doesn t do what I want it to,
I ll change the parameter, or change the way it works. Where most people in software
development tend to write up UVR, or User View Requirement, documents that plan everything out
on paper and then have people go over and review it multiple times, I tend to work more in just a
continuous stream. I just code and I try things out, I add parameters on the fly and I reconfigure the
user interface if I don t like it. I find I can t go from a User View document because it changes so
much for me as I m developing it. What I end up with might be a completely different product than
what I started out with in the first place. I think of it as being Opportunistic Programming, where you
see some neat effect or something that you re doing work on, and then you exploit that. If you re
bound doing a particular requirement that s been set down for you, then you don t have the ability
to take advantage of those kinds of opportunities.
Perry Harovas Well, I know that all of us in production have said for years They don t
understand they meaning any software company they don t understand what our real
needs are, or the fact that we don t know what our needs are, sometimes, until we actually need
them. So, it s interesting that you and the people on Chris Landreth s team are some of the only
people in software development, in 3D anyway, that seem to be doing any kind of
production-worthy stuff. And I think that s what your advantage is.
Duncan Brinsmead Well, yeah. A lot of the programmers I ve met over the years don t
necessarily have the art background to appreciate a lot of the problems, and I think also that if you
ve done any animation work, you know how frustrating it can be. You know when the software
doesn t behave the way you think or you can t get the effect you want. People will get it so that it
looks good on paper sometimes, but if it can t take you all the way to the final effect that you re
after, with all the little subtleties and nuances that you have to do for that effect to work properly,
then it s not as useful.At the same time, I do like to explore doing and creating things that are not
necessarily something I definitely know users are going to need. With Paint Effects I saw some
useful things that can be done as I was starting out on it, but you know there was a lot of time
where I didn t know what people were going to do with it because I d never seen anything quite
like it before. You know, some people might prefer some more traditional kinds of paradigms. Maya
Fur is a more traditional way of doing hair where you use attribute maps. Some people may prefer
that for certain kinds of jobs, so there s a certain amount of experimenting and risk-taking to see if
it will yield something that s useful. Sometimes you have to look at things, things that nobody has
done before, and that s very hard if I have to present something to a manager and get it approved
as a project and nobody s ever done it before! It s very hard to get anyone to agree on that, but
those kinds of things, I find I tend to just pursue them on my own, and then when they re ready I
Duncan Brinsmead Okay, let s see. If I m describing it, I d say that basically in Maya, most of
the modeling you ll do would be in terms of NURBS surfaces or polygons. The normal way of
rendering that we use is a scan-line rendering for the finished rendering. Paint Effects kind of
occupies an interim area where we re rendering to a Depth Buffer, but it s actually a complicated
set of buffers where we can handle transparencies and stuff, which normal Depth Buffering can t
handle. We also handle anti-aliasing of fine lines. If people are thinking in terms of particles, they
could think of being sort of halfway in-between the software particle render and the hardware
particle render that we have in Maya. I personally find this ground, this sort of halfway between,
very fertile for a lot of effects that you can t traditionally achieve in particular, things where you
have enormous complexity and millions of hairs, grass, a forest full of trees, these kinds of things
that are normally beyond the range of a scan line based rendering of triangles. Where the memory
requirements would be too great traditionally, Paint Effects allows you to creatively get around that
because we throw everything away as we render so that the memory costs are fixed. The memory
requirement is for the buffer or the set of buffers we use; we have about six or seven buffers, and if
you re on a really giant image, that might take up a fair bit of memory. I know a guy who s doing
an image, something unwieldy like 13000 pixels by 2000 or something, and he just went into swap
at that point on the image size.
The great thing about it is that you can render the Paint Effects if you want without any object
memory. You can pre-render your scene without the Paint Effects saving a Depth Buffer, and then
you just load the Depth Buffer and the image buffer in the Paint Effects. Then you can render Paint
Effects on that and the Paint Effects during that render will integrate with those objects as naturally
as if you d done them together. At any rate, it happens at the end of the render and some of the
memory space is freed up by the time we get to the Paint Effects phase. Then, even if you ve got
a fairly big scene with a lot of objects, it might not conflict too much with the memory in Paint
Effects (normally the memory isn t that bad anyway). The memory needed to do one blade of
grass or a million blades of grass is the same, because it s dealing with the buffer memory and not
so much the memory per tube.
Perry Harovas You see, that s beautiful because I mean, as an animator, I ve said for years
as I walk through a forest that this world is much more complex than we ever have time or memory
to handle. I mean, if you just look at the falling leaves in the forest, you couldn t possibly count
how many leaves there are just in your field of view! Never mind if you did a pan. I noticed in some
of the hair renders, that the shadow of the hair is bigger than the actual tube. Is this because&?
Duncan Brinsmead Well, I can tell you that. The Depth Map that s used by the light for the
shadow map: let s say it s at a low resolution, and a hair covers a pixel even though the hair is
only 1/10th of a pixel in width; it sets the Depth in the Depth Map for that pixel. We don t have the
notion of an anti-alias for the depth. It s an on or off thing. It s either at that depth or it s at a
different depth for that whole pixel in the Depth Map. So, what this means is that if you have stuff
like very fine fur or hair, the width of the hair is grossly exaggerated in the Depth Buffer. One way
around that is to make your Depth Buffer resolution very high (I mean your Depth Map on the light
really large, which is kind of heavy on memory).
Another thing you can do that helps is to focus in the range of the Depth Map using the placement
parameters of the Depth Map. Another trick that I sometimes use is to make the shadow color on
the light not black so that the shadows aren t quite so heavy. If you want you can try fake
shadowing on the tubes. This will give you very, very fine shadows. So if you ve got bangs or
something and you want to see the very fine shadows of the individual hairs on the forehead, you
can do that a bit with fake shadows (although this trick is not perfect because it tries to guess
where the surface is). And it s not a true cast shadow, it s basically another paint stroke that s
painted in 3D into the scene. It s just a black stroke. In some cases that can work pretty well. If
you have a tree and you want to give it a sharp base and have all the branches really sharp on the
ground, that can work for those kinds of things as well.
Perry Harovas One of the things that really shocked me, in a good way, was that you could 2D
and 3D motion blur with Paint Effects, and I think a lot of the people in the field were really
surprised and really happy that you decided, Well, we re not going to limit you to one kind of
motion blur.
Duncan Brinsmead Yeah, we realized that it was important to do both, especially when it comes
to hair. We initially did 3D, which was difficult, and once we had all that in place, it was pretty easy
to add the 2D. I think the 2D is actually the one a lot of people might end up using more because it
s faster and in some cases, it s also smoother.
Duncan Brinsmead Yeah. There are just a few cases where some people might want 3D just for
their objects, not necessarily the Paint Effects elements. Again, you can render the different
elements separately if you want. But, yeah, I thought just having motion blur in general was pretty
important for Paint Effects, because if you want to do hair or these kinds of things and moving
objects, they need to blur, and motion blur has become really important.
Perry Harovas Do you get excited about images to the point where you can t wait to show
somebody, or are you more low-key about it, like, animators hate what they do because it s never
perfect?
Duncan Brinsmead I guess I m more the show-off type. I always like having people into my
office and, in fact, I get some of the managers around here pacing around my office checking to
see if I have anyone demo ing and showing off stuff to them. I m pretty bad that way. [laughs] I
like to create images and then bring people in and ask them what they think.
Perry Harovas What did you not get to do with this release of Paint Effects that, just because of
trying to get it out the door, you think you d like to implement in the future?
Duncan Brinsmead There are a few little clunky odds and ends here and there in the interface
that we didn t get time to do or implement. But you know, all in all, I m really happy with this
release. We got a lot more in than I d originally planned on, and we extended a lot of stuff. I
wanted to have the time after SIGGRAPH to put in some presets and the way it worked out, I
ended up putting in 400 presets!
Perry Harovas The presets are even more extensive than they were at SIGGRAPH. I was really
surprised to see things like waterfalls and, quite frankly, hands! Which I still haven t found a use
for, but I m dying to find a use for that one. [laughs]
Duncan Brinsmead Yeah. I did a waterfall awhile back that we showed at SIGGRAPH using the
PowerAnimator particles, and people liked that at the time, but it was difficult to set up and to
create. There were a lot of things that I wanted to do that I just couldn t do in the PowerAnimator
particles, so I tried to make sure I put the kind of elements I wanted into the Paint Effects particles.
The volumetric self-shadowing in Paint Effects isn t as good yet as it is in the PowerAnimator
software particles, although with the Depth Map shadowing you can do half-decent stuff that way.
The nice thing in the Paint Effects particles is the way you can texture down the flow of the particles
(I shouldn t call them particles I guess, they re tubes that you define in Paint Effects). Using the
gaps (of the tubes) you can simulate a kind of particle motion through them, and you can simulate
at very slow speed. If you wanted a waterfall that had connected tubes, a really big flow coming out
through it, each tube has to move very slowly. If you re using particles in PowerAnimator, because
of the way that the streaks have to fit the motion to make tubes, you d have to have so many
particles to move slowly, like the more slowly you move, the more particles you d have to have
because of their speed. You know they connect to their last position, so you d end up raytracing
billions of particles if you wanted to do a really slow big waterfall. You can do that kind of thing in
Paint Effects. I haven t really experimented enough with it to get a good waterfall, but I think you
should be able to get a pretty decent effect. It doesn t do the collisions with objects but you can
sort of paint that in, I think. Waterfalls are rather static anyway.
Something I did as an experiment recently, that I think works out really well, is to take a cylinder
take a simple 1 degree curve 2 points on the cylinder curve-on-surface, and make it so that the U
on one of the points is like 1000. Essentially what you get is a spiral going down the cylinder. It s
like scan lines going down the cylinder, and then you assign a Paint Effects stroke to that, and this
essentially gives you a surface that s a Paint Effects surface so you can make it fuzzy. It s like a
surface where you set the stamp densities to get an even grid of stamps bound to the surface. If
you want to be fancy about it, you can turn on a tube and just have one tube that exactly follows the
stroke with the Path Follow of 1 and a Length Flex of 1 and a large number of points on it. I did this
and then added a little turbulence to it and then moved this around so that you have your cylinder,
but you re going to apply a turbulent wind to deform it. There are all kinds of neat things you can
do with that, and one of the nice things about the Paint Effects is that it s not a flat surface. Doing
it this way you create a kind of volumetric surface that, as objects are penetrated, it will kind of
softly emerge out of it.
Perry Harovas What type of things, kind of along those lines, do you wish people would do with
Paint Effects beyond just landscapes and hair and things like that?
Duncan Brinsmead I think when people get it out of the box, they will just use it for grass,
probably. [laughs]
Duncan Brinsmead I ve seen a lot of people using it for hair and stuff too. I d like to see
somebody try and tackle some really long hair, like using the control curves and maybe soft-body
dynamics or maybe just keyframing. Try doing something like a woman with long flowing hair that
kind of blows around. It might not be easy, but it would be interesting to see because I don t think
anyone s really done anything like that,& that looks half-decent. Something else I think might be a
neat way of using it is in areas where you might previously have thought of using a post-effect. For
instance, when you just want to blur a part of a scene for example, you know you can essentially
paint a brush on the object that ll blur that object or smear it a bit. There are these kinds of uses
for it. It s not like a canned effect. I think these possibilities are really great. Let s say you have a
seam on an object, and I don t say this is the best way of doing it right now, but you ve got very
crude triangulation. So you see this gap along the joint and you want to get rid of that gap. You can
up the triangulations really high, but your renders get really slow. Or you can create a Paint Effects
stroke that has tubes on with Randomize at 0 and you have these little tiny, tiny short tubes that are
very even and go sideways to the direction of the stroke. Then you paint them right along the edge
of one surface and they essentially kind of smear the edge of the triangles onto the next surface so
that it closes up the gap. There might be problems when you get an object going in front of it it
might pull in a little of that into the smear something and not look quite right but if it s really subtle
stuff, it might help make certain renders faster. I d certainly consider using Paint Effects.
Let s take the flow of gas over a car hood for example (I ve seen people struggle with that). It s
not too hard now with Maya. You can have curves, the particles can flow along the curve, so that s
not too hard to do anymore. Still, with the particles in Maya, trying to get a good-looking, coherent
flow of a stroke where you re using a texture that flows nicely along it, that might still be difficult
whereas with Paint Effects you can select one of these brushes, Jet Trail for example. You can
take a brush like that and you can either stroke it along the surface and then just do a little surface
offset to position the stroke up, or you could just take a curve and attach it to the curve and then
just animate the path follow. I think there are a lot of cases where you can use a simple kind of flow
along the curve instead of the dynamic behavior particles, and it s much easier to control that kind
of animation than it would be a particle animation.
Duncan Brinsmead It s sort of its own IPR in a way because it s a post-process. If you want,
one way of visualizing in an IPR-like setting is to take your IPR image, load it in as an image plane,
and then just modify the Paint Effects window. If you pre-render your scene, and then you save up
the scene in the Depth Buffer, there s a mode of rendering where you can load that Depth Buffer
and then the image as an image plane. You can render the Paint Effects onto that so it renders
onto that Depth Buffer. So if you do that and then you tweak something and then you update the
Paint Effects window, that s about as fast an update as you ll get. Since it s not scan line based
the way IPR is, we can t just render one scan line of Paint Effects. We can render one object in
Paint Effects, but you can t render just that one object and then have all the other objects in the
scene. You do get kind of a fast feedback if you go into Render Shaded stroke and then turn Active
on, so it s only rendering the active stroke. Then when you go in to modify it in the Attribute Editor,
it will redraw the Paint Effects for you fairly quickly. So, in a way, the Paint Effects panel is sort of
an IPR window of its own, but it s a different kind of IPR.
Perry Harovas What are the areas in CGI that you still see as needing a lot of work? Things that
you would love to tackle, or things you would love somebody else to tackle because you just don t
have the time?
Duncan Brinsmead There are a lot of great things that people here are currently working on. One
thing I think that needs work is rendering Global Illumination; a lot of good effort went into that, and
a lot of people putting that into renderers, etc. I think it s more important than some people think
for certain aspects of animation, like for facial rendering. I ve looked a lot at different shading
models for doing facial rendering, and you know, of course if you take a scan of a face, you can
make it look pretty realistic, but it doesn t hold up well under different lighting conditions, right?
One of the key aspects, I think, of white skin is the global illumination effects of light scattering in
multiple bounces, say between the lower eyelids and the cheek, because it s white and the skin is
very transparent and it scatters the light a lot. It s a very directional type of scattering, and there
are certain cases where you need to show the way light bounces around or it doesn t look quite
right. People fake it a lot with clever use of ambient lights and they kind of paint the radiosity effects
into their textures, but it would be nice to have something that automatically did that. You get some
interesting packages, some of the ones for simulating dirt. One of the neat effects is that it actually
simulates the way light is hidden by certain areas. So as you get closer to a crevice or something, it
gets darker and darker because less light can get into that region. And then more dirt tends to get
into that region as well, and I think a lot of times the reasons images look good when you apply
these dirt algorithms isn t because it s adding the dirt, but because it s adding the effect of
Global Illumination. It just jumps out it is so much more real than the typical plastic kind of graphics
rendering that you see. To me, the key difference between reality and most computer graphics
renderings is Global Illumination effects. When a novice sits down at a machine and their first
renders come out, usually the ambient light is all wrong, the shadows are blown out, it s flat, and it
is all due basically to the lack of Global Illumination. If you re using a program that uses radiosity
or something, it doesn t let you make those kinds of mistakes. You might make it look like an
over-exposed picture, if the software works well, but you shouldn t be able to make it look
unrealistic. The real problem is that Global Illumination is incredibly expensive computationally. So
it s just a very difficult problem to make it fast and easy to use. You have to do a lot of work just to
set it up to make it optimal so you can use it. I think it will be a long time before it just becomes
something that s automatically on in a scene.
Perry Harovas And people thought the same thing about raytracing. To a degree it is almost fast
enough where you can use it all the time because of the machines. It s not really because of the
algorithm, but it d be nice, because it s still such a huge problem if people figured it out on the
algorithm side first, and then we could use it now instead of waiting five years for machines to catch
up to it.
Duncan Brinsmead One of the nice things about Paint Effects is that everything is on one node,
which is kind of one of the bad things too, I suppose, depending on how you look at it. I sort of
wanted it where the animation, the modeling, and the rendering are all there together and you can
get at it very quickly. If it were a network of nodes all linked together, it would be a lot more
complicated to do (brush) blending and to make iterative changes on it. An L systems approach
would ve required that I go to some kind of multi-nodal thing and it would ve made it more
flexible, I think, on defining the shapes, but it would ve made it more difficult to use and I wanted
something that was very simple.
Perry Harovas Well, it seems like you have a type of L system in there kind of already, at least
with the trees and branching.
Duncan Brinsmead Yeah. It s not really the same, it s a different method. It s a parametric
definition of an object just with a very large parameter space. I suppose you can look at L systems
as being that way, and there are rules involved so they re not totally different, but they re
certainly different.
Perry Harovas Did you have any Beta testers out there that were using it in production?
Duncan Brinsmead Yes, quite a few. I don t know if I want to mention who or what they re
working on though. We had lots of people using Beta, including companies using it in movies.
Some people were working in very high resolution; for example, one shop was working on an
enormous project for some kind of theme park where they had multiple screens set up.
Perry Harovas I mean, you d never ever think of doing something that large in a traditional way.
Even the particle render for hair in PowerAnimator was incredibly memory-intensive.
Duncan Brinsmead I know! I wrote that, and it really wasn t initially designed to do hair; we kind
of tricked it into doing hair and as a result there were a few things I meant to change later [but] just
never got around to doing. But even that alone doing millions of hairs is incredibly
memory-inefficient if you want to raytrace them. Just trying to raytrace millions of anything gets to
be very difficult. With Paint Effects, if you want to do 10 million hairs, you can just let your renderer
run that much longer. Whereas in PowerAnimator it s more like an exponential curve, and there s
a point where you hit the slope, where the curve just suddenly shoots off into swap space, and then
forget it.
Perry Harovas Besides you, how many people actually went into the Paint Effects effort?
Duncan Brinsmead It was really a team effort where myself and Andrew Pearce did most of the
programming. We had help from others on the team on UI development (including parameter
wording, porting to NT, and then some miscellaneous bug fixing near the end.) We had product
specialists testing Paint Effects, and they also offered suggestions on parameter names. We did
quite a bit of work initially getting down the set of parameters on the brushes after usability testing.
This usability testing profiled the fact that we needed to change our layouts in windows. Honestly,
putting the toolbar in the Paint Effects window is an effort to try and help people distinguish
between the Paint Effects panel and the modeling window, because initially these people were
thinking, Oh, it s just another display model in my modeling window, and then they got
confused when they tried to tumble or pick objects. I think the toolbar helped a bit with that,
because it makes it look more like an IPR sort of window, which is closer to what it is in fact. That
was a difficult part of Paint Effects, because we had no precedent in the interface for this kind of
interaction mode.
Perry Harovas Thank you for all you have done to help further the tools we use everyday, and
thank you for taking so much time to give us a behind-the-scenes look at Paint Effects.
John Kundert-Gibbs What were your early, guiding goals when the interface team first talked of
creating the Maya GUI?
Russell Owen First, we wanted to allow users to work as much as possible in perspective mode.
We placed the axis reminder directly in the view, then we made sure all the manipulators (for
moving, scaling, and rotating) were also in the scene window, rather than in their own windows. As
the manipulators can be accessed by pressing the QWERTY menu keys, the user doesn t even
have to move the mouse outside the scene window to change tools. The goal was to keep users
from having to look all over the interface to find the most basic tools especially the manipulator
tools, the time line, and keyframing.
We also wanted to give over as much screen as possible to the scene window, so we built in the
ability to remove any or all of the menus, toolbars, and even the Channel box. An experienced user
will often work in just one big scene window with nothing else showing. To allow this space savings
to happen, we created the hotbox and other contextual menus (usually accessed via the right
mouse button), which give users the information and control they need when they need it but don t
clutter up the screen the rest of the time.
John Kundert-Gibbs Was building the interface entirely out of MEL (Maya Embedded Language)
scripts a technical issue, or one driven by user interface concerns?
Russell Owen The decision was actually a combination of technical and interface needs. We
wanted to give our interface engineers the ability to tear down and rebuild the interface without
needing to go into the C++ (base) code. Building the interface on MEL also allows users with little
technical experience to rebuild the interface themselves without having to either hire a techie to
rework the interface or wait for the next release of the software.
John Kundert-Gibbs Above, you alluded to creating a better workflow as a guiding principle for
the Maya interface. How does the Maya interface optimize workflow for the expert user?
Russell Owen Around here [A|W headquarters], we like to joke that the out of the box Maya
user interface hardly resembles an expert s interface. This is because the interface is very open to
optimization, allowing the expert user to do away with screen clutter in favor of a more streamlined
interface and workflow.
We spent some time working with human computer interaction experts, determining the cognitive
load limits of a typical user; then we tried to reduce the complexity of the interface to fit within these
parameters. In addition to the cognitive grouping of manipulator tools we discussed above, we tried
to reduce the user s need to pay attention to modes (a common hurdle in other programs). For
example, you re almost always in select mode, meaning that, whatever tool is selected, you can
still click or drag an object to select it. Not having to switch back and forth between select and
manipulation modes may seem like a simple idea, but it has reduced the difficulty of learning Maya
a great deal.
Another way we tried to increase the information that is obvious to the user (thereby reducing
the cognitive load) was to make the last selected object green, while all other selected objects are
white. Because many of Maya s functions (like Stitch, Blend, and Make Collide) depend on the
order you select objects, having a visual reminder of which object was selected last can really help
in using some of these complex tools.
Habib Zargarpour of George Lucas s visual effects firm Industrial Light & Magic (ILM) has been
instrumental in helping to create some of the most stunning visual effects ever seen on film. His
credits include The Mask, Twister, Spawn, and Star Wars: Episode I The Phantom Menace,
and he is currently working on The Perfect Storm. He has been a frequent Maya enthusiast, giving
speeches two years in a row at the Alias|Wavefront Global Users Association meetings during the
SIGGRAPH convention. He is also one of the nicest and most knowledgeable people working in
visual effects today. We spoke with him at length about the way Maya was used in Star Wars, and
how it integrated into the ILM production pipeline.
Perry Harovas The things you ve done with Maya are amazing! How long have you been using
Maya?
Perry Harovas And did you start from nothing? Were you going through the tutorials and all that,
or did you just dive in?
Habib Zargarpour I kind of dove in and tried to figure things out. I m more like a self-hacker
rather than reading manuals. So, unfortunately that means that sometimes there are a lot of
features that I don t find out about until other people tell me, but I do look at online documentation
a lot. I like doing searches through the documentation, the global index, and especially the MEL
commands. So, that stuff is really helpful.
Perry Harovas What version of Maya did you run on Star Wars?
Habib Zargarpour We started with Maya 1.0 and then we were able to get additions like the emit
command, which we use heavily in animation, and the curve emitter, so then it was called version
1.1 Alpha 3, which is pretty much like the 1.5 release.
Perry Harovas Did you have any trepidation about upgrading the software in the middle of
production?
Habib Zargarpour We had a concern, but it went very painlessly. We got the new version and
basically switched over lunch. It was fine.
Perry Harovas How did Maya get implemented into your pipeline at ILM, with all the other
applications that you use all having to talk to each other?
Habib Zargarpour When we started out, we wanted to look at rigid body dynamics to use on the
show and also to replace any particle effects we had to do instead of using Dynamation. But the
particular application for me was to use it for crashing the pods and as we were doing R&D for that,
we tripped into doing the pod flying with it, which is simulating how they fly and animate. So, we
ended up making a really nice setup where all the pod animations were, for the most part, done as
rigid body simulations in Maya, and in the same scene we were able to set up the animation for
dust for the pods and exhaust animations for the pods. Sometimes pods affecting each other, or
hitting each other.
Animators were trained to use the package and to use the dynamic controls that they needed. If
they wanted to keyframe they could go ahead and keyframe shots. And then we created a Maya
pipeline that would take the Maya scene through our in-house software so that we can render it in
Renderman. So, it was actually a pretty smooth setup, and the replacing of the geometry to higher
resolution was done in our in-house pipeline.
Perry Harovas Did you have any problems converting Maya s scene files, animations, and things
like trims that are specific to Maya, over to Renderman to render?
Habib Zargarpour We did have a problem initially, through the in-house pipeline, dealing with
NURBS because we were previously just dealing with B-Spline surfaces from Softimage. Other
than that, I believe trims made their way through okay and all the other kinds of geometry made
their way okay. We wrote our own converter so that so we could add things that were missing or we
could decide what would happen to certain types of nodes that weren t recognized.
But I think as far as the use we had for it, it kind of started growing from when we were doing the
pods to doing things like bubbles in the underwater sequence or suspended algae, doing the effect
in the underwater city when Quigon and Obi Wan walked through the membrane.
We used it for doing some flock animation of different places and then, of course, eventually it got
used for doing the people animation in the stadium people sitting on the seats and also in the end
battle sequence where the Gungans and Droids are battling. That whole choreography of running
and simulating the crowds all used Maya. So as we started out, we didn t think we would end up
with such a large usage of the software, but because of the expandability and the way we could put
our own plug-ins into it, we could make it fast and efficient. We were able to take advantage of it for
a lot of uses. And I have to say, it s thanks to our supervisor John Knoll, who s open to new ideas
and new methodologies and not afraid to dive into doing that.
Perry Harovas Was there extensive testing going on to decide what you were going to do in what
specific application and what you were actually going to shoot on-set as a real element to comp in?
Habib Zargarpour Yeah. Each Visual Effects Supervisor was using their own experience to
decide what elements should be filmed and what should be CG. But sometimes George would
have an opinion about that and he would want it one way or the other.
But the scope of the project and all the different shots that had to be accomplished was really vast,
so a lot of times approaching it wouldn t be as obvious as you would think because you would say,
Well this might make sense normally to shoot an element, but then we d need hundreds of them
from different angles. The Rotunda is an example, with all the people sitting in the boxes, trying to
get that kind of footage.
Perry Harovas I know that muticolored Q-tips were photographed in the models of the stadium to
simulate thousands of people in the stands. Were all those shots eventually replaced with CG?
Habib Zargarpour No. There were shots where the Q-tips were left in. Mostly shots where you
were not within the stadium or from a distance. The shots where you can see people waving their
arms, those pretty much were replaced with CG crowd or footage with a compositing technique.
Perry Harovas I believe I remember you saying at the Alias|Wavefront Users Group that you can
make them do the wave if you wanted to! Did you do any shots where you just had fun with them?
Habib Zargarpour We actually had blooper takes of them doing very funny stuff. But we had
some people running blooper shots on their own. What I wanted to do was have a Battle Droid
riding one of the pod engines.
Habib Zargarpour We were doing all kinds of work with dynamics and expressions, and a couple
of in-house people were experimenting with them. I started using them for the pods, and that year I
think the real robot wars got canceled. So in the back of my mind I was always saying, It s really
sad because John Knoll also participates in that, in the robot world, you know, the robot he built in
the lightweight category. So the real stuff was always in our minds, so it was only a matter of time
to connect the virtual stuff to say, I think Mike Ludlum had run some preliminary tests of rigid bodies
that moved around.
So I took that idea and took the real robot world idea and I thought, hey if you could build robots
actually with rigid bodies, then they ll have expressions so they can fight each other. Then we
actually made a sample case with it. We were having a riot with how fun it was to watch these
things go at it. I had some really preliminary tests where they would just attack a cube or
something. It grew from there to build more intelligence in them. Like the first arena I had didn t
have a border so they kept falling off the edge. So I had them build in that experience so that they
avoided the edges.
Habib Zargarpour Oh yeah, definitely! Each time we run it, people start piling up and looking and
cheering for one side or the other. If you had a new robot, you d want to run some test battles first
and fine tune your expressions first and then you ll be ready. It s kind of like an evolution thing, it
grows. With more experience you can improve your robot. It would pretty unfair if you didn t have
battle experience and you just put it in there. You d probably get run over pretty quickly the first
time!
Perry Harovas I like the rules: you can t delete your opponent, you can t change your robot s
size on the fly, and things like that.
Habib Zargarpour Right. I still have people coming up to me saying, Hey, you know you can do
this& and then you think, Well, that s cheating. The rules are getting longer and longer.
Perry Harovas Have you put up a Web site devoted to this yet?
Perry Harovas Have you ever just said, You know what, I m going to stay here late, I m going
to work on something just for fun because it s what I want to do and nobody else has to have a
say on how it looks or how it moves ? It doesn t have to be anything big or anything anybody
ever sees, but just something that make you happy as an artist.
Habib Zargarpour I find myself thinking constantly about things that are possible to do or things I
want to be able to do and it becomes like a little test pilot. Kind of like if you re in a restaurant and
you have a napkin and you find yourself sketching on it, but as ideas come you think to yourself, I
wonder if I can make something like this and hook it up to that?
To me the interesting part of the package is when you have these different modular features in it,
then you can combine them. You can combine rigid bodies with particles; you can combine
relational modeling with animation. All these different things can talk to each other, so then you
start thinking in your head about tinkering with different inventions, basically, building them in Maya,
and that s the curiosity factor for me. You build things to see if you can make it work a certain way.
Or someone else can throw you a challenge, saying, I bet you can t make a locomotive drive
chain with an IK skeleton, or something like that, you know? I have lots of scenes that are just
little proof of concepts of different effects or inventions.
Perry Harovas And I m sure all of those end up getting funneled back into production when you
need an idea, and you remember you did something 6 months ago for fun?
Habib Zargarpour Yeah, absolutely. And that s where good naming conventions come in. You
want to name something exactly what you think it should be called when you want to look for it
again.
Perry Harovas What do you see as the most difficult part of using a commercial application like
Maya in production?
Perry Harovas Having the time to learn it or just learning it in the first place?
Habib Zargarpour Both. I think there s so much there that you want to be able to continuously
learn. That s true with any package, but specifically, to really harness the power you need good
training on a package like Maya to be aware of all the different possibilities. And also to take
advantage of the expressions.
I think it is a voyage of discovery. You cannot be afraid of going into different places or menus. I
think that anyone who has fear of what s new is going to have trouble in general in the land of
computer graphics. Things change so fast that you have to accept that change is going to happen. I
went through this when I had learned Alias and then Softimage came around and I had to [learn
that]. Initially I was really angry and bitter that here s a whole new thing I have to learn after
becoming good with Alias. I think at that point I decided to accept change and decided that if there
s something new, I m going to dive into it. You just have to change your attitude around.
Perry Harovas When you open yourself up to things like that, sometimes there s the danger of
being into everything new and it affects what you re trying to do if you re excited about the new
thing and get lost in it. I imagine you have to scale yourself back sometimes so that you can meet
your schedules?
Habib Zargarpour Yeah. You don t jump into everything that s new; you have to use your
judgment to say, This particular thing looks very promising, so it seems like it s worth checking
out. As you check it out, you find pretty quickly if you made a good decision or not. You know, at
some points it was more fun to make the [MEL] scripts than to do the work. I think that s the
danger with Maya it s really fun to make those buttons and make the icons for them and make
them do stuff! I thought that was just extremely fun. We have over 200 of them, some of which I ve
made and some of which the rest of the crew did. I think we ve been very successful in integrating
it into our pipeline, customizing it for what we do.
Perry Harovas There is only so far you can go with MEL and at some point you have to do a
plug-in either for speed or just to get it done at all. Did your R&D department write a lot of plug-ins
as well?
Habib Zargarpour Yes. Actually, our R&D TD s (Technical Directors) would write plug-ins; the
software department would handle things like stand-alone tools.
Perry Harovas Are you able to write at that level of programming or are you happier and most
confident in things like expressions and MEL?
Habib Zargarpour I have a software background in mechanical engineering. I learned it there and
I have been writing code on various platforms, as well as some custom code on Twister and some
of the programs we use in-house. I wouldn t say I m totally confident with it. I m much better at
editing than writing it from scratch, and I m certainly much more comfortable with the scripting
language, having done a lot of Dynamation work before. Thanks to the speed [Maya] has, there are
very few times you need to go to the plug-in level. The cases where you have to go to the plug-in
level are if you want to create a primitive and have it deform and have it all be part of the
Hypergraph pipeline, the live relational things. I m most likely to hand that stuff out to people that
are more capable than me and much faster than me in the actual programming language.
Perry Harovas Maya Fur and Maya Cloth are part of the package and they re really well
integrated, but I imagine that there was some reason that you made a decision not to use those,
and to instead use your own in-house tools for those things?
Habib Zargarpour Those weren t decisions I had to make, as I wasn t working on that creature
portion of the show. The people that were doing the creatures were developing in-house cloth and
were open to using any other packages cloth that was available to test, but it just so happened
that we finished our cloth and made it very robust before the Maya cloth was ready. At that point,
when the Maya cloth was ready and we saw it, I think our dynamics were still ahead in terms of
robustness and realism. They still had improvements to make, which they did by SIGGRAPH last
year. The people who were deciding which methodology to use were happy with what we already
had.
In terms of Fur, we ve had a long history of doing fur kind of projects here, and they ve been
going through different evolutions with every show. The first use, I think, was in The Flintstones,
believe it or not. Then we used it on the monkeys in Jumanji, and on the lion. Then the latest
resurrection of it is in Mighty Joe Young with the gorilla fur, where we added dynamics to it.
Habib Zargarpour It used to be separate, but now both are integrated into the same. I don t
know if the people responsible for doing that work had a chance to look at Maya Fur or not.
Certainly, what they saw with the Paint Effects, they were very impressed with this year at
SIGGRAPH.
Perry Harovas Did you get a chance to see Paint Effects after your speech at the Alias|Wavefront
User s Group?
Habib Zargarpour Unfortunately not. I d seen it last year, but it was an independent unit; it wasn
t integrated into the package and I don t think he [Duncan Brinsmead] had all the animation
features. But I heard people talk about it. It sounded really promising.
Perry Harovas At SIGGRAPH, ILM presented a technical paper that described how you were able
to keyframe the dynamics, which is a fascinating concept. Have you tried to implement any of that
in Maya?
Habib Zargarpour We implemented that concept. In the Rigid Bodies, we were using impulses to
add our own guidance into what we wanted to do. In some ways, the way pod rigs were set up was
pretty much that you have human input into a dynamics system to guide it, to tell it where to go. But
basically, the bottom line would be that the simulation is going to decide where it s going based on
its own characteristics of mass, momentum all these different things. So, in a way, that setup is
entirely an input into a dynamic system, as opposed to letting it run purely based on fields, like we
do on particles. With particles, there are so many of them that you have to come up with global
controls.
Perry Harovas So the cage you set up, with the different springs attached to the engines of the
pods, that was your input device, by keyframing that, then letting the dynamics of the springs on top
of it take over under that?
Perry Harovas How, if you can tell me this without killing me, did you implement denting in the
pieces of the engine that hit the ground?
Habib Zargarpour [Laughs] We had several different R&D projects at the same time looking into
that, and one of the methodologies was to take expressions and use lattices to deform them based
on impact. To deform the object, you have to do all kinds of tricky things to the rigid bodies for them
to recognize that they got deformed, but I won t go into that! It was a combination of what s in the
package and some expressions and plug-ins that we managed to get the airframe technique
working so it would automatically dent as it hit and deform to whatever object it was impacting.
It was very exciting for us, for example, to get the front ring of the engine hitting the ground. If that
was a solid piece, it would just hit the ground and fly out, whereas if it s an airframe, the bottom
starts to take the impact and warp backwards and causes a distortion to go through it. It behaves
more like a piece of sheet metal would, that could deform, as opposed to a hard piece that would
just fly off.
The last technique was something we had developed as a plug-in, which was a deformation node.
We could hand-place and animate them as a live relational node in the Hypergraph. We would just
dial in how much deformation we wanted. That technique was used when the wrench goes into the
Marpod engine, for example. You see dents coming out of the different spots on the engine. That
way, it was real easy for us to just place them in different spots, and if George wanted more or less
of them or different timing on them, [we could do that]. So it was very simple for us to place the
deformers manually and just hand-animate them coming on. Because they were relational it was
animatable, so it wasn t like we were permanently deforming it.
Perry Harovas Were there any instances where the dynamics were not working, or taking much
too long to calculate?
Habib Zargarpour There were a few shots where the animators were trying to get the pod rigs to
move a certain way, and there would be maybe some really fast turn that they couldn t do, or a
specific action. So for the most part, they would make the simulation so that most of the pieces
were moving physically correctly, and then they could go in and hand-edit some of the keyframes.
Like, if an engine went a little too high in a certain frame, they could bring it down and basically
post-edit it as if it was motion capture. But that didn t happen very often.
Perry Harovas How long did it take you to develop the cages that surrounded the pods and
engines?
Habib Zargarpour That s a good question. That process took about three to four months. And
the reason being that it was basically an engineering project trying to make an airplane and fly it.
You need test pilots and you need mechanical configurations. We ran into all kinds of interesting
discoveries, like dealing with moving rigid body hierarchies. It was not only a matter of building it,
but also making tools that could handle it. In Maya 1.0 you couldn t do rigid body hierarchies, so
we had to come up with a way to do the hierarchies and then a way to move them and rotate them.
But it wasn t four months of full-time work for me. As I was doing the pod crashes, I was also
doing this research. As an example, if you weren t real precise with your Pod rope configuration,
let s say like where the pins would go, you would end up with some high-frequency problems at
high speed causing the cockpit to break off or something. That s why I keep saying it s like
dealing with a real craft it physically has to function that way. A lot of the time was spent trying to
get the right configuration. What is the best way to grab an engine? Do you grab it from the front,
which is the first thing we tried, or do you grab it from all four corners? Each decision has its own
repercussions and efficiency.
One of the difficulties in doing the pod race was we weren t able to tell them any details about
what we were doing with the rigid bodies. We just had to say, Look, we re trying to go really fast
and it s misbehaving or doing this or that. Not having the luxury of sending [Alias|Wavefront] a
scene and ask Why doesn t this work? that s always a frustrating thing not to be able to do
that.
Perry Harovas I think it s maybe everybody s misperception that ILM has a really, really fast
machine on everybody s desk.
Habib Zargarpour Right, that s what I thought before I came here! I thought everyone would be
doing real-time renders on big machines.
Perry Harovas Were you given something that could do the calculations in our lifetime so that you
wouldn t have to be there all day and all night to wait for the simulation?
Habib Zargarpour I just used my [SGI] O2. What you had to do is use the tools in the package to
make efficiencies happen. If two objects are really heavy, you put them on different layers. Those
kinds of things you have to constantly watch for and take advantage of. But yeah, it would be really
nice if they multi-threaded the package as far as dynamics go, not just rendering, so that you could
run the simulation on an Origin or do massive parallel processing on fast machines. Nowadays,
even desktops are coming with four processors!
Perry Harovas Is there a concern about using commercial packages, which change often, and
sometimes go away?
Habib Zargarpour Yeah, that s always a concern. I feel like we need to take full advantage as
much as we can from vendor software because there are so many developers involved with it.
There s only so much manpower you have in-house, and we do have amazing programmers here.
But I find that if we are able to harness some or both of those rather than making it exclusive, there
are huge benefits in that kind of relationship. As users, we end up benefiting from developers and
dedicated companies who make tools for you. And more and more, I guess, packages are opening
up with APIs and plug-ins, and it s creating this interesting gray area where code is code, and it s
almost like it doesn t make any difference what it s called or where it s running. Put one package
into another or vice versa. But then what s important is the user interface and the design, right?
Perry Harovas Do the other users of Maya out there ever benefit from things that you ve
developed in ILM, or do they just not let anything go to Alias|Wavefront?
Habib Zargarpour That s a good question. We have a lot of suggestions for them on improving
the package, and most of those changes get put into the official package.
Perry Harovas Thank you for a such a wonderful conversation, and for all your thoughts and ideas
and excitement.
Starting Maya 17
Command line options 17
Running prior versions of Maya 18
Environment variables 18
Main window 19
Main window and floating windows 23
Maya workspace 24
MEL commands 32
Scene management 38
Getting help 39
Arranging views 61
Displaying the workspace only 64
Laying out the views 64
Marking a view 66
Creating a bookmark 66
Selecting custom bookmarks 67
Renaming a bookmark 67
Adding a bookmark to a shelf 67
3 EDITING OBJECTS 69
Selecting objects 69
Selecting objects individually 69
Selecting multiple objects in a scene 70
Inverting a selection 70
Selecting all objects in a scene 70
Selecting objects by type 71
Selecting objects by name 72
Selecting all objects in a set 72
Selecting all objects in a display layer 72
Deleting objects 72
Deleting a single object 72
Deleting object components by type 73
Deleting all objects by type 74
4 TRANSFORMING OBJECTS 83
Using manipulators 83
About manipulator handles 84
Moving objects 88
Choosing a coordinate system for the Move Tool 90
Using the Move Normal Tool 91
Moving curves on surfaces 91
Moving a path animation marker 92
Rotating objects 92
Changing the rotation order 92
Choosing a rotate mode 93
Animating rotation channels 94
Scaling objects 94
Snapping 139
Snapping icons 139
Snapping hotkeys 140
Snapping along a constraint axis 141
Snapping to a curve on surface or isoparm curve 141
Snapping aligning objects 142
Part 2 Editors
9 USING MAYA EDITORS 207
Part 3 Preferences
12 SETTING PREFERENCES 313
PART 1
BASIC FEATURES
1 WORKING IN MAYA
Throughout Maya youll find a consistent interface and a style of working that is
both fast and easily customizable. This chapter presents these methods of working so
you can quickly launch into your projects.
STARTING MAYA
You can start Maya by either double-clicking the Maya desktop icon or by typing
maya at a command prompt. On Windows, you can also select Start > Programs >
Maya (Complete or Unlimited) 4.0 > Maya.
Note
The -batch command is not used for batch rendering. Instead, use the
Render command. However, -batch does check out a render-only license
instead of a full Maya license.
On Windows, type mayabatch when using the -batch flag. The mayabatch
command runs within the command prompt window, whereas the maya
command starts a separate window.
Environment variables
At startup, Maya uses a number of environment variables to set the environment.
Many of the variables are included in the Maya program and are set automatically
when you start Maya. To configure Maya further, you can set additional
environment variables. For more information, see Chapter 8, Setting Environment
Variables.
MAIN WINDOW
Read this section for a brief summary of the main interface elements. As you read,
keep in mind the following:
You can show or hide any of the UI elements in the main window using the
Display > UI Elements menu.
You can also hide a UI element by clicking the hide button to the left of or above
the UI element. To show a UI element, right-click another hide button and
select the desired UI element from the pop-up menu.
The critical part of the interface is in the workspace panel; see the next topic, "Maya
workspace" on page 24 for details.
You can hide all the interface elements and instead use Mayas quick command
features: the Hotbox, Marking Menus, and hotkeys. For an introduction to this topic,
see "Streamlining the interface" on page 26.
A menu icon appears to the right of the mouse pointer when a right mouse
button pop-up menu is available for the control over which the mouse is hovering.
Title bar
Main Menu bar
Status Line
Shelf
Scene Menu bar
Tool Box
Workspace
Time Slider
Range Slider
Command Line
Help Line
Channel Box
Layer Editor
Status Line
The Status Line has a variety of commands, mostly used for modeling. For example,
the central group of buttons are used to select objects and components. See "Working
with objects" on page 26 for an introduction to this topic. Also see Chapter 6,
Modeling Aids, which describes most of the options on the Status Line. The last
three buttons are used to show or hide editors, including the Attribute Editor,
Channel Box, Layer Editor, and Tool Settings. See Chapter 9, Using Maya Editors.
m ory
s
n
re ucti tion
fra ist
io
ks
e
e
ct
t
er h
s
pu
od
or
ra
as
le
al
nd on
ct
ns pe
sc e
in
m
se
nu lob
m
e
rs de
lig n
sa sc e
ve en
le
en
od
co f o
gh o
en en
lis live
ic
n
n
se
ito /hi
ht
g
hi butt
io
er
io
to
op sc
tr
er
ct
ed ow
ct
m
u
e
ap
nd
en
le
ak
le
w
ck
sh
se
ne
se
sn
re
m
m
lo
For better organization, the buttons are broken into groups that you can expand and
collapse, as shown in the following illustration.
Shelf
The Shelf is a collection of tools and other commands that you can customize for
your specific needs.
By creating custom shelves, you can organize commonly used actions and tools into
groups. For example, you can create modeling, animating, and rendering shelves
with appropriate tools and actions for each option. You can also store the same tool
more than once, but with different settings. For information on creating, editing, and
deleting shelves, see "Creating and editing shelves" on page 339.
To switch between shelves, click the tab icon, as shown in the following illustration.
Tool Box
The Tool Box contains common tools as well as the last selected tool and icons for
changing views and layouts.
Select Tool
Lasso Tool New Tool
Move Tool
Rotate Tool
Scale Tool
Four View
Persp/Outliner
New Quick Layout buttons
Persp/Graph
Hypershade/Persp
Persp/Graph/Hypergraph
Panel/Layout
The space on the Tool Box that is allocated to the last selected tool displays the
icon of the last tool you selected from a menu or shelf. Tools that already have an
icon on the Tool Box, such as the Move Tool, wont appear in this space. (This is also
referred to as the non-sacred tool.)
See Chapter 3, Editing Objects, for information on using the Select Tool and Lasso
Tool. See Chapter 4, Transforming Objects, for information on using the
transformation tools. See Chapter 2, Viewing Your Scene, for information on using
the Quick Layout buttons.
Workspace
The main purpose of the workspace is to view your scene. You can also display
various editors and arrange the workspace panels in different layouts. For further
discussion, see the next topic "Maya workspace" on page 24.
Layer Editor
Layering is a method of grouping objects so you can easily hide them from view, use
them as a template, or render them in a separate pass. The Layer Editor provides the
main controls for creating layers, adding objects to layers, and making layers visible
or invisible. See "Using layers" on page 130 for more information.
Channel Box
Most of Mayas interface elements are common to 3D software packages, but the
Channel Box is a unique and powerful feature. It gives direct access to the building
blocks of Maya: attributes and nodes. Specifically, it shows the keyable attributes,
also known as channels. (A keyable attribute means you can set animation keyframes
for it.) For further discussion, see "Object attributes" on page 28.
Command Line
Another powerful feature of Maya is the MEL command language, and the
Command Line is your pipeline to it. Notice that it has two halves.
Enter MEL command with required arguments Command response Script Editor button
The left side is where you can type MEL commands. For example, you can type a
command to quickly create a sphere with a specific name and radius.
For a longer series of commands, use the Script Editor, which you can launch from
the button on the far right.
The right half displays system responses, error messages, and warnings. It can also
show echoes of all commands if you turn on Script > Echo All Commands from the
Script Editor.
You can resize the width of the input and the output sections of the Command Line.
You can use the up and down arrow keys in the Command Line to scroll through the
list of commands that have been previously executed in the Command Line.
Help Line
Like several other applications, you can look at the help line for descriptions,
instructions, and other useful information. For full details, see "Help Line" on page
39.
Tear-off menus
You can display menus as separate windows. This is helpful when you use a menu
repeatedly. Pull down the menu and click the tear-off line at the top. Tear-off menus
always display on top.
MAYA WORKSPACE
The main purpose of the workspace is to view your scene. You can also display
various editors and arrange the workspace panels in different layouts.
Most of the commands for using the workspace are on the menu bar at the top of the
workspace panel. In particular, the Panels menu contains commands for changing
views, displaying editors, and arranging panel layouts.
Tumble
Alt
L
Track
Alt
M
Dolly
Alt
L M
This navigation is available in several editors too, like the Graph Editor and
Hypergraph. Additional view commands are available under the View menu. For
more information, see Chapter 2, Viewing Your Scene.
Layout options
You can split the workspace into a multi-panel layout. For example, press and
release the Spacebar to switch to the default, four-panel layout. Press and release the
Spacebar again to expand the active panel to full screen.
In addition, you can display various editors in any panel, giving you the capability
of arranging layouts to suit a specific workflow. Default layouts are listed under the
Panels > Saved Layouts submenu. You can also use the Panels editor (Panels > Panel
Editor) to create your own.
Selection masks
To select just the object or component types you want to edit, you use selection masks,
also called pick masks. Pick masks are available on the Status Line and also as
Marking Menus when you right click on an object.
For example, right click on a NURBS sphere, choose Control Vertex from the
Marking Menu, and the CVs display for you to edit.
Object display
By default, objects appear in wireframe display. To view objects with shaded
surfaces, choose a shade mode from the Shading menu on the view panel. The
hotkeys for these options are shown in the following table:
4 Wireframe
5 Smooth Shade
For NURBS objects (objects created from NURBS curves), you can also control how
smooth the surface appears using the commands under Display > NURBS
Smoothness. This affects display only, not how the object renders. The hotkeys are in
the following table:
1 Rough
2 Medium
3 Fine
Object attributes
All object and component characteristics are stored as attributes. When you model,
animate, assign materials, and do any kind of manipulation on objects, you are
changing attribute values.
You can see and edit attributes directly in the Channel Box or the Attribute Editor.
The Channel box contains the keyable attributes for one or more objects. The
Attribute Editor contains all attributes for any single object.
Entering values
A simple example of working with object attributes is to change its translation. In the
Channel box, the Translate X, Y, Z attributes appear at the top. To quickly position
an object at the coordinates 1, 1, 1, select all three attributes, type 1, and press Enter.
(In general, typed values do not go into effect until you press Enter or exit the field.)
Using the
Channel box
to change
translate
attributes
Note
When you change values, Maya inserts characters by default. On
Windows, you can also overtype (replace existing characters) as you type.
Press the Insert key for overtype mode.
For more information on using the Numeric Input field with the transformation
tools, see "Entering numeric values" on page 98. Also see "Selecting objects by name"
on page 72 for information on using the Numeric Input field to select objects.
Attribute Editor
Channel Box
With more experience, you can take advantage of nodes to make your own
connections. For example, you could link the animation of two orbiting spheres by
connecting the rotation attributes of those objects nodes.
For more information, see Chapter 10, Using the Hypergraph. (The Hypergraph
graphically depicts the objects and nodes in your scene so you can easily examine
and modify connections.)
Using actions
An action refers to the standard software operation of picking an object, and
selecting a menu item to perform an action. For example, if you want to create a
revolved surface, first select the profile curve you want to use, then select Revolve
from the Surfaces menu.
In Maya, many of the actions you perform have associated options. For example, you
may want to set the pivot point before you revolve the curve.
To set options, first open the option box (if available). Option boxes appear as a
square to the right of the menu label (). When you have completed the option box,
click the action button or Apply button at the bottom.
Most of the settings in option boxes correspond to object attributes, so you can edit
them later as well.
Tip
You can return to the factory option settings by choosing Edit > Reset
Settings in the option box menu.
Using tools
Working with tools in Maya is like working with a real artists tool. You pick the tool
and manipulate items with it until you complete the operation. There are visual cues
to let you know that you have picked a tool:
the word Tool appears on the menu label
the tool is highlighted on the Tool Box
in most cases, the cursor changes or a manipulator appears around the object
instructions appear on the Help Line to guide you through the operation
Tools have options you can set to control their behavior. Like actions, there is an
option box to right of the menu label that opens a window with all the options.
You can also double-click icons on the Maya windows Tool Box to display a Tool
Settings window for the tool represented by that icon. For instance, if you double-
click the following icon in the Tool Box, Maya displays a settings window for the
Rotate Tool. See Chapter 4, Transforming Objects, for information on using
transformation tools.
Double-click here to
display a Tool
Settings window for
the Rotate tool
Y handle
Center handle
Z handle X handle
Some objects have manipulators associated with them. For example, cameras and
lights have manipulators to control their center of interest and other settings. These
manipulators also have a Cycling Index. You can click the Cycling Index to cycle
through the available manipulator controls.
Pivot
Clipping Panes Center of Interest
Clipping Panes
Cycling Index
For more information on displaying camera and light manipulators, see "Displaying
camera and light manipulators" on page 128. For information on using manipulators
to modify an objects construction history, see "Using the Show Manipulator Tool"
on page 95.
MEL COMMANDS
MEL is Maya's scripting language. Here are some examples of things you can do
with MEL:
Use MEL commands to bypass Maya's user interface, quickly create shortcuts, and
access advanced features.
Enter exact values for attributes, bypassing any restrictions to precision imposed by
the interface.
Customize the interface for specific scenes, changing default settings to settings you
prefer for a particular project.
Create MEL procedures and scripts that carry out custom modeling, animation,
dynamics, and rendering tasks.
There are several ways to enter MEL commands; using the Script Editor or
Command Line are the most common. You can also execute commands in script
files, .ma files, shelf icons, hotkeys, and expressions.
See Using Maya: MEL for an introduction to using MEL commands and scripts.
North zone
South zone
Each zone contains marking menus. Use these menus to change selection masks,
control panel visibility, and panel types. For information on marking menus, see
"Using marking menus" on page 36.
Common menus
Panel menus (depends
on the active panel)
Recent main menu
selections
Functional menu set(s)
Used to customize
Hotbox appearance
Note
If you press the Spacebar briefly but do not hold it down, Maya changes
the number of views displayed. For example, if you are in a perspective
view, then press the Spacebar, Maya displays the four basic views.
Click here
Select recent
command
here
The display controls for other menus are in the bottom portion of the Hotbox
Controls, including menus for Maya Cloth and Live.
Note
Use the Restore Defaults button in the Hotkey Editor to restore a hotkey
assignment you removed.
For more information on using marking menus with hotkeys, see "Assigning
marking menus to hotkeys" on page 355.
SCENE MANAGEMENT
Throughout Maya, there are various features for organizing the elements in your
scene and for optimizing the scene file size. The following list summarizes some of
the main scene management features.
Groups You can group objects for quick selection and manipulate them as a whole. See
"Working with groups" on page 78.
Sets and
Partitions Sets are like groups, but they have the advantage of working with components as
well. A partition is a collection of sets. It is used primarily to prevent two sets from
having overlapping members. See Chapter 11, Sets and Partitions. Note that other
Maya features, such as the Character > Create commands, utilize sets as a way of
grouping objects.
Layers Layering is a method of grouping objects so you can easily hide them from view, use
them as a template, or render them in a separate pass. The Layer Editor provides the
main controls for creating layers, adding objects to layers, and making layers visible
or invisible. See "Using layers" on page 130 for more information.
Scene
optimization Before you save, we recommend that you optimize scene size for improved
performance, memory use, and reduced use of disk space (File > Optimize > Scene
Size ). For details, see "Optimizing scene size" on page 168.
Deleting construction history (if you have it enabled) is recommended when you
finish modeling and are ready to animate. (Construction history, as the name
implies, is a record of the information used in constructing an object.) To delete it,
select the object and choose Edit > Delete by Type > History.
You may want to avoid construction history altogether to optimize performance. To
do this, click the Construction History On/Off button in the Status Line to turn it off.
GETTING HELP
There are various types of online help provided with Maya.
Popup Help When you pass your mouse over an icon or button, a description of it appears. This
feature is on by default, but you can disable it (Help > Popup Help).
Help Line The Help Line at the bottom of Mayas window shows information about tools,
menus, and objects. Like the pop-up help, it displays descriptions when you pass the
mouse over icons, as well as menu items. It also displays instructions when you
select a tool; for example:
When you transform objects, the Help Line displays the object coordinates; for
example:
When you open or save a file, a progress bar control will appear in the lower left-
hand corner of the main Maya window to show you how much of the file has been
read or written.
Product
Information Choose Help > Product Information to see Mayas version and release date.
A|W Web Site Choose Help > A|W Web Site to automatically launch your default web browser
and view the A|W web site.
Online Library Also under the Help menu are selections for the online documentation library. This
help requires version 4 or higher of either Netscape Communicator or Internet
Explorer. Several of these documents are available in printable PDF format, readable
from the Maya CD-ROM. The Global Index and Search menu items can be used to
find information in the online library of documents.
Help on... For some Maya windows and dialog boxes, you can open help about the editor
directly by choosing Help > Help on windowname.
Find Menu To find the location of a main menu item, choose Help > Find Menu and type the
menu item name. The search is not case-sensitive. It accepts wildcard characters (*),
but if the menu was renamed or removed, type the name in full. The search is
limited to the main menu selections.
This chapter describes Mayas XYZ coordinate system. It also includes information
on the various tasks you can perform using Maya viewing tools. Additionally, it
explains how to hide nodes to improve Mayas playback speed.
Y-up
A Y-up world has X set up as the horizontal and Z as the depth of the scene. This
orientation is often used by animators (and games developers) who have evolved
from the 2D world of vertical (Y) and horizontal (X) to include movement toward or
away from the camera (Z).
X-axis
Z-axis
Z-up
A Z-up world begins with a ground plane that represents the X and Y directions,
with Z representing the up direction. This orientation is used by designers, whose
main concern is the ground plane where their plans are placed.
Z-axis
Y-axis X-axis
World coordinates
World coordinates represent space in the view. For example, when you move a
camera you move it in terms of world coordinates. The center of the world
coordinate system is located at the Origin.
World space is a coordinate system used to represent an object in terms you define.
For example, a model car might be defined in terms of millimeters. World
coordinates are also known as modeling coordinates.
Local coordinates
Local coordinates represent the space around an entity. The origin of a local
coordinate system is the center of that entity.
One way to understand local coordinates is to imagine an object sitting within a box.
All of the points on the objects surface are then given with respect to one corner of
the box. If you pick up the entire box and move it around the room, the coordinates
of the objectwith respect to the boxdo not change: the coordinates of the box
with respect to the room are changing. Focus on the two different descriptions: the
object with respect to the box (the objects local coordinates), and the box with
respect to the room (the position of the objects coordinate system with respect to the
world coordinate system).
Focal length
The focal length of a lens is defined as the distance from the lens to the film plane.
The shorter the focal length, the closer the focal plane is to the back of the lens.
Lenses are identified by their focal length. Focal length is expressed in millimeters or,
on occasion, in inches (1 inch is approximately 25mm).
For every shot, you must decide how big an object is in the frame. For example,
should a shot include an entire character or just its head and shoulders? There are
two ways to make an object larger in the frame. You can either move the camera
closer to the object or adjust the lens to a longer focal length.
Focal length is directly proportional to the objects size in the frame. If you double
the focal length (keeping the distance from the camera to the object constant), the
subject appears twice as large in the frame. The size of the object in the frame is
inversely proportional to the objects distance from the camera. If you double the
distance, you reduce the size of the object by half in the frame.
Angle of view
As you adjust the cameras focal length, the angle of view narrows and expands.
This is what causes objects to get larger or smaller in the frame. As you extend the
focal length, the angle of view gets narrower. As you shorten the focal length, the
angle of view gets larger.
Perspective
Since there are two ways to change the size of objects in the frame, what is the
difference between moving the camera and changing the focal length? Why choose
one over the other? The answer is that by moving the camera, you change the
perspective. Objects far from the camera change in relative size at a slower rate than
objects which are close to the camera. When you change the focal length, or zoom,
perspective does not change. All objects in the frame change size at the same rate.
Perspective could be thought of as the rate that objects change in size in the frame as
their distance from the camera changes.
Camera aperture
In a real camera, aperture is the film backs width and height in millimeters. The
camera aperture relates to the focal length in that different film backs have different
normal lenses. A normal lens has a focal length that is not telephoto or wide angle.
It closely approximates normal vision. As the size of the camera aperture increases, a
longer focal length is required to achieve normal perspective. For example, a
35mm camera uses a 50mm lens as a normal lens. On a 16mm camera, the same
50mm lens appears telephoto in nature. A 25mm lens is required to achieve
normal perspective on a 16mm camera.
This can be demonstrated in Maya by changing to different film backs without
changing the focal length. The camera appears to zoom in and out with different film
backs even though you are not changing focal length.
For more information on camera tools and settings, see Using Maya: Rendering.
You can use the Attributes Editor to change the camera type after it has been created.
For details, see "Camera Attribute Editor" on page 54.
Camera Properties
The camera viewing tools (tumble, track, and dolly) use this value to determine the
look at point when the camera is a one-node camera.
Center of
Interest The distance from the camera to the center of interest, measured in the scenes linear
working unit.
Lens Properties
Focal Length Also available in the cameras Attribute Editor. The focal length of the camera,
measured in millimeters.
Increasing the Focal Length zooms the camera in and increases the size of objects in
the cameras view. Decreasing the Focal Length zooms the camera out and decreases
the size of objects in the cameras view. The valid range is 2.5 to 3500. The default
value is 35.
Lens Squeeze
Ratio The amount the cameras lens compresses the image horizontally. Most cameras do
not compress the image they record, and their Lens Squeeze Ratio is 1. Some
cameras (for example, anamorphic cameras), however, compress the image
horizontally to record a large aspect ratio (wide) image onto a square area on film.
The default value is 1.
Camera Scale Scales the size of the camera relative to the scene. For example, if Camera Scale is 0.5,
the cameras view covers an area half as large, but objects in the cameras view are
twice as large. If the Focal Length is 35, the effective focal length for the camera
would be 70.
Horizontal Film
Offset, Vertical
Film Offset Vertically and horizontally offsets the resolution gate and the film gate relative to the
scene. Changing the Film Offset produces a two-dimensional track. Film Offset is
measured in inches. The default setting is 0.
Film Fit Controls the size of the resolution gate relative to the film gate. If the resolution gate
and the film gate has the same aspect ratio, then the Film Fit setting has no effect.
The default setting is Fill. See the following table.
Horizontal Fits the resolution gate horizontally within the film gate.
Vertical Fits the resolution gate vertically within the film gate.
You can also set Film Fit in the camera views View > Camera Settings sub-menu.
Film Fit Offset Offsets the resolution gate relative to the film gate either vertically (if Film Fit is
Horizontal) or horizontally (if Film Fit is Vertical). Film Fit Offset has no effect if
Film Fit is Fill or Overscan. Film Fit Offset is measured in inches. The default setting
is 0.
Overscan Scales the size of the scene in the cameras view only, not in the rendered image.
Adjust the Overscan value to see more or less of the scene than will actually render.
If you have view guides displayed, changing the Overscan value will change the
amount of space surrounding the view guides, making them easier to see. The
default value is 1.
1 The view guide fills the view. The edges of the view guide may be
exactly aligned with the edges of the view, in which case the view
guide will not be visible.
>1 The higher the value, the more space is outside the view guide.
Clipping Planes
Near Clip Plane,
Far Clip Plane Represents the distance of the near and far clipping planes from either the
perspective or orthographic cameras.
Near and far clipping planes are imaginary planes located at two particular distances
from the camera along the cameras sight line. Only objects between a cameras two
clipping planes are visible in that cameras view. Any objects in the scene closer to
the camera than the near clipping plane, or farther from the camera than the far
clipping plane, are not visible.
Notes
If part of an object is in front of the near clipping plane, then only the part
of the object beyond the near clipping plane will be visible. If part of an
object is beyond the far clipping plane, the entire object will be visible,
including the part beyond the far clipping plane.
If the distance between the near and far clipping planes is much larger
than is required to contain all the objects in the scene, the image quality
of some objects may be poor. Set the Near Clip Plane and Far Clip Plane
attributes to the lowest value that produces the desired result.
The objects you want to render are usually within a certain range from the camera.
Setting the near and far clipping planes just slightly beyond the limits of the objects
in the scene can help reduce rendering times.
By default, Auto Render Clip Plane is on, and the Near Clip Plane and Far Clip Plane
values do not determine the position of the clipping planes for software rendering.
The default setting for Near Clip Plane is 0.1 and for Far Clip Plane is 1000.
Important Note
Setting Near Clip Plane to 0.1 (a float) and Far Clip Plane to 100000 (a large
integer) may result in quality problems.
Motion Blur
Shutter Angle Motion Blur must be set on in the Render Globals window and in at least one objects
Attribute Editor for the Shutter Angle to have any effect. Shutter Angle is measured
in degrees. The valid range is 1 to 360. The default value is 144.
The Shutter Angle controls the blurriness of motion blurred objects. In a real-world
camera, the shutter is actually a metal disk that is missing a pie-shaped section. This
disk sits between the lens and the film, and rotates at a constant rate. When the
missing section is in front of the film, it allows light from the lens to pass through
and expose the film. The larger the angle of the pie-shaped section, the longer the
exposure time, and more blurry moving objects appear.
Orthographic Views
By default, when you create a camera from the Create menu, the view is perspective.
If you want an orthographic camera view, click the Orthographic check box and
change the Orthographic Width if necessary.
The Orthographic Views attributes control whether a camera is perspective or
orthographic (top, front, or side), and also lets you control the field of view for
orthographic cameras. See also Orthographic Views.
Orthographic If on, the camera is an orthographic camera. If off, the camera is a perspective
camera. Orthographic is off by default.
Tip
The default cameras are aligned to the major axis. You can create an off-
axis orthographic camera by rotating the orthographic camera or changing
the default tumble options and using the tumble tool.
Orthographic
Width The width (in inches) of the orthographic camera. The width of an orthographic
camera controls how much of a scene the camera can see. Changing the width of an
orthographic camera has the same effect as zooming a perspective camera.
Tip
If you want to create a new perspective camera and get out of orthographic
view mode, select Edit > Reset Settings and click the Apply button.
Note
To select the Roll, Zoom, Azimuth Elevation, and Yaw-Pitch tools, use the
View > Camera Tools menu. You cannot select these tools with the mouse
and the Alt key.
Tips
If you change the default settings in the camera tool options windows,
remember to press the Reset Tool button to reset the tool defaults for the
next operation.
If you want to keep the settings for a particular camera operation, MMB-
drag the camera tool setting icon from the mini bar into the Shelf and
click this icon for specific operations.
Select View > Default Home if you zoom and tumble the view repeatedly
and then need to see the default cameras view.
Camera tools
Tumble Tool
Revolves the camera by varying the azimuth and elevation angles in the perspective
window. You can also press Alt and the left mouse button. Press the Shift key to
constrain the camera movement.
The Tumble Tool options are as follows:
Tumble scale Scales the speed of the camera movement. The slider range is 0.01 to 10. The default
value is 1.
Tumble camera
about Center of
Interest The camera tumbles about its center of interest. Tumble camera
about is set to Center of interest by default.
Tumble Pivot The camera tumbles about its pivot point. This tumble pivot can
also be set in the cameras Attribute Editor (see Tumble Pivot for
details).These values are stored in world space coordinates.
View operations such as Frame Selection, Frame All, Look at Selection, Default
Home, and Bookmarks all set the tumble pivot.
Orthographic
views Locked If on, you cannot tumble an orthographic camera. If off, you can
tumble an orthographic camera. Locked is on by default.
Stepped If on, you can tumble an orthographic camera in discrete steps.
The Stepped operation lets you easily return to the Default Home
positions. If off, you can tumble an orthographic camera smoothly.
Stepped is only available if Locked is off. Stepped is on by default.
Ortho step The angle of steps (in degrees) that you can tumble an
orthographic camera when Locked is off and Stepped is on. The
valid range is 0.01 to 180. The default value is 5.
Track Tool
When tracking across the display, it slides the view either horizontally or vertically.
You can also press Alt and the middle mouse button. Press the Shift key to constrain
movement in horizontal or vertical directions.
The Track Tool options are as follows:
Track
Geometry If off, as the camera moves an object moves at a speed that may be different than the
speed of the cursor. This problem occurs with objects far from the camera. Track
Geometry is off by default.
If on, as the camera moves, an object moves at the same speed as the cursor. The
object selected at the beginning of the Track operation remains under the
cursor.Tracking will be slower (especially if there are many objects in the scene) if
Track Geometry is on.
Track Scale Scales the speed of the camera movement. The slider range is 0 to 100. The default
value is 1.
Dolly Tool
Moves into or away from the view. You can also press Alt and the left and middle
mouse buttons together. You can use the Dolly tool in both a perspective or
orthographic view. Use Ctrl-Alt-LMB to drag a marquee in the area in which you
want to dolly.
The Dolly Tool options are as follows:
Scale Scales the speed of the camera movement. The slider range is 0.01 to 10. The default
value is 1.
Dolly Local If on, drag in the cameras view to move the camera toward or
away from its center of interest. If off, drag in the cameras view to
move both the camera and its center of interest along the cameras
sight line. Local is on by default.
Center of
Interest If Center of Interest is on, MMB-drag in the cameras view to move
the cameras center of interest toward or away from the camera. If
off, drag in the cameras view to move the camera toward or away
from its center of interest. LMB-marquee a region and snap the
center of interest to the center of those objects.Center of Interest is
off by default.
If Center of Interest (and/or Local) and Bounding box are on,
when you drag in the views, a red line with a small x at the end
points to indicate the Center of Interest.
Snap box dolly
to A box dolly moves the center of interest to the marquee region when you use the
Ctrl-Alt-drag method to dolly the camera.
Surface If on, when you perform a box dolly (Ctrl-drag) on an object, the
center of interest moves onto the surface of the object.Calculating
the surface point will be slower if Smooth Shade mode is off (and
especially if there are many visible objects in the scene).
Bounding box If on, when you perform a box dolly (Ctrl-drag) on an object, the
center of interest moves to the center of the objects bounding box.
Bounding Box is on by default.
Zoom Tool
Changes the focal length on a camera. Zooming in is like using a telephoto lens.
Zooming out is like using a wide angle lens. You can use zoom in both a perspective
or orthographic view. To move in or out without changing the viewing angle, use
the Dolly tool.
The Zoom Tools options are as follows:
Zoom Scale Scales the speed of the camera movement. The slider range is 0.01 to 3. The default
value is 1.
Roll Tool
Rotates the display around its horizontal axis.
The Roll Tools options are as follows:
Roll Scale Scales the speed of the camera movement. The slider range is 0.01 to 10. The default
value is 1.
Tip
Press Shift to constrain the cameras movement.
Tip
Press Shift to constrain the cameras movement.
Fly Tool
The Fly Tool lets you navigate your scene as if you were playing a 3D first-person
perspective game. The camera flies through your scene without being constrained by
any geometry.
To use the Fly Tool, press-and-hold the Ctrl key, then drag with the left mouse
button. Drag up to fly forward and down to fly backward. To change the camera
direction, release the Ctrl key and drag the left mouse button.
Note
The tumble, track, and dolly commands are available while the Fly Tool is
active.
Note
You can also use the Look Through Selected command to view your scene
from the point of view of a selected light or object.
Tip
You can also use the Hypergraph to select a view. In the Hypergraph
window, select the name of a view, then select Panel > Look Through
Selected. For more information, see "Using the Hypergraph" on page 263.
Resolution Gate Displays the renderable frustum for the current resolution specified in Render
Globals. This often specifies a more exact rendered image than the Film Gate option.
Also sets the camera Overscan attribute to 2.0.
Note
If the aspect ratio between the film back and the resolution is the same,
then the two resulting rendered images match.
Field Chart Turn Field Chart on to display a grid that represents the twelve standard cell
animation field sizes. The largest field size (number 12) is identical to the rendering
resolution (the resolution gate). Render Resolution must be set to NTSC dimensions
for this option to have meaning.
Safe Action Turn this option on to display a box defining the region that you should keep all of
your scenes action within if you plan to display the rendered images on a television
screen. The safe action view guide represents 90% of the rendered resolution (the
resolution gate). Render Resolution must be set to NTSC dimensions for this option
to have meaning.
Safe Title Turn this option on to display a box defining region that you should keep titles (text)
within if you plan to display the rendered images on a television screen. The safe
title region represents 80% of the rendered resolution (the resolution gate). Render
Resolution must be set to NTSC dimensions for this option to have meaning.
Fill Automatically selects a horizontal or vertical fit so that the selected image fills the
render frame.
Horizontal Selects a horizontal fit for the selected image in the render frame.
Vertical Selects a vertical fit for the selected image in the render frame.
Overscan Selects a slightly larger fit for the selected image in the render frame.
Tip
If you click the boxes at the right of some of the attributes in this editor, the
Create Render Node window displays which means you can map certain
render nodes to the camera attributes.
The following camera attributes are described in Setting Camera options. See:
Focal Length
Camera Scale
Near Clip Plane, Far Clip Plane
Film Back
The Film Back attributes control the basic properties of a camera (for example, the
cameras film format: 16mm, 35mm, 70mm). The following Film Back attributes are
described in Setting Camera options. See:
Lens Squeeze Ratio
Film Fit
Film Fit Offset
Overscan
Film Gate Lets you select a preset camera type. Maya automatically sets the Camera Aperture,
Film Aspect Ratio, and Lens Squeeze Ratio. To set these attributes individually, set
Film Gate to User. The default setting is User.
Camera
Aperture The height and width of the cameras aperture or film back, measured in inches. The
Camera Aperture determines the relationship between Focal Length and Angle of
View. The default values are 1.417 and 0.945.
Film Aspect
Ratio The ratio of the camera apertures width to its height. Maya automatically updates
the Film Aspect Ratio (and vice versa). The valid range is 0.01 to 10. The default
value is 1.5.
Film Offset Vertically and horizontally offsets the resolution gate and the film gate relative to the
scene. Changing the Film Offset produces a two-dimensional track. Film Offset is
measured in inches. The default setting is 0.
1 The view guide fills the view. The edges of the view guide may be
exactly aligned with the edges of the view, in which case the view
guide will not be visible.
>1 The higher the value, the more space is outside the view guide.
Depth of Field
These attributes provide control over the cameras focus.
Tip
The more out of focus an image is, the longer it takes to generate the final
rendered image (that is, the post-render blur will take longer.)
Depth Of Field If on, some objects in the scene are sharply focused and others are blurred or out of
focus, based on their distance from the camera. If off, all objects in the scene are
sharply focused. Depth Of Field is off by default.
Focus Distance The distance from the camera at which objects appear in sharp focus, measured in
the scenes linear working unit. Decreasing the Focus Distance also decreases the
depth of field. The valid range is 0 to . The default value is 5.
F Stop The range of distances from the camera within which objects appear in sharp focus
(the depth of field). The range of distances is centered on the Focus Distance. The
range is smaller toward the camera and larger away from the camera. The valid
range is 1 (small depth of field) to 64 (large depth of field). The default value is 5.6.
Focus Region
Scale Scales the Focus Distance value. The valid range is 0 to . The default value is 1.
Output Settings
Control whether a camera generates an image during rendering, and what types of
images the camera renders.
Renderable If on, the camera can create an image file, mask file, and/or depth file during
rendering. By default, Renderable is on for the default perspective camera, and off
for all other cameras.
Note
Changing the Camera attribute in the Image File Output section of the
Render Globals window can change the Renderable setting in a cameras
Attribute Editor.
Image If on (and Renderable is on), the camera creates an image file during rendering. The
default setting is on.
Mask If on (and Renderable is on), the camera creates a mask during rendering. A mask is
an 8-bit channel (the alpha channel) in the image file that represents objects in shades
of gray. Black areas represent areas where there are no objects (or fully transparent
objects), and white areas represent areas where there are (solid) objects. Masks are
used primarily for compositing.
Note
If the Image Format in the Render Globals window is not set to Maya IFF,
Maya16 IFF, RLA, SGI, Tiff, or Tiff16, the camera does not include the mask
information in the alpha channel of the image file. Instead, it creates a
separate mask file. See also the Render Globals chapter in the Using Maya:
Rendering book.
Depth If on (and Renderable is on), the camera creates a depth file during rendering. A
depth file is a type of image file that represents the distance of objects from the
camera by shades of gray. Depth files are used primarily for compositing. When on,
the Depth Type attributes (next) are enabled.
Depth Type Determines which objects Maya uses to create the Depth file.
Closest Visible
Depth Uses the closest object to the camera. When transparent objects are
located in front of other objects, turn on Transparency Based
Depth to ignore the transparent object.
Furthest Visible
Depth Most often used when a Particle Effect is occluded by an opaque
object. Maya uses the Furthest Visible Depth to create a Depth file.
Transparency
Based Depth Turns on Threshold, which determines which object is closest to the camera, based
on transparency. Transparency Based Depth is only enabled when you select Closest
Visible Depth.
Tip
When transparent objects are located in front of other objects, you can turn
on Transparency Based Depth to ignore the transparent object.
Threshold Used when compositing multiple layers of transparency (which varies from 0 to 1).
For example, if Threshold is 0.9 (the default), when transparent surfaces add up to
0.9 or larger, the surface becomes opaque.
Environment
Control the appearance of the scenes background as seen from the camera. Different
cameras can use different backgrounds.
Background
Color The color of the scenes background. The default color is black.
Image Plane Creates an image plane and attaches it to the camera. Clicking the Create button
automatically changes the focus of the Attribute Editor to include attributes for an
image plane. See the Using Maya: Rendering book for details about Image Plane
attributes.
Special Effects
Shutter Angle Controls the blurriness of motion blurred objects.
In a real-world camera, the shutter is actually a metal disk that is missing a pie-
shaped section. This disk sits between the lens and the film, and rotates at a constant
rate. When the missing section is in front of the film, it allows light from the lens to
pass through and expose the film. The larger the angle of the pie-shaped section, the
longer the exposure time, and moving objects are more blurred. Shutter Angle is
measured in degrees. The valid range is 1 to 360. The default value is 144.
Important Note
Motion Blur must be on in the Render Globals window and in at least one
objects Attribute Editor for the Shutter Angle to have any effect.
Display Options
Controls the display of view guides in the cameras view, and provides options for
moving the camera. You can also access most of these attributes in any panels
View > Camera Settings pull-out menu.
Display Film
Gate Displays a rectangle that indicates the area of the cameras view that a real-world
camera would record on film. The dimensions of the film gate represent the
dimensions of the camera aperture. The film gate view guide indicates the area of the
cameras view that will render only if the aspect ratios of the camera aperture and
rendering resolution are the same. See also Film Gate.
Display
Resolution Displays a rectangle that indicates the area of the cameras view that will render. The
dimensions of the resolution gate represent the rendering resolution. The rendering
resolution values are displayed above the resolution gate. See also the Using Maya:
Rendering book.
Display Field
Chart Displays a grid that represents the twelve standard cel animation field sizes. The
largest field size (number 12) is identical to the rendering resolution (the resolution
gate). See also the Using Maya: Rendering book.
Display Safe
Action Displays a rectangle indicating the region in which all of the scenes action takes
place if you plan to display the rendered images on a television screen. The safe
action view guide represents 90% of the rendering resolution (the resolution gate).
See also the Using Maya: Rendering book.
Display Safe
Title Displays a rectangle indicating the region in which to keep titles (text) if you plan to
display the rendered images on a television screen. The safe title view guide
represents 80% of the rendering resolution (the resolution gate). See also the Using
Maya: Rendering book.
Journal
Command If on, all camera movements are written to the Script Editor and become part of the
undo queue which lets you undo or redo them. This also lets you copy camera
movements and use them for other cameras or scenes.
If off, you cannot undo or redo camera movements. Use Previous View or Next View
instead. Journal Command is off by default.
Center of
Interest The distance from the camera to the center of interest, measured in the scenes linear
working unit.
Tumble Pivot The point the Tumble tool pivots the camera about when Tumble Camera About is
set to Tumble Pivot in the Tumble Tool settings window.
Orthographic Views
When you create a camera from the Create menu, the default view is perspective. If
you want an orthographic camera view, click the Orthographic check box and
change the Orthographic Width if necessary.
The Orthographic Views attributes also let you control the field of view for
orthographic cameras. See Orthographic and Orthographic Width for attribute
descriptions.
Note
This option does not include the default light.
If there are no lights in the scene, the scene renders as an all black image.
Use Selected
Lights Uses only selected lights. If you change the light selection, the lighting also changes
respectively.
Use Previously Specified Lights
Select this option to use the lights selected with the Specify Selected Lights option.
This option is grayed until you choose Specify Selected Lights. If you select a
different set of lights when this option is selected, the scene will still use the
previously selected lights.
Note
This menu item can be turned off by picking any of the items above it.
Two Sided
Lighting Turn this option on to illuminate both sides of an object. Note that Mayas
performance may decrease on some systems.
ARRANGING VIEWS
You can use the Quick Layout buttons in the Tool Box to select a different view or to
switch to another layout. See "Using the Quick Layout buttons" on page 63. You can
also use the Panels menu to change a camera view or to view a scene or object
through a selected camera.
.
Perspective Lets you change to a perspective view or create a new perspective view. For details,
see "Creating new perspective views" on page 59.
Orthographic Lets you change to an orthographic view or create a new orthographic view. For
details, see "Creating new orthographic views" on page 59.
Look Through Selected
Lets you look through a selected camera, object, or light. For details, see "Looking
through a camera" on page 52.
Panel Displays a menu with the following commands.
Outliner Opens the Outliner, where you can view objects and their
attributes hierarchically. For more information, see "Using the
Outliner" on page 249.
Graph Editor Opens the Graph Editor where you can edit visual representations
of keys and animation curves (keysets). For more information, see
Using Maya: Animation.
Dope Sheet Opens the Dope Sheet, where you can edit event and sound
synchronization and timing. For more information, see Using
Maya: Animation.
Trax Editor Opens the Trax Editor, where you can create and edit time-
independent clips of character animation. For more information,
see Using Maya: Animation.
Hypergraph Opens the Hypergraph, which gives you an overview of your
entire scene, all objects it contains, and the relationships between
those objects. For more information, see "Using the Hypergraph"
on page 263.
Hypershade Opens the Hypershade, which you can use to create and edit
rendering nodes, and to view and edit rendering (or shading)
networks. For more information, see Using Maya: Rendering.
Visor Opens the Visor, which you can use to show images of shading
nodes you can create, those already in your scene, and those in
online libraries, in a visual outline form. For more information, see
Using Maya: Rendering.
UV Texture
Editor Opens the UV Texture Editor window, which you use to map
textures to a polygonal model. For more information, see Using
Maya: Polygonal Modeling.
Render View Opens the Render View window, where you can test render single
frames and interactively tune rendering attributes. For more
information, see Using Maya: Rendering.
Blend Shape Lets you create character deformations. For more information, see
Using Maya: Character Setup.
Dynamic
Relationships Lets you view or edit connections between dynamics elements
such as particle emitters, collisions, etc. For more information, see
Using Maya: Dynamics.
Devices Lets you use external tools and plug-ins for special devices, such
as Motion Capture.
Relationship
Editor Opens the Relationship Editor, which you can use to group and
manipulate objects as sets and assign shading groups to geometry.
For more information, see "Using the Relationship Editor" on
page 217.
Reference
Editor Opens the Reference Editor, which you can use to specify settings
for importing files by reference. For more information, see "Using
the Reference Editor" on page 181.
Component
Editor Opens the Component Editor, which you can use to specify
settings for importing files by reference. For more information, see
"Using the Component Editor" on page 209.
Paint Effects Opens the Paint Effects Panel, where you can interactively render
strokes without rendering the rest of the scene. New strokes
render as you paint them in this view. For more information, see
Using Maya: Painting.
Layouts Lets you specify how different camera views are arranged spatially in the Maya
window.
Saved Layouts Lets you select a panel layout. For more information, see "Selecting panel layouts"
on page 370.
Tear Off Moves the current camera view into a separate window. The current view is
replaced with the next view in the Panels list (to see this list, select Panels > Panel
Editor).
Tear Off Copy Copies the current camera view into a separate window.
Panel Editor Opens the Panel window, where you can create new panels, re-label existing panels,
rename layouts, and change layout configurations. For more information, see "Using
the Panel Editor" on page 367.
Persp/Outliner
Persp/Graph
Hypershade/Persp
Persp/Graph/Hypergraph
Panel/Layout
Use the Panel/Layout button to change a specific panel or to change the view
arrangement.
Note
You can right-click any of the first six Quick Layout buttons to open the
Saved Layouts pop-up menu and select a different layout, such as Four
View or Hypershade/Outliner/Persp. The icon changes to represent the
selection.
Note
You can change the icon image of any of the first six Quick Layout buttons.
This is especially useful for custom layouts. You can select one of Mayas
default images or a customized image file. For information, see To change
the icon image of a Quick Layout button:
You can place any tool in a view. For more information, see "Creating layouts" on
page 371.
In the following example, the display is changed to a 3 Left Split layout.
Note
If you want one view to occupy the entire Maya window, select the view,
then press the space bar quickly. (If you press the space bar for too long,
Maya displays the HotBox.)
To rename and delete a camera, use the Outliner. See "Using the Outliner"
on page 249.
MARKING A VIEW
You can use bookmarks to mark a view for future use. This lets you maintain a
variety of camera views for any scene. Maya has four predefined bookmarks:
Perspective, Front, Top, and Side. You can change your view to any of these
predefined bookmarks, or you can create your own bookmarks.
Note
Bookmarks are defined for specific views, such as Persp, Top, Side, or
Front. Therefore the bookmark is unique to and is only available when
youre in that view.
Note
You cannot change positions for the predefined bookmarks.
Creating a bookmark
You can create your own bookmarks to mark views other than Perspective, Front,
Top, and Side.
3 In the Name box, type the new bookmark name and then press Enter.
4 Type a description of the view in the Description box.
5 Close the Bookmark Editor.
Tip
To create a bookmark with a system-assigned name, select
View > Bookmarks > Edit Bookmarks and click New Bookmark.
Maya assigns the view to the first bookmark under the name cameraView1.
To delete a bookmark:
1 Select View > Bookmarks > Edit Bookmarks. The Bookmark Editor opens.
2 Select the bookmark you want to delete and click the Delete button.
To view bookmarks:
Select View > Bookmarks and select the bookmark you want to view the object
through.
Renaming a bookmark
You can rename bookmarks at any time.
To rename a bookmark:
1 Select View > Bookmarks > Edit Bookmarks. The Bookmark Editor opens.
2 Select the bookmark you want to change.
3 In the Name box, change the bookmark name then press Enter. The modified
bookmark appears in the Bookmarks menu.
Note
The bookmark button will only work if you are in the view in which the
bookmark view can operate.
Use the Edit menu to delete, select, duplicate, group, and parent objects. This chapter
describes how you edit objects in Maya. It also describes Mayas undo, redo, and
repeat functions.
Note
The following Edit menu option is not described in this chapter:
Keys Displays the available keys. For more information, see Using Maya:
Animation.
SELECTING OBJECTS
There are several ways to select objects in Maya. You can:
select objects individually
select all objects in the scene
select objects of a specified type
select objects of a specified name
select all objects in a set
select all objects in a display layer
When you select objects, they become highlighted. Note that you can change the
highlight color. For details, see "Changing default colors" on page 330.
To select an object:
Click on the object, or click-drag a box around it.
or
In the Outliner or Hypergraph, click on the object name. For information about the
Outliner, see "Using the Outliner" on page 249. For information about the
Hypergraph, see "Using the Hypergraph" on page 263.
or
In the Relationship Editor, highlight the object in the left panel and on the Edit
menu, click Select Highlighted. For more information about the Relationship Editor,
see "Using the Relationship Editor" on page 217.
Inverting a selection
Use Invert Selection to select all objects in the scene that are not selected. For
example, if you select two of five objects in a scene, and then select Edit > Invert
Selection, the other three objects are selected instead. Note this only works on
objects, not components.
When you select a transformation tool, the manipulator for that tool displays on the
last selected object (the one highlighted in a different color, default, green). When
you transform the selection, the selected objects move as a group.
To deselect all objects, click anywhere on the view.
2 Select Edit > Select All by Type > Joints. Maya selects the joints on the object.
DELETING OBJECTS
Use the Delete, Delete by Type, and Delete All by Type options on the Edit menu to:
delete single objects
delete object components by type
delete all objects by type
To delete an object:
1 Select the object(s) you want to delete.
To delete more than one object or component, Shift-click each object you want to
delete, or click-drag a box around the object(s).
2 Select Edit > Delete. Maya removes the object and the associated Channel Box or
Attribute Editor from the display.
Tip
You can also delete selected objects with the Backspace or Delete keys on
the keyboard.
Duplicating objects
Use the Duplicate command to create copies of geometry or lights in a scene. You
can duplicate more than one object at a time. You can duplicate objects as many
times as you like. This means that you do not have to build a new object every time
you need a copy.
Note
To create more than one copy of the object at the same time, select
Duplicate . For more information, see "Setting duplicating options" on
page 74.
To duplicate an object:
1 Select the object you want to duplicate.
If you want to duplicate more than one object, click-drag a box around the objects or
Shift-click the desired objects.
2 Select Edit > Duplicate. Maya positions the copy of the object behind the original
object. You cannot see it until you move it.
3 To move the duplicate object from behind the original, click the Move Tool on the
Tool Box. The object displays four manipulators.
4 Drag the object to move it from behind the original object. Maya deselects the
original object.
If you specified more than one copy (see "Setting duplicating options" on page 74),
click on the original with the Move tool and drag the manipulators. Repeat until all
copies appear in the view.
Note
The default for Translate and Rotate is 0.0000. The default for Scale is
1.0000. With the default values, Maya places the copy on top of the original
geometry. You can specify offset values (positive or negative floating
point) for translation, rotation, and scaling that are then applied to the
copied geometry.
Number of
Copies Specify the number of copies to create. The range is from 1 to 1000.
Geometry Type Select how you want the selected object(s) duplicated.
Copy Make a copy of the geometry being duplicated.
Instance Create an instance of the geometry being duplicated. When you create an
instance, you do not create actual copies of the selected geometry. Instead, Maya
redisplays the geometry being instanced. For more information, see "Creating
instances of objects" on page 76.
Group under Group objects under one of the following:
Parent Groups the selected objects under their lowest common parent in the
hierarchy.
World Groups the selected objects under the world (at the top level of the
hierarchy).
NewGroup Create a new group node for the duplicates.
Smart Transform Turn Smart Transform on so that when you duplicate and transform a single copy or
instance of the object (without changing the selection), Maya applies the same
transformations to all subsequent duplicates of the selected duplicate.
Tip
As a shortcut for duplicating with Smart Transform on, use
Edit > Duplicate with Transform.
...and you select D and use the Duplicate Upstream Graph option, the resultant
graph will be as follows:
A1 > B1 > C1 > D1
(where A1, B1, C1, and D1 are duplicates of A, B, C, and D respectively).
Duplicate Input Connections
Turn this option on so that in addition to duplicating the selected node, the
connections feeding into the selected node are also duplicated.
For example, if A, B, and C are connections feeding into C...
A > B > C
...and you select C and use the Duplicate Input Connections option, then the
resultant graph will be as follows:
A > B > C and
A > B > C1
(where C1 is a duplicate of C).
Note
If you move a CV on the original geometry, it affects the shape of all
instances of that object.
Instanced geometry does not display CVs or hull structure. The form of an
instance can only be altered from the original geometry.
You can create several instanced copies of the original object, rather than just
copying it. If you then make a change to the original object, all instanced copies
automatically reflect the same change.
Since instances are not actual copies of the original geometry, they take up less
system memory than actual copies. In large or complex model scenes, instancing can
speed up refresh time, reduce the size of data files, and improve rendering times.
Limitations
There are a few limitations when using instancing:
Instanced lights have no effect.
Instances share the same shader as the original geometry and cannot be assigned
independent shaders.
Some functions, such as extrude and insert, cannot be used on instanced items. In
these cases, you must make a true copy of the instanced geometry that you want to
manipulate, then continue with the function.
You can only apply clusters and deformation frames to the original geometryyou
cannot assign them independently to instances. To use clusters and deformations on
copies, you must make a true copy of the geometry.
There is always at least one non-instanced transformation node between the instance
nodes and the actual geometry nodes.
When you create an instance of an already instanced node, Maya does not create a
new level.
Sphere2, an instance of
Sphere1, has two nodes:
the transform node
(independent)
and the geometry node (shared
with Sphere1)
Grouping objects
Group a number of objects into a more complex object so that transformations can be
applied to all of them at oncein effect, treating many objects as a single object for
transformation purposes.
2 Select Edit > Group. The objects are now part of a group, according to the defined
grouping options.
Ungrouping objects
Ungroup lets you separate parts of a group and remove nodes from a hierarchy. You
can then work with each object on an individual basis.
To ungroup objects:
1 Select a group.
Tip
If your scene is comprised of many groups, use the Hypergraph to help
you select a group. See "Using the Hypergraph" on page 263.
2 Select Edit > Ungroup. Maya puts all objects at world level.
3 Click anywhere in the display to deselect the objects.
Tip
You can also create an empty group by selecting Edit > Group with no
objects selected.
Note
In the Outliner and Hypergraph, you can drag and drop one object on top
of another to parent it.
Parenting objects
When you parent an object, you make it part of a hierarchy.
To create a parent:
1 Select the objects you want to make up the parent/child relationship. Select the
children first, and the parent last.
2 Select Edit > Parent . The Parent Options window opens.
3 Set the following options and click Parent.
Parent Method Select what you want done with the selected object:
Move Objects Move the object from its current parent to the new parent (the last
selected object).
Add Instance Create an instance under the new group instead of moving the object.
Preserve
Position Turn Preserve Position on to preserve the overall world-space position by changing
the parented objects transformation matrix.
Note
If two objects are selected, the first object goes under the one selected last.
Unparenting objects
When unparenting an object from a group, you can remove it from the hierarchy and
put it into world space. If it is an instance, you can delete it altogether.
To unparent an object:
1 Select the child object.
2 Select Edit > Unparent . The Unparent Options window opens.
3 Set the following options and click Unparent.
Unparent
Method Select how you want to unparent the selected object:
Parent to World Remove the object from its current parent and place it under the
world.
Remove Instance Remove a particular instance instead of moving the object.
Preserve
Position Turn Preserve Position on to preserve overall world-space position by modifying the
parented objects transformation matrix.
To reverse an action:
Select Edit > Undo.
Note
To set how many levels of Undo you want, select Window > Settings/
Preferences > Preferences, Undo category, and set the Queue Size. Note
that a large Queue Size slows Mayas performance.
After you build your curves, surfaces, and objects, you are ready to position them in
3D space. This chapter describes how you scale, rotate, and move your objects.
Equivalent keys
Select Tool q
Lasso Tool
Move Tool w
Rotate Tool e
Scale Tool r
The q, w, e, r, t, and y hotkeys correspond to the Tool Box icons, as shown above.
When you press the w key and drag with the left mouse button, a marking menu
appears for the Move manipulator. Similarly, you can display marking menus for
using the e key (for Rotate) and r key (for Scale). The marking menu options are
another way to select manipulator handles.
USING MANIPULATORS
Manipulators provide a visual and interactive way to change an objects parameters.
You use manipulators to directly position and scale objects in the workspace.
Many tools have manipulators. Usually, a tool creates a manipulator when you open
the tool and deletes the manipulator when you exit it. (However, there are some
exceptions to this.)
When you use a manipulator to change parameter values, the Help Line displays the
values as they change.
You can also change parameter values by entering them in the Numeric Input field
(at the top right of the window). For details, see "Entering numeric values" on page
98.
Y handle
Center handle
Z handle X handle
transform tab
Pivots options
pivot point
3 Press the Insert key again to display the transform manipulator and drag to
transform the object.
rotate manipulator
Unpinned Pinned
pivot point pivot point
Note
The component pivot remains pinned in its position until you return to
edit mode (using the Insert key) and unpin it.
To unpin (or unlock) a pivot and return it to default auto-centering
mode, click the pinned pivot manipulator.
What is an axis?
An axis is a straight line that indicates the origin and direction. For example, by
using two axes, a plane is defined: the XY plane is defined by placing X and Y axes
so they intersect at the origin. Three dimensions are defined by using three axes: X,
Y, and Z.
Command Action
toggleAxis -v true; displays the axis at the bottom left of each view
toggleAxis -v false; hides the axis at the bottom left of each view
MOVING OBJECTS
The following procedure describes how you use manipulators to move an object:
3 Click-drag one of the handles, as indicated above. The selected handle changes color
when active. The default color is yellow.
To move the object along a single axis, select and drag the handle for that axis.
To move the object freely along all axes, select and drag the center handle of the
manipulator.
Tip
Another way to restrict movement to one axis is to press the Shift key and
drag using the middle mouse button. This is faster than clicking on the
manipulator to switch between specific handles.
Tip
For all manipulators, the middle mouse button controls the active
manipulator handle.
By default, the Move manipulator moves along the plane of the view. In the
perspective view, you also use it to move in the XY, YZ, or XZ planes.
To move in the XZ plane, Ctrl-click the Y handle. The current plane for the center
handle becomes the XZ plane. The center handle now moves the object in the XZ
plane (keeping the Y translation value constant).
To move in the YZ plane, Ctrl-click the X handle.
To move in the XY plane, Ctrl-click the Z handle.
If the current plane is the XZ plane (or YZ or XY) and you want to move in the view
plane, Ctrl-click the center handle.
When a snap mode is turned on, the manipulator center changes to a circle. This
indicates that the manipulator snaps instead of moving freely in the current plane.
Moving tips
Here are a few tips to help you move an object:
The Selection Mask options window controls what types of items you can move. For
example, if CVs are turned on and all other components are turned off, only CVs can
be selected and moved.
To change an objects shape, you can move CVs independently of the objects they are
in.
When you transform an object, the center of the manipulator is the center of the
current selections bounding box. It acts as a temporary pivot. To move the pivot
point, see "Moving pivot points" on page 85.
To specify an option:
1 Double-click the Move Tool icon in the Tool Box.
or
Select Modify > Transformation Tools > Move Tool .
The Tool Settings window opens.
When you select Normal, the Update [UVN] Triad checkbox appears. Turned on,
this option causes the manipulator orientation to reflect the moved surface rather
than the original surface. This is the default. Turned off, the manipulator retains the
orientation for the original surface.
You can also move a curve on surface entirely off the surface. Since it is mapped only
to the UV parameter space of a surface, once the curve or any portion of the curve is
moved off the surface, it is no longer displayed.
Similarly, if you move an edit point on a curve on surface element off the surface, the
edit point and curve spans affected by that edit point are no longer displayed.
ROTATING OBJECTS
Use the Rotate Tool to rotate objects about any or all three axes.
To rotate an object:
1 Click the Rotate Tool icon in the Tool Box.
2 Select the object you want to rotate. Maya displays a rotate manipulator consisting of
four rings (handles), plus a virtual sphere enclosed by the rings. The colors of the
handles correspond to the XYZ axes.
3 Click-drag one of the handles, as indicated above. The selected handle changes color
when active. The default color is yellow.
Use the X, Y, and Z rings to perform constrained rotations. Use the outer ring to
rotate relative to the view. For example, in the front view, the view ring rotates the
object in the XY plane. The virtual sphere is used to rotate in X, Y, and Z.
When you rotate a component, Maya rotates it about a temporary pivot which is
initially set to the center of the components bounding box. For information on
moving the pivot, see "Moving pivot points" on page 85.
To specify an option:
1 Double-click the Rotate Tool icon in the Tool Box. The Tool Settings window opens.
2 Select a Rotate Mode option, and if desired, turn on Snapping and specify a Snap to
Value, and then click Close.
Local Rotates the object about the object space axes.
Global Rotates the object about the world space XYZ axes. Notice that in this mode the rings
never change.
Gimbal Changes only the X, Y, or Z rotation value. In the local and global modes, the XYZ
constraint rings may change more than one of the rotation XYZ channels.
Snapping When Snapping is turned on and you rotate an object using one of the Rotate Tool
handles, the object snaps to increments of the Snap to Value. For example, if you
specify the Snap to Value as 5.0 and the current rotateX value is 2.25, dragging the
rotateX handle of the manipulator will snap the current rotation value to 0.0 and
then subsequent dragging of the rotateX handle will jump in units of 5.0. While
snapping works in Local, Global, and Gimbal modes, only Gimbal is guaranteed to
modify just the Channel Box attribute associated with the current handle. (In the
other two modes, you could see all three values changing as you rotate a given
handle. In these cases, snapping 5.0 degrees may not always result in nice round
numbers in the Channel Box, even though the object will appear to snap by 5.0
degrees.) To rotate without snapping, turn Snapping off. Snapping is turned off by
default.
Note
To momentarily turn Snapping on or off you can use the j key. Press the j
key and then rotate the object. If Snapping is turned on in the Rotate Tool
Settings window, then pressing j will turn it off while rotating the object. If
Snapping is turned off, then pressing j will turn it on while rotating the
object. When you release the j key, Snapping is restored to what it was in
the Rotate Tool Settings window. The snapping increment used is the value
that was last specified for the Snap to Value option in the Rotate Tool
Settings window.
Keep in mind that these attributes have a combined effect with the Rotate Mode
settings in the rotate Tool Settings.
SCALING OBJECTS
Use the Scale Tool to change the size of objects by scaling proportionally in all three
dimensions. You can also scale non-proportionally in one dimension at a time.
To scale an object:
1 Click the Scale Tool icon in the Tool Box.
2 Select the object you want to scale. Maya displays a scaling manipulator that consists
of four handles. The colors of the handles correspond to the XYZ axes.
Drag to scale in
the Y direction
Drag to scale
proportionally
Tip
A useful shortcut for non-proportional scaling in X, Y, or Z is to use the
Shift key. Hold the Shift key down, then, using the middle mouse button,
drag along the direction of the axis you would like to scale in. This is faster
because you don't need to click directly on the specific handle to switch
between scaling in X, Y, or Z.
or
From the History list menu in the Status Line, select the history node.
or
From the Channel Box, select the history node.
In the following example, the history nodes for a revolved surface and the curve
used to construct it are selected. Click revolve1 to select the history node for the
revolved surface.
Once you select the history nodes and the Show Manipulator Tool, manipulators
display on the surface or the construction curve. To interactively edit these nodes,
click-drag the manipulator handles, or change the values in the Channel Box or the
Attribute Editor.
Note
Some options windows include a Keep Original checkbox (for example,
Edit Curves > Detach Curves). Turn this on to access the manipulators.
For details, see "Displaying camera and light manipulators" on page 128.
For example, if an object is positioned at XYZ coordinates (4, 2, 2) and you move the
object by entering an absolute value of:
6 3 1
...in the numeric input field, the new position of the object is (6, 3, 1).
You can omit trailing zero values. For example, you can type:
2 3 0
or
2 3
...to move an object to (2, 3, 0).
To move or scale an object on only one or two of the axes without affecting the other
axis, you must re-enter the current values you dont want to affect. For example, to
move an object from its location at (2,3,1) to (4,4,1), enter the absolute move values:
4 4 1
Similarly, if an object is scaled by a factor of 5 on all three axes and you want to
change the scale on the x-axis to a factor of 6, enter the scale factors:
6 5 5
Note
If you select more than one object, Maya displays the manipulator on only
one object. However, each object moves, scales, or rotates relative to its
own pivot point.
3 To transform the object by an absolute amount (the default), type the XYZ
coordinates in the Numeric Input field and press Enter, or type -a before the value
and press Enter, for example:
-a 1 7 4
To transform an object by a relative amount, select Relative from the Numeric Input
fields drop-down list to switch to rel, then enter the value, or type -r before the
value and press Enter, for example:
-r 2 6 3
COMBINING TRANSFORMATIONS
You can use the combined Move/Rotate/Scale manipulator to switch between
moving, rotating, and scaling. When you first select this Tool, only part of each
manipulator is displayed. To see the complete manipulator, click one of its handles.
To transform the object, click-drag the appropriate handle. For more information, see
"Moving objects" on page 88, "Rotating objects" on page 92, or "Scaling objects" on
page 94.
Note
When you use the combined transformation tool, the transformations occur
with respect to object space only.
You can reposition the manipulator in another part of the scene to achieve different
effects on the selected objects.
4 Click-drag to position the manipulator, then drag the green handle to move the CVs
on the curves.
Distance Cutoff Objects further away than this value are ignored. The distance is measured in 3D
from the manipulator handle.
Distance Based
On The distance from the manipulator handle to the object directly influences the
modification factor. The distance will be computed along the selected axes only. If
any of these is turned off, the distance used in the computation of the propmod
effect from the handle to the point will ignore that component.
Distance Cutoff Objects further away than this value are ignored. The distance is measured in 3D
from the manipulator handle.
Degree Specifies the degree of effect in the U and V directions. A value of 0 applies the
transformation equally over the entire region.
A positive value decreases the effect of the transformation for objects further away
from the manipulator handle; the greater the degree, the greater this dampening
effect.
If Degree is negative, the effect of the transformation is increased for objects further
away from the manipulator handle.
Distance Based
On The distance from the manipulator handle to the object directly influences the
modification factor. The distance is computed along the selected axes only.
User defined
script The script should return a modification factor. The inputs to the script are float
numbers. The first three represent the position of the manipulator handle. The
second three represent the position of the point manipulated. For example, the
points for which this script returns 1 will move with the manipulator handle. The
points for which this script returns 0.5 will move half as fast as the manipulator
handle.
For more information, see "Using the PropMod script" on page 105.
Anim Curve Enter the name of an existing animation curve. Its vertical direction will map into the
modification factor. The distance maps to the anim curve time axis (in seconds).
You can use the pull-down menu to the right of the box to list and choose all the
anim curves with names starting with propModAnimCurve. You can also create one of
those by choosing Create New from the same pull-down menu.
Distance Based
On The distance from the manipulator handle to the object directly influences the
modification factor. The distance is computed along the selected axes only.
NURBS Curve
This option uses an NURBS curve to create the falloff. A NURBS curve profile can be
used to produce a modification factor.
NURBS Curve Enter the name of an existing NURBS curve. Its vertical direction will map into the
modification factor. The distance maps to the NURBS curve.
You can use the pull-down menu to the right of the box to list and choose from all
the NURBS curves.
Example
Create myPropMove.mel file as:
global proc float myPropMove(float $mx, float $my,
float $mz, float $px,
float $py, float $pz)
}
return rand (1.0)
}
CREATING LOCATORS
A locator marks a position in world space. A locator is displayed as a small gnomon;
its lines extend in each direction along the X, Y and Z axes (like the directional rods
of a sundial). You can use point snapping to snap to a locator position.
Use Create > Locator to create a space or curve locator.
The following example shows the distance locator when one point is placed in world
space and the other is placed on the surface.
The following example shows the distance locator when two points are placed on a
curve.
Normal
Normal
Curve direction
Surface direction
For surfaces, the parameter value displays the U and V values at the specified point.
If you create another locator, the previous locator is dimmed. This means that you
can move it later if you need to.
In the following example, the first figure shows the parameter locator on a surface at
the position where it was created. The second figure shows how the locator is
modified when you change the U and V Param Values.
Normal Normal
For curves, the distance of the specified point from the start point of the curve is
measured.
For surfaces, the specified point from the start point in both the U and V direction is
measured.
If you create another locator, the previous locator dims, meaning you can select to
move it later if you want.
In the following example, the first figure shows the arc length locator on a surface at
the position where it was created. The second figure shows how the locator is
modified when the U and V Param Values are changed.
This chapter describes the tools and actions you use to display or hide objects and
attributes. You can use these tools to customize your working environment and
reduce workspace complexity.
Tip
You can also control the display of many items from the Attribute Editor.
See "Using the Attribute Editor" on page 222.
USING A GRID
A grid is a 2D plane that represents 3D dimensions in the view. You can use grids to
help animate relative to a solid surface. For example, you could use a grid to help
plan the foot positions of a person walking on the ground. You can also use a grid to
construct skeletons, because you can snap grid coordinates on and off to precisely
position joints.
You can hide the grid when you need to reduce visual clutter. For example, if you
have animated a character walking across a floor and want to view the surface
texture, you can turn off the grid when youre ready to fine-tune the placement of the
characters feet.
Note
The default grid is a 24 x 24 unit grid displayed in the XZ plane.
Tip
Have at least one modeling window open when changing the Grid option.
This lets you view the changes interactively.
Size
Weve changed the Size options to clarify their function. You can change the size and
length of the grid, set the number of subdivision lines, and the increment for the grid
lines.
Length and
Width Sets the number of units for the length and width of the grid. The default is 12 units.
Grid Lines Every Displays every nth grid line. The default is 5 units.
Subdivisions Specifies the number of divisions between major grid lines. Setting the Subdivisions
option to a value greater than 1 specifies that each main grid interval will be
subdivided by the amount specified. The default is 5.
Color
You can change the color of the axes, grid lines and labels, and subdivision lines.
Axes Specifies a color for the X and Z axes on the grid. The default is dark grey.
Grid Lines & Numbers
Specifies a color for the grid lines and the grid line numbers. The default is light
grey.
Subdivision
Lines Specifies a color for the subdivision lines. The default is light grey.
Note
You can also change the color of the axes, grid lines and numbers, and
subdivision lines in the Colors window (Window > Settings/Preferences >
Colors). Go to the Inactive tab and then the Modeling category to find these
color options. Here you can also change the color of the X-, Y-, and Z-axis
that appear in the Origin and View axes.
Display
You can turn on and off the display of grid elements, including axes, thicker lines for
axes, grid lines, subdivision lines, and grid line numbers.
Axes Turns on or off the display of the axes. The default is on.
Thicker Line for Axes
Turns on or off the display of thicker lines for the axes. The default is on.
Grid Lines Turns on or off the display of the grid lines. The default is on.
Subdivision
Lines Turns on or off the display of the subdivision lines. The default is on.
Perspective Grid Numbers
In the Perspective view, you can set the grid line numbers to display on the axes,
along the edge of the grid, or just hide them.
Orthographic Grid Numbers
In the Orthographic views (top, side, front), you can set the grid line numbers to
display on the axes, along the edge of the grid, or just hide them.
Hide Hides the grid line numbers. This is the default for both
Perspective and Orthographic Grid Numbers.
On Axes Displays the grid line numbers along the axes.
Along Edge Displays the grid line numbers along the edge of the grid.
Note
To restore the default grid option settings, select Edit, Reset Settings in the
Grid Options window. However, this does not restore the default grid
color settings. To restore the default colors, go to the Colors window
(Window > Settings/Preferences > Colors) and select Edit, Reset to
Defaults. Please note that this restores all color defaults, including the grid
colors.
Poly
Count Object
Details
Origin Axis
View Axis
Camera
Names
Animation
Details
Tips
You can also change the color of the labels and values for the Heads Up
Display options. See "Changing color settings" on page 330.
You can also customize the Heads Up Display by adding your own
information. For more information, see Using Maya: MEL.
Note
To change the colors in the Wireframe Color dialog box you can also use
the Colors window (Window > Settings/Preferences > Colors). Go to the
General tab and expand the User Defined category to view and change the
eight color swatches.
To reset the colors in the Wireframe Color dialog box to the default:
1 Select Window > Settings/Preferences > Colors. The Colors window opens.
2 Select Edit > Reset to Defaults and then close the Colors window.
Warning
If you reset the Colors window to the defaults, this affects all color changes
in the Colors window.
Note
To see bounding box coordinates, open the Attribute Editor, click on the
shape node tab, and open the Object Display section. It shows the read-
only minimum and maximum world space boundary coordinates of a
surface along the X, Y, and Z axes.
Wireframe isoparms
appear over the
shaded objects
X-Ray Displays all shaded objects as semi-transparent. This can be useful for seeing
hidden parts of a model.
Interactive
Shading Controls the display of objects during interactive modes (such as transformations,
camera navigation, and playbacks). At the same time the normal display can be in
some sort of shaded mode. For example, the normal display can be smooth-shaded
while the interactive display is bounding box. There are four interactive shading
options:
Normal Keeps the interactive mode the same as regular display mode.
Wireframe Displays objects in wireframe mode during the interactive mode.
Bounding Box Displays objects as bounding boxes during the interactive mode.
Points Displays objects as points during the interactive mode.
Color Index
Mode On UNIX only, lets you manipulate a wireframe object in a complex scene more
quickly (for example, if you are using a full-color image plane while working in
wireframe mode).
Dense Wireframe Acceleration
On Windows only, lets you manipulate a wireframe object in a complex scene more
quickly. For example, suppose you have created a saloon scene with many objects.
When you use the Move tool to move a bottle in the scene, it moves slowly as you
drag the mouse. You can improve the interactive manipulation of the bottle with this
menu option.
Tip
When you use the Dense Wireframe Acceleration option, be aware of the
following:
Results vary with the graphics card installed in your
workstation.
Manipulation of wireframe objects in simple scenes is
slower.
Camera tumbling is unaffected.
Backface
Culling For objects displayed in smooth shade or flat shade mode, makes the objects back
face transparent which helps speed the display or manipulation of objects.
Hardware
Texturing Displays Maya's hardware textured rendered results as if they were being displayed
in an external viewer.
Hardware Fog Simulates hardware fog effects achievable in programs outside of Maya. Displays
how a spotlight's fog is distributed before you render. Used for preview purposes,
Hardware Fog only displays in the perspective view.
Apply Current to
All Applies the current 3D view's shading style to all objects in the scene.
Tip
It is possible to use selective CV display on more than one surface at a
time.
The selective CV display function operates exclusively from other Maya Hide and
Show commands, and therefore menu selections such as Display > Show > All and
others do not effect CVs whose display has been set using selective CV display.
All Hides all objects, whether they are selected or not.
Hide Geometry Displays a menu that lets you select the type of geometry you want to hide.
Hide
Kinematics Displays a menu that lets you select the type of kinematics you want to hide.
Hide Deformers Displays a menu that lets you select the type of deformers you want to hide.
Hide Cloth Available only if you have Maya Unlimited and are using Maya Cloth. Hides cloth
objects. For details, see Using Maya: Cloth.
Lights Hides lights.
Cameras Hides cameras.
Texture
Placements Hides texture placements.
Planes Hides planes.
Animation
Markers Hides animation markers.
Light
Manipulators Hides light manipulators.
Camera Manipulators
Hides camera manipulators.
Hiding geometry
Geometry represents the properties and relations of points, lines, surfaces, and
objects. You can hide a variety of geometry components.
To hide geometry:
1 Select an object.
2 Select Display > Hide > Hide Geometry and select the geometry components you
want to hide. You can hide NURBS Surfaces, NURBS Curves, Polygon Surfaces,
Deforming Geometry, Subdiv Surfaces, Strokes, Stroke Path Curves, and Stroke
Control Curves. If you select All, all geometry is hidden, whether it is selected or not.
Maya displays the object with the specified component hidden.
In the following illustration, the NURBS surfaces associated with a sample object are
hidden.
NURBS surfaces
shown
NURBS surfaces
hidden
Hiding kinematics
Kinematics is the study of motion without consideration to the cause of that motion.
You can hide and show kinematic components.
For information on kinematics, see Using Maya: Character Setup.
Joints shown
Joints hidden
Hiding deformers
Deformers are operations you apply to one or more geometry objects to change their
shape. You use the Hide and Show Deformers menus to control the display of the
influence objects for some deformation types. This helps reduce clutter when
you're not actively editing those parts of your scene.
For information on deformers, see Using Maya: Character Setup.
To hide a deformer:
1 Select an object.
2 Select Display > Hide > Hide Deformers and select the components you want to
hide. You can hide Lattices, Sculpt Objects, Clusters, Nonlinears, Wrap Influences,
and Smooth Skin Influences. If you select All, all deformers are hidden, whether they
are selected or not.
Maya displays the object with the specified deformer hidden.
In the following illustration, the objects clusters are hidden.
Clusters shown
Clusters hidden
Isolate Select works on a per-panel basis for any view panel (perspective or
orthographic). The components you can select for isolation are:
CVs of NURBS surfaces
faces of a polygon mesh
faces of a subdivision surface mesh
Other components cannot be selected for isolation, such as NURBS patches, curve
segments, particles, or lattice points. However, you can still see and manipulate
other component types within the items you have isolated.
Use the Show > Isolate Select menu to control the isolate select feature. The menu
options are described below.
Tip
Keep open at least one other workspace panel with isolate select turned off
so you can select other items. Also, tearing off the Isolate Select submenu
gives you quick access to these commands.
View Selected Activates or deactivates the isolate select feature. When activated, the word Isolate
appears at the bottom of the panel and the current selection becomes isolated.
Backfaces No backfaces
Lattice Points If you selected a lattice deformer (an L icon represents a lattice deformer handle),
turns on or off the display of the lattice points. For information on lattices, see Using
Maya: Character Setup.
Lattice Shape If you selected a lattice deformer, turns on or off the display of the objects lattice
shape. The lattice deformer switches between displaying its lattices and the L icon.
For information on lattices, see Using Maya: Character Setup.
Local Rotation
Axes Turns on or off the display of the objects local rotation axes. For information on
axes, see "Using axes and pivot points" on page 84.
Rotate Pivots Turns on or off the display of the objects rotate pivots. For information on pivot
points, see "Using axes and pivot points" on page 84.
Scale Pivots Turns on or off the display of the objects scale pivots. For information on pivot
points, see "Using axes and pivot points" on page 84.
Selection
Handles Turns on or off the display of selection handles on manipulators. For information on
manipulator selection handles, see "About manipulator handles" on page 84.
For details on using these submenus, see the appropriate modeling book: Using
Maya: NURBS Modeling, Using Maya: Polygonal Modeling, or Using Maya: Subdivision
Surfaces Modeling.
Clipping Panes
Pivot
Center of Interest
Center of
Interest Turns on or off the display of the cameras center of interest manipulator.
Pivot Turns on or off the display of the cameras pivot.
Clipping Planes Turns on or off the display of the cameras clipping planes.
Cycling Index Turns on or off the display of the cameras cycling index. By clicking on this control,
you can cycle through the available manipulator controls one at a time for the
selected camera.
Decay regions
(numbered rings)
Pivot
Cone Angle
Center of Interest
Penumbra
Cycling Index
Center of
Interest Turns on or off the display of a lights center of interest manipulator.
Pivot Turns on or off the display of a lights pivot.
Cone Angle Turns on or off the display of a lights cone angle.
Penumbra Turns on or off the display of a lights Penumbra.
Look through Barn Doors
Barn doors are doors or shutters fitted on the spotlight, which let you create a square
spot effect. Shows the view through the spotlights barn doors. These manipulators
appear when you are in Render View or are looking through the selected light
(Panels > Look Through Selected).
Decay Regions Turns on or off the display of a lights decay regions.
Cycling Index Turns on or off the display of the lights cycling index. By clicking on this control,
you can cycle through the available manipulator controls for the selected light one at
a time.
For more information about creating lights and editing light attributes, see Using
Maya: Rendering.
USING LAYERS
There are two types of layers: display layers and render layers.
A display layer is a collection of objects that you can quickly select, hide, or template
separate from other, distracting objects in the scene. For example, you can add a
group of trees to a display layer and hide them so they dont distract you from
viewing another part of the scene. Or you could create a template layer for the house
of some creatures youre modeling so the house is visible as a size reference, but is
not selectable. Display layers apply specifically to how objects display in the scene
view. For more information, see "Editing display layers" on page 134.
A render layer is a collection of objects that you can quickly render in separate
passes, giving you more flexibility when the shot is composited. Once you have
render layers set up, you can take advantage of the Render Layer/Pass Control
settings in the Render Globals. For more information on these settings, see Using
Maya: Rendering.Render layers apply specifically to rendering. For more information,
see "Editing render layers" on page 137.
You can use the Layer Editor to create and manage display and render layers.
Increase or
decrease width of
the Layer Editor
Note
To edit or work with multiple layers, select them and then select the Layer
menu. Please note that if you right-click a layer, your pop-up menu
selection will only affect the layer beneath the mouse pointer.
Create Layer Creates a new display layer or render layer, depending on the selection in the pull-
down menu, with a default name, for example layer1.
Delete Deletes the selected layer(s), but not the objects in the layer.
Edit Layer Opens the Edit Layer window for the selected layer(s) so you can edit layer
attributes.
Select Objects Selects the objects contained in the selected layer(s).
Add Selected Objects
Adds the selected objects to the selected layer.
Remove
Objects Removes all objects from the selected layer(s) and assigns them to the default layer.
The selected layer(s) becomes empty so you can assign other objects.
Attributes Opens the Attribute Editor for the selected layer(s). There are some attributes in the
Attribute Editor not available through the Edit Layer window. See "Editing display
layers" on page 134 and "Editing render layers" on page 137.
Membership Opens the Relationship Editor for removing or adding objects to layers.
2 Assign objects to the layer; see the next topic Assigning objects to layers.
Note
You can turn on or off Make New Layers Current in the Layer Editors
Options menu. When this setting is on, you can create a new layer and
Maya changes it to be the current layer. When this setting is off, the default
layer remains the current layer, unless you select a different current layer
in the layer attributes.
To name a layer:
1 In the Layer Editor, double-click the layer you want to name. The Edit Layer
window appears.
2 Type a new name in the Name text box and click Save.
2 In the Layer Editor, select the target layer and then select Layers > Add Selected
Objects to Current Layer.
or
Right-click the target layer and select Add Selected Objects from the pop-up menu.
Note
If the selected object already belongs to a layer, the object is transferred
from its layer to the newly assigned layer.
Deleting layers
You can delete a layer that has objects assigned to it or you can delete an unused
layer.
To delete a layer:
1 Select the layer(s) in the Layer Editor.
2 Select Layer > Delete Selected Layer(s). The layer is removed from the Layer Editor.
If the layer had objects assigned to it, they are now assigned to the default layer.
Note
To delete unused layers, select Layer > Select Unused Layers and then
select Layer > Delete Selected Layer(s).
Editing layers
You can change layer attributes directly in the Layer Editor by clicking on the layer
swatches or you can use Edit Layer window. Display layers and render layers have
unique attributes. For details on editing display layers, see "Editing display layers"
on page 134. For details on editing render layers, see "Editing render layers" on page
137.
Note
To rename a display layer, see "To name a layer:" on page 132.
Note
Each scene has a default layer that consists of all objects that have not been
assigned to any other layer. When you remove an object from a layer, it
becomes a member of the default layer.
Note
If you change the color of objects in a display layer, the objects color
change appears in the scene only if these objects are part of a Normal layer.
Color changes do not affect objects in the default layer, in a Template layer,
or in a Reference layer.
Note
To rename a render layer, see "To name a layer:" on page 132.
Note
You cant change the color of render layer objects.
Renderable is on
Renderable is off
or
Right-click a render layer and select Edit Layer from the pop-up menu.
The Edit Layer window appears.
Maya has many features that help you build and position objects. This section
describes some of those features and tells how to use them.
For a comprehensive guide to modeling features, see Using Maya: NURBS Modeling,
Using Maya: Polygonal Modeling, and Using Maya: Subdivision Surfaces Modeling.
SNAPPING
The snap options let you control an object or components position by attaching it to
a grid, point, curve, or view plane. As you draw, rotate, resize, or drag the object, it
snaps to the grid, point, curve, or view plane.
Snapping icons
Four icons in the Status Line control snap mode as you move or rotate objects and
create curves:
s
a ne
pl
ap p es
vi ts
s
ew
v
to oin
Sn p to rid
Sn p t cur
a g
Sn p to
o
a
a
Sn
Snap to grids Snaps a vertex (CV or polygonal vertex) or pivot point to a grid corner. If you select
Snap to grids before you create a curve, its vertices snap to the grid corners. For more
information on CVs, see Using Maya: NURBS Modeling.
Snap to curves Snaps a vertex (CV or polygonal vertex) or pivot point to a curve or curve on surface.
Snap to points Snaps a vertex (CV or polygonal vertex) or pivot point to a point.
Snap to view
planes Snaps a vertex (CV or polygonal vertex) or pivot point to a view plane.
Snapping hotkeys
The hotkeys for snapping are:
x for grid snap
c for curve snap
v for point snap
Tip
To minimize the initial jump, click closer to (but not on) the center of the
manipulator. This is especially important if you are using a large arrow on
the manipulator.
To change the size of the manipulator arrows, press the = and - keys.
Tip
To avoid unintentional snapping, use the c hotkey instead of the Snap to
curves icon in the Status Line. See "To use the curve snap hotkey:" on page
141.
If you select two points on each object, the points define an axis snap, which means
the object will be rotated as well as translated. This technique is useful for orienting
one object with another along some arbitrary axis.
Tip
Use the shift key to select more than one point or object.
3 4
If you select three points on each object, you can specify exactly how the objects
should be aligned against eachother. For example, you could be modeling a house
and a roof and need to join the two parts together.
In addition, you can snap align a selection of objects to an axis or axes in 3D space
using the Align Objects Options window. See "To snap align objects:" on page 144.
Note
If the objects are part of a group(s), then you can control the alignment by
specifying the Object, Parent, or Grandparent option in the Options
window.
5 Select Modify > Snap Align Objects > Two Points to Two Points. The first selected
point snaps to the third selected point, and the axis defined in steps 1 and 2 lines up
with the axis defined in steps 3 and 4.
Align Mode You can select from one of five different alignment modes according to the objects
bounding boxes.
Min Aligns selected objects according to the minimum value of the
objects bounding boxes in the chosen axes.
Mid Aligns selected objects according to the middle value of the
objects bounding boxes in the chosen axes.
Max Aligns selected objects according to the maximum value of the
objects bounding boxes in the chosen axes.
Dist Aligns selected objects so the space between the their bounding
boxes is evenly distributed in the chosen axes.
Stack Aligns selected objects so their bounding boxes are positioned
adjacently in the chosen axes.
Align In You can select an axis or multiple axes in which to align the selected objects.
World X Sets the world X axis as the alignment axis.
World Y Sets the world Yaxis as the alignment axis.
World Z Sets the world Z axis as the alignment axis.
Align to You can use this pull-down menu to specify how to align objects in the Min, Mid,
and Max modes. This pull-down menu does not apply to the Dist (Distribute) or
Stack modes.
Selection
Average Uses the average minimum, middle, or maximum value of the
objects bounding boxes as the alignment reference.
Last Selected
Object Uses the minimum, middle, or maximum value of the bounding
box of the last selected object as the alignment reference.
The following are examples of using the Align Objects options.
Stack, World Y
LIMITING SELECTIONS
Because Maya works on a selection-based mode, picking items is critical to
modeling. If you forget what needs to be picked for a tool or an action, hold and
drag the mouse button over the menu item. The Help Line displays the type of
selection required for the current item.
You can limit the items you can select in the workspace to specific types of objects,
components, or hierarchy elements. By limiting object selection, you can avoid
unintentionally selecting a nearby object. Limiting object selection is also known as
creating a pick mask or selection mask.
2 Click the adjacent icon to display the Set the object selection mask pull-down menu
and select All Objects Off.
3 Turn on one of the following icons:
s
ns ou
s s a tio ics ing ane
le s es ce m m er ll
a nd oint urv urfa efor yna end isce
H J C S D D R M
To further limit the items you can select, click the right mouse button on the icon and
turn off the appropriate checkboxes.
4 Select the object. You can only select the type of object you have specified.
5 To return to the default selection mask, click the left-most icon in the Status Line
to display the Set the selection mask pull-down menu and select Initial Default.
Example
Suppose youve created a tubular object and want to select the joint chain within the
object.
Joint
2 Click the icon to the right and select All Objects Off.
5 To return to Mayas default selection mask, click the left-most icon in the Status
Line and select Initial Default.
e ion
Po
ag tat
er
Im o
an ca s
et
d lR
Lo dle
m
Pa ts
s
s
lls
Ha ts
ne
ce
ra
in
n
vo
Li Hu
Po
Fa
Pi
To further limit the items you can select, click the right mouse button on the icon and
turn off the appropriate checkboxes.
5 Select the component.
If you didnt previously select the object containing the component, the objects
components will be displayed but not selected. Select the component again.
Maya selects only the specified type of component.
6 To return to Mayas default selection mask, click the left-most icon in the Status
Line to display the Set the selection mask pull-down menu and select Initial Default.
You can apply global selections to the entire selected surface. With the click of a
button, you can select, unselect, or toggle the selection all the components on a
surface.
4 In the Paint Operation section, select a paint operation (Select, Unselect, or Toggle)
and then drag the brush across the surface.
or
To select, unselect, or toggle the selection of all the faces on the selected surface, click
Select All, Unselect All, or Toggle All, respectively.
For details, see "Paint Operations" on page 149.
Tip
You can define hotkey combinations to change most of the settings without
opening the Tool Settings editor. For details on setting hotkey
combinations, see Defining Artisan hotkeys in Using Maya: Painting.
Paint Operations
Select a paint operation and paint, or click a paint operation button to perform the
operation.
Paint Operation Select one of the following paint operations.
Select Selects painted components.
Unselect Unselects selected painted components.
Toggle Unselects selected components and selects unselected components.
Tips
To unselect selected components while Select is chosen, press the
Ctrl key and paint over them. Similarly, when Unselect is chosen,
press the Ctrl key and paint to select unselected components.
Press u + left mouse button and select the paint operation from the
marking menu instead of the from the Tool Settings editor.
Leaf
Root
or
Click the adjacent icon to display the Set the hierarchy selection mask pull-down
menu and select Root or Leaf.
3 Select the object. Notice you can select only a root or leaf object.
4 To return to Mayas default selection mask, click the left-most icon in the Status
Line to display the Set the selection mask pull-down menu and select Initial Default.
Template
or
Click the adjacent icon to display the Set the hierarchy selection mask pull-down
menu and select Template.
3 Select the object. Maya selects only a template object.
4 To return to Mayas default selection mask, click the left-most icon in the Status
Line to display the Set the selection mask pull-down menu and select Initial Default.
1 If the Set the selection mask pull-down menu icon isnt showing, expand the
selection set icons on the Status Line.
2 Click the icon to display the Set the selection mask pull-down menu and select one
of these categories:
Animation
Polygons
NURBS
Deform
Dynamics
Rendering
This creates a selection mask that limits selection to the objects and components in
the chosen category.
3 Do one of the following:
To select an object in the chosen category, drag a selection box around the object.
To select a component in the chosen category, click the component directly. You
usually need to display components before you can select them. For example, to
select CVs, first select Display > NURBS Components > CVs to display them and the
select the desired CVs. If you drag the selection box around any of the CVs, you
select the CVs rather than the object.
Tip
You can customize the priority of object or component selection for
situations where you drag a selection box around multiple objects or
components.
To prioritize object selection:
1 Select Window > Settings/Preferences > Preferences
and choose the Selection category.
2 Select Custom from the PreSets pull-down menu.
3 Select an item in the Priority list.
4 Enter a priority number for the item in the data box.
Higher numbers have higher priority.
5 Click Save when done.
4 Click the adjacent icon to display the Set the (type) selection mask pull-down menu
and select Save to Shelf.
An icon labeled MEL appears on the shelf. If you click this icon, the selection
limitations take effect and the Status Line icons show the selection limitations.
You can change the MEL icon, as described in "Changing shelf icons" on page 345. If
you want to add an icon label, see "Setting Shelf options" on page 348.
Note
Construction history and future operations are synonomous with
construction inputs and outputs.
Tip
When you attach curves or animate CVs, turn construction history off or
you may get unexpected results.
Tip
If you animate CVs on an object that was created with history, do not
delete the objects history. The CV animation may not be correct and
unexpected results will occur.
2 Click either the construction inputs or outputs icon on the Status Line and
select the desired input or output from the pop-up menu.
3 Modify the inputs in the Channel Box or in the Attribute Editor.
2 Click either the construction inputs or outputs icon on the Status Line and
select Complete List from the pop-up menu. The List of History/Future Operations
window appears for the selected object.
3 Specify the options and then click Close.
Node State Select a node state from the pull-down menu.
Normal Displays the object/component normally.
Blocking Hides the object/component and disables it so its not included in
animation or rendering.
Filter Specify a filter option from the pull-down menu.
List The node is listed in the List of History/Future Operations
window.
Include The node is not listed in the List of History/Future Operations
window.
Tip
In the List of History/Future Operations window, in some cases you may
select and drag an item using the middle mouse button to rearrange the
items position in the list. You can use this procedure for deformers, but
not modeling operations.
Tip
Select an object and then press A and hold down the left mouse button on
the object to open a marking menu of history and future options.
Note
Only one object can be live at a time. The live object displays in a special
green color in wireframe mode to indicate its status.
2 Select Modify > Make Live or click the Make Live icon on the Status Line.
3 To turn off a live object, select Modify > Make Not Live or click the Make Live icon
again.
Notes
All creation tools respect a live surface. Actions do not.
You can use Make Live to place particles on an object's surface or on joints
and polygons.
When an object is live and the Move Tool is the current tool, the active
object snaps to the live object.
Notes
Setting up level of detail will not work if you specify
less than two levels of detail.
Different levels can come from different sets, layers,
and can be reference objects.
Level of Detail only supports discrete levels of detail.
For example, there is no blending between levels.
You can use NURBS, polygons, or subdivision surfaces
to create the different levels, and each level can use a
different geometry type if you want.
Note
Only one of the levels is visible at a time. The levels switch as you zoom in
and out.
Tip
You can also re-order a group by selecting Edit > Level of Detail >
Ungroup. Re-order the objects and create a new group.
Tip
You can also re-order a group by selecting Edit > Level of Detail >
Ungroup. Re-order the objects and create a new group.
Tip
Reset the Display Levels to uselod to return to the regular level of detail
behavior.
Maya includes many features to help you manage your files and projects. This
chapter describes how to create scenes, open and save scenes, import and export
files, how to create and edit projects, and what files formats are supported by Maya.
OPENING A SCENE
When you open a scene, Maya tries to read the scenes contents through a filter based
on currently supported file formats. For a list of file types you can open in Maya, see
"Supported file formats" on page 174.
To open a scene:
1 Select File > Open Scene.
Maya displays a file browser. When you start up Maya, the file browser
automatically goes to the scenes directory of your current project. For information on
setting projects, see "Creating projects" on page 171.
2 To display all the file types you can open, select Best Guess from the Files of type
pull-down menu (Windows only).
or
To display specific file types, select the file type from the Files of type pull-down
menu (Windows only).
3 Navigate to the file you want to open and click Open or double-click the file.
Note
Maya lists the files you have opened in the current Maya session on the
Recent Files submenu. You can open these files at any time during the
session by selecting File > Recent Files > filename.
General options
File Type Select the file format you want to use as a default for the next time you open a file.
If you have a project set up, when you open a scene, the browser points to the
directory containing files of that type. On Windows, it also sets the filter to display
only files of the selected type. See "Creating projects" on page 171 for information on
setting up projects.
For example, if you set File Type to DXF, when you open a scene, the Open window
displays the contents of CurrentProject/DXF. On Windows, it also sets your filter
type to DXF.
Depending on the File Type you select, various File Type Specific Options are
displayed.
Execute Script Nodes
Script nodes contain Mel scripts in mayaAscii or mayaBinary files. You can designate
a script node to execute its script when the node is read from a file, or before or after
rendering a frame. You can create and edit the script nodes using the Expression
Editor. See the chapter Using Script Nodes in the Using Maya: MEL book for
information on creating and editing script nodes.
User interface configuration information is stored inside the Maya scene file as an
attribute on a script node. If you disable the Execute Script Nodes option, the UI
script nodes are not executed. However, we recommend disabling script node
execution only if you have an error in your script.
Load Deferred References
Turn on the Load Deferred References option to load referenced files that may have
been unloaded. When you unload a reference, Maya removes the reference contents
from the scene but remembers how the reference was connected into the scene.
If you create a scene with references, unload some of them, and then save the scene,
you have created some deferred references. If you turn on the Load Deferred
References option, the deferred references are loaded when you open the scene. If
you turn off Load Deferred References, the deferred references are not loaded when
you open the scene.
Turn on Load Deferred References when rendering a scene in which the animators
were working with only part of the scene loaded when they saved the scene.
Move files
You must import move files (see "Importing move files" on page 177).
Anim files
You must import anim files ("Importing animation curves" on page 179).
SAVING FILES
You use Save Scene and Save Scene As to save the current scene, save the current
scene using a new name, or convert a file from Maya ASCII to Maya Binary and vice
versa. To convert a file into formats other than Maya ASCII and Maya Binary, use
the Export option ("Exporting files" on page 185).
Before you save, we recommend that you optimize scene size for improved
performance, memory use, and reduced use of disk space (File > Optimize > Scene
Size ). For details, see "Optimizing scene size" on page 168.
Note
If your scene includes referenced files, the Save Scene and Save Scene As
options save your current working file. The names of files youve imported
by reference do not change.
To convert a file:
1 Open the scene file.
2 Select File > Save Scene As.
3 Select mayaAscii or mayaBinary from Write As pull-down, depending on how you
want to convert the scene.
or
Select mayaAscii or mayaBinary from the Files of type pull-down menu (Windows).
4 Click Save. Maya saves the scene in the specified format.
Note
When the Limit Increment Saves checkbox is turned on, Incremental Save
stores only the limited number of incremental backup files. Once the limit
is reached, Maya deletes the oldest incremental file and replaces it with the
latest incremental backup file.
Note
In both the New Project and Edit Project windows, there is a Disk Cache
option in the list of Data Transfer Locations (File > Project > New, File >
Project > Edit Current). This allows you to set the default directory in
which to store the jiggle deformers disk cache files.
Use Verbose
Names Displays the full names of node attributes. For more information about using full
names see, "Setting Open options" on page 162.
Note
Your settings are saved so that when you select File > Optimize Scene Size,
the saved settings are used.
MANAGING PROJECTS
A project is a collection of one or more scene files. A project also includes files related
to the scene, such as texture files for rendering or geometry files for modeling. It
specifies the directories for the scene data and the search paths to use when
referencing files.
For example, if you were working on a project called Randy_the_Robot, you could
create a directory called robot to hold all the files related to that project, including
scene, sound, rendering, and animation. Placing all the files in one directory makes it
easier to manage the project, including referencing the files.
When you start Maya for the first time, it creates a default directory called default.
This directory contains default settings for all the subdirectories under default.
Default projects
directory
Tip
Absolute paths must always start with a drive letter (Windows) or slash
(UNIX). For example, C:\username\maya\projects\Storm\wind.
Tip
Normally, you should use a relative path. Special situations require an
absolute pathfor example, if you want to place all lights for all projects in
the same directory.
Multiple
directories
(Windows
example)
You can mix relative and absolute paths, as the above example illustrates. The entry
sourceimages is relative to the project directory, while g:\sharedimages is absolute.
Make sure to start absolute paths with either a slash (UNIX) or drive letter
(Windows).
Creating projects
You can structure a project file to suit the requirements of a particular project.
~This will
change.
User interface
field is going
away
2 Enter the name of the new project in the Name text box.
3 In the Location text box, enter or browse to the directory that will contain the new
project.
4 You can click Use Defaults to let Maya assign the default names for the following
location.
or
You can set the locations by typing them in and then click Accept.
Scenes Specifies the directory used to save scene files. This directory normally contains only
geometry information, unless you instruct Maya to put all of the information on the
file into this subdirectory. You can also use this text box to enter search criteria for
scene information. For more information, see "Multiple project directory paths" on
page 171.
Project Data
Locations Specifies the directories for files containing project textures, lights, source images,
images, and render scenes.
Data Transfer
Locations These locations specify the paths to the directories containing files in formats that
may require conversion.
Note
The location directories can be expanded using plug-ins. Each time you
add a plug-in, the New Project window displays the addition. You can
then specify the path to the plug-ins directory. For more information, see
"Using plug-ins for exporting" on page 188.
Note
If you leave a text box blank, Maya does not create a subdirectory. If you
create a scene using an unspecified project setting, Maya saves the
information in the project location directory.
Note
You cannot change the name or location of the project file.
To edit a project:
1 Select File > Project > Edit Current. The Edit Project window opens.
2 Click a triangle button to expand a section of directories related to the Scene, Project,
or Data Transfer file locations.
3 Make changes and then click Accept. Maya updates the information on the project
file.
Note
This works only if the original directory is missing. If the directory is there
but the file is missing, you will get a normal file not found error.
See the dirmap command in the online MEL command documentation for more
information.
audio audio files such Audio files for Various UNIX &
(various as WAVE and sampling in mono Windows
extensions) aiff or stereo.
IMPORTING FILES
Maya has built-in translators that let you import into Maya scenes and files created
in other applications. See "Supported file formats" on page 174 to see the types of
files you can import.
There are two ways to import a file:
You can copy the imported file into the current scene using File > Import. See
"Importing files by copying" on page 176 for details.
You can import the file by reference using File > Create Reference. When you import
by reference, Maya makes a link to the file rather than copying it. See "Importing
files by reference" on page 180 for details.
Since default nodes are always present in Maya, you dont need to create them when
you open a file. Only changes made to the defaults are saved. For more information
on default nodes, see Using Maya: Expressions.
To import by copying:
1 Select File > Import.
2 Navigate to the file you want to import.
3 Double-click the name of the file you want to import.
Maya copies the contents of the specified file into the current scene.
To resolve these naming conflicts, you can rename only nodes with the same name
and parents (clashing nodes) or you can rename all nodes. You specify whether to
use the filename as the prefix (the default) or to create a prefix string.
For more information on node hierarchy, see Using Maya: Expressions.
Tip
We recommend you use namespaces to resolve naming conflicts instead of
using the Name clash options when importing or referencing files.
File Type Choose from the pull-down menu the file type you will be importing . If you arent
sure what type of file you will be importing, you can select Best Guess.
Depending on the file type you select, various file type specific options may be
displayed, see "Setting Open options" on page 162 for information on these options.
The following file type specific options apply to importing move files:
Attributes Type the name of an attribute in the Attributes box and click Add to add the
attribute to the list of attributes to use when importing or exporting. If the attribute is
already included in the list, a duplicate is not made. You can add several attributes at
one time by separating them with a space. To remove an attribute, type the name of
the attribute and click Remove.
From Channel
Box Click From Channel Box to combine all of the selected objects in Maya, in the order
of their selection, with the channels selected in the Channel Box and place them in
the list. For example, if sphere and cone are selected, and tx, sx are selected in the
Channel Box, sphere.tx sphere.sx cone.tx and cone.sx are added to the list of attribute
to import and export.
Remove
Selected Click Remove Selected to remove all of the attributes selected in the list.
Remove All Click Remove All to remove all of the attributes from the list.
Precision This is ignored in file export. For file import, this sets the precision of the file.
When you click import or export, the move file is written or read and only the
attributes in the list are affected.
Clipboard Adjustment
Specify an option for how to handle the Clipboard contents.
Preserve Pastes the contents of the clipboard into their new positions on the
curve without any changes.
Scale Becomes enabled when Start/End is selected. The complete
contents of the clipboard curves are stretched or compressed to fit
into the specified import Time Range.
Fit Becomes enabled when Start/End is selected. The contents of the
clipboard are preserved (that is, not stretched or compressed) and
as much as will fit into the specified time range is pasted into the
new area.
Paste Method Specify a paste method.
Insert Places the clipboard contents before any existing keys in the
specified time range. The keys from the original curve that were
after the specified time range are shifted in time by the pasted
range times.
Replace Becomes enabled when Start/End or Clipboard is selected. The
clipboard contents overwrite any existing keys in the specified
time range.
Merge The clipboard contents are added to any existing keys on the
curve. In the case where a clipboard key is at the same time as an
existing key, the clipboards key replaces the existing key.
Replace Region These buttons are enabled when Paste Method is set to Replace.
Time Range Replace keys and curve segment information in the specified time
range with the contents of the keys clipboard.
Entire Curve Is available only when the Time Range setting is Clipboard. The
Entire Curve setting replaces the animation curve(s) on the
imported attributes with the contents of the keys clipboard, in
effect deleting any existing animation curves on these attributes
and applying the new curves from the keys clipboard.
Connect When turned on, adjusts the keys clipboard curves in value, so theres no
discontinuity in the animation at the start of the pasted segment.
Note
Node names from referenced files appear red in the Hypergraph. In
contrast, node names from non-referenced files appear black.
Tip
Turn on the Use Namespaces option if you referenced expressions that
include statements in MEL command format that include object names.
2 Set the options. See "Setting import options" on page 176 for information on setting
Group, Namespaces, Name clash, and File Type options.
File Particulars
Name Displays the name of the file.
Type Displays the file format.
Status Indicates if the file has been changed in some way.
Load Indicates is the referenced file is loaded or unloaded. See "Loading and unloading
reference files" on page 183.
Sub-type Displays the sub-type of file.
I/O Indicates if the file can be changed. Referenced files are always Read Only, while
files you create yourself are always Writable.
Rename Prefix Displays a prefix that can be applied to object names in the event of name clashes or
namespaces.
only as referenced objects. If you make changes to the new referenced file, the objects
in the existing scene change. For more information on exporting selections, see
"Exporting files" on page 185.
Cleaning up references
When you use reference files, Maya records any changes to the reference file. If you
load, unload, or replace reference files, these changes may or may not be used. When
you clean up references, you remove any recorded changes that arent being used.
For example, if you replace a high-resolution reference file with a low-resolution,
Maya records the connections, dynamic attributes, changed values, and disconnected
attributes, which may not apply to the low-resolution version. When you substitute
the high-resolution version again, the connections and values are restored. However,
if you dont substitute the high-resolution version, or you modify the high-resolution
version before you substitute it, the scene may have dangling connections and
unused values. When you clean up references, you eliminates this.
You should clean up reference when you are done swapping reference files.
To clean up references:
1 Select File > Reference Editor.
2 Select File > Clean Up Reference.
EXPORTING FILES
You export files when you want to copy all of a scenes contents (including
referenced files) into a single file. Export also lets you convert a file into formats
other than Maya ASCII and Maya Binary.
Export copies all of a scenes contents into another file, regardless of how the scene is
divided into segments and references. In essence, Export collapses the entire scene
into one file. This is essential when you want to save the scenes contents to another
file type, such as an IGES file, which doesnt support Maya references.
You can export scenes in several file formats depending on which export plug-ins
you have installed. For more information on export plug-ins, see "Using plug-ins for
exporting" on page 188.
Note
If you export selected objects to an existing scene, it will overwrite the
contents of the target file. If you want to add the contents of a scene to
another scene, you must use File > Import. For more information, see
"Importing files by copying" on page 176.
When you export the contents of a scene, the entire contents of the scene,
including referenced files, are written to a single file.
Note
New export file formats may be added through plug-ins. For more
information, see "Using plug-ins for exporting" on page 188.
Note
For information about move files, see "Exporting move files" on page
187.
Default File Extensions Adds the file extension .ma to Maya ASCII filenames and
.mb to Maya Binary filenames.
Keep Only a Reference Turn on to keep a reference to the file and move all of the
selected nodes out of the current scene. You must first select the objects in the scene.
Use Namespaces When you reference a scene with the Use Namespaces option
turned on, Maya creates a new namespace that contains the referenced data. Turning
on the Use Namespaces option ensures that all nodes are uniquely named. For more
information on Namespaces, see "Setting import options" on page 176)
Prefix with Select the file name to use the filename as the namespace. Select this
string and enter a name to be used for the namespace.
Include These Inputs Turn on to include or off to exclude any of the following
inputs:
History Includes or excludes construction history of the selected nodes. See "Using
construction history" on page 154 for more information.
Channels Includes or extrudes attribute values. See Using Maya: Animation for more
information on attribute values.
Expressions Includes or excludes expressions. See Using Maya: Expressions for more
information on expressions.
Constraints Includes or excludes constraints. See Using Maya: Animation for more
information on constraints.
Include Texture Info Turn on to export rendering information. The default is off.
Use Verbose Names Specifies whether you want to use long flag names for MEL
commands and full attribute names in the ASCII text.
Note
Maya plug-ins are typically designed to work on a specific operating
system.
Before you can use a plug-in, you must load it into Maya using a MEL command or
the Plug-in Manager.
To load a plug-in:
1 Select Window > Settings/Preferences > Plug-in Manager.
2 Locate the plug-in and click the loaded button.
3 After the plug-in loads, click the i button to get information on the plug-in.
Note
The objExport plug-in does not export OBJ formatted curves, surfaces,
smoothing groups, or point group materials. It also does not support
NURBS. Use the MayaToIgesDxf plug-in for scenes that contain NURBS
surfaces.
Note
When exporting to Alias Wire files, we write version 8.1 files for UNIX and
version 9.5 files for Windows.
Exporting to RenderMan
The ribExport plug-in lets you export scenes created in Maya to the RIB
(RenderMan) format.
The plug-in exports NURBS and polygonal geometry. All types of animation in
Maya are supported, including keys, expressions, path, deformations, and motion
blur.
The ribExport plug-in supports ambient, directional, point, and spot lights. It does
not support plug-in lights.
Simple non-textured shaders are supported, although only the shader color is
exported; all other shading attributes are ignored. Phong and Blinn shaders are
exported as plastic and Lambert shaders are exported as matte. Per-face shading
groups are not supported; only shading groups that are assigned to objects or object
instances are exported. Plug-in shaders and textures are not supported.
When exporting Maya scenes into RIB, note that the # character is a special
formatting character in RenderMan image names (See the RenderMan user manual
for information on its formatting capabilities). If you want to include a real #
character in a RenderMan image name, you must use ##.
The image name constructed by the ribExport plug-in includes the contents of the
imageName attribute of the renderable cameras. If you want to include the special
RenderMan formatting characters in an image, the imageName attribute is the place
those characters should be placed in quotes.
Note
When you create a camera in PowerAnimator, it is automatically given a
name that ends with the # character and a number. When the
AliasToMaya translator converts these cameras into Maya cameras, the #
is kept in the imageName attribute. If you want to render these scenes with
RenderMan, the cameras will need to be edited, and the # characters in
the imageName attributes replaced with ##.
Below Copies the animation of the selected object and all objects below it to the
clipboard.
Channels This setting is available when you want to copy only attributes selected in the
Channel Box.
All Keyable All keyable channels of the selected objects animation are copied to the
clipboard.
From Channel Box Only those channels selected in the Channel Box are copied to
the clipboard.
Control Points This option enables or disables the copy action for all the CVs, polygon vertices, and
lattice points associated with a geometry shape (or transform node hierarchically
above the geometry shape).
Normally, when a control point is copied, only the selected control point is copied.
The Control Points option enables the copying for all the control points associated
with an object. This is useful when you are doing control point-intensive animation
and dont want to select each control point to copy the animation.
Shapes This option determines if the animation of a shape attribute of an object as well as
the animation of the associated transform attribute are copied, or if only the
transform nodes animation is copied.
Generally, when an object is selected in a modeling window, the transform node
(above the shape hierarchically) is selected.
For example, if a camera, NURBS object, or light is selected, the associated transform
node is selected for copying.
Time Range All Copies all the animation information of the selected object or objects to the keys
clipboard.
Start/End copies only the animation information in the range specified in the Start
Time and End Time fields of the selected object or objects to the keys clipboard.
Help Images When checked, this option displays a diagram of the copy action, and in particular
represents graphically the two methods of copying animation information.
Method Keys Copies only keys within the selected range to the keys clipboard.
Segments Copies animation curve segments and any keys in the selected range to
the keys clipboard.
Note
The Segments method of copying keys will create keys for the copied
animation segment at the start and end times in order to preserve the
shape of the animation curve, if keys do not already exist at those points.
This chapter describes how to set environment variables using the Maya.env file and
lists standard Maya environment variables that you may want to modify.
To create Maya.env:
1 Create Maya.env in a text editor (such as jot or Notepad).
For UNIX, make sure to use capital M for Maya.env.
2 Set each variable on a single line in the following form:
NAME = VALUE
where NAME is the name of the environment variable, and VALUE is its value. For
other formatting rules, see "Rules for Maya.env" on page 196.
3 Save the file to one of the following locations.
UNIX Windows
~/maya/version drive:\WinNT\Profiles\UserName\maya\version
or or
~/maya drive:\WinNT\Profiles\UserName\maya
Note
These directory locations are the default. You can use a different directory
if you specify it in the MAYA_APP_DIR environment variable, which must
be set outside of Maya and the Maya.env file. See "Standard Maya
environment variables" on page 199.
Note
Although we recommend using different formatting for NT and UNIX
(such as \ and ; for NT, and / and : for UNIX), Maya does recognize both
formatting styles no matter what platform you use. Its still best to keep a
platform-specific format to avoid possible errors.
UNIX example:
The following example shows how you can define your own variable
(SHARED_MAYA_DIR) and use it to set the value of other Maya variables.
SHARED_MAYA_DIR = HostName:/usr/localhome/public/maya/4.0
MAYA_SCRIPT_PATH = $SHARED_MAYA_DIR/scripts:$MAYA_APP_DIR/scripts/custom
MAYA_PLUG_IN_PATH = $SHARED_MAYA_DIR/plug-ins
TMPDIR = /disk2/tempspace
Windows example:
This example is the same as UNIX, but with NT-specific formatting.
MAYA_SCRIPT_PATH = %MAYA_APP_DIR%\scripts\test
MAYA_PLUG_IN_PATH = %MAYA_LOCATION%\devkit\plug-ins;%MAYA_LOCATION%\devkit\test
TMPDIR = D:\tempspace
UNIX Windows
~/maya/version drive:\WinNT\Profiles\UserName\maya\version
or or
~/maya drive:\WinNT\Profiles\UserName\maya
Warning
Because your path settings take priority over standard Maya paths, a
conflict may occur and Maya may fail to load. In this case, try starting
Maya with only default settings by typing the following at the command
line: maya -default.
Note
Incorrect use of this flag will prevent online help from working within
Maya.
If your company has installed the documentation in a central location to save disk
space, and you are accessing it via an intranet, then you need to use both the
MAYA_HELP_URL and the showHelp command to see online documentation. Set
MAYA_HELP_URL to the URL address of the top level of the online help. (i.e. The
place where the MasterIndex.html file is found.)
e.g. MAYA_HELP_URL=http://company.com/maya4.0/docs/en_US/html/
Then each user needs to copy the file helpTable onto their machine. This file is also at
the top level of the online help. The last step is to add a line to each users
"userSetup.mel" file that tells Maya where to find the local helpTable.
e.g. showHelp -helpTable "$HOME/maya/4.0/helpTable";
The showHelp command needs a path to the helpTable, not a URL.
MAYA_LOCATION
The path for the Maya installation directory. If it is not set, it defaults to /usr/aw/
mayaVersionNumber (UNIX) or drive:\AW\mayaVersionNumber (NT).
MAYA_MODULE_PATH
Defines the search paths for Maya module files. A module file describes the install
location for certain Maya components, such as subdivision surfaces. Generally, you
dont need to set this variable. But, keep in mind that for each path extracted from
the modules files, Maya appends the suffixes plug-ins, scripts and icons and
icons, and then adds the appended path to MAYA_PLUG_IN_PATH,
MAYA_SCRIPT_PATH, and XBMLANGPATH, respectively.
The following table lists the default paths, which will always follow any path that
you specify.
%MAYA_APP_DIR%\maya\4.0\modules $MAYA_APP_DIR/maya/4.0/modules
%MAYA_APP_DIR%\maya\modules $MAYA_APP_DIR/maya/modules
C:\AW\Modules\maya\4.0 /usr/aw/modules/maya/4.0
C:\AW\Modules\maya /usr/aw/modules/maya
MAYA_NO_JITTER_FINAL_COLOR
If you are quantizing to 8-bit color, we apply some randomness, or jitter, to the color.
To enable this option, set the value equal to 1. To disable it, set the value to 0 (zero)
or leave it undefined.
MAYA_OVERRIDE_UI
If this environment variable is set, Maya wont load the file initialLayout.mel, which
creates the interface. You must specify an alternate file to run (for example,
MAYA_OVERRIDE_UI = test.mel). This variable should only be specified if you
want to completely replace Mayas UI for your own, custom-programmed interface.
MAYA_PLUG_IN_PATH
Search path for plug-ins. When a plug-in is specified by relative path name, the
directories in this path will be searched for the given plug-in name. This path also
determines which directories will be listed in the Plug-in Manager.
The following table lists the default paths, which will always follow any path that
you specify.
%MAYA_APP_DIR%\maya\4.0\plug-ins $MAYA_APP_DIR/maya/4.0/plug-ins
%MAYA_APP_DIR%\maya\plug-ins $MAYA_APP_DIR/maya/plug-ins
%MAYA_LOCATION%\bin\plug-ins /usr/aw/userconfig/maya/4.0/plug-ins
/usr/aw/userconfig/maya/plug-ins
$MAYA_LOCATION/bin/plug-ins
MAYA_PROJECT
Defines the default location of your project. You can change the location at any time
by choosing File > Project. This variable simply defines the default.
MAYA_RENDERER_RT_BACKGROUND_COLOR
If you set this variable to 1, Maya includes the camera background in the calculation
of reflection and refraction rays. If you set this variable to 0 (zero) or leave it
undefined, Maya ignores the background color for these rays.
MAYA_SCRIPT_PATH
Colon-separated search path for Mel scripts. If an unresolved Mel procedure is
called, then this path will be searched for a script that implements it. Also, if a Mel
file is sourced without giving the full path, then this path will be searched.
The following table lists the default paths, which will always follow any path that
you specify.
%MAYA_APP_DIR%\maya\4.0\scripts $MAYA_APP_DIR/maya/4.0/scripts
%MAYA_APP_DIR%\maya\scripts $MAYA_APP_DIR/maya/scripts
%MAYA_APP_DIR%\maya\4.0\prefs\shelves /usr/aw/userconfig/maya/4.0/scripts
%MAYA_LOCATION%\scripts\startup /usr/aw/userconfig/maya/scripts
%MAYA_LOCATION%\scripts\others $MAYA_APP_DIR/maya/4.0/prefs/
%MAYA_LOCATION%\scripts\AETemplates shelves
%MAYA_LOCATION%\scripts\paintEffects $MAYA_LOCATION/scripts/startup
%MAYA_LOCATION%\scripts\cloth $MAYA_LOCATION/scripts/others
%MAYA_LOCATION%\scripts\live $MAYA_LOCATION/scripts/AETemplates
%MAYA_LOCATION%\scripts\fur $MAYA_LOCATION/scripts/paintEffects
$MAYA_LOCATION/scripts/cloth
$MAYA_LOCATION/scripts/live
$MAYA_LOCATION/scripts/fur
MAYA_USE_V1_CAMERA
Allows you to revert to the old (Maya 1.0/1.5) camera model behavior. Starting with
Maya 2.0, we have fixed how the camera behaves when lens squeeze is not 1.0, or
when the resolutions aspect ratio is not the same as the x-resolution divided by the
y-resolution. If you are in the middle of a job started with Maya 1.0/1.5, you may
need the old (incorrect) behavior for continuity.
To enable this option, set the value equal to 1. To disable it, set the value to 0 (zero)
or leave it undefined.
MAYA_USE_VERSION1_DISPLACEMENT
Allows you to revert to the old (Maya 1.0) displacement mapping behavior. Starting
with Maya 1.5/2.0, we significantly improved displacement mapping. If you are in
the middle of a job started using Maya 1.0, you may need the old behavior for
continuity.
To enable this option, set the value equal to 1. To disable it, set the value to 0 (zero)
or leave it undefined.
MAYA_USE_VERSION1_POLY_TANGENT
Allows you to revert to the old (Maya 1.0) polygon tangent calculation behavior. For
Maya 1.5/2.0 we significantly improved the way we calculate tangents on polygon
objects. This primarily affects bump-mapping. If you are in the middle of a job
started using Maya 1.0, you may need the old behavior for continuity.
To enable this option, set the value equal to 1. To disable it, set the value to 0 (zero)
or leave it undefined.
TMPDIR and TEMP
This variable specifies the directory location Maya uses for various temporary files,
such as:
temporary render cache files during a render
crash files if Maya crashes
On UNIX, set TMPDIR only. On NT, set both TEMP and TMPDIR. If not set, the
temporary directory is /tmp (UNIX) or C:/temp (NT).
XBMLANGPATH
For both UNIX and Windows, this variable specifies the location of icon files, such as
icons used for Shelf buttons. On UNIX, the syntax is slightly different then other
paths. For example:
XBMLANGPATH = "./icons/%B:$HOME/dev/icons/%B"
In this example, %B is acts as a placeholder that will be replaced by Maya with the
bitmap filename.
The following table lists the default paths, which will always follow any path that
you specify.
%MAYA_APP_DIR%\maya\4.0\prefs\icons $MAYA_APP_DIR/maya/4.0/prefs/icons/%B
%MAYA_APP_DIR%\maya\prefs\icons $MAYA_APP_DIR/maya/prefs/icons/%B
%MAYA_LOCATION%\icons /usr/aw/userconfig/maya/4.0/icons/%B
%MAYA_LOCATION%\icons\paintEffects /usr/aw/userconfig/maya/icons/%B
%MAYA_LOCATION%\icons\cloth $MAYA_LOCATION/icons/%B
%MAYA_LOCATION%\icons\live $MAYA_LOCATION/icons/paintEffects/%B
%MAYA_LOCATION%\icons\fur $MAYA_LOCATION/icons/cloth/%B
$MAYA_LOCATION/icons/live/%B
$MAYA_LOCATION/icons/fur/%B
WINEDITOR
Allows you to override the Expression Editor and use your own editor. The editor
must be set to run in the foreground.
MAYA_PAINT_EFFECTS_THREADS
As of Maya 4.0, Paint Effects uses the multiple processors on your machine when
painting and rendering. You can set this variable to control the number of processors
used by Maya. The minimum is one (1) and the maximum is three (3).
PART 2
EDITORS
9 USING MAYA EDITORS
The chapter describes Maya editors, including: several of the General Editors, the
Relationship Editor, the Attribute Editor, the Channel Box, and the Outliner.
General Editors are tools you can use in a number of diverse workflows. One of the
General Editors, the Attribute Spread Sheet, lets you see and modify attributes for
multiple objects simultaneously. You use it to view and edit attributes in a columnar
layout, and to keyframe them.
The Relationship Editor provides a single place to work with memberships for sets,
deformer sets, character sets, partitions, display layers, shading groups, and light
linking. You can quickly see the relationships, and select and remove items in those
relationships.
The Attribute Editor is used to examine a particular objects attributes in more detail,
and with a more explanatory interface. Its advantage is that it is very detailed, and
allows you to work on one object at a time. This is particularly useful for dealing
with particles.
The Channel Box is the primary, fastest, and most streamlined tool for editing object
attributes. It lets you quickly set keys, and lock, unlock, or create expressions on
attributes.
The Outliner lists the objects, lights, cameras, and other items in a scene. This
arrangement is called the scene hierarchy.
Maya includes several other editors not described in this chapter. For details, refer to
the following:
Reference Editor, see "Using the Reference Editor" on page 181
Hypergraph, see "Using the Hypergraph" on page 263
Layer Editor, see "Using layers" on page 130
Rendering Editors, see Using Maya: Rendering
Animation Editors, see Using Maya: Animation
Render Globals, see Using Maya: Rendering
Hypershade, see Using Maya: Rendering
Visor, see Using Maya: Rendering
Expression Editor, see Using Maya: Expressions
Component
Editor Lets you edit data assigned to components. For example, you can use the
Component Editor to modify the weights assigned to individual CVs by cluster
deformers. See "Using the Component Editor" on page 209.
Attribute Spread Sheet
Lets you view and edit attributes for multiple objects at the same time. See "Using
the Attribute Spread Sheet" on page 212.
Connection
Editor Lets you explicitly connect any two attributes. For example, you could use the
Connection Editor to connect a shader attribute to a texture attribute. See the book
Using Maya: Rendering.
Visor Lets you manage your Maya files for various applications, including rendering and
Paint Effects. For more information, see Using Maya: Rendering, Using Maya: Painting,
and Using Maya: Animation.
Blind Data
Editor You can use Maya's Blind Data Editor to define the blind data types you need, and
then apply the blind data to objects or components in your scene. The blind data
editor also allows you to query your scene for blind data of a specific type or set of
values and use false coloring to visualize what blind data is assigned to each objects.
For more information, see Using Maya: Polygonal Modeling.
Channel
Control Displays all of a nodes attributes and lets you make them keyable or not keyable,
editable or not editable (locked or unlocked). Since the Channel Box lists only
keyable attributes, you often use Channel Control to add attributes to the items
displayed in the Channel Box. For information on using Channel Control, see Using
Maya: Animation. For information on the Channel Box, see "Using the Channel Box"
on page 236.
Script Editor Lets you edit a script. See Using Maya: MEL.
Command
Shell Lets you enter MEL commands directly through a command window. See Using
Maya: MEL.
You can use the Component Editor to edit the component data of particles, springs,
NURBS CVs, polygonal vertices, and lattice points. For example, you can edit the
following component data with the Component Editor:
the stiffness of individual springs
the colors of individual particles
polygonal vertex normals and colors
the weights of CVs, vertices, or lattice points influenced by cluster deformers
the weights assigned to CVs, vertices, or lattice points after smooth or rigid skinning
Objects influencing
component data listed by
column
Components listed by
rows
Component data is
displayed for editing in a
spreadsheet
Note
The display does not automatically update if you undo, redo, or modify
components in the workspace. For these types of changes, you must
manually load components to refresh the Component Editor display.
Note
Select Channels > Settings > Reset to Default to return the width, precision,
and channel name type back to the default settings.
Notes
When the Attribute Spread Sheet first opens, the Keyable tab is selected.
This tab displays all the keyable attributes of the selected objects. Most
other tabs display useful subsets of these attributes. The All tab displays all
attributes, keyable or not.
Many attributes useful in editing an object are not stored in its main node,
but rather in the shape node associated with it. Some of the tabs in the
Attribute Spread Sheet (such as Shape Keyable, Tessellation, and so on)
show you attributes in the associated shape.
selected node
name of the
selected node
Tips
If you have any problems selecting a node, select Window > Hypergraph.
For more information, see "Using the Hypergraph" on page 263.
To select all of an objects nodes at once, drag a box around the object.
3 Type the new entry and press Enter or the tab key. For example, type 5 and press
Enter. For a Scale X entry, this sets the X axis scaling of all selected objects to 5 grid
units.
Drag through
adjacent boxes
Tip
To select several adjacent boxes, drag through them.
To add a non-adjacent box to a selection, Ctrl-click the additional box.
To select a range of boxes, click the first box and Shift-click the last box.
To select an entire row of boxes, click the node name.
To select an entire column of boxes, click the column name.
3 Type the new entry and press Enter or the tab key.
For example, type 5 and press Enter. If Translate X and Translate Y are selected
when you enter 5, all selected Translate X and Translate Y attributes become 5.
For example, suppose youve selected an object named Ball. Its Scale X and Scale Y
attributes are set to 3 and 5 in the Attribute Spreadsheet.
If you select the Scale X and Scale Y text boxes, typing += 2 in the text box adds 2 to
each value. So Scale X would become 5 and Scale Y would become 7.
To remember a layout:
1 Select Layouts > Remember This Layout. The Remember Layout window opens.
2 Type the name of the new layout and then click Remember. Maya adds a tab for this
new layout. You can now recall the layout by clicking on the tab.
To delete a layout:
To delete a layout, select Layouts > Delete Current Layout. Maya removes the tab
from the window.
Note
You can remove Mayas pre-defined tabs, but they will return the next time
you open the window.
Note
The Relationship Editor is separate from the Dynamic Relationships Editor,
which is used to control relationships of particle objects. See Using Maya:
Dynamics for more information.
For all these types of relationships, you can do the following in the Relationship
Editor:
specify view options (see "Setting view options" on page 218)
select which relationships and objects display ("Displaying relationships and objects"
on page 218)
create and delete relationships (see "Creating relationships" on page 220)
select members of a relationship (see "Selecting relationships, relationship members,
and objects" on page 221)
add and remove members of a relationship (see "Adding and removing relationship
members" on page 221)
filter which relationships and objects display in the Relationship Editor (see
"Selecting which relationships and objects show" on page 219)
The left side of the editor displays relationships of the type you selected, while the
right side of the editor displays objects in the scene.
To display relationships:
On the left panel, select one of the following options from the List menu.
Auto Load All Turn this on to automatically display all relationships of the selected type in the
scene. This is the default.
Manual Load Turn this on to display relationships by choosing one of the following options:
Load from
Selection Display only the relationships associated with the objects selected
in the scene.
Add from
Selection Add to the display the relationships associated with the objects
selected in the scene.
Remove from
Selection Remove from the display the relationships associated with the
objects selected in the scene.
To display objects:
On the right side panel, select one of the following options from the List menu.
Auto Load All Turn this on to automatically display all objects in the scene.
Auto Load
Selection Turn this on to automatically display objects in the relationships associated with the
objects selected in the scene.
Manual Load Turn this on to display objects by choosing one of the following options:
Load List from
Selection Display only the selected objects.
Add Selection to
List Add to the display the objects selected in the scene.
Remove
Selection from
List Remove from the display the objects selected in the scene.
Creating relationships
From the Relationship Editor, you can create the following relationships:
sets (see "Creating sets" on page 303
partitions (see "Creating, displaying, and removing partitions" on page 308)
characters (see Using Maya: Character Setup)
display layers (see "Using layers" on page 130)
render layers (see "Using layers" on page 130)
shading groups (see Using Maya: Rendering)
light sets and object sets (see Using Maya: Rendering)
You cannot create deformer sets.
In general, use the following procedure to create a new relationship.
To select a relationship:
1 In the left panel of the Relationship Editor, click the relationship(s) you want to
select. Notice that member of the set are highlighted in the Objects panel.
2 Select Edit > Select Highlighted. The relationship(s) becomes active.
or
1 In the left panel of the Relationship Editor, click the relationship you want to remove
objects or items from.
2 In the Object panel of the Relationship Editor, click on the highlighted objects or
items you want to remove from the relationship.
or
In the scene, select the objects or items you want to remove from the relationship and
select Edit > Remove Selected Items or click the minus sign (-) beside the relationship
type at the top left of the Relationship Editor.
Menus
The Attribute Editor has the following menus:
List Use this menu to load attributes into the Attribute Editor and to define which items
display in the Selected/Object menu. See "Loading object attributes into the
Attribute Editor" on page 225.
Selected/
Object The Selected menu lists objects currently selected in the scene while the Object menu
displays all the objects in the scene of a selected type. See "Loading attributes from
the Selected/Object menu" on page 226.
Focus This menu displays all nodes that have been selected in the scene while the Attribute
Editor is open. The most recently selected node is at the top of the list. "Loading
attributes from the Focus menu" on page 226.
Attributes Use this menu to add, edit, and delete extra attributes for an object or node. These
appear under the Extra Attributes section. You can also add, edit, and delete
attributes using the Modify menu. For details, see "Adding a custom attribute" on
page 227, "Editing custom attributes" on page 229, and "Deleting custom attributes"
on page 230.
Set Driven Key Select this option to link the attribute values. For details, see "Linking attributes" on
page 232.
Break
Connection Select this option to break the connection between the attribute and a key or texture.
For details, see "Breaking connections" on page 232.
Create New
Texture Select this option to connect a texture to the attribute. For details, see "Mapping a
texture to an attribute value" on page 233.
Color Chooser This option displays for color attributes only. Select it to open the Color Chooser. For
details, see "Using the Color Chooser" on page 233.
Lock/Unlock
Attribute
Select the Lock option to lock an attribute value so that it cannot be changed. Use
Unlock Attribute to unlock the value. For details, see "Locking attribute values" on
page 232.
Ignore/Dont Ignore when Rendering
This option displays only for attributes that are connected to keys or textures. Select
the Ignore when Rendering option to ignore the connection when rendering. If the
attribute has a map button, the button changes to indicate that the connection will be
ignored.
Select the Dont Ignore when Rendering option to render with the set connection. For
details, see Using Maya: Rendering.
Note
If you select more than one item, Maya automatically updates the most
recently selected one (that is, the most recent one in the pick list).
2 Set the new attribute options as follows and click the Add button.
To view the new attribute controls, expand the Extra Attributes section in the
Attribute Editor.
Note
If you select Vector or Integer, you can also set Numeric Attributes.
You can change Enum strings. Select the Enum attribute in the Attributes list and
modify the strings in the Enum list the same way you created them.
Note
String type custom attributes do not appear in the Channel Box, therefore
you cant edit the Keyable check box for them.
Note
When you create a Vector type custom attribute, three child attributes are
created (nameX, nameY, nameZ, where name is the name of the attribute).
For example, if you created a vector attribute named Speed, the children
would be SpeedX, SpeedY, and SpeedZ. You cant access the Numeric
Attribute Properties (Keyable and Min/Max) of the parent vector attribute.
You have to select a child attribute and modify its Numeric Attribute
Properties.
Caching Turn Caching on to temporarily store upstream node evaluations in the cache. When
Maya needs these evaluations (as input to the node), it uses the information stored in
the cache rather than re-evaluating the upstream node. If no changes have been
made to the node, it redraws more quickly. The cache is destroyed when you edit an
attribute. Note that caching uses more memory, which could affect Mayas
performance.
Node State Changing the node state can improve performance. There are six possible node
states:
Normal Causes the node to behave normally, according to the defined
settings and effects. This is the default.
HasNoEffect Disables any effects on the node so that fewer calculations are
necessary at the time of redraw. Note that the effect will not
render until you reset the Node State back to Normal. Maya
evaluates the nodes in the nodes history, but not the node itself.
Tip
To set a key for all attributes, use the Channel Box. For details, see "Setting
keys for attributes from the Channel Box" on page 244.
Linking attributes
Maya has a special type of key called a driven key that links one attribute value to
another. When you create a driven key, you specify a driver attribute value and a
driven attribute value. The value of the driven attribute is locked to a corresponding
value of the driver attribute.
You can link attributes from the Attribute Editor by right-clicking the attribute text
box or label and selecting Set Driven Key. For details, see Using Maya: Animation.
Breaking connections
In the Attribute Editor, the text box for an attribute that is connected to an
expression, key, or other attribute (for example texture attribute) is displayed in a
different color, depending on your color settings.
To break a connection:
1 Select the object.
2 In the Attribute Editor, right-click the attribute name or text box and select Break
Connections.
To lock an attribute:
1 Select the object.
2 In the Attribute Editor, set the attribute value you want to lock.
3 Right-click the attribute name or text box and select Lock Attribute.
This locks the value. The Attribute Editor displays locked attributes with a gray
background. (This color may not be visible while the text box is selected.)
When youve locked an attribute, you cannot change its value in the Attribute Editor,
Channel Box, the workspace, or elsewhere.
You must unlock the attribute to change its value.
To unlock an attribute:
1 Select the object.
2 In the Attribute Editor, right-click the attribute name or text box and select Unlock
Attribute.
Color wheel
Blend box
Palettes (including
Adobe palettes)
0 to 255 Each component color has a value from 0 (zero intensity) to 255
(full intensity). This model is useful because it relates directly to
how monitors emit light to create colors. However, it is often hard
for people to figure out what the RGB values are for a specific
color.
A (alpha) slider With the A (alpha) slider, you can control the opacity or transparency of the color
you choose. Many Maya options already have an alpha or transparency control, but
if it does not or you are calling the Color Chooser from the command line, you can
use this slider to control the alpha channel.
Choose a palette
from the pull-down Click Blend to
create a color
gradient between a
Left click a cell to group of cells you
select a color selected
...or...
right click a cell to
store a color
Blended tiles
4 When finished assigning colors, click Save and specify the filename.
You can save the file in any directory. It is saved in ascii format.
Note
You can display either the Channel Box or the Attribute Editor in the main
Maya window, but not both.
Note
Use the Channel Box Bar to switch between the Channel Box and Layer
Editor.
Channel Box
Selected object
Object attributes
Object attributes
Section Usage
SHAPES Lists the names of nodes that define the geometry of the
object. Other nodes, such as related particle emitters may
be found here.
INPUTS Lists the names of other nodes that affect this one.
Typically, these comprise the construction history of the
node.
OUTPUTS Lists the names of the output nodes (nodes that receive
data) for this node.
If youve selected two or more objects, the Channel Box displays the attributes for
the last object selected only. To display the attributes in the Channel Box of another
selected object, select Object > objectName.
Note that edits you make in the Channel Box will affect all selected objects of the
same type as the one displayed.
Note
When you set an attribute value using an expression or a Key, the attribute
text box displays in a different color. (The actual color depends on which
color scheme you are using.)
If you turn on component selection mode (in the main menu bar) and select the CVs,
the Channel Box displays this:
You can display the CV values in the Channel Box and enter new values. To display
the values, click CVs (click to show) in the Channel Box.
Tip
The Channel Box is set to only show two decimal places of precision. You
can increase this precision up to fifteen places by selecting Channels >
Settings > Change Precision.
You can set any of these combinations with one text entry.
For example, you can enter the value 5 in one text box to change the three attributes
for scaling along the X, Y, and Z axis.
You can also change the values of several attributes by a relative amount. For
example, you can add 3 to the Scale X, Scale Y, and Scale Z attributes.
Tip
When you enter a value in the Channel Box, you can press the tab key or
one of the Enter (or Return) keys. If you press the Enter key on the numeric
keypad, the keyboard focus will stay in the Channel Box. If you press the
other Enter key, the keyboard focus will go back to the last selected panel.
Tip
You can select multiple text boxes:
To select several adjacent boxes, drag through them.
To add a non-adjacent box to a selection, Ctrl-click the additional box.
To select a range of boxes, click the first box and Shift-click the last box.
For example, suppose youve selected an object named Ball. Its Scale X and Scale Y
attributes are set to 3 and 5 in the Channel Box.
If you select the Scale X and Scale Y text boxes, typing += 2 in the text box adds 2 to
each value. So Scale X would become 5 and Scale Y would become 7.
If you do not want to display these manipulators, select Channels > Settings, then
select either No Manips or Invisible Manips. If you select No Manips, you can only
perform these operations from the Channel Box by entering values in the text boxes.
If you select Invisible Manips, you perform these operations using the mouse (see
"Entering values with the mouse (channel slider)" on page 243) or by entering values
in the text boxes.
You can also switch between using manipulators, no manipulators, and the mouse
(channel slider) using the buttons at the top of the Channel Box.
Standard Invisible No
Manips Manips Manips
You can also specify whether the attribute values change linearly as you drag (values
increase steadily as you drag), or hyperbolically (values increase more sharply as
you drag). Turn off Channels > Settings > Hyperbolic to change the values linearly,
and on to change values hyperbolically, or switch the settings using the buttons at
the top of the Channel Box.
Linear Hyperbolic
Example
Suppose you add the predefined Node State attribute to a NURBS spheres keyable
attributes. (You can do this with Window > General Editors > Channel Control.)
Node State appears in the list of attributes below the transform attributes.
If you click in the Node State text box, a pop-up menu appears with six choices:
Normal, HasNoEffect, Blocking, Waiting-Normal, Waiting-HasNoEffect, Waiting-
Blocking. Drag the mouse over the desired selection. For information on these states,
see "Changing node behavior" on page 230.
2 Enter values for the desired attributes in the Channel Box. Press Enter after entering
the attributes.
3 In the Channel Box, select Channels > Key All.
or
Right-click the attribute name or text box and select Key All.
This sets the key for all the object attribute values displayed in the Channel Box.
Note
You can key the same attribute value for two or more objects. Select the
objects, click the frame, enter the value in the text box, then select
Channels > Key Selected.
You can also key multiple attribute values for multiple objects. Follow the
instructions in the previous paragraph, only select several attribute text
boxes using Ctrl- or Shift-click before typing the numerical entry.
To break a connection:
1 Select the object.
2 In the Channel Box, select the connected attribute (click the attribute name or text
box).
3 Select Channels > Break Connections.
or
Right-click the attribute name or text box and select Break Connections.
To lock an attribute:
1 Select the object.
2 In the Channel Box, click the attribute name.
3 If you need to set the attribute value before locking it, type a value and press Enter.
4 In the Channel Box, select Channels > Lock Selected.
or
Right-click the attribute name or text box and select Lock Selected.
This locks the value. The Channel Box displays locked attributes with a gray
background. (This color may not be visible while the text box is selected.)
When youve locked an attribute, you cannot change its value in the Channel Box,
the workspace, or elsewhere.
You must unlock the attribute to change its value.
Tip
You can lock two or more attributes at the same time. Ctrl- or Shift-click
the attribute names to select them, then select Channel > Lock Selected (or
right-click the attribute names and select Lock Selected).
To unlock an attribute:
1 Select the object.
2 In the Channel Box, click the attribute name.
3 In the Channel Box, select Channels > Unlock Selected.
or
Right-click the attribute name or text box and select Unlock Selected.
Click here to
display the boxes
2 Type the new information in the respective boxes and press Enter. Each time you
change part of the objects history, Maya changes the object.
3 To return to the original setting for Subdivision Z, select Edit > Undo or press Ctrl-Z.
The object returns to its original scale for Subdivision Z.
4 Repeat for the other boxes.
Tip
If your scene has many objects or it contains character skeletons, consider
using the Hypergraph instead of the Outliner. The Hypergraph displays
the scene hierarchy in a graphical format thats more convenient for
complex scenes. See Chapter 10, Using the Hypergraph.
You can open the Outliner in its own window or in a workspace panel. If you
display it in a workspace panel, you see the Maya user interface and the Outliner at
the same time without having to reposition the windows.
Menu bar
Scene
hierarchy
Parent An object or other item that controls attributes of one or more children. A parent can
also be the child of another parent.
In the figure, InnerSolarSystem is a parent of Sun. Sun is a parent of Mercury, Venus,
Earth, and Mars. Earth is a parent of Moon.
Child An object whose attributes are controlled by its parent. A child can be the parent of
other children. A child is connected to its parent by an indented right angle line.
Sun is a child of InnerSolarSystem. Mercury, Venus, Earth, and Mars are children of
Sun. Moon is a child of Earth.
Node A parent, child, or independent object or item.
InnerSolarSystem, Sun, Moon, persp, top, and all other entries in the example are
nodes.
Hierarchy The arrangement of all connected nodes that make up a scene or object.
The scene hierarchy is made of all nodes in the figure. The Earth hierarchy consists
of Earth and Moon.
Transform node A node that contains an objects transformation attributesvalues for its translation,
rotation, and scale. It also holds information on any parent-child relationships it has
with other nodes. Transform nodes are also called DAG objects.
InnerSolarSystem, Sun, Moon, and all other entries in the example are transform
nodes.
Shape node A node that holds an objects geometry attributes or attributes other than the objects
transform node attributes. A shape node is always a child of a transform node.
Shape nodes do not appear in the Outliner by default. To display shape nodes, see
"Displaying shape nodes" on page 252.
To expand a node:
Click the plus sign ( ) to its left.
The plus sign ( ) changes to a minus sign ( ).
To collapse a node:
Click minus sign ( ) to its left.
The minus sign ( ) changes to a plus sign ( ). Note that Hierarchies become
highlighted if they are collapsed but contain an item that is selected.
Tip
To select Outliner menus more conveniently from a pop-up menu, click the
right mouse button in the Outliner window.
Example
Suppose you select Create > NURBS Primitives > Sphere to create a sphere. Maya
creates a transform node and a shape node.
If you turn on Display > Shapes and expand the nurbsSphere1 node, the shape node
appears underneath.
Maya gives the nodes the default names shown in the figure. The nurbsSphere1 is
the transform node; nurbsSphereShape1 is the shape node. If you rename the
transform node, for example, as Bubble, Maya renames the shape node BubbleShape.
If you rename the shape node, Maya does not rename the transform node. Maya
doesnt transmit a childs attribute changes up to its parent.
Note
The Display and Show menu settings are saved with a scene file. The menu
settings are not saved when you open a new or different scene.
Displaying attributes
You can display attributes of the nodes shown in the Outliner. To simplify the
Outliners appearance, you can also limit the display of attributes to the following
categories:
keyable attributes
translate, scale, and rotate attributes
attributes connected to an animation curve or expression
attributes connected to any controlling node
Some attributes also appear with ( ) to the left. These are compound attributes
consisting of two or more attributes. Click ( ) for a compound attribute to see its
component attributes. For example, the compound Translate attribute is made of
Translate X, Translate Y, and Translate Z attributes.
You cant use the Outliner to change attributes values. You can set them in the
Channel Box, Attribute Editor, or Attribute Spreadsheet. Note also that you use those
tools to set the value of noncompound attributes only. You can set compound
attributes (to set the component attributes) only with MEL commands.
Tips
To open the Attribute Editor for a node, double-click the icon beside the
node name.
You can double-click a noncompound attribute to start the Expression
Editor with the attribute automatically selected.
expression
any other direct connection
Example
Suppose you create a NURBS sphere named Ball and a NURBS cone named Cone.
You write an expression to assign the value of Balls translateY attribute to Cones
translateY attribute.
If you select Cone, turn on Display > Attributes (Channels) and
Display > Connected, then expand Cone and the Translate attribute, the Outliner
displays the following:
Parenting objects
You can make an object the child of a parent object. The child adopts some or all
attribute changes made to the parent.
For example, suppose you animate a planet to orbit the center of the workspace. If
you make a moon the child of the planet, it follows the motion of the planet.
Though the moon is the child of the planet, you can also give the moon motion thats
independent of the planet. For example, you can make it orbit the planet. If you later
change the orbiting motion of the planet, the moon continues to follow the planets
motion, but stills retains its original orbiting motion.
To control multiple objects with one node, you can also create an empty group and
make several objects its children. By grouping objects under one node, you can
move, shade, apply texture, and do many other actions to all the objects by working
with the group node.
Example
BackTire
If you modify the group node attributes, its corresponding members attributes are
also modified. For example, if you decrease the Y scale attribute for a flower group
node, the Y scale attributes of the four petals decrease also.
To select an object:
1 Scroll to find the node that represents the object or component.
2 Click the node to select it. The node is highlighted in the scene to indicate it is
selected.
To select a set:
Select Display > Select Set Members. The set members are selected in the Outliner
and in the workspace.
To deselect an object:
Click an empty spot in the Maya workspace. (You can also click below the last item
in the Outliner.)
When you deselect a node, its highlighting turns off.
To rename an object:
1 Double-click the name of the object in the Outliner.
2 Enter the name in the text box.
Reordering nodes
You can automatically sort the nodes or you can reorder the position of nodes in the
Outliner. For example, to make the nodes Outliner position correspond to its spatial
position in the workspace.
Be aware that reordering an objects position in the Outliner might may affect its
behavior or appearance in your scene. Reordering a nodes position in the Outliner
affects Mayas evaluation order for the object. Maya evaluates objects as listed from
top to bottom in the Outliner.
For example, Maya typically renders nodes in the order they appear in the Outliner.
Changing this order changes their rendering order. However, if a node has
transparency, Maya puts the node in a delayed render queue. Maya renders objects
in the queue after all opaque objects.
Example
Suppose you created a scene containing several of the solar systems planets,
including earth. As you add each planet, the Outliner adds a node representing the
planet.
Maya puts each new node in the Outliner below existing nodes. The location of the
planet nodes in the Outliner might not represent the spatial relationship of the
planets in the workspace as in this example:
Here, earth sits further from mercury than mars. In the actual solar system, and in
your workspace, this is not true.
To make the Outliner reflect the positioning of the earth in the workspace, use the
middle mouse button to drag the earth above mars.
Maya positions earth below venus and above mars.
For details, see the next topic, "Limiting the display" on page 259. Also, using the
Show menu, you can also do the following:
"Showing all items not currently displayed" on page 260
"Storing your restrictions" on page 260
"Controlling display of auxiliary nodes" on page 262
When you have a filter active, you can revert to showing all objects by clicking the
filtered display icon ( ).
If you selected only objects in step #1, only the Objects section appears on the Create
Entry window. Similarly, if you selected only attributes in step #1, only the
Attributes section appears.
4 In the Objects section (if there is one), turn Entry name on and type a name for the
selection list in the adjacent box. This name will appear on the Show > Objects menu.
5 In the Attributes section (if there is one), turn Entry name on and type a name for the
selection list in the adjacent box. This name will appear on the Show > Attributes
menu.
6 Click Save.
2 To delete from the Objects list, click the Objects tab, then click the entries you want
to delete.
or
To delete from the Attributes list, click the Attributes tab, then click the entries you
want to delete.
3 Click Delete.
To hide a node:
1 Choose Show > Auxiliary Nodes to open the Auxiliary Nodes window.
2 Select a node from the Available Node Types list and click Add To Hide List
(Above).
Note
Select Options > Auxiliary Nodes are Hidden in Editors to hide the node
types in the top list. This is the same as turning off Show > Show Auxiliary
Nodes.
Select Options > All Nodes are Shown in Editors to show all node types in
Maya editors.
A dependency graph shows the architectural connections between Maya entities that
input and output data. For example, it shows connections between shading group
elements that create an objects material appearance.
Menu bar
Tool bar
Note
Unless instructions in this chapter state otherwise, make all menu choices
from the Hypergraph menu bar.
Parent An object or other item that controls attributes of one or more children. A parent can
also be the child of another parent.
In the figure, InnerSolarSystem is a parent of Sun. Sun is a parent of Mercury, Venus,
Earth, and Mars. Earth is a parent of Moon.
Child An object having attributes controlled by its parent. A child can be the parent of
other children. A child in the graph is connected to its parent by an indented right
angle line.
Sun is a child of InnerSolarSystem. Mercury, Venus, Earth, and Mars are children of
Sun. Moon is a child of Earth.
Node A parent, child, or independent item. This refers generally to any box in the graph.
InnerSolarSystem, Sun, Moon, and all other boxes in the graph are nodes.
Subnode Any node below another node in the hierarchy.
The subnodes of InnerSolarSystem are Sun, Mercury, Venus, Earth, Moon, and Mars.
The subnodes of Sun are Mercury, Venus, Earth, Moon, and Mars. The subnode of
Earth is Moon. Moon and Mars have no subnodes.
Branch All nodes along a path from a parent to child. A branch from Sun to Moon includes
Sun, Earth, and Moon.
Hierarchy The arrangement of all connected nodes that make up a scene or object.
The scene hierarchy is made of all nodes in the figure. The Earth hierarchy consists
of Earth and Moon.
Transform node A node that contains an objects transformation attributesvalues for its translation,
rotation, scale, and so on. It also holds information on parent-child relationships it
has with other nodes.
InnerSolarSystem, Sun, Moon, and all other boxes shown in the example are
transform nodes.
Shape node A shape node holds an objects geometry attributes or attributes other than the
objects transform node attributes. Shape nodes do not appear in the scene hierarchy
by default. To display shape nodes, see "Displaying special nodes and connections"
on page 268.
The scene hierarchy and the dependency graph display animated nodes as slanted
boxes. If you animate a node with an expression, it displays a regular rectangle
rather than a slanted box. All other animation techniques display a slanted box.
Specifically, a slanted box indicates that the node has a param curve connected to it.
Note
A node name followed by ... is abbreviated in the graph. See "Dollying
the view" on page 289 to learn how to view the full name. For other graph
viewing techniques, see "Altering the view of a graph" on page 289.
To expand a node:
1 Select the node.
If the node is not visible in the scene hierarchy, select it in the workspace or Outliner.
2 Select:
Edit > Expand to expand a node to one level below.
Edit > Expand All to expand all subnodes below a node.
Edit > Show Selected to display and expand a node not visible in the graph.
To collapse a node:
1 Select the node.
2 Select Edit > Collapse.
Tips
To expand or collapse a node, double-click it.
To quickly select Hypergraph menus, click the right
mouse button in an empty part of the Hypergraph
window.
To display context-sensitive Hypergraph menus, move
the mouse over a node and click the right mouse
button. These menus are also available from the main
Hypergraph menus, but they apply only to the
selected node.
For details on navigating the view of the graph, see
"Altering the view of a graph" on page 289.
Note
Hypergraph option settings are saved with a scene file. The options are not
saved for Maya globally.
Example
Suppose you select Create > NURBS Primitives > Sphere to create a sphere. Maya
creates a transform node and a shape node.
The spheres shape node holds the mathematical description of the spheres shape.
The spheres transform node holds the spheres position, scaling, rotation, and so on.
The shape node is the child of the transform node.
If you select Options > Display > Shape Nodes in the Hypergraph, the scene
hierarchy shows these nodes for the sphere:
Maya gives the nodes the default names shown in the preceding figure. The
transform node is nurbsSphere1, the shape node is nurbsSphereShape1. If you
rename the transform node, for example, to Bubble, Maya renames the shape node to
BubbleShape.
If you rename the shape node, Maya does not rename the transform node. Maya
doesnt transmit a childs attribute changes up to its parent.
Example
Suppose you select Create > NURBS Primitives > Sphere to create a sphere. Maya
creates a transform node and a sphere node. Suppose you then select Modify > Make
Live, then use the Create > CV Curve Tool to draw a curve on the surface of the
sphere.
If you turn on the display of shape nodes and underworld nodes, the scene hierarchy
appears as follows:
Maya gives the nodes the default names shown. The transform node is
nurbsSphere1, the shape node is nurbsSphereShape1. The curve1 and curveShape1
nodes are underworld nodes for the curve created on the spheres surface.
When a curve-on-surface is hard to select in the workspace because of crowding or
complex geometry, you can select it easily in the scene hierarchy with underworld
nodes displayed.
Example
Suppose you create a NURBS sphere named Ball and a NURBS cone named Cone.
You write an expression to assign the value of Balls translateY attribute to Cones
translateY attribute.
The expression links the two values. When you move Ball up or down in the
workspace (in a Y-axis direction), Cone moves up or down the same amount.
If you select Options > Display > Expression Connections, the scene hierarchy
displays this:
Tip
You can change the color-coding of the connection lines and other
important entities by selecting Window > Settings/Preferences > Colors
from Mayas main menu bar and expanding Hypergraph/Hypershade.
Parenting objects
You can make an object the child of a parent object. The child adopts some or all
attribute changes made to the parent.
For example, suppose you animate a planet to orbit the center of the workspace. If
you make a moon the child of the planet, it follows the motion of the planet.
Though the moon is the child of the planet, you can also give the moon motion thats
independent of the planet. For example, you can make it orbit the planet. If you later
change the orbiting motion of the planet, the moon continues to follow the planets
motion, but stills retains its original orbiting motion.
To control multiple objects with one node, you can also create an empty group and
make several objects its children. By grouping objects under one node, you can
move, shade, apply texture, and do many other actions to all the objects by working
with the group node.
Example
BackTire
To parent an object:
In the scene hierarchy, use the middle mouse button to drag the child node on the
parent node.
Moon is now a
child of Planet.
If the parent node is not visible in the window, drag the child toward it in the
direction of the parent. The graph view scrolls as you drag into the Hypergraphs
window border.
If you modify the group node attributes, its corresponding members attributes also
are modified. For example, if you scale down a flower group node, the four petals
scale down also.
Example
Suppose you created a scene containing several of the solar systems planets,
including earth. As you add each planet, the scene hierarchy puts a node
representing the planet in the graph.
Maya puts each new node in the graph to the right of existing nodes. The location of
the planet nodes in the graph might not represent the spatial relationship of the
planets in the workspace, as in this example:
Here, Earth sits further from mercury than mars. In the actual solar system and in
your workspace, this is not true.
To make the graph reflect the positioning of the earth in the workspace, use Ctrl-
middle mouse button to drag the Earth on top of Mars.
Maya positions the node to the right of Venus and to the left of Mars. Thereafter,
youll know where to look for Earth in the scene hierarchy.
Important
Move as few nodes as necessary. When you drag a node to a new position
in the graph, you increase the scenes file size and the Maya processing
time needed to work with the scene.
When you move a parent node, Maya automatically moves its children
with it. Automatically moved children do not increase the file size and
processing time.
The character skeleton exists behind the scene hierarchy. With this arrangement, you
can quickly find nodes, for example, that represents the characters feet and ankles.
Whenever you display the scene hierarchy in the Hypergraph (in freeform layout),
the image appears behind the nodes.
See "Editing objects" on page 286 and "Altering the view of a graph" on page 289 for
additional details on working with a dependency graph.
Tip
As a new user of the Hypergraph, you might be unsure whether youre
looking at the scene hierarchy or a dependency graph. If you see arrows
between nodes, youre looking at a dependency graph. If Scene Hierarchy
under the Graph menu is grayed, youre looking at the scene hierarchy.
Example
Suppose you create a NURBS sphere, then use the Hypershade to create and assign a
Phong shading group to it. Next you use the Hypershade to create a 2D checker
texture and assign it to the Phong node.
The Hypershade displays the following contents:
The following dependency graph appears when you select Rendering > Show
Shading Groups in the Hypergraph.
Connection line
The connection lines between nodes show connection direction. The connection line
originates at a node that outputs data, and the line points to a node receiving the
data as input.
The preceding figure shows that the flow of output goes from the phong1SG shading
group to the renderPartition.
Although you can see most of the same nodes in the Hypershade, the dependency
graph shows the nodes in a flow diagram. This makes it easy to see the connections
between the nodes that make up a shading group.
If you move your mouse pointer over a connection line, small white boxes appear
next to the input node and output node. The white box next to an input node shows
the nodes name and attribute that receives the input.
checker1.outColor phong1.color
Mouse pointer
The white box next to an output node shows the nodes name and attribute that
provides the output. Each node name and attribute is separated by a period, for
example, checker1.outColor and phong1.color. In the preceding figure, the outColor
attribute of checker1 is output to the color attribute of phong1.
In many cases, you must be familiar with Maya internal operation details to
understand the node and attribute names you see in the white boxes.
Tip
You can select an objects shape node in the scene hierarchy without
showing shape nodes. Select the objects transform node, put the mouse
pointer in the Maya or Hypergraph window, then press your keyboards
down arrow key. The shape node is displayed in the Attribute Editor.
Selecting a shape node with this technique is useful for scenes having
many nodes, where displaying all shape nodes in the scene hierarchy takes
up a lot of panel space.
Press the up arrow key to return to the transform node.
Example
Suppose you create a wine glass surface by revolving a NURBS curve. The following
dependency graph appears when you select the revolved surfaces shape node and
select Graph > Up and Downstream Connections:
Note that the graph is shown with a vertical orientation to make the illustration fit
on this page. By default, a dependency graph has a horizontal orientation. See
"Displaying a graph vertically or horizontally" on page 295.
The connection lines between nodes show connection direction. The connection line
originates at a node that outputs data, and the line points to a node receiving the
data as input. For information on the connection line colors, see "Connection line
colors" on page 280.
The example graph shows that a curve provides input to the revolve operation node.
The revolve operation generates a revolved shapethe wine glass. The revolved
shape is connected to initialShadingGroup, which sets the default color of all
geometric shapes created in Maya.
If you move your mouse pointer over a connection line, small white boxes appear
next to the input node and output node. The white box next to an input node shows
the nodes name and attribute that receives the input.
The white box next to an output node shows the nodes name and attribute that
provides the output. Each node name and attribute is separated by a period.
In many cases, you must be familiar with Maya internal operation details to
understand the node and attribute names you see in the white boxes.
Note that the dependency graph and scene hierarchy display animated nodes as
slanted boxes. If you animate a node with an expression, it displays a regular
rectangle rather than a slanted box. All other animation techniques display a slanted
box. Specifically, a slanted box indicates Ball has a param curve connected to it.
Example
Suppose you keyframe the translateX attribute of a NURBS sphere named Ball. If
you select Balls transform node and display all upstream and downstream
connections, this graph appears:
The slanted box indicates Balls transform node has been animated. The graph
doesnt indicate which type of animation technique controls the attribute.
These colors are the default. You can change them in the Colors window (Window >
Settings/Preferences > Colors).
Also note that a dotted line in the scene hierarchy indicates a connection to an
underworld node or an instanced object.
To disconnect nodes:
1 Click the connection line representing the connection in the dependency graph. The
connection line turns yellow to indicate its selected.
2 Press your keyboards Backspace key. The connection line disappears, indicating you
disconnected the connection.
To update the graphs layout to display the disconnected nodes more appropriately,
select Graph > Layout.
Example
Suppose you create a NURBS sphere named Ball. You then use the Hypershade to
create a Phong E material with red color and assign the resulting phongE1SG
shading group node to Ball.
The Hypershade displays the following contents.
The following dependency graph appears when you select Rendering > Show
Shading Groups, then select the phongE1SG node and select Graph > Up and
Downstream Connections.
The graph shows that an attribute of the BallShape node (that represents Balls
geometry) is input to the phongE1SG shading group node. Ball gets its color from
the phongE1SG node.
To stop the phongE1SG node from setting Balls color, do the following:
1 Click the connection line leading from BallShape to phongE1SG. The connection line
turns yellow to indicate its selected.
2 Press the Backspace key on your keyboard.
The connection line disappears, indicating you disconnected the nodes. The
phongE1SG no longer controls Balls color.
Ball keeps its previous shading group attribute values. In other words, it stays red
and doesnt become the default gray. If you alter attributes of phongE1SG, though,
the changes are not passed to Ball.
You can reconnect BallShape to another shading group node to make it control Balls
shading. For example, you can use the middle mouse button to drag BallShape from
the Outliner onto initialShadingGroup.
Balls color becomes the default gray color set in the initialShadingGroup node. Note
that each geometric object you create is connected to the initialShadingGroup node,
by default, until you connect it to another shading group.
Example
Suppose you create a NURBS sphere and cone named Ball and Cone. You use the
Hypershade to create a Phong E material with red color, and a Blinn material with
blue color. You assign the resulting phongE1SG shading group node to Ball, and the
blinn1SG shading group to the Cone.
The Hypershade displays the following contents:
The following dependency graph appears when you select Rendering > Show
Shading Groups, select the phongE1SG and blinn1SG shading groups and select
Graph > Up and Downstream Connections.
The graph shows ConeShape connected to the blinn1SG shading group, and
BallShape connected to the phongE1SG shading group.
You can swap the colors of Ball and Cone by reversing their connections to the
shading groups.
To reverse connections:
1 Use the middle mouse button to drag ConeShape onto phongE1SG. This reconnects
the default output attribute of the ConeShape node to the default input attribute of
the phongE1SG node. Cone becomes red.
2 Use the middle mouse button to drag BallShape onto blinn1SG. This reconnects the
default output attribute of the ConeShape node to the default input attribute of the
phongE1SG node. Ball becomes blue.
Tip
Select Rendering > Create Render Node to create a new material, texture,
or light. You can then connect to the new node using the dependency
graph.
Example
Suppose you create a NURBS sphere named Ball. You then use the Hypershade to
create a Phong E material with blue color and assign the corresponding phongE1SG
shading group node to Ball to color it blue.
You then create a black and white 2D checker texture, but you havent assigned it to
an object.
To replace Balls blue color with the checker texture, you must use the middle mouse
button to drag the texture node onto the shading group.
If you select Rendering > Show Shading Groups, youll see the shading groups in the
scene, but not the textures.
If you select Rendering > Show Textures, youll see the textures created in the scene,
but not the shading groups.
To drag the checker1 texture onto the phongE1SG shading group, you need to
display them in the graph at the same time. Do the following steps:
1 While the checker1 node is displayed in the dependency graph, use the middle
mouse button to drag the phongE1SG shading group node from the Hypershade
into the Hypergraph window.
2 Select the checker1 and phongE1SG nodes and select Graph > Upstream and
Downstream Connections.
The dependency graph for the phongE1SG node appears as follows.
3 Use the middle mouse button to drag the checker1 node onto the phongE1SG or
PhongE1 node. Maya makes a connection from checker1 to phongE1 and draws a
connection line representing the connection:
Ball shows a black and white checkerboard texture, rather than blue color. Turn on
Shading > Smooth Shade All and Shading > Hardware Texturing to display shading
and textures of objects in your workspace.
6 Move the mouse pointer over the connection line between checker1 and phongE1.
White boxes appear next to the nodes. They show that the default output outColor
attribute of checker1 connects to the default input color attribute of phongE1.
Because of this connection, the black and white checker1 texture provides the
material color for the phongE1 node and therefore the phongE1SG shading group.
An object connected to the phongE1SG shading group receives the black and white
checker1 texture.
EDITING OBJECTS
There are several ways to edit objects as youre examining the scene hierarchy or
dependency graph. You can:
select objects
add and select an IK handle
rename objects
hide objects
edit a selected nodes attributes
add a render node
Selecting objects
The scene hierarchy and dependency graph offer a convenient way to select objects
or other items in a scene. This is useful when items in the workspace are crowded
and overlapping.
To select an object:
1 Track and dolly the view to find the node that represents the object or component.
For example, if your scene has an object named Ball, bring the node representing Ball
into view in the scene hierarchy.
2 Click the node to select it. The node changes to yellow.
Click a node to
select the object
it represents.
To deselect an object:
Click an empty spot in the window. When you deselect a node, it becomes gray
again.
To add an IK handle:
1 In the Animation menu set, select Skeleton > IK Handle Tool.
2 In the scene hierarchy, select the top node of the joint chain.
3 Shift-select the bottom node of the joint chain. Maya creates an end effector and IK
handle for the joint chain.
IK handle icon
To select an IK handle:
Click the IK handle icon to the right of the end effector node. The IK handle node
and icon turn yellow to indicate you selected it.
If you make the IK handle node the child of another node, its location might be hard
to find in the graph. The IK handle icon to the right of the end effector at the bottom
of the joint chain makes it easy to find.
Renaming an object
You can rename an object or other item in the scene hierarchy or dependency graph.
You can give two nodes the same name, but only if each has a different parent.
RoadBike MountainBike
This is allowed.
Bike
Tire Tire
To rename an object:
1 Right-click on the node representing the object and select Rename from the pop-up
menu. A small text box appears in the node:
To hide an object:
Right-click the node representing the object and select Hide from the pop-up menu.
The object disappears from the workspace and the text on the node becomes grayed
in the scene hierarchy.
Invisible node
2 Right-click on the node representing the object and select Show from the pop-up
menu. The object reappears in the workspace.
Note
If you dolly away from a graph, the text in node boxes becomes
abbreviated. An ellipses (...) appears to the right of the abbreviation.
To read the text, move the mouse pointer over the box. The nodes name
appears in a pop-up box. The type of node appears in parentheses next to
the node name.
For example, if you see Ball (transform) in a box, it means the box
represents the node named Ball, which is a transform node.
Dollying a region
You can dolly the view of a selected region by dragging a selection box around it.
To dolly a region:
Ctrl-Alt-drag a selection box from left to right around the region.
Drag from
left to right
The region in the selection box expands to the center of the Hypergraph window.
In a large graph, the node names will be too small to read. Youll need to dolly and
track this view to read the names.
Selected node
These updates slow Maya operation when you work with a complex scene or when
youre examining nodes or dragging nodes to new positions in a free-form hierarchy.
You can turn off updating to improve operation speed.
Depending on how you altered the graph, the previously displayed nodes might not
appear in the bookmarked region anymore. Youll likely need to create a new
bookmark.
As you add or delete nodes in a scene, Maya updates the layout of the scene
hierarchy and dependency graph. Dont be alarmed if you notice a node disappears
from a previously bookmarked view of the dependency graph. This is usually the
result of Maya conforming with its default graph layout.
Tip
You can ensure that a bookmarked view displays a node even after you
reposition, add, or delete nodes in the scene. To do so, select the node and
make sure its entire outline is visible in the view before creating the
bookmark.
If you select two or more nodes, the bookmarked view displays the first
node selected.
To bookmark a view:
1 Track and dolly the view as desired.
2 Select Bookmarks > Create Bookmark. The bookmarked view gets a default name,
for example, hyperView1. The name appears at the bottom of the Bookmarks menu.
You can also rename a bookmark by selecting Bookmarks > name , where name is
the name of the bookmark. A prompt window opens and lets you enter the new
name.
If you prefer to look at a graph upright, you can change to a vertical layout.
For clusters and cluster flexors, you can apply different weights to the set members
to increase or decrease deformations at specified points.
For skin, you can apply different weights to the set members to increase or decrease
skin deformation around the joints.
You can create your own set of objects or components for easier selection and
transformation. For instance, suppose you need to repeatedly select the same few
CVs around the eye of a cyclops to animate the eye. Rather than struggle to select the
CVs with a selection box, you might create a set named cyclops_eye for the CVs,
then select the set by clicking the set name in the Relationship Editor.
When you create a shading group with the Hypershade, Maya creates a set that
represents the shading group. You can work with such sets rather than the
Hypershade to conveniently assign shading groups to objects. See Using Maya:
Rendering for details on shading groups.
When you create a layer, Maya creates a set that represents it. You can work with
sets rather than layer menu entries to quickly move members from one layer to
another.
When you add a field to vertices, CVs, or edit points, Maya creates a set named after
the field, for instance, uniformFieldShape1Set. The set members are the vertices,
CVs, or edit points to which you added the field. You can add or remove the set
members to alter the effect of the field. See Using Maya: Dynamics for details on
fields.
UNDERSTANDING SETS
Its easiest to learn about sets by examining the display of the Relationship Editor,
the main tool for working with sets. You can launch the Relationship Editor by
selecting it from the main menu or with other common techniques such as the
Hotbox. For more information about the Relationship Editor, see "Using the
Relationship Editor" on page 217.
Note
Unless instructions in this chapter state otherwise, make all menu choices
from the Relationship Editors menu bar.
Example
Suppose you create three NURBS spheres. You can put the spheres in a set as
follows:
1 Select the spheres in the workspace, Outliner, or elsewhere.
2 In the Sets panel of the Relationship Editor, select Edit > Create Set. The Relationship
Editor displays the newly created set.
By default, Maya gives the set the name set1 or something similar. To use your own
name rather than the default, choose Edit > Create Set .
3 Click the plus sign (+) next to the set to expand its contents.
defaultLightSet
When you add a light to the scene, the light becomes a member of the defaultLight
set by default. Maya keeps all lights in these sets, even when you assign a light to
another set.
defaultLayer
Each scene has a default display layer that consists of all objects that have not been
assigned to any other layer. When you remove an object from a layer, it becomes a
member of the default layer.
When you add a geometric object to the scene, the object becomes a member of the
initialShadingGroup set by default. The shading group colors its members a dull
gray. (You can see the default gray color of such objects in the workspace by
choosing Shading > Smooth Shade All.)
If you create a sphere, for instance, Maya adds the sphere to the initialShadingGroup
set.
Maya keeps a newly added geometric object in the initialShadingGroup set until you
create and assign a different shader to the object. Maya then relocates the object to a
set it creates for the shading group you created. You typically wont do anything
directly with the initialShadingGroup set. Its for Mayas internal use as you make
shading choices.
Example
Suppose you use the Hypershade to create a Phong material. When you create the
node, Maya creates a set named phong1SG. This set represents the Phong shading
group.
Suppose further you use the Hypershade to assign phong1SG to a geometric object
named nurbsSphere1. Maya moves the object from the initialShadingGroup to the
phong1SG set.
Member of
phong1SG
The object receives its surface shading from the options you set in the Attribute
Editor for the phong1SG node.
If you were to add a particle object to a scene, it would become part of the
initialParticleSE shading group set. This set has the same purpose as
initialShadingGroup, only it controls the default shading characteristics of particles
rather than geometry.
An object can be part of only one shading group setwhether initialShadingGroup,
the initialParticleSE, or one you create.
By looking at the members of the shading group sets, you can see which objects are
shaded by the shading groups youve added to your scene. To try out various
shaders on different objects, use the middle-mouse button to drag objects from one
shading group set to another.
For more details on working with shading groups, see Using Maya: Rendering.
Example
Suppose you create a NURBS cone, select several CVs, then choose Deform > Create
Cluster from the Animation menu to apply a cluster.
Apply cluster to
these points
Applying a cluster
creates a set
The set contains the points in the cone controlled by the cluster. In such sets, you can
alter deformations by adding and removing points or by editing point weights of
existing members.
For example, you can add corresponding points from a newly added cone in the
scene. The added points deform with the existing points as you translate, rotate, or
scale the cluster handle.
Creating sets
You can create a set of geometric objects, CVs, vertices, polygonal faces, or other
items.
2 From Mayas main menu, choose Create > Sets > Set .
or
From the Relationship Editor, select Set Editing from the drop-down list and select
Edit > Create Set from the Sets panel.
The Create Set Options window opens.
3 Enter the name of the set in the Name text box.
For example, enter nurbsObjects.
Other options in the window let you add the set to a partition. See "Adding sets to
partitions" on page 309 for details.
4 Click Apply and Close. The set appears with the chosen name in the Relationship
Editor.
If a set or other item in the scene already has the specified name, the new set name
will be appended with a number.
Selecting sets
You can select a set or the contents of a set. You must select a set to remove or
rename it. You must select the contents of the set to apply an action to each member
of the set.
To select a set:
1 In the right panel of the Relationship Editor, click the name of the set and select
Edit > Select Highlighted.
You can also select the set in the Outliner or Hypergraphs dependency graph view.
To display set members in the Outliner so you can select them, turn on Display > Set
members.
To display sets in the Hypergraphs dependency graph view, select the object shape
node associated with the set and choose Graph > Up and Downstream Connections.
Removing sets
If you are no longer using a set, you can remove it without removing its members.
3 Enter the set name for the items and click OK. This creates the set and puts its name
in the cascading menu to the right of Edit > Quick Select Sets in the Maya main
menu.
UNDERSTANDING PARTITIONS
A partition is a collection of related sets. The sets in a partition can have no
overlapping members.
As you create shading groups, bind skin, and do a few other tasks, Maya creates
partitions. It does this to keep the sets separate where an operation would be
hindered by overlapping members. You can also create custom partitions to keep
your own sets separate.
Example
Suppose youre animating a cartoon characters nose as he smiles and laughs. You
added a cluster to several CVs for adjusting the nose as he smiles and another cluster
to different CVs for adjusting the nose as he laughs.
Creating the two clusters creates a set for each group of CVs. Occasionally you want
to move CVs from one set to the other, to alter the deformations that occur as you
transform the clusters.
When you move the CVs from one set to the other set, they remain in the first set.
You might not want the CVs in the first set because they add undesirable
deformations as you transform the cluster.
To avoid this problem, you can create a partition and put both sets in it. The
partition prevents one set from having members of another set. When you move the
CVs from the first set to the second set, theyre automatically removed from the first
set.
You can also add a partition to prevent clusters from having overlapping members
when you add the cluster with Deform > Create Cluster . See Using Maya: Character
Setup for details.
To create a partition:
1 Make sure no objects or other items are selected.
2 Select any sets you want to put in the partition. See "Selecting sets" on page 304 for
details.
3 To create a partition with a default name, select Create > Sets > Partition on the
Maya main menu.
or
In the Relationship Editor, select Partition Editing from the drop-down list and select
Edit > Create Partition in the Partitions panel.
Note
To name the partition when you create it, replace step #3 with:
Select Create > Sets > Partition in the Maya main menu or in the
Relationship Editor, select Edit > Create Partition .
Enter the name of the partition in the Name text box of the Partition
Options window and click Apply and Close.
To display partitions:
In the Relationship Editor, select Partition Editing from the drop-down list. The
partitions appear in the left panel.
To see the sets a partition contains, click the plus sign (+) beside the partition name.
PART 3
PREFERENCES
12 SETTING PREFERENCES
You can use preferences to customize Maya to the way you work. You can change
general color definitions, the way manipulators display, and the appearance of the
Shelf, menu bars, and panels. This chapter describes how to set preferences in Maya.
SETTINGS/PREFERENCES MENU
The Window > Settings/Preferences menu gives you access to the various Maya
preferences windows, including:
Preferences See "Preferences window" on page 316 in this chapter.
Tool Settings Opens the settings for the current tool. See "Specifying tool settings" on page 332 in
this chapter. Also see information on the specific tool.
Performance Settings
See "Specifying performance settings" on page 333 in this chapter.
Hotkeys Displays the Hotkey Editor to let you create and edit your own hotkey combinations.
See "Assigning hotkeys" on page 362.
Colors Displays the Colors window to let you specify the color of various components of
Maya, including the Hypergraph and the Multilister. See "Changing color settings"
on page 330 in this chapter.
Marking Menus Displays the Marking Menus window to let you edit the marking menus. See
"Creating and editing marking menus" on page 351.
Shelves Displays the Shelves window to let you create and edit shelves. See "Creating and
editing shelves" on page 339.
Panels Displays the Panels window to let you create and edit your own panels. See
"Working with Panels and Layouts" on page 367.
Plug-in
Manager Opens the Plug-in Manager to let you load and unload plug-in software and Maya
modules. See "Loading and unloading plug-ins" on page 334.
User preferences
The following files define user preferences.
userPrefs.mel Contains preferences defined in the Preferences window (Window >
Settings/Preferences > Preferences).
windowPrefs.mel Defines the default size and position of Maya windows.
Important
The scene is cleared of all objects after the commands in the userSetup.mel
file are run. Therefore, any scene elements created using the userSetup.mel
file will have been removed when Maya comes up.
For details about writing MEL scripts, see Using Maya: MEL.
PREFERENCES WINDOW
You can set a variety of preferences in the Preferences window (Window > Settings/
Preferences > Preferences). Select a category on the left and set the related
preferences on the right.
Tip
For your preference changes to take effect, make sure you click Save.
Interface
Menu Set This determines which menu set displays in the main Maya menu bar on start-up.
The default is Animation.
Show Menubar Hides or displays the main menu bar and the Panels menu bar.
Show Title Bar Hides or displays the title bars in the main window and the Script Editor. The title
bar includes window control buttons for expanding and collapsing the application.
Windows Turn on Remember Size and Position so that Maya restores the size and position of
all windows when closed and re-opened. If turned off, the Maya windows always
display in the center of the screen upon opening.
Command Line Turn on Hold Focus if you want the cursor to stay in the Command Line after you
press Enter. Otherwise, the cursor returns to the current window.
Open Attribute Editor
Use this option to specify how the Attribute Editor displays when you open it (such
as pressing Ctrl+A). To open the Attribute Editor in a separate window, select In
Separate Window. To open the Attribute Editor in the main Maya window, select In
Main Maya Window.
Open Tool
Settings Use this option to specify how the Tool Settings display when you open them. To
open the Tool Settings in a separate window, select In Separate Window. To open
the Tool Settings in the main Maya window, select In Main Maya Window.
Expression
Editor Select an Expression Editor for editing text.
UI Elements
Visible UI
Elements Hides or displays UI elements. You can also control this display from the Display >
UI Elements menu.
Turns on any elements you want displayed in the Maya main window.
Note
You cannot display both the Channel Box and the Attribute Editor in the
main Maya window at the same time.
Misc
Display Time Specify a display time for pop-up help. The default is four seconds.
Window
Selection Select whether Maya uses the existing help browser window (Use an Existing Help
Browser Window) or creates a new one (Create a New Help Browser Window for
Maya Help) when you select a Help menu item.
Window
Visibility Select whether an html browser appears when you select Help > Library, Global
Index, Search, Maya Basics, or MEL. The default is on.
When Saving When Save Panel Layouts with File is turned on, the panel layouts are saved with
the scene file. The default is on. (This replaces the former Save File options.)
When Opening When turned on, this restores saved layouts from the file. The default is on. (This
replaces the former Open File options.)
Starting New Scenes
You can specify a layout for new scenes.
Keep Current
Layout Keeps the current layout for new scenes.
Use Layout Specified
Below Creates new scenes based on the layout selected from the pull-
down menu. Single Perspective View is the default.
Display
Fast Interaction Turns Fast Interaction on to improve performance by displaying fewer geometric
entities (such as polygons). The default is off.
Axes Displays one or both of the XYZ coordinates (view and origin axes). If you disable
both choices, no XYZ coordinates appear.
View Axis Displays the XYZ coordinates in the bottom left corner of the view.
The default is on.
Origin Axis Displays the XYZ coordinates at coordinates 0, 0, 0. The default is
on.
Grid Plane Displays or hides the grid plane. The grid is a 2D plane that represents 3D
dimensions in the view. It is useful when you want to animate motion relative to a
solid surface. Select Hide to hide the grid. The default is Show.
This setting overrides the Display > Grid setting described in "Using a grid" on page
115.
Active Object
Pivots Specify whether to display pivot points. The default is off.
Affected Highlighting
Turns highlighting display on or off. An object associated with or affected by a
selected object is highlighted in a different color. The default is on.
Note
You can edit this highlight color by selecting Window > Settings/
Preferences > Colors, clicking the Active tab, expanding General, and
modifying Active Affected.
Wireframe on Shaded
Select how you want to display the wireframe on shaded objects.
Full Displays normal resolution wireframes on shaded objects. This is
the default.
Reduced Displays fewer wires on shaded objects.
None Displays no wires on shaded objects. Performance is enhanced if
you select None.
Region of Effect This option lets you turn on or off the region of effect display. Region of effect is the
part of an object that will potentially change as a result of moving selected CVs. Note
that curves show the region of effect as well as surfaces. The default is on.
Region of
Effect on
Region of
Effect off
Shade
Templates If on, template objects appear shaded in shaded view. If off, the templated objects
appear as wireframes while all other objects appear shaded. The default is off.
Kinematics
Joint Size Changes the display size of skeleton joint sizes. The range is from 0.01 to 5.0.
IK Handle Size Changes the display size of IK handles. The range is from 0.01 to 5.0.
Animation
Steps before Current Frame
Specifies how many ghosted images are drawn at frames before the current frame.
Type a value or drag the slider. The default is 3.
Steps after Current Frame
Specifies how many ghosted images are drawn at frames after the current frame.
Type a value or drag the slider. The default is 3.
Frames Per Step Specifies the number of frames between drawing the ghosts. Type a value or drag
the slider. The default is 3.
Manipulators
Global Scale Specifies the size of the manipulators. The range is from 0.10 to 10.00.
Handle Size Specifies the size of the handle. The range is from 4 to 100.
Line Size Specifies the line thickness size of the rotate manipulators rings.
Line Pick Size Determines the line thickness used when picking the rotate manipulator rings. The
pick size should be the same as line size, so you can identify which handle will be
picked by the size of the ring.
Previous State
Size Controls the size of the points drawn for a previous feedback. For example, for the
Move Tool, an axis is drawn to indicate the previous position, with square points at
the end of the axes. This controls the size of the squares.
Rotate and scale manipulators also have previous state feedback. This type of
feedback is shown only when you drag; it disappears as soon as you release the
mouse.
Default
Manipulator You can specify a Default Manipulator option in the Show Manipulator section to
control what manipulator, if any, appears when you select the Show Manipulator
Tool. The Default Manipulator options include:
None Does not display a manipulator.
Translate Displays the Move Tools manipulator.
Rotate Displays the Rotate Tools manipulator.
Scale Displays the Scale Tools manipulator.
Transform Displays the Transform (triple) manipulator.
Smart Checks the first child and if it is a shape displays the history
manipulator for the shape. Otherwise displays the Transform
(triple) manipulator. This is the default.
NURBS
New Curves, New Surfaces
Select whether you want Edit Points, Hulls, and/or CVs on new curves or new
surfaces:
Note
These options work only on new curves or surfaces, not existing items.
Surface
Divisions Controls the smoothness of an object in a view. It also affects the rendering of newly
created surfaces. Enter a value or use the slider. The range is from 0 to 64. The higher
the value, the smoother the surface.
Curve Divisions Controls the smoothness of a curve in a view. Enter a value or use the slider. The
range is from 1 to 128. The higher the value, the smoother the curve.
Shaded
Divisions Controls how smooth your smooth-shaded object looks. Enter a value or use the
slider. The range is from 1 to 64. The higher the value, the smoother the smooth-
shaded object.
Polygons
Vertices Specify how you want vertices to display:
Display Turns the display of vertices on or off.
Normals Displays vertex normals on or off.
Backculling Makes vertices invisible in areas where the normal is pointing
away from the camera.
Edges Specify how you want edges to display:
Standard Displays all edges the same (hard or soft).
Soft/Hard Displays soft edges as dotted lines and hard edges as solid lines.
Only Hard Displays hard edges only (makes soft invisible).
Highlight Specify how you want to highlight polygons:
Border Edges Displays thicker outside edges to make them more visible for
certain operations.
Texture
Borders Displays a thick border to highlight the area a texture affects per
polygon or per vertex.
Border Width Specify the width of the polygon border. The range is from 1 to 10.
Faces Specify how you want faces to display:
Centers Displays a small square to indicate the face center.
Normals Shows the normals at the center of each polygon.
Triangles Displays all polygons as triangles.
Settings
Up Axis Sets the up axis to Y or Z. The default is Y. See "Orienting the XYZ system" on page
41.
Linear Sets the unit of measure for operations that use linear values, for example, moving
and scaling. The default unit for measuring linear values is centimeters.
Angular Sets the unit of measure for operations that use an angular value, for example,
rotation. The default unit for measuring angular values is degrees.
Time Sets Mayas internal representation of what one second is. For example, in a
dynamics simulation, which relies on real world timings, the resulting simulation
will produce keys which represent one second as 24 frames (Mayas default value).
It also allows you to compensate for intermediate output devices (for example,
Abekas, etc.) which may have different frame rates to your final output (for example,
Film). When changed, your animation keys will move in time to match that range.
This is only while your time units are on that alternate setting. Returning the time
units to your creation setting will return your keys to their original location.
The default for measuring time is Film 24fps (24 frames per second).
Note
Be sure you set your preferred time unit for a particular session, before
creating any animation. This will ensure correct timing of your keyframes,
for the final output and final fps setting.
Keep Keys at
Current Frame By default when you change the current time unit, the times for any existing keys are
modified so that playback timing is preserved. For example, a key set at frame 12film
changes to frame 15ntsc when the current time unit is changed to ntsc, since they
both represent a key at 0.5 seconds. When this option is on, it will leave the key at
12ntsc that was originally at 12film. The default setting for this option is off. The
option will turn itself on once the current time unit is changed.
Tolerance
The Tolerance value determines the degree of accuracy that is maintained between
the original and fit (or interpolated) curves. This setting applies globally to Maya.
You can change it on a case-by-case basis. Set the following tolerance options:
Positional Set the degree of accuracy between the actual positions of the original and
interpolated curves.
Tangential Set the degree of accuracy required to determine if two NURBS objects are to be
made tangent across a shared edge or point.
Dynamics
Auto Create Rigid Body
Turn this option on to automatically create active rigid bodies when you connect an
object to a field (apply a fields influence to geometry).
Run Up To Current Time
If you click a frame in the Time Slider, the correct state of all dynamic objects in the
scene is displayed only if Maya performs run-up to calculate each frame prior to that
frame. Turn this option on if you want to click frames in the Time Slider. Note that
run-up also occurs for hidden objects.
Leave run-up turned off if you want to prevent Maya from calculating dynamics
when you click in the Time Slider. This is useful in a scene that has both nondynamic
objects and complex dynamic objects, where you want the state of nondynamic
objects to appear promptly after you click the Time Slider. If you are keying dynamic
objects, its also useful leave run-up turned off to avoid waiting for run-up
calculations that are irrelevant to your keying activities.
Files/Projects
Default Projects Directory,
Always Start in This Project
Use these settings to set up a default projects directory when you create new projects
and on startup.
Files,
Increments,
Projects Specify how many files, increments, and projects you want to have listed in each of
the File > Recent submenus.
On File Save Specify the compression mode you want to use when saving an ASCII file:
Compressed Saves files in compressed mode. File compression reduces the
sizes of large files so they do not occupy as much space on your
hard drive.
Uncompressed Saves files in uncompressed mode.
As Is Keeps files in their original compression mode rather than
compressing or uncompressing them. As Is is the default.
File Import
Merge Specify how you want the Display Layer merged when you import a file.
None All layers read in are put in a new layer, renumbered, and
renamed, if necessary to preserve uniqueness.
By Number Rather than creating a new layer, all layers read in that have the
same index number as an existing layer are merged with that
layer.
By Name Rather than creating a new layer, all layers read in that have the
same name as an existing layer are merged with that layer.
Keys
Auto Key Turn Auto Key on to automatically set keys on keyable attributes of an animated
object (including lights, shaders, textures, cameras, and so on).
New Curve
Default Use this menu to create blends between rotations using quaternions rather than
Euler angles.
Weighted
Tangents Turn Weighted Tangents on to give animation curve tangents weight. The default is
turned off, which means the tangents are non-weighted.
Default In Tangent, Default Out Tangent
Set the default In and Out Tangents to:
Spline Creates an animation curve that is smooth between the key before
and the key after the selected key.
Linear Creates an animation curve as a straight line joining two keys.
Clamped Creates an animation curve which has the characteristics of linear
and spline curves.
Flat Sets the in and out tangents of the key to be horizontal (with a
slope of 0 degrees).
Stepped Creates an animation curve whose out tangent is a flat curve.
Modeling
Output
Geometry As These settings determine the type of geometry created from modeling actions such
as Revolve, Loft, Extrude, Fillet Blend, and so forth. Setting it here affects all
applicable modeling actions. Otherwise, select Mixed to use the individual settings
of each modeling action.
Interaction
Mode Specify whether you want certain NURBS modeling commands to behave like
actions or tools. An action performs a discreet function on selected objects. A tool lets
you manipulate objects until you complete the operation. You may want to change
actions to tools as you become proficient at Mayas NURBS modeling, or it you are
accustomed to Power Animator tools.
To globally change the applicable modeling tools, choose Everything is a Tool or
Everything is an Action. To individually set each command, choose Mixed.
While Duplicating Select an option to specify how to handle node names while duplicating child nodes.
Retain Same Name for
Child Nodes The child node name remains the same when the hierarchy is
duplicated. This is the default.
Assign Unique Name to
Child Nodes The child node is renamed when the hierarchy is duplicated.
Selection
Modifiers
Modifiers control Maya selection operations. They work with masks to control what
is displayed when you select items. You can turn on one or more of the following:
Single Marquee Select
Selects the first object in a hierarchy.
Click Drag
Select Lets you perform one-step click-dragging with the transformation tools. You can
move one object using the Move tool, then click on a second object and the Move tool
displays. This means you do not have to select the object and the Move tool again
you can keep using the Move tool on any subsequent selected object. The default is
off.
Affects Active If you change from object to component selection mode, the selected object is not
affected. This option lets you select objects and components at the same time. The
default is on.
Popup Menu
Selection When objects overlap in the view, lets you display a pop-up list of the objects so you
can select them. Left-click on the overlap area to display the menu. The default is off.
Click Box Size This option controls the size of the selection area around the mouse pointer, or click
box. If you are having problems with selecting objects or components, try adjusting
this option. For example, a higher click box size might make it easier to select curves.
Increasing the click box size is also useful if you have a high resolution screen
display.
Polygon Selection
Select Faces
with Specify how you want to select polygonal faces:
Center Select polygonal faces at their center. In other words, you must
click the box at the center of the face to select the entire face.
Whole Face Select the entire face. You can click anywhere on the face, even any
face edge, to select it.
Priority
You can specify a selection priority for objects and components. By default, NURBS
curves have a higher selection priority than surfaces. This means that Maya will
select the NURBS curve before the surface when you select geometry that contains
both NURBS curves and surfaces.
3 Enter the
priority number.
Snapping
With these options, you can control the size region around the mouse pointer that is
used for the snap operation.
Use Snap
Tolerance When on, the snap region is restricted to a square area around the cursor, defined by
the Snap Tolerance option. When off, the snap region is unlimited; you can snap to
anything viewable.
Snap Tolerance Controls the size of the snapping area around the cursor when Use Snap Tolerance is
on. For example, if you have two curves close together and you try snapping to one
of the curves, the object may snap to the wrong curve. To avoid this, try using a
small Snap Tolerance value.
Sound
Waveform
Display The Waveform Display option allows you to control how much of the sounds
waveform is displayed.
Top Displays only the top half of the sound.
Repeat on Hold Repeats a sound at the current time. You must hold the mouse button down in the
Time Slider. For more information on using sound with Maya, see Using Maya:
Animation.
Repeat Size Controls how much sound (in the current time unit) is repeated when you turn on
Repeat on Hold.
Timeline
Playback Start/
End Specifies the range of time to use as your time playback range.
Animation Start/
End Displays the entire range of times available.
Height Adjusts the height of the time slider. This helps with sound synching (as a
soundtrack can be displayed in the time slider.) Select 1x for the default size, 2x to
double the size of the slider, and 4x to increase the size four times.
Key Ticks Keyframe ticks show the location of keys along the time slider. Select None to turn
the key tick display off, Active to display only active keys, or Channel Box to display
only those keys in the Channel Box.
Options Turn the following options on or off:
Timecode Changes the default display of time to video standard timecode.
Enables the Timecode Offset box so you can supply timecodes to
match the timing from videotape.
Snapping Turns key snapping on or off. When on, the time indicator shows
integer values only.
Timecode
Offset The Timecode Offset lets you specify how time 0 on the Time Slider appears when
displaying in Timecode mode. For example, if the Timecode Offset is set to three
hours (a value of 03:00:00:00), the Timecode Display would read 03:00:00:00 at time 0.
Update View Specifies whether Maya plays back an animation in All modeling views or only in
the active view. The default is Active.
Looping Specifies how you want Maya to play back an animation. Select Once to play an
animation once, then stop. Select Oscillate to play an animation forwards and
backwards continuously. Select Continuous to play an animation continuously.
Continuous is the default setting.
Playback
Speed Specifies the frame rate for playback.
Play every frame Displays all the frames of your animation. Each frame is updated
completely before proceeding to the next one. Specify the exact rate in the Playback
by box. This rate reflects your systems ability to draw your animation on screen and
is not necessarily a real-time playback mode. This is the default setting.
Real-time (24 fps) Plays your animation in real-time. Some frames may be dropped
(not displayed) to execute this in real-time. This depends on your systems
capabilities, the complexity of your scenes, and the display mode for the playback.
Half (12 fps) Plays back at exactly half the speed of real time.
Other Enables the Other box so you can enter an exact ratio of playback rate to real-
time.
Playback by If you select Play every frame for the Playback Speed, specify the exact rate in this
box. This rate reflects your systems ability to draw you animation on screen and is
not necessarily a real-time playback mode. The default setting is 1.0.
Undo
Undo Select On if you want to be able to undo operations. This is the default. See
"Selecting objects" on page 69.
Queue Select Infinite to perform an unlimited number of undo operations. This option can
use a lot of memory. Select Finite to limit the number of undo operations you can
perform (specified in the Queue Size box). The default is Finite.
Queue Size If Finite is the selected Queue setting, specify here the number of undo operations
you can perform. The default is 10.
Modules
Maya includes a number of different software modules. Each time you start Maya,
the software loads all the available licensed modules.
Note
If you enable or disable a module, you must exit Maya and restart the
software for the changes to take effect.
Tips
Use lighter colors for active components and darker colors for inactive
components.
If you have made changes to the color settings for a tool and want to
restore the original settings, select Edit > Reset to Defaults in the Colors
window.
The Colors window has three tabs. Each tab allows you to change the default colors
for a different set of components.
General tab Use the General tab to change the default colors for components in these areas: 3D
Views, User Defined, Ghosts, Heads Up Display, Animation, Animation Editors,
Multilister, Hypergraph / Hypershade, Outliner, and Trax Editor.
Active tab Use the Active tab to change the default colors for components in these areas:
General, Objects, Components, Deformers, Manipulators, Animation, and Artisan
Brushes.
Inactive tab Use the Inactive tab to set the colors for objects that are not selected. The Inactive tab
lets you change the default colors in the following areas or tools: General, Modeling,
Objects, Components, Deformers, and Animation.
Click here to
display the
Color Chooser
or
In the Active or Inactive tab, click on a component to select it. Maya matches the
existing color to one that most closely resembles it on the Index Palette. Double-click
the corresponding color on the Index Palette to open the Color Chooser.
4 Select the color in the Color Chooser. See "Using the Color Chooser" on page 233.
5 Click Save.
Note
You can change the color value in the Colors window by dragging the
slider beside the component color.
Duplicating a tool
Using shelves, you can have two tools with the same name but different tool
settings. For example, you can have two versions of the Particle Tool. See "To add a
tool from the Tool Box:" on page 342.
Loading plug-ins
You can manually load plug-ins each time you run Maya, or you can have them load
automatically when you start Maya.
To load a plug-in:
Select Window > Settings/Preferences > Plug-in Manager. The Plug-in Manager
window opens.
Note
You cannot load a plug-in for any version of Maya that predates the
version it was compiled for.
Auto Load Indicates whether the plug-in has been marked for auto load.
Is Loaded Indicates whether the plug-in is loaded.
Plug-in Features Displays a list of the features added by the plug-in (for example, commands,
dependency nodes, file translators).
To display additional plug-ins, click the triangle to open the Other Registered Plug-
ins section.
Unloading a plug-in
You can unload a plug-in when you finish with it. To unload a plug-in, turn off the
loaded check box next to it.
If you are developing a plug-in, unload it so the source code can be changed, the
plug-in recompiled, and then reloaded.
This chapter provides detailed information about Mayas shelves, marking menus,
and hotkeys. This information is for advanced users.
Shelves are user-customizable areas to hold the actions and tools you use most often.
Marking menus are an innovative way of selecting various menu items with the right
mouse button. Hotkeys are keyboard shortcuts for commands.
Shelves Click the Shelves tab to display existing shelves. From here you can create, delete,
and rename shelves and change their order. For details, see "Creating and deleting
shelves" on page 341 and "Reordering the shelves" on page 345.
Shelf Contents Click the Shelf Contents tab to display the contents of a specific shelf. From here you
can move and delete shelf items, change an items label and tooltip, as well as
change its icon and icon name. For details, see "Changing shelf icons" on page 345,
"Changing icon labels" on page 347, and "Setting Shelf options" on page 348.
Edit Commands Click the Edit Commands tab to view and edit the MEL code associated with a tool
or action. For details, see "Changing MEL command(s) associated with an icon" on
page 349.
Label & Tooltips Specify a brief description of the tool. This description appears with the icon in the
icon or text modes, as well as in the tooltip (the pop-up description when the mouse
hovers over the icon). For details, see "Changing icon labels" on page 347. (Where it
appears is determined by Options menu settings. For details, see "Setting Shelf
options" on page 348).
Icon Name Type a label for the icon. This text appears on top of the icon to distinguish it from
other items that use the same icon. Note that the icon name always appears on top of
the icon, unlike the label, which you can specify to show or hide.
Change Image Click this button to change the icon image. For details, see "Changing shelf icons" on
page 345.
Save All
Shelves Click Save All Shelves to save all changes immediately and write the information to
the user shelves directory. The file name for a shelf file has the prefix shelf_.
Close Click Close to accept your changes but not write them to the disk immediately. If
your UI preference is to save shelf changes only when explicitly requested, the
changes will stay in effect only for the current session. Otherwise your changes will
be saved the next time you save a file or quit the application. For information on
changing this preference, see "Setting Shelf options" on page 348.
To create a shelf:
1 Open the Shelves window (Window > Settings/Preferences > Shelves) and click the
Shelves tab. Maya displays the names of all existing shelves.
2 Click New Shelf. Maya displays a default name for the new shelf in the Name text
box and adds a new shelf tab in the main Maya window.
Default name
for new shelf
3 Double-click the name in the Name text box, type the new shelf name (for example,
Kinematics) and then press Enter. Maya adds the name of the new shelf to the Shelves
window and the Maya window.
Name of the
new shelf
Note
The shelf tabs must be turned on to see them. In the main Maya window,
click the Shelf pull-down menu and select Shelf Tabs to turn them on.
To delete a shelf:
1 Open the Shelves window (Window > Settings/Preferences > Shelves) and click the
Shelves tab. Maya displays the names of all existing shelves.
2 Select the shelf you want to delete, then click Delete Shelf. (You do not have to delete
any of the associated icons before deleting the shelf.)
You are prompted to confirm the deletion.
3 Click OK. Maya removes the shelf from the list of existing shelves and from the
Maya window.
Note
You cannot undo a delete command. However, Maya retains the shelf
information in the file shelf_NAME.mel.deleted in the user shelves
directory:
~username/maya/4.0/prefs/shelves (UNIX)
drive:\WINNT\Profiles\username\maya\4.0\prefs\shelves (Windows NT)
drive:\My Documents\username\maya\4.0\shelves (Windows 2000)
So if you want to restore a deleted shelf, rename the file to
shelf_NAME.mel, then restart Maya.
This creates an editable tool on the shelf. If you select this tool from the shelf and
change any settings in the Tool Settings window, the settings for the shelf item also
change. These new settings become the default for the shelf tool.
For example:
1 Open the Script Editor window (Window > General Editors > Script Editor).
2 Select Create > NURBS Primitives > Sphere. A sphere appears at the origin.
3 Select the Move Tool and drag a manipulator arrow to move the sphere.
The MEL command move -r 5.315 0 0; (with your own coordinates), appears in the
upper pane of the Script Editor.
4 Highlight the MEL command text in the upper pane of the Script Editor.
5 Using the middle mouse button, drag the selected text to the shelf and release. This
places a MEL icon on the shelf. When clicked, the icon executes the move -r 5.315 0 0;
command again.
Renaming shelves
You can change the name of a shelf at any time to something more meaningful (for
example, from ShelfLayout1 to Dynamics).
To rename a shelf:
1 Open the Shelves window (Window > Settings/Preferences > Shelves) and click the
Shelves tab.
2 Select the shelf you want to rename. Maya displays the name of the selected shelf in
the Name text box.
3 In the Name text box, change the name and then press Enter. Maya displays the new
name in the list of existing shelves and in the Maya window.
You cannot use spaces or special characters (for example, !,@,#,$,%) in shelf names.
4 Click Save All Shelves or Close.
Description of icon
Icon image
4 Select the description of the shelf item you want to change, then click the Change
Image button. A file browser window opens with the images directory selected.
On UNIX, the browser is called the Pixmap Selector. The browser defaults to /usr/
aw/maya4.0/icons, the location of Mayas default icons.
On Windows, the default icons are stored in drive:\AW\Maya4.0\extras\icons.
5 Select a Maya default image or navigate to a new user-created image (it must have
the file extension .xpm or .bmp).
Note
Maya stores the image as a reference file. If you move it, you must specify
the new location by using the Shelves editor or by setting the
XBMLANGPATH variable.
6 On UNIX, click Apply to see your change in the main Maya window without closing
the Pixmap Selector. Click Done to apply your change and close the Pixmap Selector.
On Windows, click Open.
7 Click Save All Shelves or Close.
Note
On UNIX, you can modify existing images and create new ones from the
Pixmap Selector.
To modify an existing image (but not a Maya default shelf button icon),
select it and click the Modify button to launch the xpaint application. Make
your changes and save them.
To create a new image, click the New button, type a name for the new file,
then click OK to create a blank image in the icons directory. Select the new
image and modify it.
Note
To show or hide the label for the tool, see "Setting Shelf options" on page
348.
Icon/Text
Below Displays the label below the icon.
Icon/Text
Beside Displays the label beside the icon.
Save
Automatically When this option is on, your changes to the shelves are saved when you exit Maya.
This is the default.
Save Only on
Request When this option is on, your changes to the shelves are only saved when you select
Save All Shelves in the Shelves window. If you dont save your changes, then they
are lost when you exit Maya.
You use the Shelves window to assign an icon name to a tool or action.
4 Click the Edit Commands tab. The commands for the shelf item appear in the text
area.
Each menu item represents a command you have added to that marking menu. You
can use the Marking Menus window to add, change, or delete a menu item or
command. For more information on using the Marking Menus window, see
"Modifying existing marking menus" on page 355.
The overflow portion (or linear portion) has one or more menu items. The overflow
items are arranged in a column below the radial items.
Marking menus can be hierarchal. In other words, any menu item can have a
submenu.
Note
Each menu and submenu can contain a maximum of 38 menu items.
3 Use the middle mouse button to drag tools or actions to the Create Marking Menu
window.
For example, to add the Pencil Curve Tool, select Create > Pencil Curve Tool. The
tool displays in the Tool Box. Using the middle mouse button, drag the Pencil Curve
Tool from the Tool Box to the Create Marking Menu window.
Note
You can also add MEL commands to the Marking Menus window. For
details, see "Associating a MEL script with a menu item" on page 359.
Tips
To delete an icon from the Create Marking Menu window, right-click the
icon and select Delete Menu Item.
To create a submenu, see "Adding submenus to menu items" on page 358.
This is useful if you want to increase the number of menu items you can
access from a marking menu.
5 Enter the name of the new menu in the Menu Name text box.
6 To move a tools position, use the middle mouse button to drag the icon to a new
position within the Create Marking Menu window.
Tip
If a tool has an option box, you can make changes to the options.
7 When you are satisfied with the position of every tool in the marking menu, click
Save and then close the Create Marking Menu window.
8 Set the following options in the Marking Menu window and click Apply Settings,
then Close.
Use Marking Menu in
Specify whether the marking menu is linked to the Hotbox or a hotkey. For
information on linking a marking menu to a hotkey, see "Assigning marking menus
to hotkeys" on page 355.
Hotbox Region If you selected Hotbox for Use Marking Menu in, select the Hotbox zone the
marking menu occupies: North, South, East, West, or Center.
Mouse
Button(s) Select the left, middle, or right mouse button used to display the marking menu. You
can select one, two, or three mouse buttons.
Note
A marking menu/hotkey combination will not work in a tear-off window.
You display marking menus by pressing the left mouse button and the appropriate
hotkey. The following hotkeys bring up marking menus.
a Select All History, Disable All Future, Select All Future, and
Enable All Future
e Rotate X, Y, and Z
For more information on setting hotkeys, see "Assigning hotkeys" on page 362.
3 Set the following options and then click Save and Close.
Label Enter the name of the marking menu item.
Icon Filename Enter the name of the icon file. For more information, see Using Maya: MEL.
Command(s) Enter the MEL script used as the command for the menu item. You can drag the
MEL script from the Script Editors bottom panel with the middle mouse button.
Check Box Displays a check box beside the marking menu item.
Radio Button Displays a check box beside the marking menu item.
Neither Displays nothing beside the marking menu item.
Option Box Turn Option Box on to display the option box beside the menu item so you can
change a tools options from the marking menu.
Note
If the tool or action does not have an options window, you must use MEL
code to create the box. Once the box is created, you must write MEL code
to invoke the option window. For more information on MEL commands,
see Using Maya: MEL.
Note
If you create submenus under an overflow menu item, the submenus
cannot contain any radial items.
In the following example, there are four menu items associated with one submenu.
Adding a submenu:
In the following example, a submenu is associated with an icon.
1 Open the Marking Menus window (Window > Settings/Preferences > Marking
Menus).
2 Select the marking menu that has the menu item you want to add a submenu to.
3 Click Edit Marking Menu.
4 Right-click the icon you want to add a submenu to and select Popup Submenu from
the pop-up menu. The icon changes shape indicating that a submenu is associated
with it and the Submenu Editor window opens.
5 Using the middle mouse button, drag tools or actions to the Submenu Editor.
6 Close the Submenu Editor window.
7 To test the submenu, click in the Click Here to Test box.
8 Click Save or Close.
3 If you want to delete the marking menu but keep a backup copy of it, select Create
Backup.
Maya stores the backup file in the user prefs directory with a file extension of .bak.
For information on how to recover the marking menu, see "To restore a marking
menu backup:" on page 360.
or
If you want to delete the marking menu without creating a backup file, click Do Not
Backup.
Note
You cannot recover a marking menu after you select Do Not Backup.
Maya removes the marking menu from the Marking Menus window.
4 Click Close.
Note
You must exit Maya before restoring a deleted marking menu.
3 Select Window > Settings/Preferences > Marking Menus. The following message
appears.
4 Click Load Menus. The recovered marking menu appears in the Marking Menu
window.
Note
Because Maya does not recover the mouse button assignment, you will
have to re-assign a mouse button to the recovered marking menu.
ASSIGNING HOTKEYS
If you use a selection frequently, you may want to assign it to a hotkey. For example,
if you frequently select File > Import, you can assign a hotkey to it. This decreases
your reliance on the main menu.
You assign hotkeys in the Hotkey Editor (Window > Settings/Preferences >
Hotkeys) window. It lists menu items in the main menus, as well as commonly-used
operations, such as Display Wireframe (hotkey 4). Also, you can assign hotkeys to
your own MEL scripts or to commands that accompany plug-in software.
Select a
command
here...
...assign the
hotkey here
Hotkeys shown
beside menu
selections
To assign a hotkey:
1 Choose Window > Settings/Preferences > Hotkeys.
2 Select the category and command.
There are categories for all of the main menus and for several other commands.
Menu commands for plug-ins, including Live and Fur, are under the User category.
If you have trouble finding a command, click Search (see "Examplecreating a
hotkey for a view menu option:" on page 365).
3 In the Assign New Hotkey area, specify the key combination and other settings. You
can see a list of which keys are unmapped by clicking List All.
Key Enter the key you want to assign to the selected command. Enter a
letter from A to Z (upper and lower case are different keys) or a
number from 0 to 9. You cannot use more than one letter or
number.
Or, choose a special key from the pull-down list. For example, if
you want the right arrow key to act as the trigger, assign it here.
Modifier Select either Alt or Ctrl for the hotkey modifier.
Direction Use Press or Release to associate a command with the press or a
release of a key. For example, you can create a hotkey to instruct
Maya to snap to a curve when you press a key, then turn off the
snapping when you release it.
If you added a key to an operation ending with (Press) or
(Release), add the same key to the corresponding (Release) or
(Press) operation.
Add to Recent
Command List Turn on so that this hotkey can appear in the Edit > Recent
Commands window.
Query Click Query to determine whether the specified key settings have
already been assigned to a command.
Find Click Find to highlight the category and command for the key you
enter in the Key field.
4 Click Assign. The new hotkey appears in the Current Hotkeys list.
7 Copy and paste the command into the Command box in the Hotkeys window. On
UNIX, use the middle mouse. On Windows, use Ctrl+C (copy) and Ctrl+V (paste).
You can use panels and layouts to customize your workspace. Panels consist of
interface elements, such as graphs, camera views, editors, and Outliners, that you can
view within the main window. Layouts are groups of panels.
Layouts Displays existing panel layouts and can be used to create additional layouts. See
"Creating layouts" on page 371.
Edit Layouts Displays the current panel layout for editing. See "Defining layouts" on page 370.
History Displays the history of the panels you used. See "Maintaining layout history" on
page 374.
MANAGING PANELS
A panel is a collection of interface display elements. You can view panels within the
main window or tear them off so they exist in a separate window. Panels can consist
of a single element, such as a camera view in a Modeling panel, or multiple
elements, such as the Multilister with its many buttons and tabs. Panels have their
own menu bars for their specific options.
To rename a panel:
1 Select Panels > Panel Editor.
2 Select the panel you want to rename.
Note
You cannot rename the Top, Side, Front, or Persp view panels.
3 Type the new name in the Label text box, then press Enter. Maya changes the name
of the panel in the list of existing panels.
4 To make sure that the renamed panel appears in the list of available panels, select
Panels > Panel.
2 If you have more than one view open, select the view where you want the new panel
to appear.
3 Select a panel (such as the Outliner), then click Make New Panel. Maya creates a new
panel and lists it before the selected view. The name of the new panel appears in the
Panels tab.
Note
Not all panels can be duplicated. For example, only one Hypergraph panel
is allowed. If you try to create multiple Hypergraph panels, Maya displays
an alert message.
4 To view a second Outliner, select Windows > Outliner. Both Outliner windows now
appear in the view.
You can now make changes to the Outliners so they display different information
about the scene.
To delete a panel:
Once you have deleted a panel, you cannot restore it.
1 Select Panels > Panel Editor.
2 On the Panels tab, select the panel you want to delete, then select Delete. A
confirmation dialog appears.
3 To confirm the deletion, click OK. Maya removes the panel from the display.
DEFINING LAYOUTS
You often work with the same combinations of panels, depending on the task you
are working on. When you render, you might want to work with the Multilister,
RenderView and a perspective view. When you edit models, you might use the
Outliner and a perspective view. Panel layouts provide these kinds of
configurations.
A number of predefined layouts are provided in Maya, but you can also create your
own.
Creating layouts
By default, any new panel layouts you create are saved with your preference file.
This allows you to use them with any of your scene files. You can also create and
save panel layouts that are only available with a specific scene.
To create a layout:
1 Select Panels > Panel Editor and click the Layouts tab.
or
Right-click a Quick Layout button in the Tool Box, select Edit Layouts and then click
the Layouts tab.
2 Select a layout, such as the Four View, and then click New Layout.
3 Rename the layout in the Name text box.
4 Click the Edit Layouts tab.
6 Resize the panes by dragging the borders in the thumbnail view of the layout. The
main window changes to reflect your changes.
8 Select whether you want layout to be scene independent or associated with the
scene.
Scene
Independent Scene independent layouts are available for all scenes. Their
contents are defined by panel types.
If you have multiple panels of the same type in a scene, it is not
certain which panels show up when you select your layout. This is
not a problem in most cases; however, if you are working in a
particular scene a great deal, then develop layouts that you can
save specifically with that scene.
Associated with
Scene These layouts are only usable with the current scene. You can
specify a particular panel if you have more than one of the same
type.
Note
If you want to look through cameras other than the built-in persp, top,
front, or side cameras, create another model panel for use in your panel
layout. The Top View, Front View, Side View, and Persp View layouts use
their respective built-in cameras as defaults.
9 From the Select Panel by Type menus, select panels for your panes.
10 Click the Layouts tab and select another layout. The main window changes to show
the selected layout.
11 Select the layout you just created and close the Panels window.
Your new panel layout displays in the main window. Your layout also appears in the
Panels > Saved Layouts menu and the Windows > Saved Layouts menu.
Deleting layouts
At some point, you may no longer need layouts you created so you may delete them.
To delete a layout:
1 Select Panels > Panel Editor.
2 Click the Layouts tab, select the layout you want to delete and then click Delete. A
Confirm dialog appears.
3 Click OK to delete the layout.
4 Close the Panels window.
Note
When you delete a layout, you only delete the named panel configuration,
not the source panels.
History Depth Specify the number of configurations you want stored in the history.
Wrap History Toggle this on to return you to the first view or the most recent view configuration
when you reach the end of recorded history.
Clear History Click this button to delete the record of all the panels you have used.
Previous Layout Click this button to browse back through the panel layouts.
Next Layout Click this button to browse forward through the panel layouts.
ANIMATION
exporting 191 compared to Attribute Spread
importing 179 Sheet 212
A using to create falloff 104
key options 325
custom attributes, adding 227
displaying 222
absolute menus 20 distance locators 109
path 170 nodes 68 linking attributes 232
values 98, 100 oscillating 329 loading attributes into 225
actions playback options 329 locators 106
defined 30 preferences button 22 locking attribute values 232
redoing 82 Animation Details mapping textures to
undoing 82 Heads Up Display 118 attributes 233
animation markers node behavior 230
Add Attributes option, Attribute
Editor 227 hiding 122 opening multiple copies 226
Animation Start/End option 328 parameter locators 111
Add Instance option 80
pivot points 85, 86
Add to Current Selection brush animImportExport plug-in 179,
right-click menu options 224
option 150 191
rotation order 92
Advanced Visualizer file aperture 44
setting keys 231
format 174 API, version for plug-ins 335
Attribute Spread Sheet 207, 212
Affects Active modifier option 326 applications, importing files layout 215
aiff file format 174 from 175 names, shortening 213
Alias Wire Apply Current to All option 121 option 208, 212
exporting file in 189 Arc Length Tool 112
aliasWire format 174 arc lengths
Align Objects 144 locators 113
Align Objects option 142 measuring 112
aligning Array Cloning. See Duplicate
objects, snapping 142 Options window 74
vertices 141 ASCII file 165
All Components Off option 147 format 174, 175
Angle of view 44
Angular units option 322
anim file
exporting 191
importing 179
animated nodes 266, 280
animating
rotation channels 94
transitions (of view) 292
P path
absolute 170
plug-ins
API version 335
packages animation marker, moving 92 auto loading 335
disabling 329 plug-ins 335 features 335
options 329 Penumbra option 129 importing 188
Paint Selection Tool 148 performance improvements 168 information about 335
paint operations 149 Performance Settings 333 loading 334
settings 149 window 333 manager 334
MayaToIges 188
Paint Set Membership Tool, editing performance, improving 121, 126,
sets 305 objExport 188
230, 318, 333
path 335
paint-selecting components 148 perspective 44, 59
references, removing 337
palette in Color Chooser 235 creating view 59
unloading 336
paletteColors.mel 314 view 58
version 335
Panel Configurations 168 Perspective option 52, 53, 58
point snap hotkey 140
Panel Editor 367 perspective view 43
Point to Point option 142
Panel option 61 pick mask 146
points
panels 368 pinning pivot points 86 cluster 302
arrangements, saving 370 pitch 51 measuring distance
arranging 371 Pivot camera option 128 between 107
creating 368 Pivot light option 129 snapping 139, 142
deleting 370 pivot points 86 snapping to 140
layouts, selecting 370 defined 84 Points option 120
managing 368 displaying 85, 127 Poly Count
renaming 368 displaying and hiding 127 Heads Up Display 118
Panels menu 61 manipulator 85 polygon count 118
panes, resizing 371 moving 85 Polygons
param curves 266, 280 pinning 86 components, displaying and
parameter temporary 86 hiding 127
locators, editing 111 unpinning or unlocking 87 polygons
range, changing 97 World Space 86 border width 321
values, displaying 110 Pixel Samples option 191 display options 321
Parameter Tool 110 placements, texture 122 displaying as triangles 321
Parent option 80 planes faces, displaying 321
Parent Options window 80 hiding 122 normal size, specifying 322
Parent to World option 81 view 139 numbering faces, edges, or
playback vertices 322
parents 250, 254, 265, 270
buttons 22 surfaces, hiding 123
breaking relationship 256, 271
frame rate, setting 329 texture border, thickening
creating 255, 271
range, setting 328 display 321
object hierachies 255
Playback Range 22 Pop HotBox hotkey 35
object hierarchies 80
removing object from 81 Playback Speed option 329 popup help 39
Partial curve range option 97 Playback Start/End options 328 popup menu
Channel Box 243
partitions 306
adding sets to 309 Popup Menu Selection modifier
created by Maya 307 option 326
created by you 306 Popup Submenu option 358
creating 308 Positional tolerance option 323
default 307 power modification falloff 103
defined 306 PowerAnimator file formant 174
displaying 308 Predefined Bookmarks option 66
removing 308
pre-defined tabs, Attribute
sets, removing from 308 Spreadsheet 216
X
xpm images for shelf icons 345
X-ray shade option 120
XYZ coordinate system 41
Y
yaw 51
Maya 4 Documentation Team: Steven Brooks, Susan-Belle Ferguson, Lisa Ford, Claude Macri, Susan
Park, Diane Ramey, and Linda Rose.
Alias is a registered trademark and Alias|Wavefront, the Alias|Wavefront logo, Conductors, Dispatcher,
Trax, Wavefront IPR, VizPaint2D, and ZaP!iT are trademarks of Alias|Wavefront, a division of Silicon
Graphics Limited. Maya is a registered trademark and Maya Artisan, Maya Builder, Maya Cloth, Maya
Complete, Maya Fur, Maya F/X, Maya Invigorator, Maya Invigorator Lite Edition, Maya Live, Maya Paint
Effects, Maya Real Time SDK,and Maya Unlimited are trademarks of Silicon Graphics, Inc., used
exclusively by Alias|Wavefront, a division of Silicon Graphics Limited. IRIX and Silicon Graphics are
registered trademarks and SGI is a trademark of Silicon Graphics, Inc.
Wacom is a trademark of Wacom Co., Ltd.
NVidia is a registered trademark and Gforce is a trademark of NVidia Corporation.
Inferno and Flame are registered trademarks of Discreet Logic Inc.
Linux is a registered trademark of Linus Torvalds.
Red Hat is a registered trademark of Red Hat, Inc. Microsoft, Windows NT, and Windows 2000 are
trademarks of Microsoft Corporation in the United States and/or other countries.
UNIX is a registered trademark, licensed exclusively through X/Open Company, Ltd.
All other product names mentioned are trademarks or registered trademarks of their respective owners.
Graph Layout Toolkit, 1992-1996 Tom Sawyer Software, Berkeley, California. All Rights Reserved.
This document contains proprietary and confidential information of Alias|Wavefront, a division of Silicon
Graphics Limited, and is protected by Federal copyright law. The contents of this document may not be
disclosed to third parties, translated, copied, or duplicated in any form, in whole or in part, or by any
means, electronic, mechanical, photocopying, recording or otherwise, without the express written
permission of Alias|Wavefront, a division of Silicon Graphics Limited.
The information contained in this document is subject to change without notice. Neither Alias|Wavefront, a
division of Silicon Graphics Limited, its affiliates, nor their directors, officers, employees, or agents are
responsible for punitive or multiple damages or lost profits or other special, direct, indirect, incidental, or
consequential damages including any damages resulting from loss of business arising out of or resulting
from the use of this material, or for technical or editorial omissions made in this document.
Using deformers 34
Using skeletons 35
Skinning 36
Using constraints 36
Part 2
Part 2 Deformers
3 INTRODUCING DEFORMERS 41
Understanding deformers 41
Deformable objects, points, and sets 42
Nodes, history, and the deformation order 43
Deformer placement 44
Examples 137
Squashing a sphere onto the ground 137
Bouncing ball setup 139
Example 148
Spiral staircase modeling 148
Example 154
Ripple animation 154
Examples 201
Deforming high-res sphere with low-res sphere 201
Deforming plane with five cones 202
Part 3
Part 3 Skeletons
18 INTRODUCING SKELETONS 207
Part 4
Part 4 Skinning
25 INTRODUCING SKINNING 309
Examples 341
Skinning a cylinder by smooth skinning 341
Hand muscle bulge with influence object 345
Using influence objects to prevent unwanted deformation 348
Example 375
Skinning a cylinder by rigid skinning 375
Part 5
Part 5 Constraints
28 INTRODUCING CONSTRAINTS 381
Examples 404
Aiming a sphere at a sphere 404
Aiming a cone at a sphere 405
Part 6
Maya offers the most sophisticated tools available for setting up characters so that
you can then focus on the creative challenges of character animation.
Model of character
The character setup features include deformers, skeletons, skinning, constraints, and
characters.
USING DEFORMERS
Deformers enable you to change the shape of objects. Deformers features are
available in the Animation menu sets Deform menu. For more information on
deformers, see Chapter 3, Introducing Deformers.
USING SKELETONS
SKINNING
USING CONSTRAINTS
Character sets bring together all the aspects of a character that you want to animate
together. Character sets are available from the Animation menu sets Character
menu. For more information on character sets, see Chapter 37, Introducing
Character Sets.
UNDERSTANDING DEFORMERS
With Mayas deformers, you can change the shape of objects. Maya includes the
following types of deformers:
Blend shape deformers: Blend shape deformers let you change the shape of one
object into the shapes of other objects. For more information, see Chapter 4, Using
Blend Shape Deformers.
Lattice deformers: Lattice deformers enable you to deform objects with lattices. For
more information, see Chapter 5, Using Lattice Deformers.
Jiggle deformers: Jiggle deformers let you cause points on a surface or curve to shake
as they move, speed up, or slow down. For more details, see Chapter 7, Using Jiggle
Deformers.
Cluster deformers: Cluster deformers enable you to control a set of an objects points
(CVs, vertices, or lattice points) with varying amounts of influence. For more
information, see Chapter 6, Using Cluster Deformers.
Bend nonlinear deformers: Bend deformers enable you to bend an object along an
arc. For more information, see Chapter 8, Using Bend Nonlinear Deformers.
Flare nonlinear deformers: Flare deformers enable you to flare or taper an object
about two axes. For more information, see Chapter 9, Using Flare Nonlinear
Deformers.
Sine nonlinear deformers: Sine deformers enable you to change to the shape of an
object along a sine wave. For more information, see Chapter 10, Using Sine
Nonlinear Deformers.
Squash nonlinear deformers: Squash deformers enable you to squash and stretch
objects. For more information, see Chapter 11, Using Squash Nonlinear Deformers.
Twist nonlinear deformers: Twist deformers enables you to twist the shape of
objects. For more information, see Chapter 12, Using Twist Nonlinear Deformers.
Wave nonlinear deformers: Wave deformers enable you to deform objects with a
circular sine wave and create ripple effects. For more information, see Chapter 13,
Using Wave Nonlinear Deformers.
Sculpt deformers: Sculpt deformers enable you to deform objects with a spherical
influence object. For more information, see Chapter 14, Using Sculpt Deformers.
Wire deformers: Wire deformers enable you to deform objects with one or more
NURBS curves. For more information, see Chapter 15, Using Wire Deformers.
Wrinkle deformers: Wrinkle deformers enable you to create detailed wrinkling
effects by combining wire deformers with a cluster deformer. For more information,
see Chapter 16, Using Wrinkle Deformers.
Wrap deformers: Wrap deformers enable you to deform objects with NURBS
surfaces, NURBS curves, or polygonal surfaces (meshes). For more information, see
Chapter 17, Using Wrap Deformers.
Note that other software packages use the terms modifiers and space warp to
refer to what Maya calls deformers.
When you create a deformer, Maya puts all the deformable object points that the
deformer can affect into a set, called a deformer set. You can edit this set; for more
information, see "Editing deformer set membership" on page 46.
Dependency graph
Mayas dependency graph provides a representation of the relationships between
connected nodes. To view the dependency graph, you can use the Hypergraph (for
more information, see Using Maya: Essentials).
For any particular node, the dependency graph shows the nodes history. The nodes
history includes all the nodes that are connected to it, or are connected to nodes that
are connected to it, and so on. For discussing a nodes history, the terms upstream
and downstream can be useful. Upstream nodes are nodes that can be evaluated
before the node itself is evaluated, and downstream nodes are nodes that can be
evaluated only after the node itself is evaluated. Note that, from Mayas perspective,
a nodes history includes its future as well as its past.
Deformation order
Its important to keep a nodes history in mind when using deformers. The
deformation effect provided by a particular deformer can depend on where Maya
places the deformer in the nodes history. The reason is that the deformation effect
can vary depending on the order in which Maya evaluates the deformations. The
order in which Maya evaluates deformations is called the deformation order.
In general, you can apply as many deformers to an object as you like. Because the
effects depend on the order in which the deformers deform the object, you can create
a great variety of effects. For example, for a NURBS cylinder, if you create a bend
deformer and then create a sine deformer, the result will be different than if you first
created the sine deformer and then created the bend deformer.
Deformation chain
Consider the history of a NURBS sphere being deformed by one or more deformers.
In the dependency graph, the original (undeformed) shape node
(nurbsSphereShapenOrig) would follow immediately after the make node
(makeNurbSpheren). Note that Maya sometimes refers to an object displayed as the
original shape node an intermediate object. Maya places a tweak node (tweakn)
after the original shape node (for more information on tweak nodes, see "Point
tweaking on objects being deformed" on page 49). After the tweak node, Maya
places the deformer nodes that carry out deformations, typically in the order that the
deformers were created. The order in which Maya places the deformer nodes
downstream from the original shape node determines the deformation order.
However, note that you can control deformer placement (see "Deformer placement"
on page 44) when you create a deformer, and change the deformation order (see
"Changing an objects deformation order" on page 50) after creation. Finally, after
the deformer nodes, Maya places a shape node that provides the final (deformed)
shape of the sphere (nurbsSphereShapen).
The spheres history determines the deformation order. Because Maya evaluates the
sphere starting from the make node and working all the way through in order to the
final (deformed) shape node, the node connections involved are said to provide a
deformation chain.
Deformer placement
When you create a deformer, you can specify the deformers placement in the
deformable objects deformation order (see "Editing advanced deformer creation
options" on page 52). The placement can affect the deformers effect and
performance.
Maya includes the following deformation order placement options:
Default placement
Before placement
After placement
Split placement
Parallel placement
Front Of Chain placement
Note that after you create a deformer, you can edit a deformer nodes placement by
changing the deformation order (see "Changing an objects deformation order" on
page 50).
Default placement
With Default placement, Maya places the deformer just upstream of (before) the
deformed shape.
Default placement is the same as Before placement unless the deformer is going to
act on a shape node with no history. In this case, the placement will be the same as
After placement.
When you create a number of deformers for an object with Default placement, the
result is a deformation chain whose order is the same as the order in which you
created the deformers.
Before placement
With Before placement, Maya places the deformer immediately upstream of the
deformable objects deformed shape. In the objects history, the deformer will be
placed right before the deformed shape.
After placement
With After placement, Maya places the deformer immediately downstream of (after)
the deformable object. You would use After placement to create an intermediate
deformed shape somewhere in the middle of the objects history. Note that with
After placement, the original shape of the object is not hidden.
Split placement
With Split placement, Maya splits the deformation into two deformation chains. You
would use Split placement to deform an object in two ways at the same time,
creating two final shapes that originate from the same original shape.
Parallel placement
With Parallel placement, Maya places the deformer in parallel with the existing
upstream nodes in the objects history, and then blends the effects provided by the
existing upstream nodes and the deformer. A parallel blender node (default name:
parallelBlendern) that blends the effects of the existing upstream nodes and the new
deformer will be placed right before the final shape.
Parallel placement is useful when you want to blend the influences of several
deformers acting on an object. For example, if for some object you create a bend
deformer with Default placement, and then create a Sine deformer with Parallel
placement, you can directly control how much influence each deformer has on the
object, blending the influence of each deformer. The parallelBlender node provides a
weight channel for each deformer. You can edit the channels of the parallel blender
node; for more information, see "Editing parallel blender channels" on page 52.
The pruning operation considers only the current position of each component in the
undeformed and deformed versions of the geometry affected by the specified
deformation. If you have animated attributes of your deformation, the pruning
operation is performed based only on the current attribute values. This means that
components that are potentially affected at other frames of your animation might get
pruned out if they are unaffected at the current frame.
Since a typical blend shape operation has weights of 0.0 for some target shapes at
any point in time, this operation is especially dangerous when applied to blend
shape deformations. For this reason, there is no menu item provided to prune
membership for blend shape deformers. (You can still use this function through the
command line.)
Note that when the deformation order includes point tweaking first (the default),
CVs may not move in the same direction as the Move tools manipulator if the
attributes of the deformers do not have their initial (reset) values. If you would like
to change this, reset the deformers to have their initial (reset) values. Alternatively,
you could change the deformation order so that Maya applies the point tweaking
after applying deformations. However, if Maya applies point tweaking after
applying deformations, you may get unexpected effects when you use the
deformers.
If you do some point tweaking and then want to check how the object deforms
without the tweaking, you can disable the tweak node.
The List of history operations window is displayed for the selected object.
3 Move the pointer over the name of the tweak node (default name: tweakn) whose
order you want to change. Press the middle mouse button, drag over the name of the
operation that is where you want point tweaking to take place, and release the
mouse button.
You can click the performance of the following to On, Off, or Interactive: sculpt
influence objects (Sculpts), lattice influence objects (Lattices), wire influence objects
(Wires), blend shapes, and clusters. You can set Cluster Resolution to Per Node,
Global, or Interactive. You can set the Lattice Resolution to Per Node, Global, or
Interactive.
3 When youre done, click Close.
Advanced
Deformation
Order Specifies the placement of the deformer node in the deformable objects history. For
more information about deformer placement, see "Deformer placement" on page 44.
Exclusive Specifies whether the deformer set is in a partition. Sets in a partition can have no
overlapping members. Check on or off (default is off). If on, the Exclusive Partition
and Existing Partitions options become available.
Partition To Use Lists any existing partitions, and a default selection Create New Partition. If you
select Create New Partition, you can edit the New Partition Name field to specify the
name of a new partition. (Available if Exclusive is on.)
New Partition
Name Specifies the name of a new partition that will include the deformer set. The
suggested partition name is deformPartition, which will be created if it does not
already exist. Typically, you might put all your exclusive deformer sets in the
partition named deformParition. However, you can create as many partitions as you
like, and name them whatever you want. (Available if Exclusive is on.)
HasNoEffect Specifies that Maya prevent the deformation, but display the object. Maya will
evaluate the nodes in the nodes history, but not the node itself.
Blocking Specifies that Maya prevent the deformation, and not display the object. Maya will
not report the results of any evaluations of upstream nodes to this node.
Waiting-Normal (For Maya internal use only.) Specifies that if the dependency graph evaluation
refresh performance setting (Window > Settings/Preferences > Performance
Settings) is set to Demand or Release, the node takes the Normal state when you
click Update or release the mouse button.
Waiting-
HasNoEffect (For Maya internal use only.) Specifies that if the dependency graph evaluation
refresh performance setting is set to Demand or Release, the node takes the
HasNoEffect state when you click Update or release the mouse button.
Waiting-
Blocking (For Maya internal use only.) Specifies that if the dependency graph evaluation
refresh performance setting is set to Demand or Release, the node will take the
Blocking state when you click Update or release the mouse button.
With blend shape deformers, you change the shape of one object into the shapes of
other objects.
Unlike the other deformers, the blend shape deformer has an editor that enables you
to control all the blend shape deformers in your scene. You can use the editor to
control the influence of the targets of each blend shape deformer, create new blend
shape deformers, set keys, and so on.
Note that other software packages use the terms morph, morphing, and shape
interp to refer to what Maya provides with blend shape deformers.
Targets
A blend shape deformer includes a keyable attribute (channel) for evaluating each
target object shapes influence on the base objects shape. These attributes are called
targets, though by default they are named after the various target objects. Each target
specifies the influence, or weight, of a given shape independently of the other
targets. Depending on how you create or edit the blend shape deformer, however, a
target can represent the influence of a series of target object shapes instead of just
one shape.
blendShapeEditor
blendShapePanel
reorderDeformers
For more information about these commands, refer to the online MEL Command
Reference documentation.
Basic
BlendShape
Node Specifies the name of the blend shape deformer (the blend shape deformer algorithm
node). You might want to use a name that reminds you of the role of the blend shape
deformation (for example, lipSync). If you dont specify a name, Maya provides the
default name blendShapen.
Envelope Specifies the deformation scale factor. Use the slider to specify values from 0.0000 to
1.0000. Default is 1.0000.
Origin Specifies whether the blend shape will be relative to the base object shapes position,
rotation, and scale. Click Local or World.
Local Local will blend the base object shape to the target object shape(s) while ignoring
differences in position, rotation, and scale between the base object and the target
object(s). For facial animation setup, you would typically want to select Local. In
general, Local is useful when you want to have your target object(s) in various
separate positions for easy viewing but dont want their positions to affect the
deformation.
World World will blend the base object shape to the target object shape(s), taking into
account any differences in position, rotation, and scale between the target object
shape(s).
Click Local or World. Default is Local.
Target Shape
Options
Includes the In-Between, Check Topology, and Delete Targets options.
In-Between Specifies whether the blending will be in series or in parallel.
If on, the blending will be in series. Shape transitions will occur in the order in which
you selected the target shape(s). The effect will be that the blend shape will be able to
change from the first target object shape, to the second, and so on, back and forth
through the series of target object shapes chained together as in-between shapes.
If off, the blending will occur in parallel. Each target object shape can influence the
blending simultaneously in a parallel fashion rather than one after another in a series
fashion. Typically, for facial animation setup, you would want In-Between off so that
you can have a variety of basic facial expressions that form the basis of all the
possible expressions. Because the blending is in parallel, you can control the
influence of each basic expression at any moment to get a nearly infinite variety of
highly nuanced expressions.
Click on or off. Default is off.
Check
Topology Specifies whether to check if the base shape and the target shape(s) have the same
topology. For example, if using NURBS objects, you could check if all the shapes
have the same number of CVs. Click on or off. Default is on.
Delete Targets Specifies whether to delete the target shape(s) after creation. Deleting target shapes
can be useful if you dont need to see or manipulate the target shape(s), and want to
improve display performance. However, be sure to save a copy of the target shapes
in case you later decide you need to adjust them. Default is off.
Advanced
See "Editing advanced deformer creation options" on page 52. Note that the default
Front Of Chain option is only available for blend shape deformers.
Click Create if you want to create a blend shape deformer now.
or
Click Save to save the creation options.
or
Click Reset to reset to the default creation options.
or
Click Close to close the BlendShape Options window.
Target weight
sliders Each slider provides a way for you to set the target weight quickly. By default, each
target slider sets values from the minimum value (by default, 0.000) to the maximum
value (by default, 1.000). The current weight is displayed in the target weight box
below the target slider.
You can change the orientation of the sliders. For more information, see "Changing
Blend Shape editor slider orientation" on page 62.
Target weight
boxes Each box displays the current weight for each target. By default, a target weight can
range from the minimum value (by default, 0.000) to the maximum value (by
default, 1.000). As you change values, the target weight sliders update according to
the value you enter in the target weight boxes.
You can enter values from -10.000 to 10.000 to invert or amplify the targets
influence. If you enter a value greater than the current maximum value (by default,
1.000), the maximum value changes to double the value or to 10.000 if double the
value is greater than 10.000. If you enter a value less than the current minimum
value (by default, 0.000), the minimum value changes to double the value or to -
10.000 if double the value is less than -10.000. When you enter values less than the
current minimum or greater than the current maximum, the target weight sliders
change to reflect the new range of values.
Target names By default, the target name is the name of a target object (for example,
nurbsSphere1). If you prefer, enter some other name for the target name. Entering a
new target name does not change the name of the target object. Changing the target
name is useful if you want to give a more appropriate target name after youve
created the blend shape deformer.
New button Click to create a new blend shape deformer. Clicking New is the same as selecting
Deform > Create Blend Shape.
Add button Bake the selected base shape and add it as a target.
Key All button Key all weights at their current values.
Reset All button Set all weight values to zero.
Select button Select the blend shape deformer node.
Key buttons Key the current value, or drag and drop on the Timeline to set an exclusive key.
Weight
Target Specifies the influence value, or weight, of the named target. A value 0.000 specifies
that the target has no influence; a value of 1.000 specifies that the target has
maximum influence. For each named target, use slider to select values from 0.000 to
1.000.
Deformer Attributes
Envelope Specifies the deformation scale factor. Use slider to select values from 0.000 to 1.000.
You can also enter values from -2.000 to 2.000. A value of 2.000 would double the
overall deformation effect. A negative value would invert the effect. Default is 1.000.
Node Behavior
See "Editing node behavior to improve performance" on page 54.
Extra Attributes
(No extra attributes by default.)
In addition to blending individual objects, you can blend hierarchies of objects. Make
sure both hierarchies have the same number of children and parenting relationships.
To blend hierarchies, you must select the parent of the target hierarchy (or
hierarchies) first and the parent of the base hierarchy last before creating the blend
shape. The parent of each must be a transform.
Each child in the base blends into its corresponding child in the target. The order of
children in the Outliner (and Hypergraph) determines which children blend. If
necessary, use the Outliner to change the order of objects in the hierarchies.
A common blend shape technique is to create duplicates of a base, deform the
duplicates, then use them as targets. For example, you might make several copies of
a face, and then alter the copies to create a smiling face, frowning face, a crying face,
and so on. If you use this technique, turn on the Check Topology creation option
when you create the blend shape deformer. This checks that the base and target
hierarchy shapes have the same number of CVs. If the CVs are different and Check
Topology is off, you might see, for instance, an eye blending into the nose. If Check
Topology is on, the members of the hierarchies must have corresponding numbers of
CVs.
You can enter values beyond the slider range in the weight boxes below the sliders.
A value above 1 exaggerates the targets influence. Negative values move the base in
a direction opposite the target components. To reset all sliders to 0, click Reset All.
To adjust weight sliders, in the Blend Shape editor (Window > Animation Editors >
Blend Shape), drag the slider or enter a value in the weight box.
BlendShape
Node Specifies the name of the blend shape deformer to which you want to add the target
object shapes. (Available if Specify Node is on.)
Existing Nodes Lists all the blend shape deformer nodes in the scene, and indicates the blend shape
deformer to which you want to add target object shapes. (Available if Specify Node
is on.)
Add In-Between
Target
Specifies whether you want to specify the Target Index and In-Between weight.
Typically, you would want to do so to control the effect of the target object shapes
you are adding.
Target Index If the blend shape deformer blends target object shapes in parallel (the In-Between
creation option was off when you created the blend shape deformer), you can add
the new target object shapes so that they work in series with one of the existing
target object shapes. One quick way you can identify the appropriate value for
Target Index is by looking at the order of the target sliders in the Blend Shape Editor
(Window > Animation Editors > Blend Shape). Note that in the editor, each target
object shape has its own target slider. In the editor, going from left to right, the
Target Index value for the left-most target slider would be 1, the next 2, and so on.
If the blend shape deformer blends target object shapes in series (the In-Between
creation option was on when you created the blend shape deformer), Target Index
can only be 1 because there is only one target slider. In this case, you dont have to
specify Target Index, but you do need to specify the In-Between Weight.
In-Between
Weight Specifies the weight at which the added target object shape will have maximum
influence. Use slider to select values from 0 to any value less than 1. Do not select 1
because 1 is the weight at which the existing target object shape has its maximum
influence.
Target Shape
Options
Specifies whether to check if the added target object shapes have the same topology
as the base object shape and the existing target object shape(s). For example, if using
NURBS objects, you could check if all the shapes have the same number of CVs.
Click Check Topology on or off. Default is on.
4 Click Apply if you want to add the selected target object shapes now.
or
Click Save if you want to save the options youve specified.
or
Click Reset to reset to the default options.
or
Click Close to close the BlendShape Add Options window.
The deformer nodes are all deleted. However, the base object still has the tweak
node as an input node, so any tweaks you might have made are preserved.
Lattices
A lattice is a structure of points for carrying out free-form deformations on any
deformable object. To create deformation effects, you edit the lattice by moving,
rotating, or scaling the lattice structure, or by directly manipulating the lattice points.
In general, you create effects by editing any of the lattice deformers attributes.
deformers effect is based on any difference between the base lattices lattice points
and the influence lattices lattice points. By default, the base lattice is hidden so that
you can focus on manipulating the influence lattice. However, remember that the
deformation effect depends on the relationship between the influence lattice and the
base lattice.
Basic
Divisions Specifies the structure of the lattice in the lattices local STU space. (STU space
provides a special coordinate system for specifying the structure of lattices.)
You can specify the lattices structure in terms of S, T, and U divisions. When you
specify the divisions, you also indirectly specify the number of lattice points in the
lattice, because the lattice points are located where the divisions meet on the lattices
exterior. The greater the number of divisions, the greater the lattice point resolution.
Though your control over the deformation increases with the number of lattice
points, the performance may be affected.
The default settings are S has 2 divisions, T has 5 divisions, and U has 2 divisions,
which provides 20 lattice points.
Local Mode Specifies whether each lattice point can influence only the deformable objects points
that are nearby (local), or can influence all the deformable objects points. Check on
or off (default is on). If on, you can specify Local Divisions.
Local Divisions Specifies the extent of each lattice points local influence in terms of the lattices local
STU space. (Only available if Local Mode is on.) The default settings are S has 2
divisions, T has 2 divisions, and U has 2 divisions. With the default setting, each
lattice point can only influence the deformable objects points that are at most two
divisions away (in S, T, or U) from the lattice point.
Positioning Specifies whether the lattice is centered around the selected deformable object(s), or
positioned at the workspace origin.
Typically you would want the lattice centered around the object(s) so that you can
create deformation effects right after you create the deformer. However, you might
want the object to be initially free of the lattices influence, deforming only when it
moves into the base lattices space. For example, you might develop a ghost (the
deformable object) that could squeeze through a keyhole-shaped influence lattice
and then pop out on the other side, resuming its original shape.
Check on to center the lattice; check off to put the lattice at workspace origin. Default
is on.
Grouping Specifies whether to group the influence lattice and base lattice together. Grouping
the influence lattice and base lattice enables you to transform (move, rotate, or scale)
the two together. Check on or off. Default is off: the influence lattice and base lattice
are not grouped by default.
Parenting Specifies whether to parent the lattice to the selected deformable object(s) upon
deformer creation. Parenting them enables you to transform (move, rotate, or scale)
them together. Check on or off. Default is off.
Freeze Mode Specifies whether to freeze the lattice deformation mapping. If frozen (checked on),
components of objects being deformed that are inside the influence lattice remain
fixed inside the lattice and affected only by the influence lattice, even if you
transform (move, rotate, or scale) the object or the base lattice. For more information,
see "Freezing the lattice deformation mapping" on page 82. Check on or off. Default
is off.
Advanced
See "Editing advanced deformer creation options" on page 52.
Click Create if you want to create a lattice deformer now.
or
Click Save to save the creation options.
or
Click Reset to reset to the default creation options.
or
Click Close to close the Lattice Options window.
Local Influence
U Specifies the extent of each lattice points local influence along the U axis of the
lattices local STU space. (Only effective if deformer was created with Local Mode
on; if not, in the Attribute Editor, under Freeform Deformation Attributes, click Local
on.) The default is 2.
3 Click on a channel name with the left mouse button.
4 In your scene, press the middle mouse button and move the mouse to the left or
right. By moving the mouse, you interactively change the value of the selected
channel. As you move the mouse, note that pressing the Ctrl key gives you finer
control, and pressing the Shift key gives you coarser control.
Freeze
Geometry Specifies whether to freeze the lattice deformation mapping. If frozen (checked on),
components (for example, CVs) of objects being deformed that are inside the
influence lattice become fixed inside the lattice and affected only by the influence
lattice, even if you transform (move, rotate, or scale) the object or the base lattice. For
more information, see "Freezing the lattice deformation mapping" on page 82. Check
on or off. Default is off.
Deformer Attributes
Envelope Specifies the deformation scale factor. Select values from 0 to 1. Default is 1.
Node Behavior
See "Editing node behavior to improve performance" on page 54.
Extra Attributes
(No extra attributes by default.)
3 The following sections make available attributes: Lattice History, Object Display,
Node Behavior, and Extra Attributes.
Lattice History
S Divisions Specifies the number of S divisions in the influence lattices structure. Default is 2.
T Divisions Specifies the number of T divisions in the influence lattices structure. Default is 5.
U Divisions Specifies the number of U divisions in the influence lattices structure. Default is 2.
Object Display
(Shape node display attributes.)
Node Behavior
See "Editing node behavior to improve performance" on page 54.
Extra Attributes
(No extra attributes by default.)
Freezing the lattice deformation mapping locks the influence lattices control over
deformable object components inside the influence lattice. If you want to have the
components of deformable objects inside of the influence lattice to remain inside and
under the influence of the influence lattice even when you move the objects or the
base lattice, you can do so by freezing the lattice deformation mapping.
Geometry attribute. After youve created a lattice deformer, you can change whether
it freezes the deformation mapping by editing the Freeze Geometry attribute (see
"Editing lattice deformer attributes" on page 78).
Improving performance
The greater the number of lattice points, the greater your control over the
deformation, but the slower the performance. Note that a lattice should always have
fewer lattice points than the deformable object has points. You gain no increase in
control over the deformation by having more lattice points than the object itself has
points.
You can edit node behavior to improve performance. For more information, see
"Editing node behavior to improve performance" on page 54.
You can change the lattice resolution performance. To change the lattice resolution
performance, set the Partial Resolution attribute (see "Editing lattice deformer
attributes" on page 78).
Finally, you can change the lattice deformer performance settings.
A cluster deformer creates a set whose members consist of selected points (CVs,
vertices, or lattice points). You assign a percentage weight to each point, indicating
how much you want each point to be affected by any translation, rotation, or scale of
the cluster set. When you transform the cluster, the points are transformed according
to the percentages you have specified.
Basic
Mode Specifies whether the cluster deformation will occur only when the cluster deformer
handle itself is transformed (moved, rotated, or scaled). With Relative clicked on,
only transformations to the cluster deformer handle itself will cause deformation
effects. With Relative off, transformations to objects parented to the cluster deformer
handle can cause deformation effects.
For example, suppose you are using a cluster deformer to smooth deformation
effects around the wrist joint of a characters skinned arm. If you create a cluster
deformer with Relative on, and then parent the cluster deformer handle to a wrist
joint, you can rotate the shoulder joint without causing cluster deformation effects
around the wrist. But when you move the cluster deformer handle itself, you cause
cluster deformation effects around the wrist.
Click on or off. Default is on.
Envelope Specifies the deformation scale factor. A value of 0 provides no deformation, a value
of 0.5 provides a deformation effect scaled to half of its full effect, and a value of 1
provides the full deformation effect. Use the slider to select values between 0 and 1.
Default is 1.
Advanced
For information on these creation options, see "Editing advanced deformer creation
options" on page 52.
Click Create if you want to create a cluster deformer now.
or
Click Save to save the creation options.
or
Click Reset to reset to the default creation options.
or
Click Close to close the Cluster Options window.
points (NURBS CVs, polygonal vertices, or lattice points). For more information on
editing and painting cluster weights, see "Editing cluster weights" on page 92 and
"Painting cluster weights" on page 93.
Note that wrinkle deformers use cluster deformers, and that you can also manipulate
the effects of wrinkle deformers with the cluster deformer handles C icon. For more
information on wrinkle deformers, see Chapter 16, Using Wrinkle Deformers.
Cluster Attributes
Relative Specifies whether the cluster deformation occurs only when the cluster deformer
handle itself is transformed (moved, rotated, or scaled). With Relative on, only
transformations to the cluster deformer handle itself cause deformation effects.
Transformations to any objects parented to the handle do not cause deformation
effects. With Relative off, transformations to objects parented to the cluster deformer
handle can cause deformation effects. The Relative attribute was initially set by the
Mode creation option when you created the cluster deformer (see "Setting creation
options" on page 88).
Partial
Resolution Specifies whether Maya provides the complete deformation, or only an
approximation of the deformation. Selections include full and partial. Full specifies
the complete deformation. Partial specifies an approximation of the deformation,
which can improve Mayas display performance. With partial, Maya rounds down
the cluster weights based on the Percent Resolution. Default is full.
Percent
Resolution Specifies the increment percentage by which the cluster deformation resolution is
rounded down. Maya uses the increment percentage to round off the cluster weights
to the next lowest increment. For example, with a Percent Resolution of 5.00, a
cluster weight of .94 would be rounded down to .90. A cluster weight of .46 would
be rounded down to .45. Default is 5.00. (Available only if Partial Resolution is set to
partial.)
Angle
Interpolation Specifies the interpolation direction. Use this attribute to correct undesirable
discontinuities in the deformation effect when you change cluster weights even by a
small amount. The discontinuities occur when the cluster deformer uses an
inappropriate interpolation direction to guide the deformation effect. To change the
interpolation direction, you can set Angle Interpolation to closest, positive, or
negative. By default, Angle Interpolation is closest, which provides the usual rigid
skinning deformation effects. The default setting is fine for most situations, but when
you encounter discontinuities you can adjust the deformation effect by selecting a
positive or negative interpolation.
Deformer Attributes
Envelope Specifies the deformation scale factor. Use slider to select values between 0.000 and
1.000. Default is 1.000.
Node Behavior
See "Editing node behavior to improve performance" on page 54.
Extra Attributes
(No extra attributes by default.)
Weight of 1.0
Weight of 0.75
Weight of 0.25
Weight of 0.15
The Paint Cluster Weights Tool automatically detects clusters on the surface and
selects one for painting.
4 Check that Color Feedback is turned on in the Display section. Color feedback helps
you identify the weights on the surface by representing them as grayscale values
(smaller values are darker, larger values are lighter).
Tip
You can use the default hotkey Alt c to turn Color Feedback on and off
outside the Tools Settings Editor.
5 Select the cluster you want to paint. In the Paint Attributes section of the Tool
Settings window, click the clustern.weights button and select the appropriate cluster
weights name from the pop-up menu.
Note that you can only paint weights on one cluster at a time. If you select more than
one cluster, you can only paint weights on the active one (the one that provides color
feedback).
If the surface has only one cluster, you can select the surface alone.
The selected cluster turns white, representing a weight value of 1, the default.
Tip
If you are painting on a single surface, you can skip step 3 and select the
cluster without opening the Tool Settings window by right-clicking the
surface and selecting the appropriate cluster weights name from the Paint
command submenu.
6 Select a brush, paint operation, and value and define other settings as required. See
"Paint Cluster Weights Tool settings" on page 96.
7 Drag the brush across the cluster.
Tip
You can quickly pick weight values from one cluster and paint them on
another cluster or the same cluster using hotkeys.
1 Select the cluster with the weight values you want to pick.
2 Hold down the Pick Color Mode hotkey (default hotkey: /), click on
the area of the cluster with the weight you want to pick, then release
the hotkey.
3 If you are painting the picked weight on the same cluster, drag the
brush across the cluster.
If you are painting the picked weight on another cluster, select that
cluster, then drag the brush across it.
Flooding clusters
Flooding a cluster is like taking a huge brush and applying its settings to the entire
cluster. When you flood a cluster, the weight of each vertex in the cluster changes
according to the value and operation set for the tool.
To flood a cluster, follow the steps under "To paint weights on a cluster:" on page
93, but instead of painting in step 7, click the Flood button (hotkey: Alt f).
Tip
To smooth the transition between cluster weights, select the Smooth paint
operation and flood the cluster.
Mapped surface
Attribute map
Tip
You can define hotkey combinations to change most of the settings without
opening the Tool Settings editor. For details on setting hotkey
combinations, see Defining Artisan hotkeys in Using Maya: Painting.
Paint Attributes
clustern.weights
jointClustern.weights
Displays the name of the cluster selected to paint and the attribute you are painting
(weights). To select another cluster to paint, click this button and select the
appropriate cluster weights name. By default, the tool selects the first cluster it
detects on the surface (for example, cluster1.weights, or jointCluster3.weights).
Filter: cluster Sets a filter so that only cluster nodes display on the menu for the button above this
one. You are painting clusters with the Paint Cluster Weights Tool, so you do not
need to change this filter.
Paint Operation Select which paint operation you want to perform on the selected cluster.
Replace Your brush stroke replaces the vertex weight with the weight set
for the brush.
Add Your brush stroke adds the vertex weight to the weight set for the
brush.
Scale Your brush stroke scales the vertex weight by the weight factor set
for the brush.
Smooth Your brush stroke averages the weights of adjacent vertices to
produce a smoother transition between weights.
Value Set the weight value to apply when you perform any of the painting operations.
Min/Max Value Set the minimum and maximum possible paint values. By default, you can paint
values between 0 and 1. Setting the Min/Max Values you can extend or narrow the
range of values.
Negative values are useful for subtracting weight. For example, if you set Min Value
to -1, Value to -0.5, and select Add for the operation, you would subtract 0.5 from the
weight of vertices you paint.
Positive values are used as multipliers.
Tip
To help you differentiate paint values when you paint with ranges greater
than 0 to 1 (for example, -5 to 5), and to maximize the range of values that
display when you paint values with ranges between 0 to 1 (for example, 0.2
to 0.8), set Min Color and Max Color (in the Display section) to correspond
with the Min/Max values.
Clamp Select whether you want to clamp the values within a specified range, regardless of
the Value set when you paint.
Lower Turn this on to clamp the lower value to the Clamp Value
specified below. For example, if you clamp Lower and set the
lower Clamp Value to 0.5, the values you paint will never be less
than 0.5, even if you set the Value to 0.25.
Upper Turn this on to clamp the upper value to the Clamp Value
specified below. For example, if you clamp Upper, set the upper
Clamp Value to 0.75, and set Value to 1, the values you paint will
never be greater than 0.75.
Clamp Values Set the Lower and Upper values for clamping.
Flood Click Flood to apply the brush settings to all the weights on the selected cluster. The
result depends on the brush settings defined when you perform the flood.
Vector Index If you are painting a three channel attribute (RGB or XYZ), select the channel you
want to paint. Cluster weight is a single channel attribute, therefore you do not need
to change this setting.
Note that painting smooth skin point weights requires the use of a different painting
tool (see "Painting smooth skin point weights" on page 327).
2 Go into smooth shading mode (select Shading > Smooth Shade All or press the
default hotkey, 5).
3 Select Deform > Paint Cluster Weights Tool .
4 Check that Color Feedback is turned on in the Display section. Color feedback helps
you identify the weights on the surface by representing them as grayscale values
(smaller values are darker, larger values are lighter).
Tip
You can use the default hotkey Alt c to turn Color Feedback on and off
outside the Tools Settings Editor.
5 Select the joint cluster you want to paint weights on. In the Paint Attributes section
of the Tool Settings window, click the jointClustern.weights button and select the
appropriate joint cluster weights name from the pop-up menu.
Note that you can only paint weights on one cluster at a time. If you select more than
one cluster, you can only paint weights on the active one (the one that provides color
feedback).
If the surface has only one cluster, you can select the surface alone.
Tip
If you are painting on a single surface, you can skip step 3 and select the
joint cluster without opening the Tool Settings window by right-clicking
the surface and selecting the appropriate cluster weights name from the
Paint command submenu.
6 Select a brush, paint operation, and value and define other settings as required. See
"Paint Cluster Weights Tool settings" on page 96.
7 Drag the brush across the cluster.
Tip
You can quickly pick weight values from one cluster and paint them on
another cluster or the same cluster using hotkeys.
1 Select the cluster with the weight values you want to pick.
2 Hold down the Pick Color Mode hotkey (default hotkey: /), click on
the area of the cluster with the weight you want to pick, then release
the hotkey.
3 If you are painting the picked weight on the same cluster, drag the
brush across the cluster.
If you are painting the picked weight on another cluster, select that
cluster, then drag the brush across it.
Tip
You can use the default hotkey Alt c to turn Color Feedback on and off
outside the Tools Settings Editor.
5 Select the jiggle deformer you want to paint. In the Paint Attributes section of the
Tool Settings window, click the jigglen.weights button and select the appropriate
jiggle weights name from the pop-up menu.
Note that you can only paint weights on one jiggle deformer at a time. If you select
more than one jiggle deformer, you can only paint weights on the active one (the one
that provides color feedback).
If the surface has only one jiggle deformer, you can select the surface alone.
Tip
If you are painting on a single surface, you can skip step 3 and select the
jiggle deformer and weight attribute without opening the Tool Settings
window by right-clicking the surface and selecting the appropriate jiggle
weights name from the Paint command submenu.
6 Select a brush, paint operation, and value and define other settings as required. See
"Paint Cluster Weights Tool settings" on page 96.
7 Drag the brush across the deformer where you want to change the weights.
Tip
Using hotkeys, you can quickly pick weight values from one jiggle
deformer and paint them on another jiggle deformer or the same one.
1 Select the jiggle deformer with the weight values you want to pick.
2 Hold down the Pick Color Mode hotkey (default hotkey: /), click on
the area of the jiggle deformer with the weight you want to pick, then
release the hotkey.
3 If you are painting the picked weight on the same deformer, drag the
brush across the deformer.
If you are painting the picked weight on another jiggle deformer,
select that deformer, then drag the brush across it.
Tip
To smooth the transition between jiggle weights, select the Smooth paint
operation and flood the jiggle deformer.
Tip
You can define hotkey combinations to change most of the settings without
opening the Tool Settings editor. For details, see Defining Artisan
hotkeys in Using Maya: Painting.
Paint Attributes
jigglen.weights Displays the name of the jiggle node selected to paint and the attribute you are
painting (weights). To select another deformer to paint, click this button and select
the appropriate jiggle deformer weights name. By default, the tool selects the first
jiggle deformer it detects on the surface (for example, jiggle2.weights).
Filter: jiggle Sets a filter so that only jiggle deformer nodes display on the menu for the button
above this one. You are painting jiggle weights with the Paint Jiggle Weights Tool, so
you do not need to change this filter.
Paint Operation Select which paint operation you want to perform on the selected jiggle deformer.
Replace Your brush stroke replaces the painted weight with the weight set
for the brush.
Add Your brush stroke adds the painted weight to the weight set for
the brush.
Scale Your brush stroke scales the painted weight by the weight factor
set for the brush.
Smooth Your brush stroke averages the weights of adjacent vertices to
produce a smoother transition between weights.
Value Set the weight value to apply when you perform any of the painting operations.
Min/Max Value Set the minimum and maximum possible paint values. By default, you can paint
values between 0 and 1. Setting the Min/Max Values you can extend or narrow the
range of values.
Negative values are useful for subtracting weight. For example, if you set Min Value
to -1, Value to -0.5, and select Add for the operation, you would subtract 0.5 from the
weight of vertices you paint.
Positive values are used as multipliers.
Tip
To help you differentiate paint values when you paint with ranges greater
than 0 to 1 (for example, -5 to 5), and to maximize the range of values that
display when you paint values with ranges between 0 to 1 (for example, 0.2
to 0.8), set Min Color and Max Color (in the Display section) to correspond
with the Min/Max values.
Clamp Select whether you want to clamp the values within a specified range, regardless of
the Value set when you paint.
Lower Turn this on to clamp the lower value to the Clamp Value
specified below. For example, if you clamp Lower and set the
lower Clamp Value to 0.5, the values you paint will never be less
than 0.5, even if you set the Value to 0.25.
Upper Turn this on to clamp the upper value to the Clamp Value
specified below. For example, if you clamp Upper, set the upper
Clamp Value to 0.75, and set Value to 1, the values you paint will
never be greater than 0.75.
Clamp Values Set the Lower and Upper values for clamping.
Flood Click Flood to apply the brush settings to all the weights on the selected jiggle
deformer. The result depends on the brush settings defined when you perform the
flood.
Vector Index If you are painting a three channel attribute (RGB or XYZ), select the channel you
want to paint. Jiggle deformer weight is a single channel attribute, therefore you do
not need to change this setting.
With the jiggle deformer, you can cause points on a surface or curve to shake as they
move, speed up, or slow down.
Basic
Stiffness Sets the rigidity of the jiggle, from 0 to 1. High values diminish
elasticity and speed up the jiggle; the points act as if controlled by
tight springs. Low values slow the jiggle and create an effect like
spongy springs.
Damping Mutes the springiness of the jiggle. A high value minimizes jiggle.
A low value increases springiness.
Weight Scales the jiggle effect up or down on all points, regardless of
individual weights. The individual jiggle weights do not change
value, only the overall amount of jiggle.
Jiggle Only After Object
Stops Jiggle occurs only after a moving object stops, not while it moves.
Ignore Transform Jiggle applies only to animated points, not to the animated
transform node of the object. For example, suppose you have
animated a kangaroo hopping as it talks. You animated the
hopping motion by keying the translate attributes of the transform
node, and you animated the talking mouth by keying points of the
mouth. With Ignore Transform on, only the talking mouth will
jiggle.
Advanced
The options on the Advanced tab are common to all deformers. See the online
Character Setup material for details on these options.
Jiggle Attributes:
Enable Enable turns on the jiggle. (Default setting.)
Disable turns off the jiggle.
Enable Only After Object Stops causes the jiggling to occur only
after a moving object stops, not while it moves.
Stiffness See "Stiffness" on page 106.
Damping See "Damping" on page 106.
Jiggle Weight See "Weight" on page 106.
Force Along
Normal Sets how much jiggling occurs in directions normal to the surface.
Force On Tangent Sets how much jiggling occurs in directions tangent to the surface.
Motion Multiplier If you select Enable Only When Resting (see description for
Enable), the Motion Multiplier scales how much the object jiggles
after it stops moving.
Ignore Transform See "Ignore Transform" on page 106.
Deformer Attributes
Envelope Scales the amount the points move during deformation. Adjust the
slider to select values from 0 to 1. You can also enter values from -
2 to 2 in the text box. A value of 2 doubles the effect. A negative
value inverts the effect. Default is 1.
Important
To avoid unexpected deformations, do not change the number of a
deformable objects points after you create a deformer.
Bend deformer
acting on a cone
For more information about these commands, refer to the online MEL Command
Reference documentation.
Basic
Low Bound Specifies lower extent of the bending along the bend deformers negative Y-axis.
Values can be negative numbers or zero. Values can be negative numbers or zero.
Use slider to select values from -10.0000 to 0.0000. Default is -1.0000.
High Bound Specifies upper extent of the bending along the bend deformers positive Y-axis.
Values can be positive numbers only (minimum is 0.0000). Use slider to select values
from 0.0000 to 10.0000. Default is 1.0000.
Curvature Specifies the amount of bending. Negative values specify the bending towards the
bend deformers negative X-axis; positive values specify the bending towards the
deformers positive X-axis. Use slider to select values from -4.0000 to 4.0000. Default
is 0.0000, which specifies no bending.
Advanced
See "Editing advanced deformer creation options" on page 52.
Click Create to create a bend deformer.
or
Click Save to save creation options without creating a bend deformer.
or
Click Reset to reset to default creation options.
or
Click Close to close the window.
High Bound
Curvature
Low Bound
4 In the scene, select one of the manipulators on the bend deformer handle. Press the
middle mouse button and move the mouse to edit interactively. Note that the
Channel Box updates the values you are changing.
One quick way to select the bend deformer node is to select the object being
deformed, and then select the bend deformer node in its history from the Channel
Box (under INPUTS).
Note that you can control which attributes are listed as keyable attributes (channels)
in the Channel Box with the Channel Control editor (select Window > General
Editors > Channel Control).
2 In the Channel Box, the following channels are listed by default:
Envelope Specifies the deformation scale factor. Default is 1.
Curvature Specifies the amount of bending. Negative values specify the bending towards the
bend deformers negative X-axis; positive values specify the bending towards the
deformers positive X-axis. Default is 0, which specifies no bending.
Low Bound Specifies lower extent of the bending along the bend deformers negative Y-axis.
Values can be negative numbers or zero. Values can be negative numbers or zero.
Default is -1.
High Bound Specifies upper extent of the bending along the bend deformers positive Y-axis.
Values can be positive numbers only (minimum is 0.0000). Default is 1.
3 Click on a channel name with the left mouse button.
4 In your scene, press the middle mouse button and move the mouse to the left or
right. By moving the mouse, you interactively change the value of the selected
channel. As you move the mouse, note that pressing the Ctrl key gives you finer
control, and pressing the Shift key gives you coarser control.
Deformer Attributes
Envelope Specifies the deformation scale factor. Select values from 0 to 1. Default is 1.
Node Behavior
See "Editing node behavior to improve performance" on page 54.
Extra Attributes
(No extra attributes by default.)
Basic
Low Bound Specifies the lower extent of the flare on the deformers local negative Y-axis. Values
can be negative numbers or zero. Use the slider to select values from negative
10.0000 to 0.0000. Default is -1.0000.
High Bound Specifies the upper extent of the flare on the deformers positive local Y-axis. Values
can be positive numbers only (minimum value is 0). Use the slider to select values
from 0.0000 to 10.0000. Default is 1.0000.
Start Flare X Specifies the amount of flaring from the deformers X-axis at the Low Bound. The
flaring progresses along the deformers local X-axis, varying according to the value
of Curve. Use the slider to select values from 0.0000 to 10.0000. Default is 1.0000.
Start Flare Z Specifies the amount of flaring from the deformers Z-axis at the Low Bound. The
flaring progresses along the deformers local Z-axis to the High Bound, varying
according to the value of Curve. Use the slider to select values from 0.0000 to
10.0000. Default is 1.0000.
End Flare X Specifies the amount of flaring from the deformers X-axis at the High Bound. The
flaring starts at the Low Bound and progresses along the deformers local X-axis to
the High Bound, varying according to the value of Curve. Use the slider to select
values from 0.0000 to 10.0000. Default is 1.0000.
End Flare Z Specifies the amount of flaring from the deformers Z-axis at the High Bound. The
flaring starts at the Low Bound and progresses along the deformers local Z-axis to
the High Bound, varying according to the value of Curve. Use the slider to select
values from 0.0000 to 10.0000. Default is 1.0000.
Curve Specifies the amount of curvature (the profile of the flaring curve) between the Low
Bound and the High Bound. A value of 0 specifies no curvature (linear
interpolation). Positive values specify outward, bulging curvatures; negative values
specify inward, hourglass-shaped curvatures. Use the slider to select values from
0.0000 to 10.0000. Default is 0.0000.
Advanced
See "Editing advanced deformer creation options" on page 52.
Click Create to create a flare deformer.
or
Click Save to save creation options without creating a flare deformer.
or
Click Reset to reset to default creation options.
or
Click Close to close the window.
For more information on creating and editing deformation effects, see the next
section.
End Flare Z
Curve
Start Flare Z
4 In the scene, select one of the manipulators on the flare deformer handle. Press the
middle mouse button and move the mouse to edit interactively. Note that the
Channel Box updates the values you are changing.
4 In your scene, press the middle mouse button and move the mouse to the left or
right. By moving the mouse, you interactively change the value of the selected
channel. As you move the mouse, note that pressing the Ctrl key gives you finer
control, and pressing the Shift key gives you coarser control.
Deformer Attributes
Envelope Specifies the deformation scale factor. Use slider to select values from 0.000 to 1.000.
Default is 1.000.
Node Behavior
See "Editing node behavior to improve performance" on page 54.
Extra Attributes
(No extra attributes by default.)
The sine deformer changes the shape of an object along a sine wave.
Sine deformer algorithm node (default name: sinen; also note deformSine and
nonLinear nodes)
Sine deformer handle node (default name: sinenHandle)
Sine deformer handle shape node (default name: sinenHandleShape)
Sine deformer set node (default name: sinenSet)
Tweak node (default name: tweakn)
For more information about these nodes, refer to the online Node and Attribute
Reference documentation.
Basic
Low Bound Specifies the extent of the sine wave along the deformers local negative Y-axis.
Values can be negative numbers or zero. Use the slider to specify values from
negative 10.0000 to 0.0000. Default is -1.0000.
High Bound Specifies the extent of the sine wave along the deformers local positive Y-axis.
Values can be positive numbers only (minimum value is 0). Use the slider to specify
values from 0.0000 to 10.0000. Default is 1.0000.
Amplitude Specifies the amplitude (maximum wave amount) of the sine wave. Use the slider to
specify values from -5.0000 to 5.0000. Default is 0.0000 (no wave).
Wavelength Specifies the frequency of the sine wave along the deformers local Y-axis. For
greater frequency, decrease the wavelength; for lesser frequency, increase the
wavelength. Use the slider to specify values from -0.1000 to 10.0000. Default is
2.0000.
Dropoff Specifies how the amplitude decays. Negative values specify a decay towards the
center of the deformer handle (maximum is -1.0000), and positive values specify a
decay away from the center of the deformer handle (maximum is 1.0000). Use the
slider to specify values from -1.0000 to 1.0000. Default is 0.0000 (no decay).
Offset Specifies the location of the sine wave relative to the center of the deformer handle.
Changing this value can create a wriggling effect. Use the slider to specify values
from -10.0000 to 10.0000. Default is 0.0000.
Advanced
See "Editing advanced deformer creation options" on page 52.
Click Create to create a sine deformer.
or
Click Save to save creation options without creating a sine deformer.
or
Click Reset to reset to default creation options.
or
Click Close to close the window.
High Bound
Wavelength
Amplitude Offset
Low Bound
4 In the scene, select one of the manipulators on the sine deformer handle. Press the
middle mouse button and move the mouse to edit interactively. Note that the
Channel Box updates the values you are changing.
Deformer Attributes
Envelope Specifies the deformation scale factor. Select values from 0 to 1. Default is 1.
Node Behavior
See "Editing node behavior to improve performance" on page 54.
Extra Attributes
(No extra attributes by default.)
Squash deformer
acting on a sphere
Squash deformer algorithm node (default name: squashn; also note deformSquash
and nonLinear nodes)
Squash deformer handle node (default name: squashnHandle)
Squash deformer handle shape node (default name: squashnHandleShape)
Squash deformer set node (default name: squashnSet)
Tweak node (default name: tweakn)
For more information about these nodes, refer to the online Node and Attribute
Reference documentation.
Basic
Low Bound Specifies the lower extent of squashing (or stretching) along the deformers local
negative Y-axis. Use the slider to select values from negative 10.0000 to 0.0000.
Default is -1.0000.
High Bound Specifies the upper extent of squashing (or stretching) along the deformers local
positive Y-axis. Use the slider to select values from 0.0000 to 10.0000. Default is
1.0000.
Start
Smoothness Specifies the amount of initial smoothing toward the low bound position (along the
deformers local negative Y-axis). Use slider to select values from 0.0000 to 1.0000.
Default is 0.0000.
End
Smoothness Specifies the amount of final smoothing towards the high bound position (along the
deformers local positive Y-axis). Use the slider to select values from 0.0000 to 1.0000.
Default is 0.0000.
Max Expand
Position Specifies the center of maximum expansion between the high bound position and the
low bound position. Values can be between 0.01000 (near the low bound position) to
0.9900 (near the high bound position). Use the slider to select values from 0.0100 to
0.9900. Default is 0.5000.
Expand Specifies the amount of expansion outwards during squashing or inwards during
stretching. Use the slider to select values from 0.0000 to 1.7000. Default is 1.0000.
Factor Specifies the amount of squashing or stretching. Increasing negative values specify
squashing along deformers local Y-axis; increasing positive values specify stretching
along deformers local Y-axis. Use the slider to select values from -10.0000 to 10.0000.
Default is 0.0000 (no squashing or stretching).
Advanced
See "Editing advanced deformer creation options" on page 52.
Click Create to create a squash deformer.
or
Click Save to save creation options without creating a squash deformer.
or
Click Reset to reset to default creation options.
or
Click Close to close the window.
You can edit the effects of the squash deformer by editing the squash handle node
and the squash deformer node. You can move (translate), rotate, and scale the
squash handle to edit the effects of the deformation. You can also edit the squash
deformer nodes keyable attributes (channels), which are displayed in the Channel
Box.
High Bound
Low Bound
4 In the scene, select one of the manipulators on the squash deformer handle. Press the
middle mouse button and move the mouse to edit interactively. Note that the
Channel Box updates the values you are changing.
2 Open the Attribute Editor by selecting Window > Attribute Editor (default shortcut:
Ctrl a).
The following sections make available attributes: Nonlinear Deformer Attributes,
Deformer Attributes, Node Behavior, and Extra Attributes.
Deformer Attributes
Envelope Specifies the deformation scale factor. Select values from 0.000 to 1.000. Default is
1.000.
Node Behavior
See "Editing node behavior to improve performance" on page 54.
Extra Attributes
(No extra attributes by default.)
The squash deformer handle, squash deformer handle shape, and squash deformer
nodes are all deleted. However, the object still has the tweak node as an input node,
so any tweaks you might have made are preserved. Also, note that the various input
nodes that structure the evaluation of the deformation are not deleted.
EXAMPLES
This section includes two examples of using squash deformers:
You can create squash and stretch effects with the squash deformer. This example
shows how you can set up a ball for a bouncing ball animation, a classic test of an
animators skills.
These images show just a simple example of a bouncing ball. As you develop your
animation of a bouncing ball, try to see how much character you can give to the
balls movements.
Twist deformer
acting on a box
Twist deformer algorithm node (default name: twistn; also note deformTwist and
nonLinear nodes)
Twist deformer handle node (default name: twistnHandle)
Twist deformer handle shape node (default name: twistnHandleShape)
Twist deformer set node (default name: twistnSet)
Tweak node (default name: tweakn)
For more information about these nodes, refer to the online Node and Attribute
Reference documentation.
Basic
Low Bound Specifies the position of the start angle twisting on the deformers local Y-axis.
Values must be negative numbers or zero. Use the slider to select values from -
10.0000 to 0.0000. Default is -1.0000.
High Bound Specifies the position of the end angle twisting on the deformers local Y-axis. Values
must be positive numbers. Use the slider to select values from 0.0000 to 10.0000.
Default is 1.0000.
Start Angle Specifies the degree of twisting at the low bound position on the deformer handles
local negative Y-axis. Use the slider to select values from -10.0000 to 10.0000. Default
is 0.0000.
End Angle Specifies the degree of twisting at the high bound position on the deformer handles
local positive Y-axis. Use the slider to select values from -10.0000 to 10.0000. Default
is 0.0000.
Advanced
See "Editing advanced deformer creation options" on page 52.
Click Create to create a twist deformer.
or
Click Save to save creation options without creating a twist deformer.
or
Click Reset to reset to default creation options.
or
Click Close to close the window.
4 In the scene, select one of the manipulators on the twist deformer handle. Press the
middle mouse button and move the mouse to edit interactively. Note that the
Channel Box updates the values you are changing.
Start Angle Specifies the degree of twisting at the low bound position on the deformer handles
local negative Y-axis. Default is 0.
End Angle Specifies the degree of twisting at the high bound position on the deformer handles
local positive Y-axis. Default is 0.
Low Bound Specifies the position of the start angle twisting on the deformers local Y-axis.
Values must be negative numbers or zero. Default is -1.
High Bound Specifies the position of the end angle twisting on the deformers local Y-axis. Values
must be positive numbers. Default is 1.
3 Click on a channel name with the left mouse button.
4 In your scene, press the middle mouse button and move the mouse to the left or
right. By moving the mouse, you interactively change the value of the selected
channel. As you move the mouse, note that pressing the Ctrl key gives you finer
control, and pressing the Shift key gives you coarser control.
Deformer Attributes
Envelope Specifies the deformation scale factor. Select values from 0.000 to 1.000. Default is
1.000.
Node Behavior
See "Editing node behavior to improve performance" on page 54.
Extra Attributes
(No extra attributes by default.)
EXAMPLE
Spiral staircase modeling
The foundation, rail, and moldings of the staircases model were shaped with the
twist deformer.
The wave deformer deforms an object based on a circular sine wave for ripple
effects. If youd like to explore an example now, see "Example" on page 154.
Wave deformer algorithm node (default name: waven; also note deformWave and
nonLinear nodes)
Wave deformer handle node (default name: wavenHandle)
Wave deformer handle shape node (default name: wavenHandleShape)
Wave deformer set node (default name: wavenSet)
Tweak node (default name: tweakn)
For more information about these nodes, refer to the online Node and Attribute
Reference documentation.
Basic
Min Radius Specifies the minimum radius of the circular sine wave. Use the slider to select
values from 0.0000 to 1.0000. Default is 0.0000.
Max Radius Specifies the maximum radius of the circular sine wave. Use the slider to select
values from 0.0000 to 10.0000. Default is 1.0000.
Amplitude Specifies the amplitude (maximum wave amount) of the sine wave. Use slider to
select values from -5.0000 to 5.0000. Default is 0.0000 (no wave).
Wavelength Specifies the frequency of the sine wave. For greater frequency, decrease the
wavelength; for lesser frequency, increase the wavelength. Use the slider to select
values from -0.1000 to 10.0000. Default is 1.0000.
Dropoff Specifies how the amplitude decays. Negative values specify a decay towards the
center of the deformer handle (maximum is -1.0000), and positive values specify a
decay away from the center of the deformer handle (maximum is 1.0000). Use the
slider to select values from -1.0000 to 1.0000. Default is 0.0000 (no decay).
Offset Specifies the location of the sine wave relative to the center of the deformer handle.
Changing this value can create a rippling effect. Use the slider to select values from -
10.0000 to 10.0000. Default is 0.
Advanced
See "Editing advanced deformer creation options" on page 52.
Click Create to create a wave deformer.
or
Click Save to save creation options without creating a wave deformer.
or
Click Reset to reset to default creation options.
or
Click Close to close the window.
3 Note the manipulators on the wave deformer handle. These enable you to edit
attributes interactively.
Amplitude Wavelength
Max Radius
Note: Offset and Min Radius Note: adjust Dropoff from the
manipulators are both at the Channel Box.
center of the handle by default.
4 In the scene, select one of the manipulators on the wave deformer handle. Press the
middle mouse button and move the mouse to edit interactively. Note that the
Channel Box updates the values you are changing.
Note that the Offset and Min Radius manipulators are both located at the center of
the handle by default.
One quick way to select the wave deformer node is to select the object being
deformed, and then select the wave deformer node in its history from the Channel
Box (under INPUTS).
Note that you can control which attributes are listed as keyable attributes (channels)
in the Channel Box with the Channel Control editor (select Window > General
Editors > Channel Control).
2 In the Channel Box, the following channels are listed by default:
Envelope Specifies the deformation scale factor. Default is 1.
Amplitude Specifies the amplitude (maximum wave amount) of the sine wave. Default is 0 (no
wave).
Wavelength Specifies the frequency of the sine wave. For greater frequency, decrease the
wavelength; for lesser frequency, increase the wavelength. Default is 1.
Offset Specifies the location of the sine wave relative to the center of the deformer handle.
Changing this value can create a rippling effect. Default is 0.
Dropoff Specifies how the amplitude decays. Negative values specify a decay toward the
center of the deformer handle (maximum is -1), and positive values specify a decay
away from the center of the deformer handle (maximum is 1). Default is 0 (no
decay).
Dropoff Position Specifies the location of the maximum amplitude between the minimum radius and
the maximum radius (only has effect when Dropoff is not 0). The value can range
from 0 to 1, with 0 specifying the dropoff position at the minimum radius, and 1
specifying the dropoff position at the maximum radius. A value of 0.5 places the
dropoff position halfway between the minimum radius and maximum radius.
Default is 0.
Min Radius Specifies the minimum radius of the circular sine wave. Minimum value is 0;
Maximum value is 1. Default is 0.
Max Radius Specifies the maximum radius of the circular sine wave. Minimum value is 0;
Maximum value is 1. Default is 1.
3 Click on a channel name with the left mouse button.
4 In your scene, press the middle mouse button and move the mouse to the left or
right. By moving the mouse, you interactively change the value of the selected
channel. As you move the mouse, note that pressing the Ctrl key gives you finer
control, and pressing the Shift key gives you coarser control.
Wavelength Specifies the frequency of the sine wave. For greater frequency, decrease the
wavelength; for lesser frequency, increase the wavelength. Use the slider to select
values from 0.100 to 10.000. Default is 1.000.
Offset Specifies the location of the sine wave relative to the center of the deformer handle.
Changing this value can create a rippling effect. Use the slider to select values from -
10.000 to 10.000. Default is 0.000.
Dropoff Specifies how the amplitude decays. Negative values specify a decay towards the
center of the deformer handle (maximum is -1.000), and positive values specify a
decay away from the center of the deformer handle (maximum is 1.000). Use the
slider to select values from -1.000 and 1.000. Default is 0.000 (no decay).
Min Radius Specifies the minimum radius of the circular sine wave. Minimum value is 0.000;
Maximum value is 1.000. Use the slider to select values from 0.000 to 10.000. Default
is 0.000.
Max Radius Specifies the maximum radius of the circular sine wave. Minimum value is 0.000;
Maximum value is 1.000. Use the slider to select values from 0.000 to 10.000. Default
is 1.000.
Deformer Attributes
Envelope Specifies the deformation scale factor. Select values from 0.000 to 1.000. Default is
1.000.
Node Behavior
See "Editing node behavior to improve performance" on page 54.
Extra Attributes
(No extra attributes by default.)
EXAMPLE
Ripple animation
You can create ripple effects by using a wave deformer on a NURBS or polygonal
surface. This example shows how you can create a simple ripple effect on a NURBS
plane.
Ripple at frame 1
Ripple at frame 10
3 Set keys for all of wave1s attributes.
Ripple at frame 20
3 Set keys for all of wave1s attributes.
With sculpt deformers, you can deform objects with a spherical influence object
called a sculpt sphere.
Sculpt sphere
The sculpt sphere is the spherical wireframe influence object you manipulate to
create deformation effects. The sculpt spheres deformation effects depend on the
mode of the sculpt deformer. Sculpt deformer modes include flip, project, and
stretch.
Flip mode
A sculpt deformer in flip mode has an implicit locator in the center of the sculpt
sphere. When the sculpt sphere is near the geometry, deformation occurs. This mode
is called flip mode because as the center of the sculpt sphere passes through the
surface, the deformed surface flips to the other side of the sculpt sphere.
Project mode
In project mode the sculpt deformer projects the geometry onto the surface of the
sculpt sphere. The extent to which the projection takes place depends on the sculpt
deformers Dropoff Distance attribute.
While the Dropoff Distance specifies the extent of the projection directly onto the
sculpt sphere, the Maximum Displacement attribute specifies whether the projection
takes place directly onto the sculpt sphere, inside the sculpt sphere, or outside of the
sculpt sphere.
With a Maximum Displacement of 1.0, the projection takes place on the surface of
the sculpt sphere. This is the effect you would usually want to achieve with project
mode. However, by changing the Maximum Displacement you can displace the
projection from the surface of the sculpt sphere. With a Maximum Displacement
between 0 and 1.0, the projection takes place within the sculpt sphere. With a
Maximum Displacement greater than 1.0, the projection takes place outside of the
surface of the sculpt sphere. Finally, with a Maximum Displacement of 0, the
geometry is projected into the center of the sculpt sphere.
Finally, with a Maximum Displacement of less than 0, the projected geometry turns
inside out as it is projected through the center of the sculpt sphere.
Stretch mode
In stretch mode, as you move the sculpt sphere away from the geometry, the affected
surface of the geometry stretches or bulges to stay with the sculpt sphere. The stretch
direction extends from the point marked by a stretch origin locator to the surface of
the sculpt sphere.
When you create a sculpt deformer in stretch mode, you can select and move the
stretch origin locator as you do any object, or parent it to the sculpt sphere and move
them in combination. Depending on the effect you want to create, you could also
parent the locator to some other object in the animation.
Basic
Mode Specifies the sculpt deformers mode. Select Flip, Project, or Stretch. Default is
Stretch.
Inside Mode Specifies how the deformer influences the deformable objects points located inside
the sculpt sphere. There are two modes: Ring and Even.
Ring mode pushes inside points outside of the sculpt sphere, creating a contoured,
ring-like effect around the sculpt sphere.
Even mode spreads the inside points all around the sculpt sphere evenly, creating a
smooth, spherical effect.
Select Ring or Even. Default is Even.
Max
Displacement Specifies the distance that the sculpt sphere can push a deformable objects points
from the spheres surface. Use the slider to select values from -10.000 to 10.000.
Default is 0.100.
Dropoff Type Specifies how the sculpt spheres range of influence declines or drops off. (The range
of influence is specified with the Dropoff Distance.) There are two Dropoff Types:
None and Linear.
None specifies no decline, providing a sudden dropoff effect.
Linear specifies a gradual decline, providing a dropoff effect that decreases linearly.
Select None or Linear. (Default is Linear.)
Dropoff
Distance Specifies the sculpt spheres range of influence. (How the range of influence can
decline is specified by Dropoff Type.)
Positioning Specifies the placement of the sculpt sphere. Click Positioning on to center sculpt
sphere within the deformable object. Click off to place sculpt sphere at the
workspace origin. Note that if you are creating a stretch sculpt deformer (Mode is set
to Stretch), the stretch origin locator will be placed with the sculpt sphere. Default is
on, which centers the sculpt sphere within the deformable object.
Grouping If you are creating a stretch sculpt deformer (Mode is set to Stretch), you can choose
whether the stretch origin locator will be put in a group with the sculpt sphere. Click
on to group the sculpt sphere with the stretch origin locator. Default is off.
Advanced
See "Editing advanced deformer creation options" on page 52.
Click Create if you want to create a sculpt deformer now.
or
Click Save to save the creation options.
or
Click Reset to reset to the default creation options.
or
Click Close to close the Sculpt Options window.
Specifies the distance that the sculpt sphere can push a deformable objects points
from the spheres surface. Enter values from -10.000 to 10.000. Default is 0.100.
(When you created the deformer, Maximum Displacement was set to the Max
Displacement creation options value.) The effect can depend on the deformers
Mode attribute setting. For instance, if Mode is set to Project, see "Project mode" on
page 160.
Dropoff
Distance Specifies the sculpt spheres range of influence. How the range of influence can
decline is specified by Dropoff Type attribute. The effect can depend on the
deformers Mode attribute setting. For instance, if Mode is set to Project, see "Project
mode" on page 160.
3 Click on a channel name with the left mouse button.
4 In your scene, press the middle mouse button and move the mouse to the left or
right. By moving the mouse, you interactively change the value of the selected
channel. As you move the mouse, note that pressing the Ctrl key gives you finer
control, and pressing the Shift key gives you coarser control.
Sculpt History
Mode Specifies the sculpt deformers mode. To create a flip, project, or stretch sculpt
deformer, select Flip, Project, or Stretch. Default is Stretch.
Inside Mode Specifies how the deformer influences the deformable objects points located inside
the sculpt sphere. There are two modes: Ring and Even.
Ring mode pushes inside points outside of the sculpt sphere, creating a contoured,
ring-like effect around the sculpt sphere.
Even mode spreads the inside points all around the sculpt sphere evenly, creating a
smooth, spherical effect. Select Ring or Even. Default is Even.
Max
Displacement Specifies the distance that the sculpt sphere can push a deformable objects points
from the spheres surface. Use the slider to select values from -10.000 to 10.000.
Default is 0.100. (Max Displacement corresponds to the Maximum Displacement
channel.) The effect can depend on the deformers Mode attribute setting. For
instance, if Mode is set to Project, see "Project mode" on page 160.
Dropoff Type Specifies how the sculpt spheres range of influence declines or drops off. (The range
of influence is specified with the Dropoff Distance.) There are two Dropoff Types:
None and Linear.
None specifies no decline, providing a sudden dropoff effect.
Linear specifies a gradual decline, providing a dropoff effect that decreases linearly.
Select None or Linear. (Default is Linear.)
Dropoff
Distance Specifies the sculpt spheres range of influence. Note that Dropoff Type specifies
how the range of influence can decline. The effect can depend on the deformers
Mode attribute setting. For instance, if Mode is set to Project, see "Project mode" on
page 160.
Deformer Attributes
Envelope Specifies the deformation scale factor. Values can vary from 0 to 1. Default is 1.
Node Behavior
See "Editing node behavior to improve performance" on page 54.
Extra Attributes
(No extra attributes by default.)
Wire deformers are like the armatures used by sculptors to shape objects. With a
wire deformer, you use one or more NURBS curves to change the shape of objects.
For a quick example of creating a wire deformer, see "Quick start" on page 167.
QUICK START
This section shows you how to create a typical wire deformer as quickly as possible.
In this example, you will deform a surface with an S-shaped curve, limiting the
deformation region with a circle.
Youll use the circle to limit the deformation region. A curve that limits the
deformation region is called a holder.
To create deformations:
1 Select the S-shaped curve.
2 Move the S-shaped curve up.
Holders
Holders are curves that you can use to limit the deformation region. As with other
curves, you can move, rotate, or scale holders. You can also edit a holders shape.
Moving, rotating, scaling, or editing holders can change the deformation effect.
Wire Options
Holders Specifies whether you want to create a wire deformer with holders. Holders are
curves that you can use to limit the deformation region. Click on or off. Default is
off.
Envelope Specifies the deformation scale factor. Use the slider to select a value between 0.0000
and 2.0000. A value of 0 specifies no deformation effect. Default is 1.0000.
Crossing Effect Specifies the amplitude of the deformation effect where two of the deformers
influence wires cross. Use the slider to select values from 0.0000 to 2.0000. Default is
0.0000, which specifies a smooth, not additive, effect.
Local Influence Specifies the localization of the deformation effect of two or more influence wires.
Use the slider to select values from 0.0000 to 2.0000. Default is 0.0000.
Dropoff
Distance Specifies the range of influence of each influence wire. Use the slider to select values
from 0.0000 to 10.0000. Default is 1.0000.
Deformation
Order Specifies the placement of the deformer node in the deformable objects history.
Placement selections include Default, Before, After, Split, or Parallel. Default
typically places the deformer immediately upstream of the current final shape node.
Before places the deformer immediately upstream of (before) the current final shape
node. (Default and Before typically provide the same placement.) After places the
deformer immediately downstream of (after) the current final shape node, and
creates a new final shape node. Split splits the upstream deformation history into
two separate deformation chains, providing two final shapes originating from the
same deformable object. Parallel creates a final shape that blends the objects current
upstream history in parallel with the new deformer. Select Default, Before, After,
Split, or Parallel.
Exclusive Specifies whether the deformer set will be in a partition. If a deformer set is in a
partition, the points in the set cannot be in any other set. The result is that only the
deformer you are about to create can influence the points. Check on or off (default is
off). If on, the Exclusive Partition and Existing Partitions options become available.
Exclusive
Partition Specifies the name of the partition. (Default name is deformPartition.) Available if
Exclusive is on.
Existing
Partitions Specifies an existing partition. (Default existing partition is characterPartition.)
Available if Exclusive is on.
Click Reset Tool to reset to the default tool settings.
or
Click Close to close the Tool Settings window.
Note that you can change the tool settings whenever you are using the Wire Tool by
selecting Window > General Editors > Tool Settings.
10 When you are ready to create the wire deformer, clear the selection list by selecting
empty space, and then press Enter.
A wire deformer is created based on the Wire Tools tool settings. The curves you
selected are now influence wires that you can use to deform the object(s) you
selected.
A base wire is created for each influence wire. The base wire(s) are listed in the
Outliner. By default, they are not shown in the scene, but they do influence the
deformation effect. The wire node calculates the deformation effect based on
differences between each influence wire and its base wire.
A deformer set is created. The deformer set includes all the deformable objects
points that can be influenced by the wire deformer.
Note that you cannot edit the shape of the base wires, though you can edit the shape
of the influence wires.
Local Influence Specifies the localization of the deformation effect of two or more influence wires.
Values range from 0 and 1, with 1 specifying greatest localization. Default is 0.
Rotation Specifies an effect that varies between shearing and tangency. Values range from 0
and 1, with 0 indicating maximum shearing and 1 maximum tangency.
Dropoff
Distance[n] Specifies the range of influence for each influence wire. The value of n indicates
which influence wire. As the value of Dropoff Distance increases, more points within
the deformation region are influenced by the influence wire. Default is 1.
Scale[n] Specifies the scale of influence for each influence wire. The value of n indicates
which influence wire. Scale controls the strength of an influence wires attraction to
points in the deformation region. Scales value has the effect of scaling a surface
radially around an influence wire. The scaling effect can be gradually reduced by the
Dropoff Distance.
Locator
Envelope[n] Specifies the deformation scale factor for a wire dropoff locator. The value of n
indicates which wire dropoff locator. Default is 1. These channels are only displayed
if you have created wire dropoff locators (see "Using wire dropoff locators for
localized deformation effects" on page 180).
Wire Locator
Twist[n] Specifies localized twisting effects around a wire dropoff locator. The value of n
indicates which wire dropoff locator. As you increase or decrease the value, you see
a twisting of the region of the surface influenced by the wire dropoff locator. In
character setup, changing Wire Locator Twist can provide subtle effects for lip and
eyebrow action. Default is 0, which specifies no twisting effects. These channels are
displayed only if you have created wire dropoff locators (see "Using wire dropoff
locators for localized deformation effects" on page 180).
3 Click on a channel name with the left mouse button.
4 In your scene, press the middle mouse button and move the mouse to the left or
right. By moving the mouse, you interactively change the value of the selected
channel. As you move the mouse, note that pressing the Ctrl key will give you finer
control, and pressing the Shift key will give you coarser control.
Parameters
Rotation Specifies an effect that varies between shearing and tangency. Values range from 0
and 1, with 0 indicating maximum shearing and 1 maximum tangency. Use the
slider to select values from 0.000 to 1.000. Default is 1.000.
Crossing Effect Specifies the amplitude of the deformation effect when two influence wires cross.
Values can vary from 0 (smooth effect) to 1 (additive effect). Default is 0. Use the
slider to select values from 0.000 to 1.000. Default is 0.000.
Local Influence Specifies the localization of the deformation effect of two or more influence wires.
Values range from 0 and 1, with 1 specifying greatest localization. Use the slider to
select values from 0.000 to 1.000. Default is 0.000.
Tension Specifies the influence wires attraction strength. Values specify how strongly the
influence wire can attract the deformable objects points away from the base wire.
The attraction strength is therefore expresses a tension between the influence wire
and the base wire. Use the slider to select values from -10.000 to 10.000. Default is
1.000.
Freeze
Geometry Specifies whether to freeze the wire deformation effect. If frozen (checked on),
components (for example, CVs) of objects being deformed that are under the
influence of the influence wire become fixed and affected only by the influence wire,
even if you transform (move, rotate, or scale) the object or the base wire. The reason
you would want to freeze geometry is to improve performance. Note that you
should not move geometry objects relative to the base wire with freeze geometry
checked on. Check on or off. Default is off.
Scale
curven Specifies the scale of influence for each influence wire. The value of n indicates
which influence wire. Default is 1.00.
Dropoff Distance
curven Specifies the range of influence for each influence wire. The value of n indicates
which influence wire. Default is 1.00.
Locators
If you have created any wire dropoff locators, this section lists the attributes for each
wire dropoff locator on each influence wire.
curveShapen-
>locatorn
Identifies the influence wire shape (default name: curveShapen) and the wire dropoff
locators (default name: locatorn) on that wire. The locators are numbered in the
order that they were created, starting with 1.
Param[n] Specifies the location of the wire dropoff locator on the influence wire curve. The
value of n indicates which wire dropoff locator, numbered in the order created,
starting with 0. The value is in terms of the curves U parameter.
Percent[n] Specifies the local effect the locator has on the influence wires dropoff. The value of
n indicates which wire dropoff locator, numbered in the order created, starting from
0. By default, the influence wire has two implicit locators at each end with a Percent
of 1.000; other locators have an effect relative to the Percent of those locators. Use the
slider to select values from 0.000 to 1.000. Default is 1.000.
Twist[n] Specifies localized twisting effects around a wire dropoff locator. The value of n
indicates which wire dropoff locator, numbered in the order created, starting with 0.
As you increase or decrease the value, you see a twisting of the region of the surface
influenced by the wire dropoff locator. In character setup, changing Twist can
provide subtle effects for lip and eyebrow action. Default is 0, which specifies no
twisting effects. (Note that this attribute corresponds to the Wire Dropoff Twist
channel.)
Envelope[n] Specifies the deformation scale factor for a wire dropoff locator. The value of n
indicates which wire dropoff locator, numbered in the order created, starting with 0.
Default is 1. (Note that this attribute corresponds to the Locator Envelope channel.)
Deformer Attributes
Envelope Specifies the deformation scale factor. Values range from 0.000 to 1.000.
Node Behavior
See "Editing node behavior to improve performance" on page 54.
Extra Attributes
(No extra attributes by default.)
Render Stats
This section includes settings for rendering. For more information about rendering,
see Using Maya: Rendering.
Object Display
This section includes settings for the dropoff locators visibility (the Visibility
attribute) and templating (the Template attribute).
Node Behavior
See "Editing node behavior to improve performance" on page 54.
Extra Attributes
(No extra attributes by default.)
To add holders:
1 Select the curves you want to add to the deformer as holders.
2 Shift-click on any wire in the deformer to select the deformer to which you want add
the curves as holders.
3 Select Deform > Edit Wire > Add Holder.
The selected curves become holders for the wire deformer.
To remove holders:
1 Select the curves that you want to remove as holders.
2 Select Deform > Edit Wire > Remove.
The selected curves are no longer holders.
A wrinkle deformer combines a cluster deformer with one or more wire deformers.
Wrinkle deformers are useful for creating detailed wrinkling effects.
Wrinkle deformer
consisting of
cluster deformer
controlling wire
deformers
Wrinkle
deformer acting
on characters
mouth
Wires group nodes that parent influence wires and their base wires (default name:
influenceWireWires).
For more information about these nodes, refer to the online Node and Attribute
Reference documentation.
Wrinkle Options
Type Specifies the type of wrinkle deformer. Select Tangential, Radial, or Custom. Default
is Radial.
Amount Specifies the number of parent influence wires in the wrinkle deformer. (The total
number of influence wires can also include child influence wires specified by Radial
Branch Amount and Radial Branch Depth). Use the slider to select value between 0
and 20. Default is 3.
Thickness Specifies the surface dropoff, which is the area influenced by each influence wire.
Use the slider to select values from 0.0000 to 2.0000. Default is 1.0000.
Randomness Specifies how close the wrinkle deformer conforms to the specified Amount,
Intensity, Radial Branch Amount, and Radial Branch Depth. Use the slider to select
values from 0.0000 to 1.0000. Default is 0.2000.
Intensity Specifies the sharpness of the creases created by the influence wires. The minimum
intensity (0) specifies smooth creases. The maximum intensity (1) specifies sharp,
steep creases. Use slider to select values from 0.0000 to 1.0000. Default is 0.5000.
Radial Branch
Amount
Specifies the number of child influence wires that branch from each parent influence
wire. Applies to radial wrinkle deformers only. Use slider to select values from 0 to
10. Default is 2.
Radial Branch
Depth Specifies the depth of the influence wire hierarchy, which is the number of levels of
child influence wires that branch from each parent influence wire. Increasing the
Radial Branch Depth exponentially increases the total number of influence wires.
Applies to radial wrinkle deformers only. Use slider to select values from 0 to 4.
Default is 0.
Click Reset Tool to reset to default options.
or
Click Close to close the Tool Settings window.
Note that you can change the tool settings whenever you are using the Wire Tool by
selecting Windows > General Editors > Tool Settings.
DEFORMERS