Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › X scale by time

  • Posted by Harald Weist on December 20, 2019 at 12:01 pm

    Hi there
    i´m a newbee and have a question. i try to tweak an expression i found here.
    It works fine but it scales in both directions. it should only scale in x direction but never under 100%. tnx in advance
    *h

    segMin = 1; //minimum segment duration
    segMax = 5; //maximum segment duration
    minVal = 100;
    maxVal = 130;

    end = 0;
    j = 0;
    while ( time >= end){
    j += 1;
    seedRandom(j,true);
    start = end;
    end += random(segMin,segMax);
    }
    s = random(minVal,maxVal);
    endVal = [s,s];
    seedRandom(j-1,true);
    dummy=random(); //this is a throw-away value
    s = random(minVal,maxVal);
    startVal = [s,s]
    ease(time,start,end,startVal,endVal)

    Harald Weist replied 6 years, 9 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    December 20, 2019 at 5:25 pm

    Try it this way:


    segMin = 1; //minimum segment duration
    segMax = 5; //maximum segment duration
    minVal = 100;
    maxVal = 130;

    end = 0;
    j = 0;
    while ( time >= end){
    j += 1;
    seedRandom(j,true);
    start = end;
    end += random(segMin,segMax);
    }
    endVal = random(minVal,maxVal);
    seedRandom(j-1,true);
    dummy=random(); //this is a throw-away value
    startVal = random(minVal,maxVal);
    s = ease(time,start,end,startVal,endVal);
    [s,value[1]]

    Dan

  • Harald Weist

    December 20, 2019 at 5:52 pm

    Hey Dan
    you nailed it !! Works perfect,
    tnx *h

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