Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Simple scale/position expression needed

  • Simple scale/position expression needed

    Posted by Tom Nelson on September 2, 2010 at 4:43 pm

    I apologize if a similar post has been made – I know this will be an easy solution for someone who is familiar with expressions.

    I’ve got a layered Illustrator file where I want the layers to begin at a random position and scale, and end up at their correct location and scale after a second of movement, thus building the scene.

    I’d like the scale for each layer to be a random value between 110 and 200, and the position to be a random value that puts each part’s originating point within 500 pixels of the edges of my visible frame.

    This looks cool in my head. I’m not too familiar with expressions, though, so please let me know if it isn’t possible or might not look good.

    Thanks in advance for the expertise.

    -Tom

    Tom Nelson replied 15 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    September 2, 2010 at 5:13 pm

    These might be close to what you want:

    // scale

    seedRandom(index,true);
    s = random(110,200);
    linear(time,0,1,[s,s],value)

    // position

    seedRandom(index,true);
    p = [thisComp.width/2,thisComp.height/2];
    while (p[0] > 0 && p[0] < thisComp.width && p[1] > 0 && p[1] < thisComp.height)
    p = random([-500,-500], [thisComp.width+500,thisComp.height+500]);
    linear(time,0,1,p,value)

    Dan

  • Tom Nelson

    September 2, 2010 at 5:40 pm

    This is exactly what I was looking for – fantastic.

    Thanks, Dan.

    -Tom

    Tom Nelson
    Videographer/Editor
    Essex Television Group

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