Copy link to clipboard
Copied
Hey Peeps,
I don't know no better title to post this.
I'm working with After Effects for more than 5 Years now, most of the time sailing around expressions.
For a Project now, i have 300 Photos organized in a grid and want to make an animation where the camera drives towards the middle of the grid, while the pictures move "up" towards the camera on the z-axis.
Naturally, they should move at different times, in the different speeds...
As there are 300 layers to animate, i dont want to animate them individually but find a way to give all the layers the same expression.
I'm now 2 days into learning expressions and tried many things. valueatTime, randomSeeds,... timeremapping only works with precomposed layers and i have the photos as seperate footagelayers.
If anyone can push me in the right direction, i would be sooo thankful.
Have a nice day!
Copy link to clipboard
Copied
That's the good old proximity detection thing where you measure the distance from the layer to the camera with length() and then use a simply linear() driven by said distance getting shorter to drive the layer's position, give or take some specifics that may apply to your project and we don't know about it. Throw in a bit of your random() to vary the trigger distances and it#s a done deal. Really nothing too complicated. The real trick will be tweaking values to make it look good, so you may want to rig it up with sliders for easy adjustments (and potentially also animating the values in addition to get an even more organic feel).
Mylenium
Copy link to clipboard
Copied
The trick for this kind of work is to create your expressions using layer in and out points. You can also take into account scale and use the original position as the resting point or hero position. You then save the animated properties as an animation preset. The last step is to just select all of your layers and apply the animation preset to all of them at the same time.
I have saved about a hundred of this kind of animation presets. I'll share one of them with you. Download it here.
Here's the code:
sif = effect("slideIn Frames")("Slider");
sof= effect("slideOut Frames")("Slider");
// find in and out pointOfInterest
stime = time - inPoint;
inTime = sif * thisComp.frameDuration;
if (effect("Match SI SO")("Checkbox") == 0) {
outTime = sof * thisComp.frameDuration;
}
else if (effect("Match SI SO")("Checkbox") == 1) {
outTime = inTime;
}
// Fix layer size when scaled
sf = scale - [100, 100];
xSize = width + (width * sf[0]/100);
ySize = height + (height * sf[1]/100);
realSize = [xSize, ySize];
// Set Positions
spx = 0 - realSize[0] + realSize[0]/2 ;
rstx = value [0];
rsty = value[1];
epy = thisComp.height + realSize[1] - realSize[1]/2;
// create movement
freq = effect("bounce Frequency")("Slider");
amplitude = effect("bounce Amplitude")("Slider");
decay = effect("bounce Decay")("Slider");
posCos = Math.abs(Math.cos(freq*time*2*Math.PI));
nt = time-inPoint;
y = amplitude*posCos/Math.exp(decay*nt);
moveIn = Math.min(linear(stime,0,inTime,spx ,rstx-y));
moveOut = Math.min(easeIn(time,outPoint - outTime,outPoint - thisComp.frameDuration,rsty ,epy));
[moveIn, moveOut]
Here's a tutorial I just produced on saving animation presets.