ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Avoid jump from one wiggle cycle to another

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ricardo Avila Ponce
Avoid jump from one wiggle cycle to another
on Nov 9, 2018 at 12:40:44 am

Hi, I’m using audio generated key frames to apply wiggle to and object rotation. The problem is that every time the audio stop the object jump back to the original rotation value. How can I avoid the jump between every wiggle cycle.

if(thisComp.layer("Audio Amplitude").effect("Left Channel")("Slider")>1)wiggle(1,10) else ???

thanks in advance.

if(thisComp.layer("Audio Amplitude").effect("Left Channel")("Slider")>1)wiggle(1,10) else ???


Return to posts index

Dan Ebberts
Re: Avoid jump from one wiggle cycle to another
on Nov 9, 2018 at 1:31:54 am

It's tricky--you have to count the previous frames where your condition for wiggling was true and use that to calculate the 5th parameter (time) of the wiggle:


a = thisComp.layer("Audio Amplitude").effect("Left Channel")("Slider");
t = time;
f = 0;
while (t >= 0){
if (a.valueAtTime(t)>1) f++;
t -= thisComp.frameDuration;
}
wiggle(1,10,1,0.5,framesToTime(f))



Dan



Return to posts index

Ricardo Avila Ponce
Re: Avoid jump from one wiggle cycle to another
on Nov 9, 2018 at 3:15:11 pm

Wow! I thought it will be something easier like a “hold” expression or something like that.
It works perfectly, thanks a lot Dan!


Return to posts index


Kalleheikki Kannisto
Re: Avoid jump from one wiggle cycle to another
on Nov 9, 2018 at 12:55:21 pm

Would be easier to apply the slider value to the wiggle amount

wiggle(1, thisComp.layer("Audio Amplitude").effect("Left Channel")("Slider")*10)

The slider output will need the correct multiplier to get it in a sensible range.

Kalleheikki Kannisto
Senior Graphic Designer


Return to posts index

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