-
Having trouble with Time Displacement effect and expressions
Hi,
First of all, I’m pretty new to After Effects, so I don’t know a lot about expressions. I’m currently trying to put together a raining code effect like we see in the Matrix movies, but with ants instead of letters and symbols. So my problem goes like this:
I started out by following this tutorial with good results, until I hit a roadblock at the 13:17 timestamp. Here, he adds an adjustment layer to his composition so he can use a Time Displacement effect on it, using luminosity values of the pixels from the ReTimeMap layer (in the same comp) to kind of randomize the glyphs of the MatrixStrip layer. It gives a great visual effect and is exactly what I want to accomplish.
The thing is, his MatrixStrip comp is only a text layer on which he applies an Animator with its Character Offset property set up to be time dependent using this expression: time*2
Mine is a PNG sequence of 10 frames, with a different ant on each one, on which I apply the posted expression to randomize the order in which they appear. It works great for a single MatrixStrip, but when I try to put many together and apply the Time Displacement effect the way he did, nothing happens. I’ve tried making that expression time-dependent in a lot of different ways, but to no avail. I’ve also tried using comp(“MatrixStrip”).layer(“AdjustmentLayer”).time to try and get the “displaced” time, but it didn’t work either. I’m running out of ideas.
What’s the best way to go about this? Is there any way to make this expression time dependent that I haven’t thought of? Maybe I need to set up a Controls comp and use global variables? How would I go about that? Or maybe it’s something else entirely and I’ll need to rethink the whole process?
Here are a few screenshots and a GIF of my progress so far: https://imgur.com/a/f4rNOnC
I hope you guys have enough information to help me. If I left anything unclear, please ask any questions you might have. I don’t have a lot of free time tomorrow, but I’ll be checking in as often as possible.
Thank you!
posterizeTime(2);
fr=2; //frame rate;
numFrames=10;
seedRandom(index,true);
seg=Math.floor(time*fr);
f=Math.floor(random(numFrames));
for(i=0;i<seg;i++)
f=(f+Math.floor(random(1,numFrames)))%numFrames;
framesToTime(f);