Chapter 2. Maya Cameras

Maya is a visual effects studio designed with the art of filmmaking in mind. Maya's virtual camera replicates real-world cameras as much as possible, while at the same time offering enough flexibility in the settings to allow for a wide variety of creative uses. This chapter introduces the core concepts of how to work with Maya's virtual cameras.

In this chapter, you'll learn to:

  • Determine image size and resolution

  • Work with camera settings

  • Create custom camera rigs

  • Use Depth of Field and Motion Blur

  • Create orthographic and stereoscopic cameras

Image Size and Resolution

When starting a new project in Maya, you should first determine the final size of the rendered image or image sequence. These settings will affect every aspect of the project, including texture size, model tessellation, render time, how the shots are framed, and so on. You should raise this concern as soon as possible and make sure every member of the team, from the producer to the art director to the compositor to the editor, is aware of the final output of the animation. This means the image size, the resolution, the frames per second, and any image cropping that may occur after rendering. Nothing is worse than having to redo a render or even an animation because of a miscommunication concerning details, such as resolution settings or frames per second.

Set Image Size

The settings for the image size and resolution are located in the Render Settings window under the Common tab (shown in Figure 2.1). When you start a new scene, visit this panel first and make sure these settings are what you need.

The Common tab in the Render Settings window is where the image size and image resolution are established. Visit this panel when you start a new project.

Figure 2.1. The Common tab in the Render Settings window is where the image size and image resolution are established. Visit this panel when you start a new project.

Image size refers to the number of pixels on the horizontal axis by the number of pixels on the vertical axis. So a setting of 640×480 means 640 pixels wide by 480 pixels tall.

Resolution refers to how many pixels fit within an inch (or centimeter, depending on the setting). Generally you'll use a resolution of 72 pixels per ich when rendering for animations displayed on computer screens, television screens, and film. Print resolution is much higher, usually 300 pixels per inch.

You can create any settings you'd like for the image size and resolution, or you can use one of the Maya Image Size presets. The list of presets is divided so that common film and video presets are at the top of the list and common print settings are at the bottom of the list. Size and resolution units can be changed in the Common tab of the Render Settings window as well.

Resolution is expressed in a number of ways in Maya:

Image aspect ratio

The ratio of width over height. An image that is 720 by 540 has a ratio of 1.333.

Pixel aspect ratio

The ratio of the actual pixel size. Computer monitors use square pixels: the height of the pixel is 1 and the width of the pixel is 1; thus the pixel aspect ratio is 1. Standard video images use nonsquare pixels that are 1 in. height by 1.1 in. width, giving them a pixel aspect ratio of 0.9.

Device aspect ratio

The image aspect ratio multiplied by the pixel aspect ratio. For a video image that is 720 × 486 (1.48) using nonsquare pixels (0.9), this would be 1.48 × 0.9 = 1.333.

Film aspect ratio

The camera aperture attribute (found in the Attribute Editor for a camera) represented as a ratio. For a typical 35mm video image, this would be 0.816/0.612 = 1.333.

Set Film Speed

