When you change the focal length on a camera, you have to dolly the camera
toward or away from the "subject" to maintain the original composition. This tool
allows you to change the focal length while automatically preserving composition.
Given a new focal length, the following happens:
1. The new focal length is set.
2. The camera is automatically moved toward or away from the "subject".
3. The focusDistance is automatically adjusted.
IMPORTANT: The "subject" is determined by the focusDistance.
The "Visualize focusDistance and depth of field with locators" checkbox will
help you set this value properly.
This tool can also be used to keyframe the perfect dolly zoom.
DEPTH OF FIELD NOTES:
In addition to the focusDistance locator, there are 3 more depth of field (DOF)
locators: nearDOF, farDOF, and hyperfocalDistance. Everything between nearDOF
and farDOF will be "in focus".
What you consider to be "in focus" is determined by the circleOfConfusion
attribute on the cameraShape. I found that a value of 0.3 is accurate
for Mental Ray. You will have to play with this value until the near/farDOF
locators actually match the render DOF. (The "standard" coc value for a 35mm
camera is 0.03, but I recommend to trust your eyes and set the coc value yourself.)
Controlling the DOF is done just like with a real camera: by changing
the focalLength, fStop, and focusDistance. It is important to note that
the circleOfConfusion does not affect DOF; it only aids in the visualization
of DOF and depends on what you consider to be "in focus".
Note: If you ever find the farDOF locator behind the camera, that's normal.
It means that everything from the nearDOF locator to infinity will be in focus.
o Execute 'oaFocalLengthSwitcher' to bring up UI.
o Follow the directions in the UI.
IF YOU ENJOY THIS MEL SCRIPT, PLEASE RATE IT. I WOULD APPRECIATE IT. THANK YOU!