-
Trigger animation on passing Nth marker in main timeline
Hey guys,
I have the following challenge.
In order the make my animation more flexible I’d like to start an animation in a secondary comp when the main comp passes a specific comp marker. I’ve set a number in the “Chapter” field of the marker so I can check wheter it’s the right animation.This works pretty good, but as soon as a new marker is closer to the current time then the one that triggers the animation, it’s being reset the default values.
What I’d like is to set a “global” variable that will not refresh on each frame as soon as the specific marker is in the past. So that my animation (in this case a linear opacity fade in) stays at 100% in stead of falling back to 0 as soon as time approaches the new marker.
This way I hope to achieve that by moving a marker on the main timeline, all animations on nested comps will automatically start at the right time.
I know this all sounds pretty vague, but I sinerely hope some one can help me out with this.
Thanks!!
Cheers,
Allardm = comp('SmartBox Overlay').marker
hasPassed = 0;if (m.numKeys > 0) {
next_frame=m.nearestKey(time);if(next_frame.chapter == 1) {
t = next_frame.time;
hasPassed = 1;
if (time > t) {
ease(time,t,t+0.5,0,100);
} else {
0
}
} else {
if(hasPassed == 1) {
100
} else {
0
}}
} else {
0
}