Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Bart Van zon on September 8, 2009 at 2:34 pm

    I’m trying to create an effect of a videoreel sliding by, to achieve this i want to use an imagesequence, import them as seperate stills and place them in the comp. Now i want to place all the images next to eachother, and then slide from left to right over a period of time. However i never used expressions before so i have no idea where to start. I was thinking of using the index to see where the still has to stand,
    so the x position of the layer should be it’s index times the width of the still (640), so
    position.y = thisLayer.index*640 or something like that would position the the images at start, and then over a period of for example 3 frames it should slide 640 pixels to the left. Also i was wondering if then i can past this expression in all layers at once (i’m testing this now with about 250 layers so would be quite some work to paste it in each frame manually). And this way would mean that after effects will have to calculate all the layers each frame, would this influence my render time or will after effects ignore the calculations of layers that aren’t shown at that moment?

    Paul Hennell replied 16 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Bart Van zon

    September 8, 2009 at 3:37 pm

    excuse me for the double post but couldn’t find an edit button,
    i emulated the expression by copy pasting a lot of keyframes and i now have the desired effect without expressions. However i’m still curious about how it would have been done with expressions.

  • Paul Hennell

    September 8, 2009 at 9:12 pm

    You basically had it, just the formatting was a problem. The expression: x = index*640;
    [x,value[1]]

    would work fine. (Mostly)

    [That expression assigns X as what you suggested (‘layer index * 640’) then gives it to the layer along with the original value for y. (Positions need two numbers for the X and Y dimensions).]

    Just as good coding practice I’d suggest we change it to:
    x = index*width;
    [x,value[1]]

    which uses the layer width for the multiplier rather then 640. (Slightly irrelevant as this would break using different width images in the same project, but you know, it’s just better 😉

    Anyway, with that you can use the oh-so-handy Edit > Copy Expression item to copy the expression from the property, then select all layers and paste!

    From there you could parent them all to a null and move them about as one etc.


    Only in after effects do children get to pick and whip their parents.
    https://hennell-online.co.uk

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