4 Replies Latest reply on Apr 25, 2017 7:09 AM by garanr72167080

# After Effects Combine x2 Expressions - Bounce & loopOut

I'm after help combining x2 expressions. A bounce expression like below...

n = 0;

if (numKeys > 0){

n = nearestKey(time).index;

loopOut("cycle");

if (key(n).time > time){

n--;

}

}

if (n == 0){

t = 0;

}else{

t = time - key(n).time;

}

if (n > 0){

v = velocityAtTime(key(n).time - thisComp.frameDuration/10);

amp = .05;

freq = 4.0;

decay = 2.0;

value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);

}else{

value;

}

...with the standard loopOut("cycle") expression. I have a few key frames to lift an object slowly then to drop it quickly (hopefully with a bounce) and I need to repeat this indefinitely. Can any one help?

• ###### 1. Re: After Effects Combine x2 Expressions - Bounce & loopOut

Going to have a moderator move your post to the Expressions forum.

• ###### 2. Re: After Effects Combine x2 Expressions - Bounce & loopOut

Realised I had copied the loopOut expression into the bounce code in line 4. Can anyone help to get these working together?

• ###### 3. Re: After Effects Combine x2 Expressions - Bounce & loopOut

loopOut()requires keyframes, not expressions. You cannot simply combine these two expressions. You have to apply the bounce first, convert to keyframes and then apply the loop expression, which ideally you might do on duplicate layers to not mess up your original keyframing.

Mylenium

• ###### 4. Re: After Effects Combine x2 Expressions - Bounce & loopOut

Hi Mylenium,

Brilliant I hadn't thought of doing that. Thanks.