Using an expression to change focus distance three times in one composition (rack focus effect)
Hello all,
I'm running AE CC 2014. I know next to nothing about expressions, but I've been experimenting with them to try and find a way to create a rack focus effect on a photo that I cut up into several layers using Photoshop.
I'm working in 3D, and I'm changing my camera's positioning to zoom in and pan around the image. As I zoom from layer to layer, I want to create a rack focus effect by changing the value of the camera's focus distance.
I found an expression that allows me to keep the focus distance locked onto one layer, and then I found another expression that builds on the first one and allows for one rack focus between two layers after a few seconds:
target1 = thisComp.layer("people left/painting cutup.psd");
target2 = thisComp.layer("Middle man 1/painting cutup.psd");
tStart = 6;
tEnd = 7;
d1 = length(thisComp.layer("people left/painting cutup.psd").transform.position[2],transform.position[2]);
d2 = length(thisComp.layer("middle man 3/painting cutup.psd").transform.position[2],transform.position[2]);
ease(time,tStart,tEnd,d1,d2,)
My problem is that I don't know how to build on that expression and add a second rack focus to a third layer. I really don't even know where to start - does anyone have any advice?
Many thanks.
