Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Alternating Wiggle Dimentions?

  • Alternating Wiggle Dimentions?

    Posted by Jerry Fines on June 16, 2009 at 3:53 am

    I have a small 10×10 solid and it moves from one corner of the screen down to the opposite corner. What I wanted to do after this was add a wiggle expression that only affected it on the X plane for 1 frame, then and then the Y dimension for the next frame. Is this possible?

    Dan Ebberts replied 16 years, 11 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    June 16, 2009 at 5:38 am

    I’d start with something like this:

    f = timeToFrames();
    w = wiggle(3,25);
    if (f%2) [value[0],w[1]] else [w[0],value[1]]

    Dan

  • Jerry Fines

    June 16, 2009 at 11:23 pm

    Thanks, it did work. I am trying a variation on this now where I don’t even have to keyframe the diagonal movement, perhaps you could help…

    In this variation I am trying to get the solid to move (from its starting location) only in positive movements in the X plane (so from left to right) and in negative movements in the Y plane (so from top to bottom. I am trying to get it to move a random distance (min/max random) every ‘phase’ (30 frames or so). I think this would be like your grid expression, but the circles in your expression would never go ‘back’, they’d just keep going in one direction. Is this possible? Maybe I should just keyframe.

  • Dan Ebberts

    June 17, 2009 at 1:39 am

    Maybe something like this:

    minDist = 50;
    maxDist = 100;
    minFrames = 25;
    maxFrames = 35;

    minDur = framesToTime(minFrames);
    maxDur = framesToTime(maxFrames);
    t0 = t1 = 0;
    p0 = p1 = [0,0];
    seedRandom(index,true);
    dir = random() > 0.5 ? true: false;
    while (t1 < time){ t0 = t1; p0 = p1; t1 += random(maxDur,maxDur); if (dir){ p1 += [random(minDist,maxDist),0]; dir = false; }else{ p1 += [0,random(minDist,maxDist)]; dir = true; } } ease(time,t0,t1,value+p0,value+p1) Dan

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