Activity › Forums › Adobe After Effects Expressions › timeRemap play
-
Flo Stanger
May 11, 2022 at 2:24 pmWow Dan! This is such a helpful Expression for triggering Time Remap.
I am trying to slightly modify it, so I can also specify a second threshold (slider-driven) that will set the time remap of the pre comp to a different time.
But all my attempts so far failed. To understand what I am trying to solve:
I am visualising the development of clubs/bars within the last century on a map. The information of each of the ~300 clubs/bars is loaded into AE via an .csv file (Location, Opening Year, Closing Year), each one being a (identical) pre comp.
So when the years-slider (starting 1900 till 2022 at the end) reaches the opening year of a club, this pre comp does start the animation (Opening Animation). Nice!
How can I add a second “treshhold” (Closing Year), that will make the pre comp continue playing at a later point in time (Closing Animation)?
Thx so much for any ideas and your awesome support, community.
open = 1965;
close = 2012;
year = thisComp.layer(„controller“).effect(„year“)(„Slider”);
check = false;
frame = Math.round(time / thisComp.frameDuration);
while (true){
t = frame * thisComp.frameDuration;
if (check){
if (year.valueAtTime(t) < open){
frame++;
break;
}
}else if (year.valueAtTime(t) >= open){
check = true;
}
if (frame == 0){
break;
}
frame–
}
if (! check){
t = 0;
}else{
t = time – frame * thisComp.frameDuration;
}
-
Dan Ebberts
May 11, 2022 at 3:55 pmIt will probably look something like this (assumes that opening animation starts at time = 0 and closing animation starts at time = 5):
open = 1965;
close = 2012;
closeAnimStart = 5;
year = thisComp.layer("controller").effect("year")("Slider");
frame = timeToFrames(time);
t = time;
if (year >= close){
while (year.valueAtTime(t) >= close){
frame--;
t = framesToTime(frame);
}
t += thisComp.frameDuration;
closeAnimStart + time - t;
}else if (year >= open){
while (year.valueAtTime(t) >= open){
frame--;
t = framesToTime(frame);
}
t += thisComp.frameDuration;
time - t;
}else{
0;
}
-
Flo Stanger
May 11, 2022 at 4:33 pmWooooow. Thanks you so much for your quick support! That’s amazing.
For a moment it seemed to work, but now it freezes AE and produces a “Timeout while waiting for the engine” on the last
t = framesToTime(frame)
I don’t fully understand how this code is working yet, to be honest 🙂
So very carefulguess: Could it help to give the last while() a try()/Catch error around?
Reply to this Discussion! Login or Sign Up