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.
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.
Let’s rename that new camera and make it the active camera in the Viewport > Panels > (Camera Name).
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.
Since we don’t have defined the focus distance yet all looks quite blurry.
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.
Make a click at the camera and at the object in your scene you want to have in focus.
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.
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.
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.
For the final rendering we should decrease the Aperture Size, I used here 0.05.