Copy link to clipboard
Copied
Hi,
I'm looking to create an expression that does the same as this opacity expression, which fades in and out, but for scale
fadeInTime = .15; // fade in time (seconds)
fadeOutTime = .15;
Math.min(linear(time,inPoint,inPoint +
fadeInTime,0,100),linear(time,outPoint -
fadeOutTime,outPoint,100,0))
I've tried this but it doesn't work.
fadeInTime = .15;// fade in time (seconds)
fadeOutTime = .15;
Math.min(linear(time,inPoint,inPoint +
fadeInTime,[0,0],[100,100]),linear(time,outPoint -
fadeOutTime,outPoint,[100,100],[0,0]))
this works on it's own for the in but i can't make it work for the out!!
fadeInTime = .15;// fade in time (seconds)
fadeOutTime = .15;
linear(time,inPoint,inPoint +
fadeInTime,[0,0],[100,100])
Can you help?
Thanks
Chris
This should work:
fadeInTime = .15;
fadeOutTime = .15;
if (time < (inPoint+outPoint)/2){
linear(time,inPoint,inPoint+fadeInTime,[0,0],[100,100]);
}else{
linear(time,outPoint-fadeOutTime,outPoint,[100,100],[0,0]);
}
Dan
Copy link to clipboard
Copied
This should work:
fadeInTime = .15;
fadeOutTime = .15;
if (time < (inPoint+outPoint)/2){
linear(time,inPoint,inPoint+fadeInTime,[0,0],[100,100]);
}else{
linear(time,outPoint-fadeOutTime,outPoint,[100,100],[0,0]);
}
Dan
Copy link to clipboard
Copied
Thank you, thank you,
Where was I going wrong? is it easy to explain?
Copy link to clipboard
Copied
The method that you were using relies on a Math.min() trick that works with single values varying between 0 and 100, but not with arrays, like scale values. You could make that method work like this though:
fadeInTime = .15;
fadeOutTime = .15;
s = Math.min(linear(time,inPoint,inPoint + fadeInTime,0,100),linear(time,outPoint - fadeOutTime,outPoint,100,0));
[s,s]
Dan
Copy link to clipboard
Copied
Thanks.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now