ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Having trouble with Time Displacement effect and expressions

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Thomas Forest
Having trouble with Time Displacement effect and expressions
on Nov 25, 2018 at 8:11:21 am

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);


Return to posts index

Kalleheikki Kannisto
Re: Having trouble with Time Displacement effect and expressions
on Nov 25, 2018 at 6:37:15 pm

This is a bit of a guess, but did you pre-comp the layer used for time displacement? If not, you should, otherwise AE reads the layer without the effects applied to it.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Thomas Forest
Re: Having trouble with Time Displacement effect and expressions
on Nov 26, 2018 at 3:56:46 am

I'm guessing you are talking about the ReTimeMap layer? If that's the case, then yes, it is a pre-comp.


Return to posts index


Kalleheikki Kannisto
Re: Having trouble with Time Displacement effect and expressions
on Nov 26, 2018 at 9:59:48 am

Yes, but are the effects inside the precomp or applied to the precomp?

Should be the former.

I see from the screenshot that some effect has been applied to the precomp, but the image cuts off so I don't know what it is.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

Thomas Forest
Re: Having trouble with Time Displacement effect and expressions
on Nov 27, 2018 at 6:51:30 am

It works! Thank you very much sir!

It was exactly as you said, the effects were applied to the pre-comp instead of being inside it. I wish I'd known this earlier hahaha, it would have saved me a lot of trouble. But I guess these types of problems are inevitable when you're a novice. It was great to be able to learn from you. Thanks again!

P.S.: I'll try to think of posting the final result here, if you want to see it ;)


Return to posts index

Kalleheikki Kannisto
Re: Having trouble with Time Displacement effect and expressions
on Nov 27, 2018 at 12:18:55 pm

Yes, would be fun to see the final result.

By the way, the recent versions of AE have the option, in many cases, to include "masks and effects" instead of just the source of the layer, which obviates having to precompose with effects for such things. I'm not sure if it is available for every effect, haven't investigated the matter that thoroughly.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]