Datasheet
12
Chapter 1 Customization and MEL Scripting
2. Select the stroke curve and open its Attribute Editor tab. Switch to the Paint Effects tab
to the immediate right of the stroke tab. The Paint Effects tab is named after the brush
type. In the Texturing section, click the file browse button beside the Image Name attri-
bute and load your own bitmap. IFF, TIF, and BMP formats work. If you’d like transpar-
ency, choose an IFF file with an alpha channel. For a sprite to work, the Map Method
attribute must be set to Tube 2D. (Tube 3D will work but will cause the image to disap-
pear when the back side of the tube faces the camera.)
3. Render a test. Your bitmap image appears along the painted stroke.
If you’d like to permanently create a custom sprite brush, it’s fairly easy to adapt an
existing MEL file:
1. Open the Maya brushes folder. Open the flesh subfolder. Duplicate the hands.mel file.
Rename the duplicated file
custom.mel. Create a new subfolder and call it custom, as in
this example:
C:\Program Files\Alias\Maya8.0\brushes\custom\
Move custom.mel into the custom folder.
2. Open custom.mel with a text editor. (Windows WordPad provides the proper formatting.)
Change the second line to the following:
bPsetName “imageName” “custom.iff”;
custom.iff is your custom bitmap. Maya assumes that all brush images are in the
brushImages folder:
C:\Program Files\Alias\Maya8.0\brushImages\
Change the last line of the brush script to this:
rename (getDefaultBrush()) custom;
3. Save the file. Make sure that the file has the .mel extension or the brush will not work.
Start or restart Maya. Choose Window
➔ General Editors ➔ Visor. Switch to the Paint
Effects tab. The new
custom folder is listed with all the original brush folders. Click the
custom folder icon. The custom.mel brush appears with a generic “Maya” icon. Click the
icon. The Paint Effects brush is activated. Click+drag the mouse in a workspace view.
The Paint Effects stroke appears. Render a test frame. Your custom image is rendered
along the stroke path.
07405c01.indd 1207405c01.indd 12 1/17/07 8:30:51 PM1/17/07 8:30:51 PM