TEST TEST

Autofocus expression

iaian7 » tutorials » lightwave   John Einselen, 13.01.09 (updated 27.07.09)    

This is a super simple expression that drives the Camera focal distance with a null. Hardly deserving of much description, but I need it often enough, I get tired of redoing it in the Expression builder every time.

vmag( Camera.wpos(Time)- Null.wpos(Time))

To use this expression, open the camera properties panel (shift-c to select the camera, p to open properties) and click the focal distance envelope button (labeled e, immediately to the right of the focal distance numerical field). Find the Expressions tab in the opened graph editor (near the bottom of the window), and create a new one with the code above. Make sure you update the Camera and Null names to match the names in your scene, and save the expression. Apply it to the focal distance channel (should still be selected in the graph editor), and there you go! Instant autofocus.

bookmark