Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Wiggle Expression too random, need a “Pulse Effect”

  • Wiggle Expression too random, need a “Pulse Effect”

    Posted by Ian Rajkumar on July 3, 2011 at 9:43 pm

    Hey Guys,

    I need your help here, so you know when you write an expression for the wiggle (eg wiggle(2,15)) it will wiggle randomly to those values you specified right?

    but here’s the thing, the wiggle expression about gives unpredictable random movements, lets say I want the object (position in this case) to ‘PULSE’

    For instance the object is at the position 0,0
    and I write the expression to wiggle the object 15 pixels ONLY on the X axis (just to make things simple) it would look something like this;

    a = wiggle(2,15);
    [a[0],0]

    okay, the above expression is gonna create some seriously random ‘organic’ movements.

    But what I really want is to have this object ‘PULSE’ between +/-15 pixels, one keyframe it’s at -15, the next keyframe it is at +15

    Thanks guys, I hope you understand my question clearly and help me out, much appreciated

    Dan Ebberts replied 10 years, 5 months ago 6 Members · 11 Replies
  • 11 Replies
  • Dan Ebberts

    July 3, 2011 at 10:34 pm

    You could keyframe one complete cycle and then use loopOut() to make it cycle.

    Dan

  • Ian Rajkumar

    July 3, 2011 at 10:53 pm

    I am not too sure what you mean, but I would like this the solution to be purely expression based

  • Dan Ebberts

    July 3, 2011 at 11:12 pm

    >I would like this the solution to be purely expression based.

    Well, you did mention keyframes. Did you mean frames?

    This will jump between 15 and -15 on each frame:

    x = (timeToFrames()%2) ? -15 : 15;
    value + [x,0]

    That’s pretty fast though. Maybe this what you meant:

    freq = 2;
    amp = 15;
    x = amp*Math.sin(freq*time*Math.PI*2);
    value + [x,0]

    Dan

  • Ian Rajkumar

    July 4, 2011 at 3:47 pm

    thanks Dan Ebberts, that works like a charm!

  • Kath Rin

    September 5, 2012 at 2:54 pm

    Hello! And want to do this Expression on the z axis, but it doesn`t work.

    freq = 2;
    amp = 15;
    z = amp*Math.sin(freq*time*Math.PI*2);
    value + [z,0]

    There is a alarm message:
    Expression result must have the dimension 1 not 2!

    Can anybody help me?

    Thank you!

  • Dan Ebberts

    September 5, 2012 at 5:19 pm

    Change the last line to:

    value + [0,0,z]

    Dan

  • Kath Rin

    September 5, 2012 at 8:33 pm

    Thank you Dan for the quick answer! It works, yeah!

  • Johannes Strømme

    December 1, 2015 at 7:33 am

    This is so close to what I´m looking for. Probly just need a few tweaks that i can´t figure out.

    I have about 20 different layers of photoshopped stars in a comp, and I want them all to be twinkling randomly using expressions. I want them to both twinkle and fade in and out randomly like real stars appear to do, not as strobe lights, which is what happens when i try the wiggle() or random() expressions. I want the twinkling and fading to slowly pulsate at random intervals and i also want the duration of each “pulse” to be randomized.

    If I apply this expression to all 20 stars, they all pulse in and out at the exact same times with exact same shine and duration. The “Shine” effect is a good look, but it is a hassle to keyframe each of the 20 stars differently to make it appear convincingly random.

    I would really appreciate a swift reply to this! Thank you so much for any help!

  • Kalleheikki Kannisto

    December 1, 2015 at 8:21 am

    Sine wave is not exactly random, but if you put a different freq setting for each star, that would give the impression they are random.

    Wiggle should work for this though if the time setting is slow enough. Such as: wiggle(.5,[your brightness change here]) or even slower.

    If you don’t want to deal with each star separately, other approaches could be used, such as putting an animated fractal noise layer above your stars.

  • Sam Rippon

    January 8, 2016 at 3:54 pm

    Hi Dan,

    How do you apply this to both the x & y?

    Thanks

    freq = 2;
    amp = 15;
    x = amp*Math.sin(freq*time*Math.PI*2);
    value + [x,0]

Page 1 of 2

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