Expression to move keyframes to the end of a layer
by Ole Petersen on Jun 14, 2015 at 6:19:45 pm
I was looking around quite a bit now for a solution but I couldn't find one.
I've got an Audio Amplitude which will be changed everytime for every render process, is there an expression, which adjusts the keyframes of a solid to the end of the Audio Amplitude?(for the opacity)
The Fade in Keyframes are already put and should not be changed, just the 2 last keyframes which should fade out the whole thing.
Re: Expression to move keyframes to the end of a layer by Walter Soyka on Jun 16, 2015 at 12:20:17 am
Assuming that the sound track is always the second layer in the Musik comp, and assuming that Main and Musik comps are synchronized in time, Alt+click the stopwatch on the opacity property of the layer(s) you with to fade according to the length of the music track and paste the following expression:
l = comp("Musik").layer(2);
This will start the fade a half-second before the track ends.
Re: Expression to move keyframes to the end of a layer by Ole Petersen on Jun 16, 2015 at 7:32:20 pm Last Edited By Ole Petersen on Jun 16, 2015 at 7:40:34 pm
The Track is within the Composition lengths, I did remove the fade out keyframes and left the fade in there like it should be.
But I did edit the expression a little bit: l = comp("Musik").layer(2);
// I did remove the "value*" and did change it from "linear(time,l.outPoint-0.5,l.outPoint,1,0)"
// to "linear(time,l.outPoint-0.5,l.outPoint,0,100)
with "value*" in there it didn't work really for me, also with the 1 and 0.
(After Effects CC 2014)
I'm a complete newbie in using expressions too, as you might've guessed, really sorry to bother you with my newbie things..