Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Slider Controls

  • Posted by Max Baxter on April 8, 2014 at 6:10 pm

    Hi, I don’t know if this in the right area of of the forum for after effects, but this is also getting posted into other ones.

    I want to take multiple PSD files into after effects and then use a slider control to go through them all? for example at the start of the slider it is one image and then each whole number is a different image? (I know how to make the number rounded up so that’s not a problem it’s just the images part I’m struggling with.

    Any help will be useful

    Max Baxter replied 12 years, 1 month ago 3 Members · 7 Replies
  • 7 Replies
  • George Goodman

    April 9, 2014 at 1:47 pm

    Just do it with opacity. So lets say you have 5 images you want to choose between. You would just write an expression that says, when slider is 1, have opacity at 100 otherwise at 0. For the second image, it would just be, when slider is at 2, 100 otherwise 0. I’ve done the first one for you below. (I put the slider on a null object). Simply change the “1” after x== to “2” for the next layer and so on.

    x=thisComp.layer("Null 1").effect("Slider Control")("Slider");
    on=100;
    off=0;
    if (x==1) on else off

    “|_ (°_0) _|”

    Sincerely,

    George

  • Max Baxter

    April 10, 2014 at 11:13 am

    To Clarify, do I put the images in the composition and then pick whip the images to the opacity on the null target?

  • George Goodman

    April 10, 2014 at 1:59 pm

    No, just put the expression I wrote in the opacity property of each image. You will have to change one detail of each images expression though. So in the first image, it will say x==1 (the one I actually wrote), in the second, change it to x==2, and the third x==3. When you do this, your just telling it that when the slider is on that number, to show the image, if it’s not, then don’t. For this to work the way I’ve written it, the slider should be on a null object called Null 1

    “|_ (°_0) _|”

    Sincerely,

    George

  • Darby Edelen

    April 10, 2014 at 4:17 pm

    I’d put all of the Photoshop files into one composition, trim them each to be 1 frame long and then use Animation > Keyframe Assistant > Sequence Layers… with no overlap. This will place each layer after the previous. The composition’s duration will need to be long enough to contain all of the PSD files in sequence (number of layers * 1 frame per layer = number of frames of duration for the composition).

    Then take put that composition into a new composition and apply time-remapping to it. Apply an Effect > Expression Controls > Slider Control to the layer and then apply this expression to the time-remapping on the layer:

    n = Math.floor(effect("Slider Control")("Slider"));
    framesToTime(n);

    Darby Edelen

  • Max Baxter

    April 10, 2014 at 4:21 pm

    Okay, it’s all working now for that. Thank you very much this has saved me a lot of time.

  • George Goodman

    April 10, 2014 at 4:25 pm

    Ya, Darby’s suggestion is better since mine involves a bunch of variations of the expression. If you did use my version though, you would want to use hold keyframes on the slider so that it just jumps to the next number.

    “|_ (°_0) _|”

    Sincerely,

    George

  • Max Baxter

    April 11, 2014 at 1:16 pm

    Thank to both of you, both methods work really well I do this that Darbys way works a lot better and is quicker for what I’m doing. Again thank you very much.

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