Activity › Forums › Adobe After Effects › Switching focus of a camera with expressions
-
Switching focus of a camera with expressions
Posted by Evan Seccombe on August 16, 2006 at 8:53 pmthanks to the knowledgeable people in the forum, i found how to make an expression focus in a specific object admidst a multitude of them, but now the question is how do i make the camera change focus from object to another.
also, can anyone lead me to an effective tutorial somwehere on how to handle depth of field properly?
Evan Seccombe replied 19 years, 9 months ago 3 Members · 6 Replies -
6 Replies
-
Mike Clasby
August 16, 2006 at 9:37 pmDan Ebberts’
Building the World’s Greatest Cameraman
https://www.creativecow.net/show.php?page=/articles/ebberts_dan/expression_cont/index.html
See the last two sections.
-
Evan Seccombe
August 16, 2006 at 10:23 pmyeah i looked at that. it really makes no sense to me though. anywhere i can go to learn how to make sense of all the expression code?
-
Dan Ebberts
August 17, 2006 at 2:18 amYou have to calculate the distance that the camera’s focal plane would need to be from the camera to include the target object. If the object is not on the camera’s z axis, it involves a little vector math, but that is greatly simplified by AE’s dot product operator.
For a target layer named “target” the expression for Focus Distance would look like this:
P = thisComp.layer(“target”).position;
dot(P – position,toWorldVec([0,0,1]))For serious depth of field effects you’re probably going to want to crank the Aperture way up (in the hunderds).
Dan
-
Mike Clasby
August 17, 2006 at 5:43 amHey, I dunno how it works mathematically, but practically the expression on the camera tells it to focus on the layer number that corresponds to the keyframe number set by the slider in the Null (layer 7), So you can tell it to change focus to another layer by changing the Slider keyframes in the Null layer. So if you want to focus on another layer, say layer 3 (third layer down), set a keyframe for 3 and the camera will shift to layer 3. Transition time is hardwired into the camera expression and I think Dan talks about that in the tut. It looks like to me it take 1/3 to 1//2 second (10 to 15 frames) for that camera to track down the new layer.
Hope that helps.
-
Mike Clasby
August 17, 2006 at 6:18 amAs for understanding expressions, Methinks the two best places are here:
Dan Ebbert’s site (also, see reference books at bottom of home page)
and Gifford’s (very basic but not simple stuff, probably a good first stop)
https://jjgifford.com/expressions/basics/index.html
-
Evan Seccombe
August 17, 2006 at 8:13 amwwow thanks you guys. glad to know there are people with patience with noobs like myself
Reply to this Discussion! Login or Sign Up