Hi- I'd like to create an expression that links the speed at which a camera's focus distance changes to a brightness filter.
So, for example, if the focus distance changes abruptly and quickly, I want an image to suddenly get brighter proportionate to how fast the focus distance changed. Conversely, if the speed at which the focus distance changes is slow, then there should be very little change in the image's brightness.
Even better, if you could tell me how to make the brightness changes lag by about a half a second after the focus distance changes have occured, that would be great!
Thanks so much!
thanks so much Dan, you're awesome. It works, but not perfectly. The brightness dips in the negatives apparently as the speed decelerates. Is there a way to set the brightness range to occur between say 0 and 50 only. Finally, the delay works well, but do you know how to also extend the effect? In other words, once the brightness cranks up to 50 quickly, is there a way for the brightness to slowly return to 0 over say 1 second?
I forgot about negative speed. This should fix that problem:
atten = 20;
delay = .5;
C = thisComp.layer("Camera 1");
Math.abs(C.cameraOption.focusDistance.speedAtTime(time-delay))/atten
Your second question requires a much more complicated expression. The expression would have to loop back, frame-by-frame to figure out how long ago the most recent transition in the focal distance occured and use that time to drive some kind of decaying pulse for the brightness. It sounds like fun--I wish I had time to work it out for you.
Dan
North America
Europe, Middle East and Africa
Asia Pacific