FORUMS: list search recent posts

Auto Ken Burns

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Bryan Woods
Auto Ken Burns
on Apr 14, 2013 at 10:59:14 pm

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!

Return to posts index

Ht Davis
Re: Auto Ken Burns
on Apr 5, 2016 at 8:56:29 pm

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.

Return to posts index

Kalle Kannisto
Re: Auto Ken Burns
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.

zoom = thisComp.layer("Controls").effect("Zoom Speed")("Slider");
seedRandom(index, true);
x_origin = random(thisComp.width);
y_origin = random(thisComp.height);
origin = [x_origin, y_origin];
shift = [thisComp.width/2, thisComp.height/2]-origin;
x_shift = (shift[0]*(100+zoom)/100-shift[0]);
y_shift = (shift[1]*(100+zoom)/100-shift[1]);
mult = linear(time, inPoint, outPoint, 0, 1);
[thisComp.width/2, thisComp.height/2]+mult*[x_shift, y_shift]

with the external slider, the scale expression becomes

zoom = thisComp.layer("Controls").effect("Zoom Speed")("Slider");
value + linear(time, inPoint, outPoint, 0, [zoom, zoom])

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 All Rights Reserved