Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › Undulation seamless loop

  • Undulation seamless loop

    Posted by Shannon Towell on September 11, 2020 at 8:30 am

    Hi! I’m using the Dan Ebbert’s expression for undulation (https://www.motionscript.com/expressions-lab-ae65/undulations.html), as I want my objects to look like they’re moving like a wave. I’m having trouble making a seamless loop. My composition has 5 objects using this expression, and is 3 seconds long. I’d appreciate any help you can muster, thanks!

    —–

    The undulation expression is:
    Position:

    xAmp = 3; //height of undulations (pixels)
    xFreq = .3; //undulations per second
    xSpeed = 150; //speed of wave (pixels per second)
    
    wl = xSpeed/xFreq; //wavelength (pixels)
    phaseOffset = ((position[0]%wl)/wl)*2*Math.PI;
    y = xAmp*Math.sin(2*Math.PI*xFreq*time + phaseOffset);
    value + [0,y]

    Rotation:

    xFreq = .3; //undulations per second
    xSpeed = 150; //speed of wave (pixels per second)
    damping = 15; //undulation damping factor
    
    wl = xSpeed/xFreq; //wavelength (pixels)
    phaseOffset = ((position[0]%wl)/wl)*2*Math.PI;
    theta = Math.atan(Math.cos(2*Math.PI*xFreq*time + phaseOffset));
    radiansToDegrees(theta)/damping;
    Shannon Towell replied 6 years ago 2 Members · 2 Replies
  • 2 Replies
  • Filip Vandueren

    September 11, 2020 at 9:23 am

    the frequency of .3 doesn’t fit exactly in 3 seconds. But 0.333333 would.

    To be absolutley sure, you might want to express the undulations as 1 undulation over the entire comp’s time like this:

    xFreq = 1 / thisComp.duration; 

    (or simply 1/3 in this case)

  • Shannon Towell

    September 22, 2020 at 7:13 am

    Thank you very much, that worked a treat! I hope you have had a good weekend!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy