The Art of Maya 3rd Edition
The Art of Maya 3rd Edition
The Art of Maya 3rd Edition
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
Copyright © 2005 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.
ISBN: 1-894893-82-4
SYBEX and the SYBEX logo are either registered trademarks or trademarks of SYBEX Inc. in the USA and other countries.
TRADEMARKS: Sybex has attempted throughout this book to distinguish proprietary trademarks from descriptive terms by following
the capitalization style used by the manufacturer. Copyrights and trademarks of all products and services listed or described herein
are property of their respective owners and companies. All rules and laws pertaining to said copyrights and trademarks are inferred.
This document may contain images, text, trademarks, logos, and/or other material owned by third parties. All rights reserved. Such
material may not be copied, distributed, transmitted, or stored without the express, prior, written consent of the owner.
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 manufacturers. 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.
Sybex Inc.
1151 Marina Village Parkway
Alameda, CA 94501
U.S.A.
Phone: 510-523-8233
www.sybex.com
Exploring Maya
Before exploring modeling and animation concepts, it is a good idea to become
familiar with the way Maya’s user interface works. The user interface is where
3D artists display and organize scenes, save and open files, and transform and
animate objects. While developing these skills 3D artists learn just how they can
make Maya do what they want it to.
Maya has a very clean user interface where many of the elements
share generic editor windows. At first, this may make it difficult to distinguish
different parts of a scene, but with experience 3D artists learn the power of this
paradigm. The generic way in which Maya presents information makes it very
easy to transfer skills from one area of Maya to another. This lets 3D artists
focus on learning Maya’s underlying concepts instead of always re-learning
how the user interface works.
Maya’s Dependency Graph concept links virtually all objects in a scene
to each other. As 3D artists learn more, they discover this underlying structure
plays a key role in how they work and animate in Maya.
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
The Workspace
QWERTY Tools
The “qwerty” hotkeys
The Work Space
Channel Box
can be used to Select The Channel Box lets
(q), Move (w), Rotate you edit and key values
(e), Scale (r), and Show Panels
for selected objects.
Manipulators (t) as well The workspace can be divided into
as access the last tool multiple panels that offer different
used (y) in the scene. ways of creating and evaluating
your scenes.
Playback
The Playback controls
let you move around
time and preview your
"spotLightShape1.useDepthMapShadows" on;
23
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
Simplifying the User Interface The Hotbox
All of the UI tools that are available when Maya is The Hotbox gives you access to all of Maya’s menu items and tools
first launched can be turned off or on as needed. right at your cursor position. When you press and hold down the Space
In fact, you can turn them all off and focus on one bar on your keyboard, after a short delay the Hotbox appears. The
single view panel if this is how you like to work. In Hotbox is fully customizable and lets you focus on the tools you feel
this case, you would use interface techniques such are most important to your workflow. The Hotbox Controls let you turn
as the Hotbox, Hotkeys, or the right mouse button to off the main menus and the panel menus in the workspace. When the
access tools and options. menus and panels are off, you can focus entirely on using the Hotbox.
This is a single shaded view panel with the hotbox being used to
access tools. Most likely, you will configure the workspace some-
Marking Menus
where between this minimal setup and the default setup. Marking menus are accessed by selecting a Hotkey and clicking with
your left mouse button. The menu appears in a radial form so that all
Hotkeys your options are simply a stroke away. Once you learn the location of
Hotkeys will give you quick access to many of the the menu options, you can quickly stroke in the direction of an option
tools found in Maya. To set up Hotkeys, select without having to see the menu itself. Because the menu is radial, it is
Windows > Settings/Preferences > Hotkeys. The very easy to remember the location of each menu option. It will only
Hotkey Editor lets you set up either a single key or take a short time for you to master this way of accessing tools.
a key and a modifier key such as Ctrl, Shift, or Alt, You can set up your own marking menus by building them in
to access any tool in Windows > Settings/Preferences > Marking Menus, then assigning the
Maya that is listed in new marking menu to a Hotkey.
the Editor.
It is also possible
to build custom
commands using a
MEL (Maya Embedded
Language) script.
This feature allows First Use Expert Use
When you first use a marking menu, press the As you become an expert, you can quickly press the
you to set up the UI to Hotkey and click-drag to the desired location in the
Hotkey, click and hold it with the mouse while you
The Hotkey Editor gives you access to completely reflect your view the Options, then drag to the desired location menu. The menu doesn’t appear and your selection
all of the tools in Maya. quickly flashes by.
own workflow. in the menu.
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
24
File Management Maya File Types
Maya has several dedicated file
types for saving scenes, images,
A typical Maya project is made up of many files that need to be Maya Binary (.mb)
easily accessible. To organize these files, Maya uses a special directory This scene file description uses binary
structure for different file types such as 3D scenes, texture files, and code to efficiently store information about
final rendered images. You may also want to make specific directories objects, shaders, and animation. This format
is only accessible from within Maya.
for importing and exporting files. It is, therefore, important to learn
about the file types you will be working with and how they apply to
Maya ASCII (.ma)
your Maya project.
This scene file description is written with
As your production workflow becomes more sophisticated, you ASCII text and can be opened and edited
may want to begin sharing files with other users or create libraries for using any Text Editor. Its file size is larger
your own long-term use. With a few modifications, these alternative than a Maya binary file, but allows those
familiar with Maya a chance to tweak parts
workflows can easily make use of Maya’s file management capabilities. of a scene without opening the file
within Maya.
The Maya Directory
setAttr "spotLightShape1.centerOfIllumination" 17.56598; setAttr "spotLight1.rotate" -type double3 0
A new Maya directory is created for each user. This makes it possible Maya IFF (.iff)
"spotLightShape1.centerOfIllumination" 20.319657; setAttr "spotLight1.translate" -type double3 0
for multiple users on the same machine to have personalized UI setups, Maya’s bitmap file format is called IFF. It
scripts, and project files. Some of the directories found in the Maya can save RGB channels as well as mask
and depth channels. It can also be used to
directory are: Projects, Source Images, and Scripts. save rendered images and file textures used
when rendering. While other industry stan-
dard image file formats can be used, Maya
Scripts
IFF is more efficient when used within Maya,
The Scripts directory is where you
because it is a file created for Maya.
can store scripts available for any
versions of Maya, quickly accessed
10.213951 12.56598 ; setAttr "spotLightShape1.coneAngle" 65.764707; setAttr
Project Files
"spotLightShape1.useDepthMapShadows" on;
Creating Projects
The Projects directory stores and organizes all the information related
to a scene. It contains sub-directories in which different scene elements,
such as textures and scene files, are located.
When you start a new production, you will want to create a new
exploring maya
25
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
The Projects Directory Setting Projects
The Projects directory is where all your Maya files are stored. The new Setting a project in Maya
project options window is divided into three separate sections: Scene allows you to specify
File Locations, Project Data Locations, and Data Transfer Locations. the location of your
You can use Maya’s default settings or enter your own in the text field. current project. This is
If you leave a field blank, a folder will not be created for that section useful when working
and the default location directory will be used. with multiple projects,
allowing you to save
and open files from the
Scene File Locations
appropriate directories.
By default, this directory saves Maya scene
files. It contains files in either Maya ASCII or To set a project, select
Maya binary format. File > Project > Set.
Data Transfer
Transferring data from one scene to another can be done in one of
two ways. Scenes can be imported to merge with your current scene
or they can be referenced into your scene.
Importing data into your present scene merges the material,
making the file size larger. When you import data, you can make any
changes needed to that file. Files that have not been created in Maya,
such as Adobe Illustrator®, and EPS files can also be imported into
a scene . This feature can be useful when creating 3D text and flying Shared Directories
logos, where the artwork is created in a 2D package and imported as When sharing a project with other people, you may
a NURBS curve. To import a scene into Maya, select File > Import. want to set up a common folder where information
Referencing a scene file allows you to share that same file with can be shared.
other scenes. The scene content is not copied into your scene, but Under the Project Data Locations menu, you
a visible reference of the scene to which changes cannot be made can specify more than one directory from which
appears. The benefit of referencing a scene file is the ability to work to retrieve information. Shared directories can be
with multiple scenes that use the same reference file. If that file useful when working on different scene files that
requires changes, all you need to do is change the original file and all share common source images.
scenes containing reference to that file will automatically be updated.
To reference a scene file, select File > Create Reference.
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
26
Viewing 3D Scenes
View Tools
Tumble
By pressing the Alt key along
Press the Alt key plus the left mouse
with different mouse button button to rotate the camera around a
combinations, you can navigate 3D Perspective view.
the objects around in your scene.
While the Tumble Tool is only Track
used to rotate a 3D Perspective Press the Alt key plus the middle
mouse button to pan from left to
view, you can track and dolly in
exploring maya
27
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
Shading
Maya’s Shading menu offers several options for displaying objects in a
scene. Shading can be different for each view panel, allowing geometry
to be shown at different levels of complexity.
The more detailed a scene becomes, the greater the need to
simplify the objects in it. Although Maya is very good at processing Bounding Box Points Wireframe
complex levels of geometry, it is a good idea to view your objects in Bounding Box displays Points shading displays Wireframe shading is
objects as boxes. This objects as a group of the default shading
a less complex shading mode until you are ready to render or make is useful when working points that represent the quality in Maya.
adjustments to those objects. with complex scenes. shape of the object.
There are several shading display options to choose from. The
default shading in Maya is Wireframe. Other display options include:
Bounding Box, Points, Flat Shade, Smooth Shade, Hardware Lighting,
Wireframe on Shaded, and X-Ray.
Show Menu
The Show Menu allows you to show and hide different elements of
a scene. You can show all or none or specific items such as NURBS Flat Shade Smooth Shade Hardware Texturing
curves, lights, or cameras. Flat shade displays all or Smooth Shade displays Hardware Texturing
only the selected objects all or only the selected displays smooth-shaded
The Show Menu is accessible from all views and can hide items with lower resolution objects as smooth sur- surfaces with textures.
in one view while displaying them in another. faceted display. faces with surface color
and shading properties.
Using Isolate Select allows you to hide CVs X-Ray Wireframe on Shaded
on a NURBS surface. X-Ray shading displays Wireframe on Shaded
objects with a semi- displays a wireframe on a
transparent surface. shaded surface.
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
28
Objects and Components
Y ou can transform objects in Maya by selecting objects and their
components. Selection masks allow you the flexibility to select only
the items you want in a scene. These masks are grouped into three
categories: Hierarchy, Object type, and Component type selections.
Object Types
Scene objects are items such as Cameras, Curves, Surfaces,
Dynamics, Joints, Handles, and Deformers. Objects created in Maya
are made up of two parts: a Transform node and a Shape node. The
Transform node contains basic information about an object’s position,
orientation, and scale in space. The Shape node defines what the object
looks like.
The Outliner can be used to select
Rendering and view hierarchical relationships
Scene objects such as between the objects in your scene.
lights, cameras, and
setAttr "spotLightShape1.centerOfIllumination" 17.56598; setAttr "spotLight1.rotate" -type double3 0
Skeleton Joints
Curves Skeleton joints are used
Turning off the Curve to help control characters.
selection means you can
not select the curves in
the scene.
Handles
10.213951 12.56598 ; setAttr "spotLightShape1.coneAngle" 65.764707; setAttr
Surfaces
Objects and Components
Dynamics Deformations
Dynamic objects such as Deformers such as cluster
particles can be separately flexors and lattices modify
selected by toggling the the shape of an object.
Dynamics button on.
Points Faces
"spotLightShape1.useDepthMapShadows" on;
29
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
Hierarchy Object Component
hierarchy
Selecting by Hierarchy allows you to select objects at either the Root,
Selection Masks Leaf or Template node level. Unlike Object and Component selection
masks, you are not able to turn on more than one mask at a time.
Selection masks allow you to select
the specific items you want to work
on. There are three main groups of
selection masks: Hierarchy, Object,
and Component. Object
Hierarchy mode allows you to Object selection masks allow you to make selections based on the
object types you specify. Left-clicking on the arrow to the left of the
select nodes at different levels. In
pick masks displays a menu allowing you to turn all objects on or off.
this mode you can select the Root,
Leaf, and Template nodes.
Object mode allows you to select
scene elements at the Transform
node level. These include objects Component
Component selection masks offer a variety of pick masks to choose
such as surfaces, curves, and joints.
from. Right-clicking on a mask displays more selection options.
Component-type selections are
selections made to objects at the
Shape node level, such as isoparms
and CVs.
Right Mouse Button Selections
Clicking the right mouse button over an object
Selection Priority will bring up a marking menu that allows you to
Objects and Components are choose from both Object and Component selection
selected in order of priority based types, while remaining in
on an assumed production work- Component mode. The
flow. For example, if you want to menu choices are specific
select both joints and surfaces, Maya to the object selected or
Preferences
anticipates that you want to select The selection priority list can be found under
the object beneath the
joints first. To select more than one Windows > Settings/Preferences > Preferences. marking menu.
object with different priorities, select In this window, you can change the order in which
Objects and Components are selected.
the first object and shift-click on the
object of different priority. Root node selection
viewed in Hypergraph
Hierarchies
When working with a group of
objects that are arranged in a hier-
Quick Select
archy, you may want to specifically Using Quick Select, you can type in the name of an
work at the Root node or Leaf object in the text field and it will become selected
Selection of any Leaf node
node level. will select the root node in your scene.
If you choose to work at the This is particularly useful when there are
Root node level of a group, also several objects in a scene with a common name.
known as the top node in a hier- You can type in the name followed by an asterisk
archy, you can toggle on the Select (*) and all objects containing that same name will
by Hierarchy: Root mask. In this be selected.
selection mode, you can click on
any object in the hierarchy and
only the top node of the object
picked will be selected.
If you want to work at the Leaf
node level, toggle on the Select by Toggling on the Select by Hierarchy: Root mask
Hierarchy: Leaf button. In this mode, allows you to select any Leaf node in a hierarchy and
only the leaf nodes or children of a the Root node will become selected.
hierarchy will be selected.
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
30
Dependency Graph
E verything in Maya is represented by a node with attributes that can
be connected to other node attributes. This node-based architecture
allows connections to be made between virtually everything in Maya.
Node attributes determine such things as the shape, position, construction
history and shading of an object. With this architecture, you can create
inter-object dependencies, shading group dependencies, and make your
own node connections.
to as a Shading Network.
The Hypershade window allows you to make
and break connections between shading group
Animation Curve nodes. The Hypershade displays thumbnail images
When an animation is produced in Maya, node dependencies are representing each node. The diagrams below both
created between the animation curves and the object being animated. show the same shading group dependency in the
Hypershade and Hypergraph windows.
10.213951 12.56598 ; setAttr "spotLightShape1.coneAngle" 65.764707; setAttr
Node Dependencies
0 0 ; setAttr "spotLight1.translate" -type double3 0 0 12.56598 ; setAttr
In the diagram below you can see the nodes that are
dependent on each other to make up a chess piece.
Dependency Graph
Hypershade
Using the Hypershade, you can make materials and textures and
view the node dependencies used to create them.
exploring maya
Hypergraph
The Hypergraph window can also be used to view and create
shading group dependencies. However, it does not have swatches as
the Hypershade does.
31
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
Viewing Dependencies Making Connections
Dependencies are relationships created between nodes that are Connections made in Maya represent the flow of
connected. There are many ways to view and edit dependencies in information from one node to another. You can
Maya including the Hypergraph, Attribute Editor, and Channel Box. make your own connections between nodes as well
By selecting a node and clicking the Up and Downstream as break connections using the Connection Editor.
Connections button in the Hypergraph window, you can view node The Connection Editor offers a list of node
dependencies on a selected node. This window visually displays the attributes that can be connected to other node
connection between nodes with arrows showing the direction of their attributes. For example, you can map the scale of
dependency to one another. one object to influence the rotation of another.
The Attribute Editor is made up of several tabs allowing you to This creates a connection between the two nodes
view related nodes of a dependency group. In the Attribute Editor, you where every time you scale one, the other
can edit the attributes that affect these nodes. automatically rotates.
In the Channel Box, the selected node is shown with a listing The Connection Editor can extend the
of any keyable attributes that belong to it. Depending on the node possibilities of your production by automating tasks
selected, it will also show input, output, or shape nodes. If you select done through the connection of nodes.
more than one node with the same keyable attributes, you can modify
them at the same time using the Channel Box.
Hypergraph
In the Hypergraph window,
you can see the input and
output connections of a Connection Editor
selected node. The Connection Editor allows you to make connections
between nodes attributes.
Hypergraph
In the Hypergraph, you can view the result of connections
made in the Connection Editor.
Construction History
When an object is built in Maya, Input nodes can be viewed in the
Dependency Graph containing information on how the object was Construction History On
created. These Input nodes allow you to edit an object based on the
geometry used to build it. For example, if you were to create a curve
and use the Revolve Tool to make a surface from it, the curve used to
create the surface would hold information as to how the surface was
created. Using construction history, you can go back to the original Construction History Deleted
curve and alter the shape of the object.
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
32
Transformations
T ransformations are changes made to an object’s position, orienta-
tion, and scale in space. The Transform node holds all of this infor-
mation and the Transform manipulators such as the Move, Scale and
Rotate Tools are used to transform an object along the X, Y, and Z axes.
Manipulators
Manipulators are used to move, scale, and rotate objects in ortho-
graphic and 3D space. Each of the manipulators uses red, green, Move/Rotate/Scale Tool
and blue color handles matching the colors of the X, Y, Z locator at This tool incorporates the Move, Rotate, and
the bottom left corner of the view, making it easier to distinguish Scale manipulators into one tool. Select Modify >
Transformation Tools > Move/Rotate/Scale
the direction of the transformation. These handles are designed Tool to use this Tool.
to constrain the transformation to one, two, or three axes at a time,
allowing for complete control.
Transformation Tools
To work quickly and efficiently
in Maya, the QWERTY hotkeys
setAttr "spotLightShape1.centerOfIllumination" 17.56598; setAttr "spotLight1.rotate" -type double3 0
Reset Transformations
Once you have manipulated an
object, you may not be satisfied
"spotLightShape1.useDepthMapShadows" on;
Freeze Transformations
Select Modify > Freeze
Transformations to keep your
current position as the default
exploring maya
33
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
Scaling Options Rotate Options
The Scale Manipulator allows you The Rotate Tool menu offers three rotate modes to
to change the size of an object both pick from - Local, Global, and Gimbal.
proportionally and non-proportion-
ally. The default coordinate system
for scaling is local.
Move Options
Double-clicking on the Move Tool
icon brings up the following four
coordinate systems: Object, Local,
World, and Normal.
Each object has its own XYZ coordinates. To view an object’s
coordinates, select Object in the options window. Changing an object’s
coordinates to Local aligns the object’s axes to its parent’s axes, Rotation around local
axis of object
ignoring any transformations made to itself.
World is the default coordinate system for the Move Tool. When
World coordinates are selected, the object moves in World coordinate
space where the Y-axis always points up.
Normal coordinates work at a component level displaying NUV
and is useful for CV manipulation. N represents the Normal direction
of the surface. At this level, you can move across the surface in both N, Local
U, and V directions. Local is the default setting. Local allows you to rotate an object in object
space with the axis rotating along with it.
Local Normal
Global
Selecting Global coordinates means the object will rotate within
world space with the Y-axis always pointing up. In this mode, the
rings never change position.
Object World
Gimbal
When Gimbal Lock is on, you can rotate your object only one
axis at a time.
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
34
Duplication
T he Duplicate command window allows you to create copies of
the objects in your scene. This saves you from having to rebuild
identical versions of objects that have been already created.
There are many options to choose from when making a duplicate.
You can Translate, Rotate, and Scale the object you duplicate and To duplicate the surface
specify the number of copies you need. Maya also lets you choose curves of an object, select
an isoparm and choose
whether or not you want to make a geometry copy or a geometry Edit Curves > Duplicate
instance of the selected object. Surface Curves.
from the last duplication and applies the same displayed twice, taking up less system memory.
transformation to the new duplicate. For example, An instance of an object is given its own
if you want to create a staircase, you can select the Transform node. You can make transformations
first step and duplicate it using Smart Transform. such as Rotate and Scale on each instance as well
Move and rotate the duplicate step until you are as apply different textures and shaders without
happy with its position. Duplicate the second step affecting other instances.
using Smart Transform. This time, the third step will Although they do not share Transform nodes,
already be in the right position. instance copies share the same Shape node. If
"spotLightShape1.useDepthMapShadows" on;
35
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
Radial Duplication
To create a radial duplication around the pivot point Duplicate Input Connections
of a selected object, select the Duplicate Options Objects that are duplicated using Duplicate Input
window and enter both a Rotate value and the Connections share the same Construction History.
number of copies you need. For example, to create This means if you were to edit the input attributes of
Pivot Point
the palette below, the pivot point of a single piece one object, all downstream connections inherit the
was snapped to the end vertex around which the same values.
duplication was made.
Mirror Duplication
To create a mirror image of a selected object, open the Duplicate
Options window. Depending on the axis you want to duplicate along,
type in -1 in the appropriate axis field next to the scale option.
mirrored shoe
Animated Snapshot
can be used to create
duplicates of an
object along a path
that can then be used
as a modeling guide.
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
36
Snapping
T he snapping tools let you snap to grids, curves,
points, and view planes. These tools used in
conjunction with the transformation tools allow you
Press x – Snap to grids
Components and select the Component type you of the grid and the grid subdivision, select Grid >
want to display. Display and change options in the options window.
Display points on
unselected objects.
"spotLightShape1.useDepthMapShadows" on;
Selected object
exploring maya
37
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
Point Snapping
Toggling on Point Snapping allows you to snap
vertices or pivot points to another point.
To use Point Snapping, select the object or
component you wish to snap and select the Move
Tool. Press the V key on the keyboard and middle
mouse click on the vertex you wish to snap to.
In the example to the right, the pivot point of
the scooter has been snapped to an edit point
on a path.
The Align Tool displays an easy to use manipulator. The Snap Together Tool lets you pick the Select a vertex on the object you want to move and then
surfaces to snap. shift and select the vertex you want to snap to.
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
38
Artisan
P ainting with Artisan is an intuitive way to make selections, sculpt
surfaces, and paint values on selected surfaces, as well as over
multiple surfaces at a time.
Artisan Brushes
Using an Artisan brush is much like using a real paint brush, with the
ability to paint different shapes and opacities. The advantage of using
an Artisan brush is that you can select and modify the values of select-
ed surfaces quickly, receiving visual feedback while you paint. Using Stylus
a stylus pen in conjunction with the Artisan brush allows you to apply Using a stylus pen with the Artisan brush
allows you to increase and decrease the
pressure-sensitive brush strokes while you work.
pressure while you paint, much like using a
real paint brush.
Radius Profile
setAttr "spotLightShape1.centerOfIllumination" 17.56598; setAttr "spotLight1.rotate" -type double3 0
Opacity
The Opacity attribute Sculpt Variables
determines the frac- Sculpt Variables allow you to
tion of the amount of change the direction in which
maximum displacement an operation will occur.
or brush value applied to
each brush stamp.
10.213951 12.56598 ; setAttr "spotLightShape1.coneAngle" 65.764707; setAttr
0 0 ; setAttr "spotLight1.translate" -type double3 0 0 12.56598 ; setAttr
Operation Flood
Operation determines the Clicking the Flood button
function of the brush. An will apply your settings to
Operation can be to Push, Pull, the entire surface of all
Smooth, or Erase a surface. selected objects.
Artisan
Sculpting
"spotLightShape1.useDepthMapShadows" on;
Artisan Sculpt Surfaces Tool allows you to intuitively mold organic models. The above
example shows a torso before and after it was sculpted in Artisan.
39
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
Selecting Painting Values
The Paint Selection Tool allows you to select and Changing values, such as cluster weights or soft-body goal weights,
deselect CVs, polygonal vertices, edges, and faces allows you to create organic quality animations. With an Artisan brush,
using an Artisan brush. There are several selection you can directly influence the way a surface moves over time by
types to choose from when using this tool. You painting values to different areas of a surface.
can Select, Unselect, and Toggle selections. There Values applied using Artisan range between 0 and 1. These values
are also global selection options that let you Select are represented by a gradation from black to white that acts as a visual
All, Select None, and Toggle all selections. You can guide when you paint.
determine the shape of your selection by choosing
different brush shapes.
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
40
MEL Scripts
M EL (Maya Embedded Language) is Maya’s own scripting language. MEL is used to
execute almost all functions found within Maya. Like most programming languages,
MEL has its own command language which can be used to make the most of Maya.
and commands.
0 0 ; setAttr "spotLight1.translate" -type double3 0 0 12.56598 ; setAttr
MEL commands can be typed in the Command Line and the Script Command Flags give Maya
Editor. More than one command can be executed at a time by inserting instructions on how to execute
a semicolon (;) between commands. It is important to be consistent a command. Command Flags
with uppercase and lowercase naming conventions because MEL is are distinguished by the dashes
case sensitive. placed in front of them separating
Scripts comprising more than one MEL command can be quickly them as Flags.
"spotLightShape1.useDepthMapShadows" on;
accessed by creating Shelf buttons or hotkeys, or incorporating such Command Flags can deter-
scripts into the marking menus accessible from Maya’s Hotbox. mine attributes of an object such
as the scale, position, and name
depending on the Flags used. If
you wanted to create a NURBS
sphere with the Start Sweep
starting at 0 and the End Sweep
at 180, you would type the follow-
ing in the Command Line or Script
Editor: sphere -ssw 0 -esw 180;
exploring maya
41
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
The Script Editor Adding a Macro
The Script Editor can be opened by clicking on the Script Editor icon to the Shelf
to the right of the Command Line or by selecting Window > General A macro is a combination of several Maya commands
Editors > Script Editor.... This window is divided into two sections: that have been saved to the Shelf, Hotkey or marking
the History section and the Input field. menu. Macros are timesaving features that take repet-
The History section is a feedback window that displays MEL itive tasks and combine them into a single button.
functions that have been executed while working in Maya. With your Macros can be created by copying pieces of MEL code
middle mouse button, you can drag strings of code from this window from the Script Editor and creating a shortcut on the
into the Input field to help Shelf to execute several MEL commands at once.
develop your MEL scripts. The History section can be used as a learning
tool to help build upon your MEL scripting knowledge. Macro
You can directly type and execute strings of MEL code in the Input To create a macro, highlight
several commands at once and
field. In this field, you must use the Enter key on the numeric keypad to drag them to the Shelf using
execute a command; using the Enter key on the alpha-numeric keypad the middle mouse button.
takes you to the next line.
Building Procedures
A procedure is code that has been written in the
History Script Editor or a Text Editor outside of Maya and
The History section offers can be stored in memory. When writing a proce-
feedback on functions
executed in Maya. dure, it is important to write a description of what
the procedure is meant to do. The description
Input should be written with comment tags (//) in front
The Input field is used to type of it so that once the script is executed, Maya will
in and execute MEL scripts.
know to ignore these lines. The power of proce-
dures is that they do more than simply execute
commands, they are able to pass arguments from
one procedure to another, store variables, and
How to Use a MEL Script support arguments that require user input.
A MEL script is a file that contains MEL commands, procedures, or
both. MEL scripts should be saved in the scripts directory where Maya Building a Custom User Interface
will look for them. With MEL, you can build your own custom UI with
Before using any MEL script, it is important to read the header information relative to your scene. Since most user
information describing the purpose of the script. The header states the interface elements are created using MEL, you have
usage of the script and whether or not there are any variables required the power to create custom windows with buttons,
to execute it. It is also important to be aware of any reference the sliders, and other controls to modify your scene.
script may have to other scripts, which would also have to reside in
the Scripts directory to be found by Maya.
There are two ways to execute a MEL script. One way is to type
the script name in the Command Line and press the Enter key. Maya
will search the Scripts directory for a .mel file with the same name and
execute it. You can also type the script name in the Script Editor and
execute it using the Enter key on the numeric keypad. The Script Editor
can be used to review or edit the script within Maya.
Command Line
A Text Editor can also be used to write MEL scripts that can be accessed by typing the name
of the procedure in Maya’s Command Line. In this example, spiral.mel is saved under the same
name as the procedure “spiral” and is placed in the scripts directory. This script requires the
user to type in the name of the procedure with a specific height, radius, and the number of This simple MEL script creates a window with the title “Art of Maya,”
turns to create a spiral that is centered about the origin. specifying button and slider names, and slider values.
Copyright © 2005 Alias Systems, a division of Silicon Graphics Limited. All rights reserved.
42