Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Better wiggler (for me anyway)

  • Better wiggler (for me anyway)

    Posted by Harry Hoag on March 19, 2009 at 10:52 am

    Hi,
    I hate the wiggler, there just aren’t enough settings!
    If you want a good, fast shake to something the wiggler is pretty much useless. The wiggler will often put two similar values next to each other, making the wiggle appear to stop for a couple of iterations. That is bad.

    I need an expression that will make a random wiggle but i want the value to alternate above and below the starting value on each frame…

    for example if the starting value on frame 0 = 250, then frame 1 will be > 250, frame 2 will be < 250, frame 3 will be > 250, etc.

    But within a specified range like the wiggler. so if the range is 5, then frame 1 would be somewhere between 251 and 255, frame 2 will be somewhere between 249 and 245, etc.

    This way you’ll get a nice jagged shake to whatever.
    Can this be done?

    Btw, I am a total doughnut with expressions…

    thanks

    Harry Hoag replied 17 years, 2 months ago 3 Members · 8 Replies
  • 8 Replies
  • Dan Ebberts

    March 19, 2009 at 3:45 pm

    Something like this should work for a 1D parameter like rotation:

    range = 5;

    rnd = random(range);
    fr = timeToFrames(time);
    if(fr%2) value – rnd else value + rnd

    For 2D or 3D, it gets more complicated because you have to decide if you want x and y to both change in a positive direction on the same frame, etc.

    Dan

  • Harry Hoag

    March 19, 2009 at 4:06 pm

    wow, excellent, thanks man…

    I see what you’re saying about a 2D movement, although that would be useful. What determines the whether it’s shaking horizontal or vertical at the moment?

    Because I could simply apply a horizontal shake to the object itself, then make it an embedded composition and apply a vertical shake to the embedded comp…

  • Dan Ebberts

    March 19, 2009 at 5:29 pm

    You can shake both dimensions in one expression, it’s just that if your requirement is that they shake in the positive direction on even frames and the negative direction on odd frames, the shaking will always be to the lower right (+x,+y)or upper left (-x,-y), never to the upper right (+x,-y) or lower left (-x,+y).

    Dan

  • Harry Hoag

    March 19, 2009 at 5:45 pm

    ahh, i see.
    Ok, I’ll use the wiggler on the other axis to give it a more random movement rather than diagonal.

    But, at the moment it is only moving the first value on anything I put it on, in my case horizontal position.

    How do I make it affect just vertical?

    cheers

  • Dan Ebberts

    March 19, 2009 at 6:04 pm

    This would affect just y:

    range = 5;

    rnd = random(range);
    fr = timeToFrames(time);
    if(fr%2) value – [0,rnd] else value + [0,rnd]

    Dan

  • Harry Hoag

    March 19, 2009 at 6:10 pm

    ahh, cool cool cool,
    my knowledge of expressions just increased by 0.0001
    [x,y]
    understandings

    thanks man

  • Filip Vandueren

    March 20, 2009 at 3:51 am

    What about thinking of a 2D wiggle as expressed in polar coördinates, letting each subsequent wiggle be at least +/-90° and max +/-270° away from the current coördinate, and at a random distance from the center.
    That might give a random, yet more consistently ‘all over the place’ wiggle ?

  • Harry Hoag

    March 21, 2009 at 4:45 pm

    Not sure i know what you mean. Actually i s’pose i don’t know what you mean by polar coordinates?

    sounds like a crazy amount of jiggling around if the range is 90 to 270 degrees…

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