Answered
Need Help with expression. Play auto fade in/out using 'Slider'
Hey guys, does anyone know how to apply this sort of expression to the opacity parameter, to play auto fade every time when 'Slider' has a keyframe?
Hey guys, does anyone know how to apply this sort of expression to the opacity parameter, to play auto fade every time when 'Slider' has a keyframe?
Not sure exactly what you're doing, but I think you need to find the nearest keyframe to the current time, with something like this:
fDur=0.5; //fade time
p = essentialProperty("Rows");
if (p.numKeys > 0){
n = p.nearestKey(time).index;
t = p.key(n).time;
if (time < t){
linear(time, t-fDur, t,100, 0);
}else{
linear(time, t, t+fDur, 0, 100);
}
}else
valueAlready have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.