Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Help for expression that lets a slider control counts…

  • Help for expression that lets a slider control counts…

    Posted by Marten Kopp on May 10, 2009 at 6:05 pm

    Hi dear friends,

    Once again I find myself in a difficult position. The thing this time is that I need an expression that needs to do some math for a slider.

    I got 1 slider control witch controlles the zoom of a camera. It goes between 4 and 5 (in witch 5 makes the target full screen and 4 zooms out a little bit).

    And I got another slider control witch is actually needed to count the times the first went from 5 to 4 and counterwise.

    So SC1 starts at 5 and SC2 starts at 1. If SC1 goes to 4, SC2 needs to go to 2. And if SC1 goes back to 5, SC2 needs to stay at 2. But if SC1 goes back to 4, SC2 needs to go to 2.. etc.

    Here something I tried:

    hoogte = thisComp.layer("height").effect("Slider Control")("Slider");
    yes = effect("SureTarget")("Slider").(value +1);
    no = effect("SureTarget")("Slider");

    if (hoogte = 5){
    yes}

    if (hoogte = 4){
    no}

    But that does not the thing I want.

    Thanks for any help.

    Marten Kopp replied 16 years, 12 months ago 2 Members · 2 Replies
  • 2 Replies
  • Marten Kopp

    May 10, 2009 at 7:04 pm

    Hi Dan,

    Thanks for your quick reply. I allready tried another way. It works a little now.

    What I actually try to accomplish is that (i use the suretarget plugin from videocopilot) when I move around between target, the camera zooms out a bit.

    I got this expression now:

    nummer = thisComp.layer(“Null 5”).effect(“SureTarget”)(“Slider”);

    if (nummer == 1 || nummer == 2 || nummer == 3 || nummer == 4 || nummer == 5 || nummer == 6 || nummer == 7 || nummer == 8 || nummer == 9 || nummer == 10 )
    {5}
    else
    {2}

    It’s a bit amature I guess, but it works for now.

    My new problem is how to let the camera ease while its zooming in or out.

    The current situation is:

    I got 1 Null object witch controlls the suretarget plugin. It’s manually keyframed.

    Another Null is copying the output from the slider witch the plugin use, into its own slider control. On this one I have the expression witch you saw above.

    Finally, my camera (cam optionszoom) has the expression:

    thisComp.layer(“height”).effect(“Slider Control”)(“Slider”)*100

    That multiplies the output 5 or 2 from the second Null to give the camera some altitude.

    But how can I ever manage to let the cam ease its zoom?

  • Dan Ebberts

    May 10, 2009 at 7:06 pm

    You can’t do it the way you are trying to do it. Variables don’t presist from frame to frame, they get reset at each frame.

    Are you using keyframes for the zoom slider? If so, it seems like you could just use (your slider).numKeys divided by 2 (or something like that anyway) to figure out how many transitions you have made.

    Dan

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