Getting Started with Maya and Arnold 7

Camera / Depth of Field Blur

In the Outliner a default (hidden) perspective camera is already listed. We will use that one as a flexible working camera.

DefaultCamera

For animation and specific camera setup we need an extra camera for each shot. The easiest way to add a camera is to go in the perspective viewport and select View > Create Camera From View.

CreateCamera

Let’s rename that new camera and make it the active camera in the Viewport > Panels > (Camera Name).

SwitchCamera

To activate the depth of field blur we go to the CameraShape node, activate “Enable DOF” in the Arnold section (not in the Depth of Field section, that’s for the Maya standard renderer) and increase the Aperture Size.

CameraArnoldDOF

Since we don’t have defined the focus distance yet all looks quite blurry.

DOFBlur

To find out the right distance we need to measure it. Let’s temporarily hide unnecessary objects by hitting the “H” key. Switch to the default “persp” in the Viewport > Panels > (Camera Name). Activate “Snap to points” in the toolshelf and Create > Measure Tools > Distance Tools.

DistanceTool

Make a click at the camera and at the object in your scene you want to have in focus.

DistanceValue

When we apply that distance value in the “Focus Distance” attribute in the Arnold section of our camera the chosen area in our scene becomes sharper.

DOFPre

The DOF blur effect is still intense, but that’s fine for making adjustments.  When we move the camera or want to have another part in focus, do we have to measure again? No. First we parent the camera locator by MMB dragging onto the Camera in the Outliner.

CameraLocator

Rename the second locator to “Focus”. When we now move the camera or the “Focus” locator, the length value on the distance dimension tool should change. To connect the resulting length of our distanceDimension1 with the Arnold Focus Distance attribute in our Camera1 we just copy paste the following line into the “MEL” script field at the bottom left:

connectAttr -f distanceDimension1.distance Camera1Shape.aiFocusDistance;

Then hit “Enter”. Important: To make the script work, your camera needs to be named exactly “Camera1” and the distance tool “distanceDimension1”. If you want to make it work with different names you need to adapt the terms in the script accordingly.

DistanceMEL

For the final rendering we should decrease the Aperture Size, I used here 0.05.

IPRDOF

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s