ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# Using loop expressions in an effect property

FAQ   •   VIEW ALL
 Using loop expressions in an effect property on Apr 22, 2018 at 10:40:21 pm

Hello!
I followed this tutorial to create some sun rays:

It's all well and good, but, the animation does that little "bump" when it reaches the end and jumps back to the beginning.
So I'm thinking about how to make it loop forever without that nasty bump.
From previous experience I guess the smart way to do it would be to use a loop expression, right?
But none of the ways I know how, work in this scenario.

In the tutorial above, the instructions are to just use a "time*100" expression inside the Evolution parameter of the Fractal effect.
When I try to plug in the loop one, it doesn't work.

Why? How do I do this?

```time*100 LoopOut(“PingPong”);```

 Re: Using loop expressions in an effect propertyon Apr 23, 2018 at 12:57:35 am

You can't just add loopOut() like that (it invalidates everything that comes before).

You could try something like this 5-second ping pong loop, but I'm guessing it won't be very convincing where the ping pong happens:

loopDur = 5;
t = time%loopDur;
n = Math.floor(time/loopDur);
if(n%2) t*100 else (loopDur-t)*100

Dan

 Re: Using loop expressions in an effect propertyon Apr 23, 2018 at 1:54:31 am

Thank you!!!

I did kind of a workaround, which was keyframing the property, then adding a keyframe halfway through the timeline and make the evolution go a full cycle (360), then two more keyframes, both at 0 at start and end.

A LOT more work than just adding the expression, and I suspect the expression will look better, so I'll still try it. Let's see.

 Re: Using loop expressions in an effect propertyon Apr 23, 2018 at 2:06:29 am

So... yeah that didn't work. I still see a "bump" when it loops.
The expression itself worked as far as making it loop, but I need it to loop smooth, without giving away when the loop ends and restarts...

 Re: Using loop expressions in an effect propertyon Apr 23, 2018 at 3:38:50 am

I don't know if you'll be able to use this for your application, but it does make a pretty convincing loop. You would duplicate the Noise layer. The top layer gets this for Evolution:

loopDur = 6;
t = time%loopDur;
t*100;

and this for layer Opacity:

loopDur = 6;
rampDur = 1;
t = time%loopDur;
linear(t,loopDur-rampDur,loopDur,100,0)

The bottom copy gets this for Evolution:

loopDur = 6;
rampDur = 1;
t = time%loopDur;
linear(t,loopDur-rampDur,loopDur,-rampDur,0)*100

Dan