I'm currently working on a new stock After Effects template, and while doing so, I realized there were a couple things that I kept on doing. One was setting the anchor point to the center of a text layer. (Which is why I made the Move Anchor Point Script) The other was setting the cameras focus distance to the layer it was looking at. Even though setting the focus distance of a camera is easy, I thought it could be a little quicker. So I wrote this plug-in that automatically sets the focus distance for the active camera to the selected layer.
Once downloading and installing, Auto Focus will show up in the 'Layer' menu between 'Guide Layer' and 'Add Marker'. (May differ depending on the selections in your layer menu). To use, simple select the layer you want to focus on and click 'Auto Focus'.
The selected layer must be a 3D layer and can't be a light or a camera. If there is no active camera when you run the script, you will receive an error. Cameras can't be set to a negative focus distance, or course, so if the layer is behind the camera, you will be asked if you would like to set the focus distance to what it would be if the camera was facing the selected layer.
Auto Focus (For After Effects CS3 and Up) is free to download. If you have any issues, comments or questions, leave a comment.