Datasheet
11
A working autosave script, named as.mel, is included in the Chapter 1 mel folder on the
CD. To use
as.mel, choose File ➔ Source Script in the Script Editor. By default, it will pop up
a save reminder window every 5 minutes.
With this script, you have the option to save the file with an incremen-
tal name (
as.1.mb, as.2.mb, and so on), skip the save and exit the window,
or kill the autosave job completely. You’ll find additional customization
notes at the top of the file. Keep in mind that this script is meant to demon-
strate various MEL concepts and should not be considered a perfect exam-
ple of MEL coding. That is, there are numerous ways to make the script
“tighter” and take up fewer lines.
The scriptJob command has other uses beyond the creation of an autosave script. For
instance, you can kill all MEL jobs currently running, regardless of their number, with the
following line:
scriptJob -killAll
The -killAll flag won’t affect protected jobs. To see what jobs exist and which ones
are protected, use the
-listJo b s flag. The Script Editor lists all jobs with the job number
to the left:
27: “-protected” “-event” “SelectionChanged”
“objectDetailsSmoothness()”
4167: “-event” “SelectionChanged” “SaveScene”
If you’re feeling adventurous, you can kill all the protected script jobs by adding the -force
flag. Caution should be used, however, since Maya supplies a number of jobs that control the
UI. You can also protect your own jobs by adding the
-protected flag.
a
Creating Your Own Paint Effects Brushes
Paint Effects is a powerful system that allows you to paint geometry and other specialized
strokes. With a few simple steps, you can create an entire forest, a raging fire, or a scruffy
beard.
Paint Effects brushes are, in reality, short MEL scripts that live in the
brushes folder in
the Maya program directory (for example,
C:\Program Files\Alias\Maya8.0\brushes\). Two
basic brush styles exist: tube and sprite. Tube brushes grow primitive tube geometry into
complex shapes. Sprite brushes paste bitmaps onto short tube segments.
To swap out a default sprite brush bitmap for your own:
1. Switch to the Rendering menu set, choose Paint Effects ➔ Get Brush, and a select a
brush that uses sprites, such a
hands.mel in the flesh brush folder. Paint a stroke.
The save
reminder
window of the
as.mel script
Creating Your Own Paint Effects Brushes
07405c01.indd 1107405c01.indd 11 1/17/07 8:30:51 PM1/17/07 8:30:51 PM