Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions random Position with a flop or invert

  • random Position with a flop or invert

    Posted by Anthony Dupsta on January 19, 2008 at 12:26 am

    I feel a bit like a toad with these expressions right now.

    What would be a better way to execute this.

    As of now I have a texture I am overlaying over a sequence. I want every frame of the texture to have a diff position, I flop it also on the x a few times for more variation.. As of now I have created about 10 key frames animating pos and than I have looped it. I invert it using rotation (180) , but a neg scale in the x axis would flop it and work also.

    What is a better way to do this.

    Darby Edelen replied 18 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Darby Edelen

    January 19, 2008 at 8:29 am

    The random() function will return a new value on every frame. So for position it might look like this:

    //The below values return a position somewhere inside the composition when passed to random();
    minPos = [0,0];
    maxPos = [thisComp.width, thisComp.height];

    random(minPos, maxPos);

    The code for your flop might look like this on the scale property:

    norm = value;
    flop = [-value[0], value[1]];

    n = Math.round(random()); //either 0 or 1

    if(n) norm; //return normal value if n is not 0
    else flop;
    //return flopped value otherwise

    If this is a little too random for you then I’d consider using a wiggle() on the position, or calling posterizeTime(fps); at the beginning of your expressions (where ‘fps’ is equal to the number of times you want the expression’s return value updated per second).

    Darby Edelen
    Designer
    Left Coast Digital
    Santa Cruz, CA

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