Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Position Move on layer’s inPoint from multiple variable specified Coordinates randomly per layer?

  • Position Move on layer’s inPoint from multiple variable specified Coordinates randomly per layer?

    Posted by Gerald mark Soto on March 23, 2018 at 3:29 pm

    Okay so what i want to do is have have a grid of 20 boxes (100×100 pixels). And I want the boxes to slide into a grid formation from their inpoints. I would arrange them into a perfect grid but then i would like the inpoint to animate them into that perfect grid. Meaning i would like each layer to random choose to come from the top, bottom, left or right axis then settle into place. And I would like for the move to be specific to a range of movement, lets say 100 pixels in any direction. is that possible? I know about making expression for inpoints. But how do you make multiple variable for inpoint expressions.

    Gerald mark Soto replied 7 years, 11 months ago 2 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    March 23, 2018 at 4:09 pm

    Something like this maybe:


    easeTime = .5; // ease into postion over .5 second
    easeAmt = 100;
    seedRandom(index,true);
    offset = random() < .5 ? [easeAmt,0] : [0,easeAmt];
    offset *= random() < .5 ? 1 : -1;
    t = time - inPoint;
    value + easeOut(t,0,easeTime,offset,[0,0]);

    Dan

  • Gerald mark Soto

    March 23, 2018 at 6:02 pm

    PERFECT !!!! Thanks again.

  • Gerald mark Soto

    April 9, 2018 at 9:56 pm

    Is it possible to add the same in point animation to the out point. So it randomly comes in and it randomly comes out.
    Thanks Again sir.

  • Dan Ebberts

    April 9, 2018 at 10:19 pm

    Something like this maybe:


    easeTime = .5; // ease into postion over .5 second
    easeAmt = 100;
    if (time < (inPoint+outPoint)/2){
    seedRandom(index,true);
    t = time - inPoint;
    }else{
    seedRandom(index*1001,true);
    t = outPoint - time;
    }
    offset = random() < .5 ? [easeAmt,0] : [0,easeAmt];
    offset *= random() < .5 ? 1 : -1;
    value + easeOut(t,0,easeTime,offset,[0,0]);

    Dan

  • Gerald mark Soto

    June 4, 2018 at 5:27 pm

    Had another query,
    How can I apply this same animation but instead of using the inpoint of the layer to activate, it moves randomly with layer markers. So if I have 2 or 3 layer markera on the layer, it would move 3 times in either an X or Y position move?

    Here is what I got:

    sx = 100; // slide distance
    sd = .25; // slide duration
    seedRandom(index,true);
    offset = random() &lt; .5 ? [sx] : [sx];
    offset *= random() &lt; .5 ? 1 : -1;

    m =marker;
    x = 0;
    if (m.numKeys > 0){
    n = m.nearestKey(time).index;
    if (time &lt; m.key(n).time) n--;
    if (n > 0){
    t = time - m.key(n).time;
    x = ease(t,0,sd,(n-1)*offset,n*0);
    }
    }
    value + [x,0]

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