The film speed (also known as transport speed) is specified in frames per second. This setting is found in the Maya Preferences window (Window

Set Film Speed
The animation speed (frames per second) is set in the Preferences window.

Figure 2.2. The animation speed (frames per second) is set in the Preferences window.

Camera Settings

The settings found in a camera's Attribute Editor greatly impact the look of a rendered animation. In this section, you'll practice using these settings on an animatic of a sci-fi car chase.

Creating a Camera

Every new Maya scene has four preset cameras by default. These are the front, side, top, and perspective (persp) cameras. You can render using any of these cameras; however, their main purpose is to navigate and view the 3D environment shown in the viewport. It's always a good idea to create new cameras in the scene for the purpose of rendering the animation.

  1. Open the chase_v01.ma scene from the chapter2/scenes folder on the DVD. You'll find that a simple animatic of a car racing down a track has been created.

  2. Create a new camera (Create

    Creating a Camera
    A new camera is created and renamed in the Outliner.

    Figure 2.3. A new camera is created and renamed in the Outliner.

  3. In the Display Layer Editor, turn off the visibility of all the layers except street to hide the unnecessary geometry in the scene.

  4. Select shotCam1 in the Outliner, and press the f hot key to focus on this camera in the viewport.

    The icon for the camera looks like a movie camera. It has a transform node and a shape node. The camera attributes are located on the shape node.

  5. Select shotCam1, and switch to the Move tool (hot key = w). Move the camera up from the center of the grid to the level of the street. Set the Translate X, Y, and Z channels to 1.382, 4.138, and −3.45.

  6. In the toolbox, click the Show Manipulator tool (the bottom icon in the toolbox). If you zoom out in the viewport, you'll see the camera has a second positional icon; this is the center of interest (see Figure 2.4). The value shown in the camera's Channel Box for the center of interest is the distance (in the scene's working units—meters for this scene) between the camera and the center of interest. Grab this part of the manipulator and position it on the street so the camera is looking up the road (toward the beginning of the track where the car starts). This is one technique for aiming the camera.

  7. In the Viewport panel menu, choose Panels

    Display Layers
    The Show Manipulator tool allows you to aim the camera using a second transform manipulator.

    Figure 2.4. The Show Manipulator tool allows you to aim the camera using a second transform manipulator.

    Maya 2009 has added icons to the Viewport panel so that you can quickly access common viewport settings (see Figure 2.5). The first group of icons on the left side is directly related to camera display options. Starting from the left, here is a list of the actions associated with each icon:

    • Select Camera—Selects the transform node of the current viewing camera.

    • Camera Attributes—Opens the Attribute Editor for the current viewing camera.

    • Bookmark—Stores a bookmark for the current camera position. To move the camera to a bookmarked position, choose View

      The Show Manipulator tool allows you to aim the camera using a second transform manipulator.
      The new panel icon bar provides easy access to common viewport commands. The first two groups of icons on the left side are camera-related options.

      Figure 2.5. The new panel icon bar provides easy access to common viewport commands. The first two groups of icons on the left side are camera-related options.

    • Image Plane—Creates an image plane for the current camera. Image planes are discussed in Chapter 3.

    • Grid View—Turns the Grid display on or off.

    • Film Gate—Turns the Film Gate display on or off.

    • Resolution Gate—Turns the Resolution Gate display on or off.

    • Gate Mask—Turns the shaded Gate Mask on or off when either the Resolution Gate or Film Gate display is activated.

    • Field Chart—Turns the Field Chart display on or off.

    • Safe Action—Turns the Safe Action display on or off.

    • Safe Title—Turns the Safe Title display on or off.

  8. In the Display Layer Editor, turn on the buildings layer so the buildings are visible. Tumble around in the viewport (LMB-drag while holding down the Alt key) so you can see part of the large building to the left of the street.

  9. In the panel view, turn on the Resolution Gate. Click the Camera Attributes icon to open the Attribute Editor for shotCam1.

    The image size of this scene is set to 1280 × 72., which is the HD 72. preset. You can see the image resolution at the top of the screen when the Resolution Gate is activated. Working with the Resolution Gate on is extremely helpful when you're establishing the composition of your shots (Figure 2.6).

    The Resolution Gate is a helpful tool when framing a shot.

    Figure 2.6. The Resolution Gate is a helpful tool when framing a shot.

    When you create a new camera to render the scene, you need to add it to the list of renderable cameras in the Render settings. You can render the scene using more than one camera.

  10. Scroll down in the Attribute Editor for shotCam1 and expand the Output Settings area. Make sure the Renderable option is selected.

  11. Open the Render Settings window. In the Renderable Cameras area, you'll see both the shotCam1 and persp cameras listed (see Figure 2.7). To remove the perspective camera, click the trashcan to the right of the listing.

    Cameras can be added to the list of renderable cameras in the Render Settings window.

    Figure 2.7. Cameras can be added to the list of renderable cameras in the Render Settings window.

To change the renderable camera, choose a different camera from the list. To add another camera, choose Add Renderable Camera at the bottom of the list. The list shows all available cameras in the scene.

When batch rendering a scene with more than one renderable camera, Maya creates a subdirectory named after each renderable camera in the image directory of the project. You can add the camera name to the name of the image sequence by adding %c to the name listed in the File Name Prefix field in the Render Settings window. For example, setting the File Name Prefix to myAnimation_%c in a scene with two renderable cameras creates two image sequences named myAnimation_camera1.#.tif and myAnimation_camera2.#.tif. See Figure 2.8.

The camera name can be appended to the image name in the rendered sequence by adding %c.

Figure 2.8. The camera name can be appended to the image name in the rendered sequence by adding %c.

Camera Attributes

At the top of the Attribute Editor for the camera's shape node, you'll find the basic settings for the camera available in the Camera Attributes rollout.

  1. Select shotCam1 and open its Attribute Editor to the shotCam1Shape tab. In the Controls drop-down list, you have the option of switching to a camera with an aim node or to a camera with an aim and an up control. Set the camera to Camera And Aim (Figure 2.9).

    A single-node camera is just a plain camera like the perspective camera. You can change its rotation and translation by setting these channels in the Channel Box, using the Move and Rotate tools, or tumbling and tracking while looking through the camera.

    You can add additional camera controls using the Controls menu in the Attribute Editor. The camera is then grouped in the Outliner with a separate aim control.

    Figure 2.9. You can add additional camera controls using the Controls menu in the Attribute Editor. The camera is then grouped in the Outliner with a separate aim control.

    A two-node camera is a camera with a separate aim control grouped together. When you switch to this type of camera (or create this type of camera from the Create

    Moving the Camera

    A three-node camera is created when you choose Camera, Aim, And Up from the Controls menu. This adds a third locator, which is used to control the camera's rotation around the Z axis. These controls and alternative arrangements will be explored later in the section on camera rigs.

    When working with two- or three-node cameras, resist the temptation to move or keyframe the position of the group node that contains both the camera and the aim locator. Instead, expand the group in the Outliner and keyframe the camera and aim nodes separately. This will keep the animation simple and help to avoid confusion when editing the animation. If you need to move the whole rig over a large distance, Shift+click both the camera and the aim locator, and move them together. Moving the group node separately is asking for trouble.

  2. Expand the shotCam1_group node that now appears in the Outliner, and select the shotCam_aim node. In the Channel Box, set its Translate X, Y, and Z settings to −0.155, 4.2.6, −2.884. (The camera's node should still have its X, Y, and Z translation settings at 1.382, 4.138, and −3.45.)

  3. In the Display Layer menu, turn on the car layer. Set the current frame to 60 so that the car is in view of the camera.

  4. In the Attribute Editor for shotCam1, adjust the Angle Of View slider. Decreasing this setting flattens the perspective in the image and zooms in on the scene; increasing this setting exaggerates the perspective and zooms out.

  5. With the camera still selected, switch to the Channel Box and find the Focal Length setting under the shotCamShape1 node. Highlight the Focal Length channel label, and MMB-drag back and forth in the viewport window. Set the Focal Length to 2. (see Figure 2.10).

    The Angle Of View slider in the Attribute Editor and the focal length attribute in the Channel Box both adjust the zoom of the camera.

    Figure 2.10. The Angle Of View slider in the Attribute Editor and the focal length attribute in the Channel Box both adjust the zoom of the camera.

Adjusting the focal length of the camera has a similar effect on the camera as changing the angle of view; however, it is inversely related to the angle of view. Increasing the focal length zooms in on the scene, and decreasing it zooms out. The two settings are connected; they can't be set independently of each other.

In a real camera as you adjust the focal length, you are essentially repositioning the lens in the camera so that the distance between the lens and the film gate (where the film is exposed to light) is increased or decreased. As you increase the focal length, objects appear larger in frame. The camera zooms in on the subject. The viewable area also decreases—this is the angle of view. As you decrease the focal length, you move the lens back toward the film gate, increasing the viewable area in the scene and making objects in the frame appear smaller. You're essentially zooming out (see Figure 2.11).

By default, Maya cameras have a focal length of 35. Roughly speaking, the human eye has a focal length of about 50. A setting of 2. is a good way to increase drama in an action scene by exaggerating the perspective.

Two Maya cameras seen from above. A longer focal length produces a smaller angle of view (left camera); a shorter focal length produces a larger angle of view (right camera)

Figure 2.11. Two Maya cameras seen from above. A longer focal length produces a smaller angle of view (left camera); a shorter focal length produces a larger angle of view (right camera)

Clipping Planes

Clipping planes are used to determine the range of renderable objects in a scene. Objects that lie outside of the clipping planes are not visible or renderable in the current camera. Clipping planes can affect the quality of the rendered image; if the ratio between the near clipping plane and the far clipping plane is too large, image quality can suffer (if the near clipping plane is 0.1, the far clipping plane should be no more than 2.000). Keep the far image plane just slightly beyond the farthest object that needs to be rendered in the scene, and keep the detail of distant objects fairly low.

The Auto Render Clip Plane option automatically determines the position of the clipping planes when rendering with Maya software (this setting does not affect animations rendered with mental ray, Maya hardware, or Vector renders). It's always a good idea to turn off this option and set the clipping plane values manually.

  1. From the Panel menu choose Panels

    Clipping Planes
  2. Select shotCam1 and choose the Show Manipulators tool from the toolbox. Zoom in on the shot cam, and click the blue manipulator switch (located just below the camera when the Show Manipulators tool is active; see Figure 2.12) twice to switch to the clipping plane display.

    Clicking the blue switch below the Show Manipulators tool cycles through the various actions of the tool. Clicking twice activates the manipulators for the clipping planes.

    Figure 2.12. Clicking the blue switch below the Show Manipulators tool cycles through the various actions of the tool. Clicking twice activates the manipulators for the clipping planes.

    The clipping plane manipulator consists of two blue rectangles connected by lines. The near clipping plane is a small rectangle very close to the camera; the far clipping plane is very large and far from the camera

  3. Zoom in close to the shot cam and MMB-drag the near clipping plane manipulator. You can set the position of this clipping plane interactively. Note that as you move the plane away from the camera, the geometry in the shotCam1 view is cut off. Any object between the camera and the near clipping plane will not render or will only partially render.

  4. Zoom out until you can see the far clipping plane manipulator. MMB-drag on this and bring it in closer to the camera. Objects beyond this clipping plane will not be rendered by the camera or will appear cut off.

  5. In the Attribute Editor for the shotCam1Shape node, set Near Clip Plane to .05 and Far Clip Plane to 85 (the units for this scene are set to meters). This is a good starting place; if the positions of the planes need to change later on, they can be adjusted (see Figure 2.13).

  6. Save the scene as chase_v02.ma. To see a version of the scene to this point, open chase_v02.ma from the chapter2/scenes directory on the DVD.

The positions of the clipping planes are set for the shotCam.

Figure 2.13. The positions of the clipping planes are set for the shotCam.

Film Back

In an actual camera the film back refers to the plate where the negative is placed when it is exposed to light. The size of the film determines the film back setting, so 35mm film uses a 35mm film back. The film gate is the gate that holds the film to the film back. Unless you are trying to match actual footage in Maya, you shouldn't need to edit these settings. Ideally you want the film gate and the resolution gate to be the same size. If you turn on the display of both the Film Gate and the Resolution Gate in the camera's Display Options rollout (toward the bottom of the Attribute Editor—you can't turn on both the Film Gate and Resolution Gate using the icons in the panel menu bar), you may see that the Film Gate is larger than the Resolution Gate. You can fix this by adjusting the Film Aspect Ratio. Simply divide the resolution width by the resolution height (1280 ÷ 72. = 1.777777), and put this value in the Film Aspect Ratio (see Figure 2.14).

In the top image, the Film Gate and Resolution Gate settings do not match. In the bottom image, the Film Aspect Ratio has been changed so that Film Gate and Resolution Gate match.

Figure 2.14. In the top image, the Film Gate and Resolution Gate settings do not match. In the bottom image, the Film Aspect Ratio has been changed so that Film Gate and Resolution Gate match.

The Film Gate drop-down list has presets available that you can use to match footage if necessary. The presets will adjust the aperture, film aspect ratio, and lens squeeze ratio as needed. If you're not trying to match film, you can safely leave these settings at their default and concern yourself only with the Image Size and Resolution attributes in the Render Settings window.

The Film Fit Offset and Film Offset controls can be very useful in special circumstances where you need to change the center of the rendered area without altering the position of the camera. The parallax caused by the perspective of the 3D scene in the frame does not change even though the camera view has. Creating an offset in an animated camera can create a strange but very stylistic look.

The Film Fit Offset value has no effect if Fit Resolution Gate is set to Fill or Overscan. If you set the Fit Resolution Gate to Horizontal or Vertical and then adjust the Film Fit Offset, the offset will be either horizontal or vertical based on the Fit Resolution Gate setting. The Film Offset values accomplish the same thing; however, they don't depend on the setting of Fit Resolution Gate.

  1. Continue with the scene from the previous section or open the chase_v02.ma scene from the chapter2/scenes directory on the DVD. Set the current camera in the viewport to shotCam1 and the timeline to frame 61.

  2. In the Display layers, turn on the choppers layer so that the helicopter is visible in the shot.

  3. Open the Attribute Editor for shotCam1, and switch to the shape node (shotCam1Shape) tab. In the Film Back rollout, set the Film Offset to 0.2 and −.05. Notice how this change alters the composition of the frame. Even a small change can affect the emotional impact of a shot (see Figure 2.15).

    Adjusting the Film Offset changes the framing of the shot without actually moving the camera or the perspective of the image.

    Figure 2.15. Adjusting the Film Offset changes the framing of the shot without actually moving the camera or the perspective of the image.

Camera Shake

Maya 2.09 introduces the new Shake attribute, which is an easy way to add a shaky vibrating motion to a camera. The first field is the Horizontal shake, and the second field is the Vertical shake. The values you enter in the shake fields modify the current settings for the Film Offset. When you are applying a shake, you're essentially shaking the film back, which is useful because this does not change how the camera itself is animated. You can apply expressions, keyframes, or animated textures to one or both of these fields. The Shake Enabled option allows you to turn the shaking on or off while working in Maya; it can't be keyframed. However, you can easily animate the amount of shaking over time.

In this example, you'll use an animated fractal texture to create the camera shaking effect. You can use an animated fractal texture anytime you need to generate random noise values for an attribute. One advantage fractal textures have over mathematical expressions is that they are easier to animate over time.

  1. Turn on the Shake Enabled option. Right-click the first field in the Shake option, and choose Create New Texture from the pop-up window (see Figure 2.16).

  2. Switch to the Textures tab in the Create Render Node window, choose Fractal from the 2D Textures section, and make sure Normal is selected. The camera view will move when you add the texture, and that's okay.

    Right-click the attribute field and choose Create New Texture. The Create Render Node window will open.

    Figure 2.16. Right-click the attribute field and choose Create New Texture. The Create Render Node window will open.

  3. The attributes for the fractal texture will appear in the Attribute Editor. Set the Amplitude to 0.1.

  4. Check the Animated check box to enable the animation of the texture. Rewind the animation. Right-click the Time attribute, and choose Set Key (see Figure 2.17).

    To animate a fractal texture, turn on the Animated option and set keyframes on the time slider.

    Figure 2.17. To animate a fractal texture, turn on the Animated option and set keyframes on the time slider.

  5. Set the Timeline to frame 2.0. Set the Time attribute to 100, and set another key. Rewind and play the animation; you'll see the camera move back and forth.

  6. Repeat steps 1 though 5 for the Vertical setting in Shake to add another animated fractal texture to this attribute. You want to have a different texture for each setting so that horizontal and vertical shaking of the camera are not the same value; otherwise the camera will appear to shake diagonally.

  7. Select the second fractal texture, expand its UV Coordinates rollout, and click the arrow to the right of it to go to the fractal texture's place2dTexture node. Set the Rotate UV value to 45. This rotates the texture so that the output of this animated texture is different from the other, ensuring a more random motion.

    You may notice that the shaking is nice and strong but that you've lost the original composition of the frame. To bring it back to where it was, adjust the range of values created by each texture. The Fractal Amplitude of both textures is set to 0.1, which means each texture is adding a random value between 0 and 0.1 to the film offset. You need to equalize these values by adjusting the Alpha Offset and Alpha Gain of the textures.

  8. Open the Hypershade by choosing Window

    To animate a fractal texture, turn on the Animated option and set keyframes on the time slider.
  9. Hold the mouse over the line connecting one of the textures to the shotCamShape1 node. The pop-up label shows that the outAlpha attribute of the texture is connected to the vertical or horizontal shake of the camera. This means that the outAlpha value must be adjusted to compensate for the change made to the camera's offset (see Figure 2.18).

    If you look at what's going on with the fractal texture, you'll see that when the Amplitude of the texture is set to 0, the outAlpha value is 0.5 (you can see this by switching to the shotCamShape1 tab and looking at the Horizontal Shake field). The fractal texture itself is a flat gray color (value = 0.5). As you increase the Amplitude, the variation in the texture is amplified. At an Amplitude of 1, the outAlpha ranges from 0 to 1. You can see this in the values generated for the Shake attribute in the camera node. This is a very large offset and causes the shaking of the camera to be very extreme. You can set the amplitude to a very low value, but this means that the outAlpha value generated will remain close to 0.5, so as the shake values are added to the film offset, the composition of the frame is changed—the view shifts up to the right.

    To fix this, you can adjust the Alpha Gain and Alpha Offset attributes found in the Color Balance section of each fractal texture. Alpha Gain is a scaling factor. When Alpha Gain is set to 0.5, the outAlpha values are cut in half; when Alpha Gain is set to 0, the outAlpha is also 0, and thus the Shake values are set to 0 and the camera returns to its original position. So if you want to shake the camera but keep it near its original position, it seems as though the best method is to adjust the Alpha Gain of the fractal texture.

    The outAlpha value generated by the animated fractal texture is connected to the camera's horizontal shake.

    Figure 2.18. The outAlpha value generated by the animated fractal texture is connected to the camera's horizontal shake.

    However, there is still one problem with this method. You want the outAlpha of the fractal to produce both negative and positive values so that the camera shakes around its original position in all directions. If you set the Alpha Gain to a positive or negative number, the values produced will be either positive or negative, which makes the view appear to shift in one direction or the other. To properly adjust the output of these values, you can use the Alpha Offset attribute to create a shift.

    Set the Alpha Offset to negative one-half the Alpha Gain to get a range of values that are both positive and negative; 0 will be in the middle of this range. Figure 2.19 shows how adjusting the Amplitude, Alpha Gain, and Alpha Offset attributes affect the range of values produced by the animated fractal texture.

    The range of values produced by the animated fractal texture can be adjusted using the Amplitude, Alpha Offset, and Alpha Gain attributes.

    Figure 2.19. The range of values produced by the animated fractal texture can be adjusted using the Amplitude, Alpha Offset, and Alpha Gain attributes.

    The best way to set this up is to create a simple expression where the Alpha Offset is multiplied by negative one-half of the Alpha Gain. This technique can be used any time you need to shift the range of the fractal texture's outAlpha to give both positive and negative values.

  10. Select the fractal1 node and open its attributes in the Attribute Editor. Expand the Color Balance rollout and set the Alpha Gain of fractal1 to 0.25.

  11. In the field for Alpha Offset, type =-0.5*fractal1.alphaGain;. Then hit the Enter key on the numeric keypad to enter the expression (Figure 2.20).

  12. You can create the same setup for the fractal2 node. However, it might be a better idea to create a direct connection between the attributes of fractal1 and fractal2, so you need only adjust the Alpha Gain of fractal1, and all other values will update accordingly.

    An expression is created to automatically set the Alpha Offset of fractal1 to negative one-half of the Alpha Gain.

    Figure 2.20. An expression is created to automatically set the Alpha Offset of fractal1 to negative one-half of the Alpha Gain.

  13. In the Hypershade, MMB-drag fractal1 on top of fractal2, and choose Other from the pop-up menu to open the Connection Editor. On the left side of the Connection Editor, select alphaGain; on the right side, select alphaGain to connect these two attributes. Select alphaOffset on the left side, and then select alphaOffset on the right side to connect these two attributes. Select Amplitude on the left, and then select Amplitude on the right to connect these two attributes as well (see Figure 2.21).

  14. Play the animation, and you'll see the camera shake. To tone down the movement, reduce the Alpha Gain of fractal1.

  15. Set the timeline to frame 60, and set the Alpha Gain of fractal1 to 0. Right-click over the Alpha Gain field and choose Set key.

  16. Set the timeline to frame 65. Set the Alpha Gain of fractal1 to 0.5, and set another key.

  17. Set the timeline to frame 90. Set the Alpha Gain of fractal1 to 0, and set a third key. Play back the animation, and you'll see the camera shake as the car and helicopter fly by.

  18. Save the scene as chase_v03.ma. To see a version of the scene to this point, open the chase_v03.ma file from the chapter2scenes directory.

The Shake Overscan attribute moves the film back and forth on the Z axis of the camera as opposed to the Shake settings, which move the film back and forth horizontally and vertically. This can be used to create some great horror-movie effects.

The Connection Editor is used to connect the Alpha Gain, Alpha Offset, and Amplitude of fractal2 to fractal1.

Figure 2.21. The Connection Editor is used to connect the Alpha Gain, Alpha Offset, and Amplitude of fractal2 to fractal1.

Custom Camera Rigs

Maya's three camera types (camera, camera and aim, camera aim and up) work well for many common animation situations. However, you'll find that sometimes a custom camera rig gives you more creative control over a shot. This section shows how to create a custom camera rig for the car chase scene. Use this example as a springboard for ideas to design your own custom camera rigs and controls.

Swivel Camera Rig

This rig involves attaching a camera to a NURBS circle so that it can easily swivel around a subject in a perfect arc.

  1. Open the chase_v03.ma scene from the chapter2scenes directory on the DVD, or continue with the scene from the previous section. In the Display layers, turn off both the choppers and buildings layers.

  2. Switch to the Persp camera in the viewport. Create a NURBS circle by choosing Create

    Swivel Camera Rig
  3. Create a new camera (Create

    Swivel Camera Rig
  4. Open the Attribute Editor for swivelCam to the swivelCamShape tab. Set the Controls to Camera and Aim.

  5. Expand the new swivelCam_group node in the Outliner. Select the swivelCam and press the f hot key to focus on the camera in the viewport.

  6. In the Outliner, select swivelCam and Ctrl+click the swivelCamRig circle. Switch to the Animation menu set, and choose Animate

    Swivel Camera Rig
    The swivelCam is attached to the NURBS circle using the Attach To Motion Path command.

    Figure 2.22. The swivelCam is attached to the NURBS circle using the Attach To Motion Path command.

    The camera is now attached to the circle via the motion path; the camera will stay in a fixed position on the circle curve. This is a fast and easy way to attach any object or other type of transform node (such as a group) to a curve.

  7. Turn on the street and car display layers, and rewind the animation.

  8. Zoom out in the viewport. In the Outliner, select the swivelCamRig and MMB-drag it up in the Outliner into the vehicleAnim group. Expand the vehicleAnim group, and select the swivelCamRig. Open the Channel Box, and set the Translate and Rotate channels to 0. The circle will be repositioned around the car.

  9. Select the swivelCam_aim locator from within the swivelCam_group. In the Outliner, MMB-drag this up into the vehicleAnim group as well. Set its Translate and Rotate channels to 0. This will move to the pivot point of the vehicleAnim group.

  10. Select the swivelCamRig, and in the Channel Box set Translate Y to 0.4. Set the Scale attributes to 0.5 (see Figure 2.23).

  11. Set the viewport to the swivelCam, and turn on the Resolution Gate. Select the swivelCam node, and set its focal length to 2.. Play the animation.

Swivel Camera Rig Asset

The camera follows the car, but things don't get interesting until you start to animate the attributes of the rig. To cut down on the number of node attributes that you need to hunt through to animate the rig, you'll create a container for the camera and rig and publish attributes to the container, thus turning the rig into an asset. For more information on assets, consult Chapter 1.

  1. In the Outliner, Ctrl+click the swivelCam node, swivelCamShape, the swivelCam_aim locator, and the swivelCamRig node. Choose Assets

    Swivel Camera Rig Asset
  2. Choose Assets

    Swivel Camera Rig Asset
    The NURBS circle (swivelCamRig) and the swivelCam_aim have been parented to the vehicleAnim group.

    Figure 2.23. The NURBS circle (swivelCamRig) and the swivelCam_aim have been parented to the vehicleAnim group.

    A container is created from nodes selected in the Outliner.

    Figure 2.24. A container is created from nodes selected in the Outliner.

  3. Click the plus sign in the square to expand the swivelCamera container, and then expand the swivelCam rig node (click the plus sign in the circle next to swivelCamRig). From the list of Attributes, select the Translate Y attribute. Click the second icon from the top at the center of the Asset Editor. Set the published name to rise.

  4. Select the Rotate Y attribute, and publish it using the name swivel. Select Scale Z, and publish it using the name push.

  5. Expand the swivelCam_aim node, and select its Translate attribute. Publish it using the name aim (see Figure 2.25). The three attributes Aim X, Aim Y, and Aim Z will be created at once.

  6. Expand the swivelCam (click the plus sign in the square) and the swivelCamShape nodes (click the plus sign in the circle). Select the Focal Length attribute, and publish it using the name zoom.

  7. Close the Asset Editor, and select the swivelCamera container node in the Outliner. Try changing the values of the published attributes and play the animation.

    Various attributes are chosen from the nodes in the swivelCam container and published to the container using the Asset Editor.

    Figure 2.25. Various attributes are chosen from the nodes in the swivelCam container and published to the container using the Asset Editor.

  8. Open the Preferences panel (Window

    Various attributes are chosen from the nodes in the swivelCam container and published to the container using the Asset Editor.
    • Frame 1

      • Rise: 3.2.27

      • Swivel: 48.411

      • Push: 6

      • Aim X: 0

      • Aim Y: 0

      • Aim Z: 0

    • Frame 41

      • Rise: 0.06

      • Swivel: 134.265

      • Push: 0.3

      • Aim X: 0

      • Aim Y: 0

      • Aim Z: 0

    • Frame 92

      • Rise: 0.06

      • Swivel: 246.507

      • Push: 0.3

      • Aim X: 0

      • Aim Y:0 .091

      • Aim Z: 0.046

    • Frame 145

      • Rise: 0.13

      • Swivel: 290.819

      • Push: 0.8

      • Aim X: 0

      • Aim Y: 0.167

      • Aim Z: −0.087

    • Frame 160

      • Rise: 0

      • Swivel: 458.551

      • Push: 0.4

      • Aim X: 0

      • Aim Y: 0.132

      • Aim Z: −0.15

    • Frame 2.0

      • Rise:0 .093

      • Swivel: 495.166

      • Push: 0.4

      • Aim X: 0

      • Aim Y: 0.132

      • Aim Z: −0.015

  9. Set the view in the perspective window to swivelCam (Panels

    Various attributes are chosen from the nodes in the swivelCam container and published to the container using the Asset Editor.
The attributes of the container are selected and keyframed.

Figure 2.26. The attributes of the container are selected and keyframed.

A custom camera rig can make exciting camera animation easy to create and edit.

Figure 2.27. A custom camera rig can make exciting camera animation easy to create and edit.

Depth of Field and Motion Blur

Depth of field and motion blur are two effects meant to replicate real-world camera phenomena. Both of these effects can be used to increase the realism of a scene as well as the drama. However, they can both increase render times significantly, so it's important to learn how to efficiently apply them when rendering a scene. In this section, you'll learn how to activate these effects and the basics of how to work with them. Using both effects effectively is closely tied to render-quality issues. Render-quality issues are discussed more thoroughly in Chapter 12.

Depth of Field Settings

The Depth of Field (DOF) settings in Maya simulate the photographic phenomena where some areas of an image are in focus and other areas are out of focus. Artistically this can greatly increase the drama of the scene, as it forces the viewers to focus their attention on a specific element in the composition of a frame.

Depth of field is a ray-traced effect and can be created using both Maya software and mental ray; however, the mental ray Depth of Field feature is far superior to that of Maya software. This section describes how to render depth of field using mental ray.

There are two ways to apply the mental ray Depth of Field effect to a camera in a Maya scene. You can activate the Depth Of Field option in the camera's Attribute Editor, or you can add a mental ray physical_lens_dof lens shader to the camera (mental ray has special shaders for lights and cameras, as well as surface materials). Both methods produce the same effect. In fact, when you turn on the DOF option in the Camera Attributes settings, you're essentially applying the mental ray DOF lens shader to the camera. The controls in the camera's Attribute Editor are easier to use than the controls in the physical DOF shader, so this example will describe only this method of applying DOF.

  1. Open the chase_v05.ma scene from the chapter2/scenes directory on the DVD. In the viewport, switch to the DOF_cam camera. If you play the animation (which starts at frame 100 in this scene), you'll see the camera move from street level upward as two helicopters come into view.

  2. In the Panel menu bar, click the second icon from the left to open the DOF_cam's Attribute Editor. Expand the Environment settings, and click on the color swatch. Use the Color Chooser to create a pale blue color for the background (Figure 2.28).

    A new background color is chosen for the DOF_cam.

    Figure 2.28. A new background color is chosen for the DOF_cam.

  3. Open the Render settings and make sure the Render Using menu is set to mental ray. If mental ray does not appear in the list, you'll need to load the Mayatomr.mll plug-in found in the Window

    A new background color is chosen for the DOF_cam.
  4. Select the Quality tab in the Render settings, and set the Quality preset to Preview:Final Gather.

  5. Switch to the Rendering menu set. Choose Render

    A new background color is chosen for the DOF_cam.
  6. Set the timeline to frame 136, and Choose Render

    A new background color is chosen for the DOF_cam.

    The Render View window will open and render a frame. Even though there are no lights in the scene, even lighting is created when Final Gather is activated in the Render settings (it's activated automatically when you choose the Preview:Final Gather Quality preset). The pale blue background color in the current camera is used in the Final Gather calculations. More sophisticated environmental lighting is discussed in Chapter 10. This particular lighting arrangement is simple to set up and works fine for an animatic.

    As you can see from the test render, the composition of this frame is confusing to the eye and does not read very well. There are many conflicting shapes in the background and foreground. Using Depth of Field can help the eye to separate background elements from foreground elements and sort out the overall composition.

    A test render is created for frame 136.

    Figure 2.29. A test render is created for frame 136.

  7. In the Attribute Editor for the DOF_Cam expand the Depth Of Field rollout and activate Depth Of Field. Store the current image in the Render Preview window (from the Render Preview window menu choose File

    A test render is created for frame 136.
  8. Use the scroll bar at the bottom of the Render View window to compare the images. There's almost no discernable difference. This is because the Depth of Field settings need to be adjusted. There are only three settings:

    • Focus Distance: This determines the area of the image that is in focus. Areas in front or behind this area will be out of focus.

    • F Stop: This describes the relationship between the diameter of the aperture and the focal length of the lens. Essentially it is the amount of blurriness seen in the rendered image. F Stop values used in Maya are based on real-world f-stop values. The lower the value, the blurrier the areas beyond the focus distance will be. Changing the focal length of the lens will affect the amount of blur as well. If you are happy with a camera's Depth of Field settings but then change the focal length or angle of view, you'll probably need to reset the F Stop setting. Typically values range from 2.8 to around 12.

    • Focus Region Scale: This is a scalar value that you can use to adjust the area in the scene you want to stay in focus. Lowering this value will also increase the blurriness. Use this to fine-tune the DOF effect once you have the Focus Distance and F Stop settings.

  9. Set the Focus Distance to 15, the F Stop to 2.8, and the Focus Region Scale to 0.1, and create another test render.

    The blurriness in the scene is much more obvious and the composition is a little easier to understand. The blurring is very grainy. You can improve this by adjusting the Quality settings in the Render Settings window. Increasing the Max Sample level and decreasing the Anti-Aliasing Contrast will smooth the render, but it will take much more time to render the image. For now you can leave the settings where they are as you adjust the DOF. Render-quality issues are discussed in Chapter 12 (see Figure 2.30).

  10. Save the scene as chase_v06.ma. To see a version of the scene so far, open chase_v06.ma from the chapter2scenes directory on the DVD.

Adding depth of field can help sort out the elements of a composition by increasing the sense of depth.

Figure 2.30. Adding depth of field can help sort out the elements of a composition by increasing the sense of depth.

Creating a Rack Focus Rig

A rack focus refers to a depth of field that changes over time. It's a common technique used in cinematography as a storytelling aid. By changing the focus of the scene from elements in the background to the foreground (or vice versa), you control what the viewer looks at in the frame. In this section, you'll set up a camera rig that you can use to interactively change the focus distance of the camera.

  1. Continue with the scene from the previous section or open the chase_v06.ma file from the Chapter2scenes directory of the DVD.

  2. Switch to the perspective view. Choose Create

    Creating a Rack Focus Rig
  3. In the Outliner, rename locator1 camPosition and rename locator2 distToCam (see Figure 2.31).

  4. In the Outliner, expand the DOF_cam_group. MMB-drag camPosition on top of the DOF_cam node to parent the locator to the camera. Open the Channel Box for the camPosition locator, and set all of its Translate and Rotate channels to 0; this will snap camPosition to the center of the camera.

    A measure tool, consisting of two locators, is created on the grid.

    Figure 2.31. A measure tool, consisting of two locators, is created on the grid.

  5. Shift-select the camPosition's Translate and Rotate channels in the Channel Box, right-click the fields, and choose Lock Selected so that the locator can no longer be moved.

  6. In the Outliner, MMB-drag distToCam on top of the camPosition locator to parent distToCam to camPosition. Select distToCam, and in the Channel Box set its Translate X and Y channels to 0 and lock these two channels (see Figure 2.32). You should be able to move distToCam only along the Z axis.

    The Translate X and Y channels of the distToCam node are locked so that it can move only along the Z axis.

    Figure 2.32. The Translate X and Y channels of the distToCam node are locked so that it can move only along the Z axis.

  7. Open the Connection Editor by choosing Window

    The Translate X and Y channels of the distToCam node are locked so that it can move only along the Z axis.
  8. Expand the DOF_Cam node in the Outliner, and select DOF_camShape. Click Reload Right in the Connection Editor.

  9. From the bottom of the list on the left, select Distance. On the right side, select FocusDistance (see Figure 2.33).

    The Distance attribute of the distanceDimensionShape1 node is linked to the focusDistance attribute of the DOF_camShape node using the Connection Editor.

    Figure 2.33. The Distance attribute of the distanceDimensionShape1 node is linked to the focusDistance attribute of the DOF_camShape node using the Connection Editor.

  10. Look in the perspective view at the distance measured in the scene, select the distToCam locator, and move it so that the annotation reads about 5.5 units.

  11. Select the DOF_camShape node and look at its focusDistance attribute. If it says something like 550 units, than there is a conversion problem. Select the distanceDimensionShape node in the Outliner, and open the Attribute Editor. From the menu in the Attribute Editor, click Focus, and select the node that reads unitConversion14. If you are having trouble finding this node, turn off DAG Objects Only in the Outliner's Display menu, and turn on Show Auxiliary Nodes in the Outliner's Show menu. You should see the unitConversion nodes at the bottom of the Outliner. Select unitConversion14 from the list to switch to the unitConversion node, and set the Conversion Factor to 1.

    Occasionally when you create this rig and the scene size is set to something other than centimeters, Maya converts the units automatically, and you end up with an incorrect number for the Focus Distance attribute of the camera. This node may not always be necessary when setting up this rig. If the value of the Focus Distance attribute of the camera matches the distance shown by the distanceDimension node, then you don't need to adjust the unitConversion's Conversion Factor.

  12. Set the timeline to frame 138. In the Perspective window, select the distToCam locator and move it along the Z axis until its position is near the position of the car (about −10.671). In the Channel Box, right-click the Translate Z channel, and choose Key Selected (see Figure 2.34).

    The distToCam locator is moved to the position of the car on frame 138 and keyframed.

    Figure 2.34. The distToCam locator is moved to the position of the car on frame 138 and keyframed.

  13. Switch to the DOF_cam in the viewport, and create a test render. The helicopters should be out of focus, and the area near the car should be in focus.

  14. Set the timeline to frame 160. Move the distToCam node so it is at about the same position as the closest helicopter (around −1.026). Set another keyframe on its Z translation. Render another test frame. The area around the helicopter is now in focus (see Figure 2.35).

If you render a sequence of this animation for the frame range between 12. and 180, you'll see the focus change over time. To see a finished version of the camera rig, open chase_v07.ma from the chapter2scenes directory on the DVD.

The focus distance of the camera has been animated using the rig so that at frame 160 the helicopter is in focus and the background is blurry.

Figure 2.35. The focus distance of the camera has been animated using the rig so that at frame 160 the helicopter is in focus and the background is blurry.

Motion Blur

If an object changes position while the shutter on a camera is open, this movement shows up as a blur. Maya cameras can simulate this effect using the Motion Blur settings found in the Render settings as well as in the camera's Attribute Editor. Not only can Motion Blur help make an animation look more realistic, it can also help smooth the motion in the animation.

Like Depth of Field, Motion Blur is very expensive to render, meaning it can take a long time. Also much like Depth of Field, there are techniques for adding Motion Blur in the compositing stage after the scene has been rendered. You can render a Motion Vector pass using mental ray's passes (Render passes are discussed in Chapter 12) and then adding the motion blur using the Motion Vector pass in your compositing software. For jobs that are on a short timeline and a strict budget, this is often the way to go. In this section, however, you'll learn how to create Motion Blur in Maya using mental ray.

There are many quality issues closely tied to rendering with Motion Blur. In this chapter, you'll learn the basics of how to apply the different types of Motion Blur. Chapter 12 will discuss issues related to improving the quality of the render.

Motion Blur is enabled in the Render Settings window, so unlike Depth of Field, which is activated per-camera, all cameras in the scene will render with Motion Blur once it has been turned on. Likewise all objects in the scene have Motion Blur applied to them by default. You can, and should, turn off Motion Blur for those objects that appear in the distance or do not otherwise need motion blur. If your scene involves a close up of an asteroid whizzing by the camera while a planet looms in the distance surrounded by other slower-moving asteroids, you should disable Motion Blur for those distant and slower-moving objects. Doing so will greatly reduce render time.

To disable Motion Blur for a particular object, select the object, open its Attribute Editor to the shape node tab, expand the Render Stats rollout, and deselect the Motion Blur option. To disable Motion Blur for a large number of objects at the same time, select the objects and open the Attribute Spread Sheet (Window

mental ray Motion Blur
Motion Blur can be disabled for a single object in the Render Stats section of its Attribute Editor or for a large number of selected objects using the Attribute Spread Sheet.

Figure 2.36. Motion Blur can be disabled for a single object in the Render Stats section of its Attribute Editor or for a large number of selected objects using the Attribute Spread Sheet.

There are two types of Motion Blurs in mental ray for Maya: No Deformation and Full. No Deformation calculates only the blur created by an object's transformation—meaning its translation, rotation, and scale. A car moving past a camera or a helicopter blade should be rendered using No Deformation.

The Full setting calculates motion vectors for all of an object's vertices as they move over time. Full Motion Blur should be used when an object is being deformed, such as when a character's arm geometry is skinned to joints and animated moving past the camera. Using Full Motion Blur will give more accurate results for both deforming and nondeforming objects, but it will take a longer time to render than using No Deformation.

The following exercise shows how to render with Motion Blur.

  1. Open the scene chase_v08.ma from the chapter2scenes directory of the DVD.

  2. In the Display Layer panel, right-click on the buildings display layer and choose Select Objects. This will select all of the objects in the layer. Open the Attribute Spread Sheet (Window

    Motion Blur for Moving Cameras
  3. Switch to the Rendering menu set. Choose Render

    Motion Blur for Moving Cameras
  4. Switch to the shotCam1 camera in the viewport. Set the timeline to frame 59, and open the Render View window (Window

    Motion Blur for Moving Cameras
  5. Create a test render of the current view. From the Render View panel, choose Render

    Motion Blur for Moving Cameras
  6. In the Render View panel, drag a red rectangle over the blue helicopter. To save time while working with Motion Blur, you'll render just this small area.

  7. Open the Render Settings window. Switch to the Quality tab. Expand the Motion Blur rollout, and set Motion Blur to No Deformation. Leave the settings at their default, and in the Render View panel, click the render region icon (second icon from the left) to render the selected region in the scene. It will take a couple minutes. When it's finished, store the image in the render view. You can use the scroll bar at the bottom of the render view to compare stored images (see Figure 2.37).

    The region around the helicopter is selected and rendered using Motion Blur. Just this small area took two minutes!

    Figure 2.37. The region around the helicopter is selected and rendered using Motion Blur. Just this small area took two minutes!

    Immediately it should become apparent that Motion Blur adds a lot to render time, considering that this scene has no textures and simple geometry. It's true that Final Gather will add time to the render, but if you compare the time it took to render the full frame using the Final Gather Preview Render preset and the time it takes to render just a small portion of the frame with default settings, the difference is very significant. Clearly, optimizing Motion Blur is extremely important, and you should always consider balancing the quality of the final render with the amount of time it takes to render the sequence. Remember that if an object is moving quickly in the frame, some amount of graininess may actually be unnoticeable to the viewer.

  8. In the Render Settings window, switch to the Features tab and set the Primary Renderer to Rasterizer (Rapid Motion) (see Figure 2.38). Click the Render Region button again to re-render the helicopter. This time it renders much faster. Store the image in the render view and compare it to the previous render.

    Changing the Primary Renderer to Rasterizer (Rapid Motion) reduces the render time for the helicopter region to 12 seconds.

    Figure 2.38. Changing the Primary Renderer to Rasterizer (Rapid Motion) reduces the render time for the helicopter region to 12 seconds.

    The Rapid Motion setting uses a different algorithm to render motion blur, which is not quite as accurate but much faster. However, it does change the way mental ray renders the entire scene.

    If you render the buildings, you'll notice that the shading when you use Rasterizer (Rapid Motion) is different from when you use Scanline. The Rasterizer does not calculate motion blurring for ray-traced elements (such as reflections and shadows). You can solve some of the problem by using detailed shadow maps instead of ray-traced shadows (discussed in Chapter 9), but this won't solve the problem that reflections lack motion blur.

  9. Switch back to the Quality tab and take a look at the settings under Motion Blur:

    Motion Blur-By

    This setting is a multiplier for the motion blur effect. A setting of 1 produces a realistic motion blur. Higher settings create a more stylistic or exaggerated effect.

    Shutter Open and Shutter Closed

    These two settings establish the range within a frame where the shutter is actually opened or closed. By increasing the Shutter Open setting, you're actually creating a delay for the start of the blur; by decreasing the Shutter Close setting, you're moving the end time of the blur closer to the start of the frame.

  10. Render the region around the helicopter. Store the frame, and then set Shutter Open to 0.25 and render the region again. Store the frame and compare the two images. Try a Shutter Close setting of 0.75. Figure 2.39 shows the results of different settings for Shutter Open and Shutter Close.

    Setting Shutter Open and Shutter Close to the same value effectively disables Motion Blur. You're basically saying that the shutter opens and closes instantaneously, and therefore there's no time to calculate a blur.

  11. Return the Shutter settings to 0 for Shutter Open and 1 for Shutter Closed. In the Quality section below the Motion Blur settings, increase the Motion Steps to 6 and render the helicopter region again. Store the image and compare it to the previous renders. Notice that the blur on the helicopter blade is more of an arc, whereas in previous renders, the blur at the end of the blade is a straight line (Figure 2.40).

The Motion Steps attribute increases the number of times between the opening and closing of the shutter that mental ray samples the motion of the moving objects. If Motion Steps is set to 1, the motion of the object when the shutter opens is compared to the motion when the shutter is closed. The blur is calculated as a linear line between the two points. When you increase the number of Motion Steps, mental ray increases the number of times it looks at the motion of an object over the course of time in which the shutter is open and creates a blur between these samples. This produces a more accurate blur in rotating objects, such as wheels or helicopter blades.

Different settings for Shutter Open and Shutter Close affect how Motion Blur is calculated. From left to right, the Shutter Open and Shutter Close settings for the three images are (0, 1), (0.25, 1), and (0.25, 0.75). The length of time the shutter is open for the last image is half of the length of time for the first image.

Figure 2.39. Different settings for Shutter Open and Shutter Close affect how Motion Blur is calculated. From left to right, the Shutter Open and Shutter Close settings for the three images are (0, 1), (0.25, 1), and (0.25, 0.75). The length of time the shutter is open for the last image is half of the length of time for the first image.

Increasing Motion Steps increases the number of times the motion of the objects is sampled, producing more of an accurate blur in rotating objects.

Figure 2.40. Increasing Motion Steps increases the number of times the motion of the objects is sampled, producing more of an accurate blur in rotating objects.

The other settings in the Quality section include:

Displace Motion Factor

This is new to Maya 2.09. The setting adjusts the quality of motion-blurred objects using a displacement map. It effectively reduces geometry detail on those parts of the model that are moving past the camera based on the amount of detail and the amount of motion as compared to a nonmoving version of the same object. Slower-moving objects should use higher values.

Motion Quality Factor

This is used when the Primary Renderer is set to Rasterizer (Rapid Motion). Increasing this setting lowers the sampling of fast-moving objects and can help reduce render times. For most cases a setting of 1 should work fine.

Time Samples

This controls the quality of the motion blur. Raising this setting adds to render time but increases quality. As mental ray renders a two-dimensional image from a three-dimensional scene, it takes a number of spatial samples at any given point on the two-dimensional image. The number of samples taken is determined by the anti-alias settings (discussed further in Chapter 12). For each spatial sample a number of time samples can also be taken to determine the quality of the motion blur effect; this is determined by the Time Samples setting.

Time Contrast

Like Anti-Aliasing contrast (discussed in Chapter 12), lower Time Contrast values improve the quality of the motion blur but also increase render time. Note that the Time Samples and Time Contrast settings are linked. Moving one automatically adjusts the other in an inverse relationship.

Motion Offsets

These controls enable you to set specific time steps where you want motion blur to be calculated.

Orthographic and Stereo Cameras

Orthographic cameras are generally used for navigating a Maya scene and for modeling from specific views. A stereoscopic or stereo camera is actually a special rig that can be used for rendering stereoscopic 3D movies.

Orthographic Cameras

The front, top, and side cameras that are included in all Maya scenes are orthographic cameras. An orthographic view is one that lacks perspective. Think of a blueprint drawing, and you get the basic idea. There is no vanishing point in an orthographic view.

Any Maya camera can be turned into an orthographic camera. To do this, open the Attribute Editor for the camera, and in the Orthographic Views rollout, turn on the Orthographic option. Once a camera is in orthographic mode, it appears in the Orthographic section of the viewport's Panels menu. You can render animations using orthographic cameras; just add the camera to the list of renderable cameras in the Render Settings window. The Orthographic Width is changed when you dolly an orthographic camera in or out (see Figure 2.41).

The Orthographic option for the perspective camera is activated, flattening the image seen in the perspective view.

Figure 2.41. The Orthographic option for the perspective camera is activated, flattening the image seen in the perspective view.

Stereo Cameras

Stereo cameras are new to Maya 2.09. These can be used when rendering a movie that is meant to be seen using special 3D glasses. Follow the steps in this example to learn how to work with stereo cameras.

  1. Create a new scene in Maya. From the Create menu choose Cameras

    Stereo Cameras
  2. Switch the panel layout to Panels

    Stereo Cameras
  3. Create a NURBS sphere (Create

    Stereo Cameras
  4. In the perspective view, select the center camera, and open the Attribute Editor to stereoRigCenterCamShape.

    In the Stereo settings you can choose which type of stereo setup you want; this is dictated by how you plan to use the images in the compositing stage. The interaxial separation adjusts the distance between the left and right cameras, and the zero parallax defines the point on the Z axis (relative to the camera) at which an object directly in front of the camera appears in the same position in the left and right cameras.

  5. In the Attribute Editor, under the Stereo Display Controls rollout, set Display Frustum to All. In the perspective view you can see the overlapping angle of view for all three cameras.

  6. Turn on Display Zero Parallax Plane. A semitransparent plane appears at the point defined by the Zero Parallax setting.

  7. Set the Stereo setting in the Stereo rollout to Converged.

    As you change the Zero Parallax value, the left and right cameras will rotate on their Y axis to adjust, and the Zero Parallax Plane will move back and forth depending on the setting.

  8. Set the Zero Parallax attribute to 10 (see Figure 2.42). In the perspective view, switch to a top view and make sure the NURBS sphere is directly in front of the center camera and at the same position as the zero parallax plane (Translate Z = −10).

    A stereo camera uses three cameras to render out an image for 3D movies. The zero parallax plane is positioned at the point where objects in front of the center camera appear in the same position in the left and right cameras.

    Figure 2.42. A stereo camera uses three cameras to render out an image for 3D movies. The zero parallax plane is positioned at the point where objects in front of the center camera appear in the same position in the left and right cameras.

  9. In the top view, move the sphere back and forth toward and away from the camera rig. Notice how the sphere appears in the same position in the frame in the left and right camera view when it is at the zero parallax plane. However, when it is in front of or behind the plane, it appears in different positions in the left and right views.

    If you hold a finger up in front of your eyes and focus on the finger, the position of the finger is at the zero parallax point. Keep your eyes focused on that point, but move your finger toward and away from your face. You see two fingers when it's before or behind the zero parallax point (more obvious when it's closer to your face). When a stereo camera rig is rendered and composited, the same effect is achieved and, with the help of 3D glasses, the image on the two-dimensional screen appears in three dimensions.

  10. Turn on the Safe Viewing Volume option in the Attribute Editor. This displays the area in 3D space where the views in all three cameras overlap. Objects should remain within this volume in the animation so that they render correctly as a stereo image.

  11. Open the Render settings to the Common tab. Under Renderable cameras you can choose to render each camera of the stereo rig separately, or you can select the stereo pair option to add both the right and left camera at the same time. Selecting the stereoCamera option renders the scene using the center camera in the stereo camera rig. This can be useful if you want to render a nonstereoscopic version of the animation.

The cameras will render as separate sequences, which can then be composited together in compositing software to create the final output for the stereo 3D movie.

You can preview the 3D effect in the Render View window by choosing Render

Compositing Stereo Renders in Adobe After Effects

The Bottom Line

Determine image size and resolution

The final image size of your render should be determined at the earliest possible stage in a project. It will affect everything from texture resolution to render time. Maya has a number of presets that can be used to set the image resolution.

Master it

Set up an animation that will be rendered to be displayed on a high-definition progressive-scan television.

Work with camera settings

The settings found in the Attribute Editor for a camera enable you to replicate real-world cameras as well as add effects such as camera shaking.

Master it

Create a camera setting where the film back shakes back and forth in the camera. Set up a system where the amount of shaking can be animated over time.

Create custom camera rigs

Dramatic camera moves are easier to create and animate when you build a custom camera rig.

Master it

Create a camera in the car chase scene that films from the point of view of chopperAnim3 but tracks the car as it moves along the road.

Use Depth of Field and Motion Blur

Depth of Field and Motion Blur replicate real-world camera effects and can add a lot of drama to a scene. Both are very expensive to render and should be applied with care.

Master it

Create a camera asset with a built-in focus distance control.

Create orthographic and stereoscopic cameras

Orthographic cameras are used primarily for modeling because they lack a sense of depth or a vanishing point. A stereoscopic rig uses three cameras and special parallax controls that enable you to render 3D movies from Maya.

Master it

Create a 3D movie from the point of view of the driver in the chase scene.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset