Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions footage switch with expression is there?

  • footage switch with expression is there?

    Posted by Kristijan Mrsic on August 25, 2010 at 12:38 pm

    Hi all,
    I need help on this one. I have one comp and in it one clip.
    Now, I would like to add slider control with value 1-12 to switch between 12 different clips. Basically replacing that 1 clip with one of 12 but with a slider drag.
    Is there a way to that?

    Thank you.

    Kristijan

    Kristijan Mrsic replied 15 years, 11 months ago 2 Members · 2 Replies
  • 2 Replies
  • Kevin Camp

    August 26, 2010 at 8:20 pm

    i don’t think you can do that with an expression quite like that…

    you could put all the footage layers into one comp, then add an expression to the opacity property of each footage layer that would set the opacity (either 0 or 100) based on the value of the slider. that slider could be in a separate comp than the footage comp, if you needed to keep the footage as a single layer — the footage would be in a comp that would be nested in the comp with the slider.

    to do something like that, first add the 12 clips to a new comp (i’ll call ‘main’) in the order that you want (1 being topmost, 12 being last). select all those layers and choose layer>pre-compose.

    in the main comp add a slider to the nested footage comp. in the footage comp, add an expression to the opacity property of a footage layer that looks something like this:

    if (Math.floor(comp(“main”).layer(“footage comp”).effect(“Slider Control”)(“Slider”))==index) 100 else 0;

    then, with that opacity property selected choose edit>comp expression only. select the other footage layers and choose edit>paste.

    now if you go back to the main comp, you should be able to edit the value of the slider to make the different footage layers visible.

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Kristijan Mrsic

    August 27, 2010 at 5:07 am

    Hi,

    Thank you, that’s exactly what I did, without floor function.
    And since this comp is going to be duplicated many times I alsu used index function so in the expression I only need to change the name of the slider for it to work. (And do copy expression only).

    Kristijan

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