Recording the script history
 
 
 

In order to make a shelf button, you need to create Script Editor history to copy to the shelf. In this procedure, you create a three-point lighting system for the current geometry using MEL, copy the script history, and apply the created three-point lighting to an existing scene.

To create the main lighting

  1. Clear Script Editor history by clicking the Clear History button .
  2. Create a directional light for the main lighting by typing the following:
    directionalLight -intensity 1;

    Certain commands require that you to refer to the light by name.

  3. Rename the selected light to “main_light” by typing the following:
    rename main_light;
  4. Enable the main light to cast shadows by typing the following:
    setAttr "main_lightShape.useDepthMapShadows" 1;

    The setAttr command allows you to set attributes of a node. In the above command, you are enabling depth map shadows on the main light.

  5. Adjust the resolution of the shadow maps so that the shadows appear sharper by typing the following:
    setAttr "main_lightShape.dmapResolution" 2048;

    In the above command, you are increasing the resolution of the depth map shadows to 2048.

  6. Position and aim the main light by typing the following:
    move 0 3 0;
    rotate -30 0 0;

Next, you create a rim light for the scene to help differentiate the torus from its background.

To create the rim light

  1. Create a point light by typing the following:
    pointLight -intensity 2 -rgb 0.9 0.9 1;

    The intensity flag has been used to set the brightness of the light. The -rgb flag sets the color and takes three values: red, green and blue. The red and green values are less than the blue value, so the light has a blue tint.

  2. Rename the light by typing the following:
    rename back_light;
  3. Reposition the light behind the torus by typing the following:
    move -relative -1.5 1 -1.5;

Next, you create a fill light for the scene to soften the main lighting, fill the shadowed part of the torus and decrease the overall contrast of the lighting in the scene.

To create the fill lighting

  1. Create a point light with an intensity of 0.5 by typing the following:
    pointLight -intensity 0.5;
  2. Rename the light by typing the following:
    rename fill_light;
  3. Reposition the light above the torus in a way so that the light rays from the fill light are approximately 90 degrees to those of the main light by typing the following:
    move -relative 4 6 2;