Join Angie Taylor for an in-depth discussion in this video Looping keyframed values, part of After Effects Expressions for Premiere Pro Editors.
After Effects is the ideal choice of software when it comes to adding visual effects to your shots. And in this edit I've added some color correction to this clip and I've also added some lightening, and I've used key frames and after effects to animate the lightening. Let's just have a look at the edit in Premier Pro first. (recording We've also got footage for adding Visual Effects two-) So you see there's one lightening strike in there. This is a dynamically linked composition so I'm going to go to Edit Original to open up the original in After Effects.
And you'll see here I've got the Lightening effect applied to this layer and if we preview that you'll see that I've animated the direction of the lightening to create these two lightening strikes. And I've done that with two sets of key frames, here you can see the lightening going in out, in out again and then I've got a held key frame here. We'll talk a little more about that in a second. So if I want to create several lightening strikes in order to loop it all I need to do is just Alt-click on the stopwatch to add my Expression and we're going to use the Expression Language menu which is activated by this button here.
So I'm going to click on that and go down to the Property section and choose loopOut. If we apply that it writes the expression for me and the expression reads loopOuttype = "cycle", number of Key frames equals zero Now we're going to remove the text at the end there now this is in parentheses so make sure you don't select the parentheses but just select comma number of key frames equals zero and we'll just delete that. All we're going to use is the loop type, now the word type equals is just there to help you, it's not part of the expression so we can also delete that.
So we just have loopOut and then in parentheses and quotation marks we have the word ("cycle") And that makes our expression work if we preview that we'll now see we get the original two lightening strikes but if we keep playing you should notice that we get another couple of lightening strikes later on. Now in order to see what's happening it's a good idea to look at the Graph Editor. So if we click on the Graph Editor button and open it up you can see the original two lightening strikes that were created by key frames.
If you click on this button here and this is the Show Post Expression Graph button, if we click on that we can also see all the other lightening strikes. And you'll see what it's doing it's looping these two groups of key frames. Now how is it looping them? Well it's looping them and then it's using this third key frame, or when I say third I mean third in the groups of key frames as an anchor point and this is why I create that extra key frame.
It means that I can drag that key frame around to decide where my other lightening strikes happen. Okay so it's looping not only these two groups of key frames but also this key frame as well and that gives me a handy control to drag those lightening strikes along the timeline. It's doing a cycle loop it's going through this process and then starting again and then going through this process again over and over again. There is another type of loop call pingpong which will make it go backwards and forwards.
Let me show you that. If we click off the Graph Editor button come into Expression and type in the word pingpong. All one word. Make sure I get rid of that e, and then go back to our Expression graph, you'll see that it's a different shape now it's going backwards and forwards. And again I can just adjust that last key frame there to decide where I want it to be. Now if I wanted space between these two elements, what I can do is create a key frame here as well.
So I could go back to my value and just add a key frame at the current time and that allows me to space it on that side as well. I get more control over the spacing of these lightening strikes and now you can see it goes forwards backwards forwards backwards and we get these lovely repeating lightening strikes. So you can use the loop expression for any kind of looping key frames but I just thought this was quite a useful way of using the key frames to create a repeating visual effect shot like this.
And the great thing is if we want to retime any of this it's very easy to retime the whole animation. Just by selecting the key frames we want to retime, and then squashing or stretching the animation. And you'll see that if we retime the first two lightening strikes that all the others update too. So if I do that and then we just jump back to Premier Pro, if I just ran preview a little bit of this, you'll see we've now got much faster lightening strikes coming in quicker and more regularly.
And now I jump back to Premier Pro and if we have a look at it in here (recording We can also get footage for adding Visual Effects two as well as-) You'll see we've now got much more quick and regular lightening strikes. So that's how you can use the loop expression to loop key frames and they can be any kind of key frames at all.
After Effects Expressions for Premiere Pro Editors is a creative, project-based workshop. Editors take a basic Premiere Pro edit and bring it to life using After Effects expressions and Dynamic Link, following author Angie Taylor's expert instructions. The concepts are broken down into manageable 3–5 minute videos, covering techniques such as randomizing effects, linking animation and color to sound, automating animation, and more.
- Linking footage from Premiere Pro in After Effects with Dynamic Link
- Understanding the expression language
- Automating animation with expressions
- Randomizing effect properties
- Linking color and light changes to audio
- Creating camera shake with a wiggle expressions
- Linking keyframes to create a lightening strike effect
- Synchronizing color and other design elements
- Creating amazing text animations