ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

X scale by time

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Harald Weist
X scale by time
on Dec 20, 2019 at 12:01:54 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)


Return to posts index

Dan Ebberts
Re: X scale by time
on Dec 20, 2019 at 5:25:56 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



Return to posts index

Harald Weist
Re: X scale by time
on Dec 20, 2019 at 5:52:56 pm

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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2020 CreativeCOW.net All Rights Reserved
[TOP]