Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions a grids of layers converge on one point

  • Dan Ebberts

    October 5, 2011 at 5:20 pm

    Where are the layers convening? Do they all arrive at the same time? If so, how long does it take? Or, do they all move at the same speed and arrive at different times? If so, how fast do they move? Do the layers already have position expressions to establish the grid, or did you arrange them by some other method?

    Dan

  • Birgit Rathsmann

    October 5, 2011 at 5:29 pm

    The convergence point is x:858, y:344, the take 5 frames and the all arrive at the same point.
    The grid was made by hand, but would be happy to re-make with an expression.
    Thank you.

  • Dan Ebberts

    October 5, 2011 at 5:47 pm

    Try this:


    target = [858,344];
    frames = 5;

    if (thisComp.marker.numKeys >0){
    t0 = thisComp.marker.key(1).time;
    ease(time,t0,t0+frames*thisComp.frameDuration,value,target)
    }else{
    value
    }

    Dan

  • Birgit Rathsmann

    October 5, 2011 at 6:09 pm

    Thank you, you’re very kind.
    Birgit

  • Birgit Rathsmann

    October 5, 2011 at 7:02 pm

    Hi,
    I tried to adapt the code you sent for postion and apply it to rotation, but it’s failing.
    Each layer in the grid should rotate once at marker two: randomly between -5 degrees and +5 degrees and hold that rotation for the rest of the comp. (The comp is only 30 frames).

    Thanks for all your help.
    Birgit

  • Dan Ebberts

    October 5, 2011 at 7:12 pm

    Try this:


    maxR = 5;
    frames = 5;
    if (thisComp.marker.numKeys > 1){
    seedRandom(index,true);
    target = random(-maxR,maxR);
    t0 = thisComp.marker.key(2).time;
    ease(time,t0,t0+frames*thisComp.frameDuration,value,target)
    }else{
    value
    }

    Dan

  • Birgit Rathsmann

    October 5, 2011 at 7:31 pm

    Hi Dan,
    Thank you so much.
    Maybe I am putting your code into the wrong spot because it’s not doing anything at marker 2.
    I assumed I should paste into rotation expression text field?’
    I am entirely learning a lot about expressions today though, so that’s fabulous.
    Birgit

  • Dan Ebberts

    October 5, 2011 at 7:58 pm

    Have you tried it on multiple layers? It’s a pretty subtle rotation. Zero degrees is within the random range of -5 to +5.

    Dan

  • Birgit Rathsmann

    October 5, 2011 at 8:32 pm

    I works beautifully, except the animation changed and now the rotation has to occur 4 frames before the postion transformation. Obviously I can’t just switch the markers, so I tried re-writing the code as below, but that didn’t work.
    Is there something strange in the sequence?

    Thanks,
    Birgit

    Position: everyone converges on a target point at marker 2

    target = [1296,1194];
    frames = 5;

    if (thisComp.marker.numKeys >1){
     t0 = thisComp.marker.key(2).time;
     ease(time,t0,t0+frames*thisComp.frameDuration,value,target)
    }else{
     value
    }

    Rotation: at marker 1, everyone rotates randomly between -5 and plus 5

    maxR = 5;
    frames = 2;
    if (thisComp.marker.numKeys >0){
     seedRandom(index,true);
     target = random(-maxR,maxR);
     t0 = thisComp.marker.key(1).time;
     ease(time,t0,t0+frames*thisComp.frameDuration,value,target)
    }else{
     value
    }

  • Dan Ebberts

    October 5, 2011 at 8:43 pm

    It works for me–they all rotate at the first marker, and move at the second marker.

    In what way is it not working for you?

    Dan

Page 1 of 2

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