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.
So here's another script I just wrote. Spent a couple of hours on it only to find that there is a script called Reposition Anchor Point by Charles Bordenave who runs nabscripts.com. Its also available for download at aescripts.com. I decided to post mine anyways because it does handle things a little bit differently.
The point of move anchor point is to change the placement of the anchor point of the layer without changing the position of the layer. The script quickly move the anchor point to one of nine key places on the layer, (shown in the image above). If there are keyframes on the anchor point, position is not maintained, but a new anchor point keyframe is set to the desired position. If there are position keyframes, the anchor point is moved and position is corrected for all of those keyframes. This means that any position animation that you have already set up will not be changed by the script. (That is where it differs from Mr. Bordenave's script)
If you have any suggestions for making this script better or experience any problems, post them here or send me an email.
By the way, I went through this script file and made a bunch of comments explaining the entire script. So if you are just starting to learn scripting or are just interested to see whats going on inside, feel free to check it out.