Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects script to change image at marker

  • script to change image at marker

    Posted by Rowan Bilkey on August 12, 2009 at 2:29 am

    Hi guys, I am after a script to change an image periodically. Basically I have a long comp where I have a logo on stage for the entire comp, but the logo needs to change 90 times throughout the comp from a database of 10 different logos. i hope that makes sense. I have a similar situation with a text box, but I have a script that will change the text to the next line in a designated .txt file on each marker. is there some way to do this with the images? thanks in advance

    Kevin Camp replied 17 years ago 2 Members · 2 Replies
  • 2 Replies
  • Kevin Camp

    August 12, 2009 at 3:14 pm

    it’s probably not worth the time to try and write and debug a script (or even and expression) to do this.

    figure out how long each logo duration needs to be to fill the comp duration (comp duration / 90). then just drag the 90 logo files into the comp. with them still selected, position the cti to the duration that the logos need to be and hit opt-] (mac), alt-] (pc) — that’s opt/alt-right-bracket — to trim them all. still with them selected, choose animation>keyframe assistant>sequence layers… choose not to overlap them and hit ok.

    all the layers should now be sequenced and it should only take a minute or so to do.

    i should also note that the layers are sequenced in the order that you select them — ie, the first selected layer will be the first layer in the sequence… so you may need to reselect them in the correct order. so, maybe it will take 2-3 minutes to complete the process.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Kevin Camp

    August 12, 2009 at 3:51 pm

    if you needed needed more flexibility to jockey the logos around (order wise) then this little expression would make it easy to modify the order by just changing the layer order the layer(s) in the time line.

    so, drag all the logos into the comp (keep them full length layers) and paste this into the opacity expression field of a single logo layer:

    duration = 10; // set duration in seconds
    if (Math.floor(time/duration) == index-1) 100 else 0

    set the duration as needed (value in seconds) then, select the opacity property and choose edit>copy expression only, select the other logo layers and choose edit>paste to add the expression to all the logo layers.

    now as the animation plays, the logos layers will turn on/off one by one based on the duration that was set. it you need to modify the order of the logos, simply modify the layer order in the timeline (drag them up or down). the topmost layer will be first to play.

    note: the expression assumes the logo layers will be at the top of the comp, ie, the first logo will be layer 1. if that is not the case, modify the part of the expression that says index-1 to be index minus the topmost logo layer number. so, if the top most logo layer was layer 9, that part of the expression would be index-9.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

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