Creative Communities of the World Forums

The peer to peer support community for media production professionals.

  • Posted by Alexander Weil on May 13, 2014 at 3:40 pm

    hey
    i’m not an expression expert but i know a little bit and what i dont know i get from this great forum.
    at the moment i got an scale over time expression.
    its working but i want to have more control over it.
    i want to decide between scale from “in- to outpoint” and “scale over a specific time” with a simple checkbox

    this is my code

    how can i get the the solution from this if express into my “scaleUpTime” ?

    scaleUpTime = if (effect("Checkbox")("Checkbox") == 1) a
    else aa ;

    this doesnt work.
    i had this question very often but always found a way to do it in a different way

    i’m pretty sorry for my bad english 🙁

    per = value[0,0]+(value[0,0]/100)*effect("Scale over Time Percent")("Slider");
    a = effect("time")("Slider") ; //time control via slider
    aa = outPoint-inPoint;

    if (effect("Checkbox")("Checkbox") == 1) a
    else aa

    startScale = value[0,0]; // percent of Scale at start
    endScale = per ; // percent of Scale at end
    scaleUpTime = 3; // time to scale up from inPoint in seconds

    s = [endScale - startScale] /scaleUpTime;
    sx = startScale + ((time-inPoint) * s);

    ss = clamp(sx,endScale,startScale);

    [ss,ss]

    Alexander Weil replied 12 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 13, 2014 at 4:33 pm

    Basically, I guess you’d just replace this:

    scaleUpTime = 3;

    with this:

    if (effect(“Checkbox”)(“Checkbox”) == 1){
    scaleUpTime = a;
    }else{
    scaleUpTime = aa;
    }

    or this more compact version:

    scaleUpTime = (effect(“Checkbox”)(“Checkbox”) == 1) ? a : aa;

    Dan

  • Alexander Weil

    May 14, 2014 at 7:46 am

    its so simple … thanks a lot dan !

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