//1 Реверс анимации по маркеру
//ставим маркер и добавляем экспрешн на любой параметр с ключами
//ищем номер ближайшего маркера слева
//если надо пускать сразу много анимаций в обратку
//одновременно - ставим маркер на композиции
//и меняем все marker на thisComp.marker
n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time) n--;
}
if(n>0){
try{
t = time-marker.key(n).time; if(n%2==1){
lastKeyTime = thisProperty.key(thisProperty.numKeys).time;
thisProperty.valueAtTime(lastKeyTime-t);
}
else{
thisProperty.valueAtTime(t+thisProperty.key(1).time);
}
}
catch(err){value};
}
else value
//2 Авто прозрачность в начале и конце слоя
//Autofade: Add to opacity
transition = 20; // transition time in frames
if (marker.numKeys<2){
tSecs = transition / ( 1 / thisComp.frameDuration); // convert to seconds
linear(time, inPoint, inPoint + tSecs, 0, 100) - linear(time, outPoint - tSecs, outPoint, 0, 100)
}else{
linear(time, inPoint, marker.key(1).time, 0, 100) - linear(time, marker.key(2).time, outPoint, 0, 100)
}
//3 Автозум в начале и конце слоя
//Snap zoom in and out: apply to scale
snapScale = 300; //percent of scale to zoom
trans = 4; // transition time in frames
trans = trans * thisComp.frameDuration;
inTrans = easeOut(time, inPoint, inPoint + trans, [snapScale,snapScale], [0,0]);
outTrans = easeIn(time, outPoint, outPoint - trans, [0,0], [snapScale, snapScale]);
value+ inTrans + outTrans