You can save Script
Editor history as a Shelf button.
To create the shelf button
- Highlight all the text in the history
window by clicking at the beginning of the history in the upper
section of the Script Editor and dragging
the selection to the end of the Script Editor history
- Release the mouse button. The selected
text should read:
directionalLight -intensity 1; rename main_light; setAttr "main_lightShape.useDepthMapShadows" 1; setAttr "main_lightShape.dmapResolution" 1024; move 0 3 0; rotate -30 0 0; pointLight -intensity 2 -rgb .9 .9 1; rename back_light; move -r -1.5 1 -1.5; pointLight -intensity .5; rename fill_light; move -r 4 6 2;
- Middle-drag the selected text to the
A pop-up window asks
you which type of shelf button you are saving.
- Click the MEL button on the pop-up window.
A Shelf button
is created that executes the scripting commands you dragged to the
shelf setting up three-point lighting for a scene.
To test the Shelf button
- Open the scene named Mel_cone.mb.
This file can be found
in the GettingStarted directory
that you set as your Maya project:
- Render the scene in the perspective view
by selecting the render scene button on the Status
- Save the rendered image by clicking the Keep
Image button in the Render
- Click your newly created MEL Shelf button.
Three point lighting
is applied to the scene.
- Render the scene again by selecting the
render scene button on the Status
- Compare the two images using the scroll
bar at the bottom of the window.
To delete the Shelf button
- Middle-drag the Shelf button you want
deleted to the trash can icon on the far right of the Shelf.
The pointer icon
changes to a
when you are dragging a Shelf button.