Activity › Forums › Adobe After Effects Expressions › start/stop expression at specific time
-
Clayton Krause
November 7, 2016 at 6:35 pmGreat thread. Lots of information. I’m going to resurrect it with another question on delaying an expression.
What Dan posted up is fantastic, IF you know what frame you need to start something at. In my specific situation I do not know the specific frame…
I have 4000 little cubes scattered throughout my canvas. They are all duplicates with the same expression. The cubes are all solids with a Hue/Sat adjustment applied to it. There is an animated Null that goes from the bottom up to the top of the canvas. The expression for the lightness in the Hue/Sat reads-
When the Null Y pos exceeds a specific cube’s Null Y pos, have the cube Hue/Sat lightness turn to a higher value. I got it working, but I want to add easing to that value. Instead of snapping from valueOff to valueOn, have it ease there.
I don’t know the specific hit frame on each cube and ultimately if I did, that information would be useless as this expression which controls the lightness cannot be hard coded, but needs to revolve around the unique position of that unique cube in relation to the one animated null.
Anyone have any ideas on how to work this? If my description didn’t make sense let me know and I’ll post more about it.
-
Clayton Krause
November 7, 2016 at 7:08 pmSorry to be annoying and make a double post on this.
What I need to figure out (I think) is how to return the specific time that a conditional executes. What is the exact time that the null posY exceeds the cube posY and use that to stagger the ease –
stagger = specific time that null posY exceeds cube posY
easeIn(time-stagger, 0, 10);Don’t know how to get that information. In part because the variables don’t get stored and are refreshed on each frame.
Thanks for any help!
-
James Valpy
May 10, 2020 at 11:58 pmHey Dan,
Thanks for sharing your work, really helpful for people like myself ????
I am working on an expression and cannot get it to work properly, please could you help? I am trying to make an expression that is on a contrast parameter, the expression should flash the contrast to 100 periodically with a delay offset for each layer that I apply the expression to. Imagine the flashing leading lights on a runway…
I had to use thisLayer.name because I’m working in 3d and index is the wrong way round for how I have positioned my layers in space. Currently this expression makes the flash on the first intended instance but doesn’t repeat.
Cheers!
beginFrame = (framesToTime(thisComp.layer("Controls").effect("Flash Delay")("Slider"), fps=.04/thisComp.frameDuration)*(Math.round(thisLayer.name)-1))+ thisComp.layer("Controls").effect("Flash Start")("Slider"); // start frame
t = time - framesToTime(beginFrame);
if (t >= 0) {
f = time - beginTime;
frequency=thisComp.layer("Controls").effect("Flash Frequency")("Slider"); // Hz
burstlength=2; // in framesf=time%(1/frequency);
t < framesToTime(burstlength) ? 100 : 0;;
}else
0James Valpy
Black Dog Video
Reply to this Discussion! Login or Sign Up