In this post I will show you how to use markers to trigger animation without keyframes in After Effects. So let’s dive right in!
Here we are in After Effects. As you can see, I have an IN POSITION
and OUT POSITION.
The IN and OUT POSITION determine the beginning position and end position of my animation. So it doesn’t matter where we place the IN or OUT POSITION. It will always go from in to out.
Then we have two markers in our timeline.
The first marker determines the beginning animation. That’s why it’s called start and the second marker triggers the end animation.
So if I move my time indicator in the timeline and as soon as I pass my first marker, that’s what’s going to trigger my animation. It is going to play out my animation until I get to the end marker.
It doesn’t matter where we place the start and end markers. It will always trigger the animation. Let me show you how to set it all up.
Alright, so the first thing I’m going to do is select my logo and hit P to reveal the position property.
As you can see we have our old expression.
So I’m going to get rid of it by holding ALT+Left Click on PC or OPT+Left Click on a Mac.
Then to create a new one, we need to again ALT+Left Click on PC or OPT+Left Click on a Mac on the stopwatch icon. You should see a white text box appear in the timeline.
I’m going to set some variables inside of the white text box. The first one is going to be startMarker and we are going to give it a value.
So smartMarker is going to be thisComp.marker.key(). In the () we are going to determine the index. The 1st one is going to be START and the 2nd is going to be END. So I am going to say 1 for START.
Here is what it should look like: startMarker = thisComp.maker.key(1).
However, that’s not enough. We have to determine what we want from that. Do we want the value, the duration? What is it? So I am going to say that I want the time from that marker startMarker = thisComp.maker.key(1).time;
In other words, I want to know where it is located on the timeline. That is going to be important later on.
Next, I am going to select my text and copy it with the copy keyboard shortcut CTRL+C on a PC or CMD+C on a Mac.
Then hit enter on the keyboard and paste the text with the paste keyboard shortcut CTRL+V on a PC or CMD+V on a Mac like so:
I’m going to change the startMarker to endMarker.
The end marker is going to be the second one. I hope it is making sense so far.
Next, I’m going to select my IN and OUT POSITION and hit P to reveal the position property.
So now I’m going to determine some variables for position. I’m going say xInPosition you are going to be the xInPosition like so: xInPosition = thisComp.layer(“IN POSITION”).transform.position[0];
Next, I’m going say yInPosition, you are going to be thisComp.layer(“IN POSITION”).transform.position[1];
Then I’m going to do xOutPosition and I’m going to say you are going to be thisComp.layer(“OUT POSITION”).transform.position[0];
Then I’m going to do yOutPosition and it’s going to be the Y property like so:
I think this is it as far as variables go. Now we’re going to do some expressions. I’m going to type X = and then I’m going to go to expression helper -> interpolation and I’m going to select this ease expression.
I’m going to click on that then I’ll add the semicolon at the end like so:
Inside this ease expression I’m going to change from T to time like so: x = ease(time, tMin, tMax, value1, value2);
I can then set tMin and tMax from 0 to 1 second, but instead I am going to call out my variable. I am going to say x = ease(time, startMarker, endMarker, value1, value2);
So it is going to start at the beginning of my marker and end at the end of my marker.
Next, I need to determine the value1 and value2. So what value do I want it to go from?
In this case we are on the x-axis. So I am going to say xInPosition is going to be my starting position and xOutPosition is going to be my end position like so:
x = ease(time, startMarker, endMarker, xInPosition, xOutPosition);
Now lets copy our x = ease(time, startMarker, endMarker, xInPosition, xOutPosition);
hit enter and paste it below but this time change the x to y like so:
y = ease(time, startMarker, endMarker, yInPosition, yOutPosition);
And after that I’ll just determine that in my square brackets like so: [x, y]
and that should make it all work!
You can download the project file for this tip by filling out the form below.