Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions range selector function inside expression selector?

  • range selector function inside expression selector?

    Posted by Santi Agustí on November 17, 2016 at 3:29 am

    Hi!
    I am using an expression selector to start a scale in animation once a given marker is reached. The problem is, I’m using a range selector to make the scale occur at the desired range. (The range selector Start and End values are tied to 2 sliders, btw)
    Everything works fine, except one think I’m not able to fix: as I’m using the textIndex on the main expression, but it is then limited by the range selector, once the marker is reached, the action is delayed xxx frames if the range is not 0 (so if the selected range is 12 to 18, it takes a while to start the scale from the marker, because it’s already triggered but not visible)

    Is there a way to be able to get rid of the range selector and have all the expression built inside the expression selector?
    Or maybe just doing some formula like myDelay=textIndex-startRange? I tried but no luck at all.

    Thanks!

    This is the expression I have right now:

    delay=framesToTime(2);
    myDelay = (textIndex-1)*delay;
    freq = 5;
    decay =5;
    dur =framesToTime(20);
    m = marker
    n = 0;
    try {
    if (m.numKeys > 0){
    n = m.nearestKey(time).index;
    if (m.key("go").time > time) n--;
    if (n > 0){
    t = time - (m.key("go").time + myDelay);
    startVal = 0;
    endVal = 100;
    }
    if (t < dur){
    s = ease(t,0,dur,startVal,endVal)
    }else{
    amp = (endVal - startVal)/dur;
    w = freq*Math.PI*2;
    s = endVal + amp*Math.sin((t-dur)*w)/Math.exp(decay*(t-dur))/w;
    }
    [s,s]
    } }catch(err) {

    0
    }

    Santi Agustí replied 9 years, 8 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

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