Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Wiggle Y loop

  • Wiggle Y loop

    Posted by Warren Smith on April 19, 2017 at 3:47 pm

    I’m trying to get an vertical bar to seamlessly loop on the y axis, I have this expression but it’s just not working properly.

    Any help would be appreciated! ☺

    freq = 2;
    amp = 150;
    w = wiggle (freq ,amp);

    startFrame = framesToTime(20);
    stopFrame = framesToTime(200);
    easeOver = framesToTime(20);

    if((time >= startFrame)&&(time < stopFrame)){

    if((time >= startFrame)&&(time <= startFrame+easeOver))
    linear(time, startFrame, startFrame + easeOver, [value[0], w[1]]);
    else

    if(time >= stopFrame – easeOver)
    linear(time, stopFrame – easeOver, stopFrame, [value[0], w[1]]);

    else [value[0], w[1]];
    }

    else value

    Warren Smith replied 9 years, 4 months ago 2 Members · 4 Replies
  • 4 Replies
  • Kevin Camp

    April 19, 2017 at 4:51 pm

    here’s a link that describes how to create looping wiggle:
    https://motionscript.com/design-guide/looping-wiggle.html
    modifying dan’s code to fit what you are trying to do, i came up with this which creates looping vertical wiggle:
    freq = 2;
    amp = 150;
    loopTime = thisComp.duration;
    t = time % loopTime;
    wiggle1 = wiggle( freq, amp, 1, 0.5, t );
    wiggle2 = wiggle( freq, amp, 1, 0.5, t - loopTime );
    w = linear( t, 0, loopTime, wiggle1, wiggle2 );
    [ value[0], w[1] ]

    if you need it to start and stop, like in your current expression (which wouldn’t exactly be looping anymore), it would need further modification.

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

  • Warren Smith

    April 19, 2017 at 5:00 pm

    Thanks Kevin.

    Yeah sorry maybe my wording was misleading.

    I need the start and end positions as it forms a logo…

  • Kevin Camp

    April 19, 2017 at 5:28 pm

    got it, try this:
    freq = 2;
    amp = 150;

    startFrame = framesToTime( 20 );
    stopFrame = framesToTime( 200 );
    easeOver = framesToTime( 20 );

    w = wiggle( freq, amp );

    if( time >= startFrame && time < stopFrame ) {
    if( time >= startFrame && time <= startFrame + easeOver ) {
    linear( time, startFrame, startFrame + easeOver, value, [ value[0], w[1] ] );
    } else {
    if( time >= stopFrame - easeOver ) {
    linear( time, stopFrame - easeOver, stopFrame, [ value[0], w[1] ], value );
    } else {
    [value[0], w[1]];
    }
    }
    } else {
    value;
    }

    you were very close, you just needed to interpolate from the wiggle position back to the original value in line 15, also start with the original value in line 12.

    Kevin Camp
    Art Director
    KCPQ, KZJO & KRCW

  • Warren Smith

    April 20, 2017 at 4:45 pm

    Kevin you are a legend! That worked perfectly, thank you so much!

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