ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression to move keyframes to the end of a layer

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ole Petersen
Expression to move keyframes to the end of a layer
on Jun 14, 2015 at 6:19:45 pm

Hello,
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.

Kind Regards,
Ole


Return to posts index

Dave LaRonde
Re: Expression to move keyframes to the end of a layer
on Jun 15, 2015 at 2:24:47 pm

Ugh. Messing with audio in AE isn't good -- AE stinks at audio.

Is there a reason why you feel you have to do this in AE? Please describe your work flow.

Dave LaRonde
Promotion Producer
KGAN (CBS) & KFXA (Fox) Cedar Rapids, IA


Return to posts index

Ole Petersen
Re: Expression to move keyframes to the end of a layer
on Jun 15, 2015 at 3:39:33 pm

It's for a Music channel, basically to "visualize" the Music. Just to make it completely automatic, I would like for it to fade out automatically.

I know that AE is bad for Audio but for something like that it's quite good.


Return to posts index


Walter Soyka
Re: Expression to move keyframes to the end of a layer
on Jun 15, 2015 at 4:45:15 pm

[Ole Petersen] "is there an expression, which adjusts the keyframes of a solid to the end of the Audio Amplitude?(for the opacity)"

Can you shot a screenshot of what this looks like in your project?

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Ole Petersen
Re: Expression to move keyframes to the end of a layer
on Jun 15, 2015 at 5:40:45 pm

Sure


Return to posts index


Walter Soyka
Re: Expression to move keyframes to the end of a layer
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);
value*linear(time,l.outPoint-0.5,l.outPoint,1,0)


This will start the fade a half-second before the track ends.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index


Ole Petersen
Re: Expression to move keyframes to the end of a layer
on Jun 16, 2015 at 12:09:54 pm

Thank you, works perfectly!


Return to posts index

Ole Petersen
Re: Expression to move keyframes to the end of a layer
on Jun 16, 2015 at 12:16:47 pm

Just curious - is it possible with the Main Comp length too?


Return to posts index

Walter Soyka
Re: Expression to move keyframes to the end of a layer
on Jun 16, 2015 at 12:30:15 pm

No, the duration of a composition cannot be controlled by an expression. Only keyframeable properties can be controlled by expressions.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index


Ole Petersen
Re: Expression to move keyframes to the end of a layer
on Jun 16, 2015 at 4:41:51 pm

I noticed that the fade in isn't there anymore, how can I fix it?

Ole


Return to posts index

Walter Soyka
Re: Expression to move keyframes to the end of a layer
on Jun 16, 2015 at 7:05:24 pm

Is the music track longer than the containing comps?

Do you still have those two "fade out" keyframes in there? If so, remove them. You can leave the "fade in" keyframes intact.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Ole Petersen
Re: Expression to move keyframes to the end of a layer
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);
linear(time,l.outPoint-5,l.outPoint,0,100)
// 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..


Return to posts index


Walter Soyka
Re: Expression to move keyframes to the end of a layer
on Jun 16, 2015 at 8:02:52 pm

[Ole Petersen] "with "value*" in there it didn't work really for me, also with the 1 and 0. (After Effects CC 2014)"

What didn't work for you about it?

That was there to fade out of whatever the existing value was; in other words, to preserve your keyframed fade in.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Ole Petersen
Re: Expression to move keyframes to the end of a layer
on Jun 16, 2015 at 8:06:59 pm

If I keep the value* in, it does fade in but doesn't fade out basically.


Return to posts index

Walter Soyka
Re: Expression to move keyframes to the end of a layer
on Jun 16, 2015 at 8:08:02 pm

Hmm. It should. Can you post a project file (no footage necessary)?

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index



Walter Soyka
Re: Expression to move keyframes to the end of a layer
on Jun 16, 2015 at 9:00:40 pm

Now I understand; you're fading a black solid in, not fading it out. I was thinking of this backwards.

l = comp("Music").layer(2);
if (time < 5) linear(time,0,5,100,0) else linear (time,l.outPoint-5,l.outPoint,0,100);


Translated to English:

If the time is less than 5 seconds, as time goes from 0 to 5, make opacity go from 100 to 0.

If the time is greater than 5 seconds, as time goes from five seconds before the end of the music layer to the end of the music layer, make opacity go from 0 to 100.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Ole Petersen
Re: Expression to move keyframes to the end of a layer
on Jun 17, 2015 at 12:20:14 pm

Perfect, thank you Mr. Soyka!


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]