Working on a kind of Auto Ken burns effect expression and could use some guidance.
I have a script that applies a slider control to the selected layer(s), then adds an expression to the scale to use this slider to control the speed of scale. Scaling is automatic based on the in/out points of the layer. There are some inneficiencies though, and I'd love some critique on it.
Here's the expression: zoom = effect("Zoom Speed")("Slider");
value + linear(time, inPoint, outPoint, 0, [zoom, zoom])
Haha, I smile every time I see that array.
ANYWAY, this works and is fairly flexible. But its very basic. I end up repositioning the anchor point of the layer to change where it zooms into, which can be hit or miss and require a few attempts to figure out where I need to reposition the anchor so it zooms into the correct area. Ideally I'd like to initially have a random position chosen for every layer this expression is applied to (so probably driven by index number), but also be able to move the "target" where we zoom into if the random position doesn't work. I thought possibly the point controller would be my answer, but it does some weird things when using it to move the anchor point, one of which moves the entire image inversely of the anchor point, which doesn't help me.
Any thoughts on the additions to this script that I want to implement? Thanks!
The position marker prevents Drifting the center point or anchor inadvertently. However, if it is readable from the comp in a script, you could set a start and end slider for it. The values could have an adjustable range that centers at normal and can drift either direction on either axis by a value no bigger than the comp's farthest edge dimensions. They would allow you to zoom a photo to any anchor point on or off screen. Give it beginning and end keys, and viola. I'm no scripter. But your script has possibilities.
on Apr 6, 2016 at 8:42:48 am Last Edited By Kalle Kannisto on Apr 6, 2016 at 8:44:45 am
That was more complicated than I thought, but here it is.
For random zoom origin, you can use this expression on the position value. Note that I moved the Zoom Speed slider to a separate layer named "Controls". If you want individual zoom speeds, you can use your original expression for the zoom.
Disable the expression for any layers where you want to control the anchor point manually.