I want to use four markers to control the timing of the animation.
There are markers "inStart", "inEnd", "outStart", "outEnd".
1.Before the beginning of the first marker "inStart" must always be 0, so that the animation starts after the first marker;
2.There must be an animation time from the "inStart" marker to the "inEnd" marker;
3.From the "inEnd" marker to the "outStart" marker, there must be a static frame time, that is, a temporary pause;
4.From the marker "outStart" to the marker "outEnd" there should be a reverse animation;
There is some error in the expression, but due to the fact that I am not good at writing expressions, I cannot understand what is the reason and what is wrong here.
Error message: undefined value used in expression (could be an out of range array subscript?)
Please help solve this problem.
Code: Select all
//Time Remap Code
compDur = comp("Animation_1").duration-thisComp.frameDuration; // Comp and Frame Duration
inStart = thisComp.marker.key(1).time; // In-animation start point time
inEnd = thisComp.marker.key(2).time; // In-animation end point time
outStart = thisComp.marker.key(3).time; // Out-animation start point time
outEnd = thisComp.marker.key(4).time; // Out-animation end point time
// Value before in-animation start point time
if(time<inStart || time==inStart){
0;
}
// Span between in-animation start and end point time
if(time>inStart){
linear(time,inStart,inEnd,0,compDur);
}
// Span between out-animation start and end point time
if(time>outStart){
linear(time,outStart,outEnd,compDur,0);
}