background top icon
background center wave icon
background filled rhombus icon
background two lines icon
background stroke rhombus icon

Download "After Effects Expressions 403 - Triggers Using Markers"

input logo icon
"videoThumbnail After Effects Expressions 403 - Triggers Using Markers
Table of contents
|

Table of contents

0:00
Intro
0:18
Simple Triggers With Layer Markers
0:51
Trigger Fade Expression
5:42
Adding Layer Markers
7:48
Trigger Multiple Nested Animations
8:11
Looking at the Nested Composition
9:17
Adding Reference Markers
11:18
Adding Trigger Markers
11:38
Marker Sync Expression
14:18
Animating the Trigger Markers
15:36
Wrap Up
Video tags
|

Video tags

adobe
after effects
tutorial
how to
animoplex
parker young
create
motion
graphics
software
website
expressions
course
introduction
scripting
programming
learn
guide
walk through
class
javascript
actionscript
trigger
layer
marker
multiple
nested
composition
reference
sync
dan
ebberts
animation
precomp
timing
cue
comment
Subtitles
|

Subtitles

subtitles menu arrow
  • ruRussian
Download
00:00:09
Using layer and composition markers to trigger animations is a great way to easily recycle
00:00:14
simple animations or complex nested animations in another composition.
00:00:22
Sometimes you may want to reuse a single animation on the same property.
00:00:26
This technique allows you to change a property value at a specific point in time
00:00:31
by placing a marker on a layer.
00:00:33
You can also name the markers to trigger a variety of simple property value changes.
00:00:38
Let's make the Planet fade in and out at a specific point in time using markers.
00:00:44
So, with the Planet layer highlighted, press T on your keyboard to open Opacity.
00:00:50
Add a new expression and begin the first line with a variable, called fadeFrames, capital F.
00:00:56
Follow this with an equal sign and value of 10, and then close the line with a semi colon.
00:01:02
Now this is the number of frames that your animation will interpolate across.
00:01:06
Now, on the same line, you can add a new variable called m, followed by an equal sign,
00:01:12
and set this to a value of 0.
00:01:14
This sets the initial number of layer markers for the expression.
00:01:18
And finally, include another variable on the same line, t, followed by an equal sign.
00:01:24
And set this value to time, and then semi colon.
00:01:28
The t variable will represent time until we redefine it later.
00:01:32
Now, on the next line, start a conditional statement with if, open parenthesis,
00:01:37
and then you can type marker, period operator, numKeys, capital K, greater than symbol, a 0,
00:01:48
and then a close parenthesis.
00:01:50
And then, at the end of this, start an open curly bracket.
00:01:54
Now, because this is a multi line conditional statement, we're going to leave the curly bracket
00:01:58
at the end of this line, go to the next line, and indent 2 spaces.
00:02:03
On this line, we're going to redefine m to represent the nearest keyframe.
00:02:07
So start with another m variable, followed by an equal sign, and then we'll use marker again,
00:02:14
period operator, and then we'll search for the nearest key, so nearestKey, capital K.
00:02:21
And then open parenthesis, time, close parenthesis.
00:02:26
After that, a period operator, and then index, and then end the line with a semi colon.
00:02:32
So this line is looking for the nearest marker to the current time,
00:02:35
and then redefines the m variable as the marker's index.
00:02:40
On the next line, indent two spaces, and then create a new variable called tag,
00:02:46
and then an equal sign, and then marker, period operator, key, open parenthesis,
00:02:53
m, close parenthesis, period operator, comment.
00:02:59
And then end this line with a semi colon.
00:03:01
This line finds the marker specified in m, and then assigns the marker's comment
00:03:06
to the tag variable.
00:03:08
On the next line, indent two spaces and then start a new conditional statement.
00:03:12
So start with if, and then open parenthesis, and then we're looking for the contents of tag,
00:03:18
double equal sign, open double quotation, In, with a capital I, and then close double quotation.
00:03:25
After this, you can close it with a close parenthesis, and then open a curly bracket.
00:03:30
And then we can redefine t, equal sign, to the marker, period operator, key, open parenthesis, m,
00:03:39
close parenthesis, period operator, time minus time, close curly bracket.
00:03:48
This line checks to see if the nearest marker's comment matches m, and if so it defines t
00:03:54
as the gap between the marker and the current time.
00:03:58
The next line will do the same, but it's going to look for a marker with Out as the comment.
00:04:03
So indent two spaces and then start with else if, and then open parenthesis, tag,
00:04:10
double equals sign, open double quotation, Out, with a capital O, close double quotation, and then
00:04:17
close parenthesis, open curly bracket, t equals time minus marker, period operator, key,
00:04:28
open parenthesis, m, close parenthesis, and then period operator, time, close curly bracket.
00:04:35
So this line is looking for a marker with a comment of Out, and then defines t
00:04:41
as the current time minus the marker's time.
00:04:44
So the next line assembles everything together in the linear method.
00:04:48
So indent twice and then linear, open parenthesis, t as the input, comma,
00:04:55
the beginning of the range is going to be 0, comma, and then framesTo, capital T, capital T, Time, capital T,
00:05:03
open parenthesis, fadeFrames, capital F, which is our value from before, and then close parenthesis,
00:05:11
comma, and then the beginning of the output is going to be value, comma, 0, close parenthesis.
00:05:18
So this linear method evaluates the value change of t across the fadeFrames value,
00:05:24
and then animates from 0 to the original property value.
00:05:28
So on the next line we're going to end this statement with a close curly bracket.
00:05:34
And finally, we just want to set a fallback, so else, open curly bracket,
00:05:39
value, close curly bracket.
00:05:42
Now if I click away from the expression, nothing's going to happen immediately
00:05:45
because we don't have any layer markers.
00:05:47
So if I highlight Planet, and then if I navigate to the top level menu under Layer,
00:05:53
and then come down about half way and you'll see Add Marker.
00:05:56
So if you click that, it's going to add a layer marker to the selected layer.
00:06:00
And now if you put your mouse directly over it and double click, you'll get a Layer Marker dialog box.
00:06:06
And by default the cursor is already in the comment box.
00:06:09
And you can make this the beginning of the fade in, so In, capital I.
00:06:14
And then hit OK.
00:06:16
So now you see that this marker has been labelled with In, but the Planet is still at 100 percent Opacity.
00:06:22
And that's because the marker is at the very beginning of the composition.
00:06:26
But if I click and drag on this marker and drag it forward in time,
00:06:30
you'll notice that now the Planet has disappeared.
00:06:32
And now you'll see that the Planet fades in over 10 frames right here before the 1 second mark.
00:06:38
So that's pretty cool!
00:06:40
I can change the fadeFrames from 10 to something like 30, and then click away from the expression.
00:06:45
And now if you preview, you'll see a nice smooth transition from 0 to 100 Opacity
00:06:50
across 30 frames.
00:06:52
Okay so now that we have the fade in, let's go ahead and add a fade out.
00:06:55
I'm going to come to second 4 and highlight the Planet layer.
00:06:59
I have an extended keyboard, so I can just hit the asterisk on the num pad to add a layer marker.
00:07:05
And now you can see the Planet layer has disappeared, but that's because this marker
00:07:09
doesn't have a comment.
00:07:10
So if I double click and in the comment box, type Out, capital O, and then come and hit OK.
00:07:16
Now, this marker has Out applied to the label, and then Planet is back.
00:07:21
And if I preview from this point, you'll see that now the Planet fades out of view.
00:07:26
Now, for this Opacity fade, it would have probably been pretty easy to keyframe this manually.
00:07:31
The benefit you get from these markers is the ability to drag them around
00:07:35
very easily without selecting keyframes.
00:07:38
You also have the ability to add more markers along the timeline.
00:07:43
And now you have multiple fade in and outs without a single keyframe on the Timeline.
00:07:52
You can take the layer markers method a step further, and create a series of pre-built,
00:07:56
complex, nested animations that are triggered with corresponding markers.
00:08:01
This is a technique that's borrowed from Dan Ebbert's Marker Sync expression on MotionScript.com,
00:08:07
so be sure to visit him and say thank you if you find this technique useful.
00:08:11
So, in this composition, you'll see a Rocket layer.
00:08:14
It's a little different than the Rocket layer in other lessons because the Rocket is a
00:08:19
nested composition instead of a shape layer.
00:08:21
So, if you come over to the Timeline and double click on the Rocket,
00:08:25
it's going to open it in a separate composition.
00:08:27
Now, if you preview the composition, you'll see a couple of nested animations
00:08:30
with the Fin and the Flame, and even a Laser that shoots out.
00:08:34
Each of these animations happens one time, and they are about a second apart from each other.
00:08:39
If I hit U to reveal all keyframes, you'll see that the first second in time is pretty static,
00:08:45
and then across the next second, you have the fins close, and then they open again,
00:08:51
and then the Flame grows larger and then it gets smaller and then the Laser shoots.
00:08:56
Each of these animations happens one time, and then it returns to the original state.
00:09:01
If you need complex variations of the scene, you can have multiple layers of this method.
00:09:06
It's all up to how much flexibility and complexity you desire.
00:09:10
So, inside the Rocket composition, you have some pre built animations and we know that
00:09:14
each animation is one second in length.
00:09:17
To access these stages, we have to link them to markers.
00:09:20
Now, an easy way to do this is to create a blank null layer at the top of the composition.
00:09:25
My favorite way to do this without adding unnecessary solids to the Project panel,
00:09:29
is to double click the shape layer, and then delete the contents.
00:09:34
This essentially creates a null for me, but it hasn't created any additional assets.
00:09:39
Now, I can rename this shape layer to Markers, hit enter, and then hit U to collapse this up.
00:09:46
Now, I'm going to hit U so I can see the keyframes really quick.
00:09:49
And I'm going to highlight the Marker layer.
00:09:52
Now, first you want to add a marker to the very beginning to specify the base stage.
00:09:56
So with Markers highlighted, I'm going to go to Layer, Add Marker,
00:10:01
and then come down and double click the marker and I'm going to name this Rocket, capital R.
00:10:08
Now, when I hit OK it's going to add the label here.
00:10:11
I'm going to come to 1 second and do the same thing.
00:10:14
Layer, Add Marker, double click to rename.
00:10:18
And this animation has the Rocket Fins closing.
00:10:21
So I'm just going to call it Fin Close, and then hit OK.
00:10:25
I'm going to come to second 2 where the Fins have already been closed
00:10:29
and they are getting ready to open up.
00:10:30
And go to Layer, Add Marker, double click, Fin Open, and then hit OK.
00:10:37
I'm going to come to second 3, and this is where the Flame grows larger.
00:10:41
I'm going to go to Layer, Add Marker, double click, Flame Grow, hit OK.
00:10:48
Do the same thing for number 4, Layer, Add Marker, double click, Flame Shrink.
00:10:55
Really creative names, huh?
00:10:57
And then come to second 5, Layer, Add Marker, double click, I'm going to call this Laser Shoot,
00:11:03
and then hit OK.
00:11:06
So this Markers layer is going to be our reference for all of the animation stages.
00:11:11
So I'm going to click outside and hit U to collapse everything up.
00:11:14
And then I'm done with this composition, so I'm going to close it.
00:11:16
And now we're back in our main composition.
00:11:19
So now, to properly link these two together, we need to add some markers in this composition.
00:11:24
So I'm going to come to second 2, and with Rocket selected, I'm going to go to Layer,
00:11:29
Add Marker, double click.
00:11:31
I'm just going to get it started with Fin Close.
00:11:34
That will be our first test animation.
00:11:36
I'm going to hit OK.
00:11:38
So now, you actually need to apply the marker's expression to see it in action.
00:11:42
This is a pretty complex expression to write step by step in this lesson,
00:11:46
so I'm just going to walk through the different parts to help you understand.
00:11:50
If you're watching the tutorial online, you'll find a link to copy the expression in the video description.
00:11:55
If you've downloaded the project files, you can find the expression in the Resources folder
00:12:00
of the project files, or in the 403: Reference composition.
00:12:04
Okay, so at this point, you've probably grabbed the expression.
00:12:07
I have it right here in Sublime Text.
00:12:09
So I'm going to select all of the text and copy, Ctrl + C (or Cmd + C on a Mac) and then
00:12:14
I'm going to navigate back to After Effects.
00:12:16
And we need a property to paste this to.
00:12:19
So with the Rocket layer selected, I'm going to go to Layer, Time, Enable Time Remapping.
00:12:26
And now we have a new Time Remapped property on the Timeline.
00:12:30
So I'm going to hit tilde on my keyboard so I can full screen this.
00:12:33
And come over and add a new expression to Time Remap.
00:12:37
Now, I'm going to drag this expression window down so we can kind of see what we're doing.
00:12:41
And I'm going to hit Ctrl + V (or Cmd + V on a Mac) to paste the expression.
00:12:45
The only line you should really need to edit is this first line.
00:12:49
So in this case, the first line is correct on mine, you may need to update yours depending
00:12:53
on what you named that layer.
00:12:55
And I'm going to go ahead and walk through this expression really quick.
00:12:58
So this first line is looking for the composition called Rocket, because that's the name of
00:13:02
the current layer.
00:13:04
And then inside of that it's looking for the layer called Markers.
00:13:07
The next line sets an initial value for the number of markers which will be redefined layer.
00:13:13
The next conditional statement checks to see if there are any markers on the layer.
00:13:18
If there are, it's going to redefine n as the index of that marker.
00:13:23
Now, the next conditional statement right here sets the Time Remapping to 0
00:13:27
if it doesn't detect any markers.
00:13:29
Now, the next conditional statement is a pretty complex block of code.
00:13:34
And this is basically a series of conditions that compares the comment value of the previous marker
00:13:39
with comments inside of the nested composition.
00:13:42
If it detects a match between the two comment names, it's going to change the Time Remapping value
00:13:48
based on the marker's time of the matching comment.
00:13:51
The nested conditional statement here ensures that once a scene has played through,
00:13:56
it pauses at the end and waits for another marker, rather than play through the rest of the scenes
00:14:01
in sequence.
00:14:03
Catch is included to suppress errors and to set Time Remapping to 0 if markers don’t match up.
00:14:09
So now, everything looks good here and it's applied to the property.
00:14:12
So I'm going to click outside of the expression window and collapse this up.
00:14:16
And hit tilde to collapse this back down.
00:14:18
So now, we're back in the composition and we're at 2 seconds in time,
00:14:22
but Time Remapping is at 1 second.
00:14:24
And that's because the Fin Close animation starts at second 1 inside of the Rocket composition
00:14:30
and animates for 1 second.
00:14:33
So, for simplicity sake, I'm going to hide the Planet layer just so we can focus on the Rocket.
00:14:37
And if you preview the scene, the fins close right at the 2 second mark
00:14:42
where the marker is placed.
00:14:44
You can add new markers that match the scene names.
00:14:46
So for example, at second 4, I can come up to Layer, Add Marker, double click,
00:14:52
Fin Open as the name, and hit OK.
00:14:57
And now, the fins will open right at the 4 second marker.
00:14:59
I can come over to second 7 for example, highlight the Rocket layer, go to Layer, Add Marker,
00:15:07
double click on the marker, and call this one Laser Shoot and then hit OK.
00:15:13
And now, if you preview, you'll see the Laser coming out of the ship right at second 7.
00:15:18
You can add some Position keyframes, layer markers to trigger specific animations,
00:15:23
add some Rotation, Scale keyframes, easing, some more layer markers.
00:15:28
And now you have a finished animation, complete with complex nested animations
00:15:33
triggered with simple layer markers.
00:15:39
We've arrived at the end of Lesson 403: Using Markers on the Timeline to Trigger Animations
00:15:46
If you enjoy this expressions course, consider purchasing the paid content.
00:15:50
It includes in-depth documentation, extra tutorial content, high definition videos,
00:15:54
and all the project files used in the training.
00:15:57
Your purchase will help to create more free courses like this in the future.

Description:

Get the Course Materials: https://animoplex.gumroad.com/l/animoplex-expressions World of Expressions - Full Playlist: https://www.youtube.com/playlist?list=PLvr5U5ZSt6IzHyvSL9fo0M9NRPsTvra31 0:00 - Intro 0:18 - Simple Triggers With Layer Markers 0:51 - Trigger Fade Expression 5:42 - Adding Layer Markers 7:48 - Trigger Multiple Nested Animations 8:11 - Looking at the Nested Composition 9:17 - Adding Reference Markers 11:18 - Adding Trigger Markers 11:38 - Marker Sync Expression 14:18 - Animating the Trigger Markers 15:36 - Wrap Up Copy & Paste - Trigger Fade Expression: https://gist.github.com/animoplex/8611bf480e2ef63be27d7870430b4a3d Copy & Paste - Marker Sync Expression: https://gist.github.com/animoplex/cecf1c64aec4f2733ecd0edbebf4786d Marker Sync Expression based on Dan Ebbert's Marker Sync Tutorial: http://www.motionscript.com/design-guide/marker-sync.html View Course: https://www.animoplex.com/learn/expressions.html If you enjoy this expressions course, consider purchasing the paid content! It includes in-depth documentation, extra tutorial content, high definition video files, and project files used in the training. Your purchase will fund the release of this free course online for everyone to enjoy. Your support is greatly appreciated, and you’re helping to build more free courses like this in the future! For additional questions and help, reporting issues, or to share examples of how you used the World of Expressions tutorials, please email [email protected] or post in the comments below.

Preparing download options

* — If the video is playing in a new tab, go to it, then right-click on the video and select "Save video as..."
** — Link intended for online playback in specialized players

Questions about downloading video

mobile menu iconHow can I download "After Effects Expressions 403 - Triggers Using Markers" video?mobile menu icon

  • http://unidownloader.com/ website is the best way to download a video or a separate audio track if you want to do without installing programs and extensions.

  • The UDL Helper extension is a convenient button that is seamlessly integrated into YouTube, Instagram and OK.ru sites for fast content download.

  • UDL Client program (for Windows) is the most powerful solution that supports more than 900 websites, social networks and video hosting sites, as well as any video quality that is available in the source.

  • UDL Lite is a really convenient way to access a website from your mobile device. With its help, you can easily download videos directly to your smartphone.

mobile menu iconWhich format of "After Effects Expressions 403 - Triggers Using Markers" video should I choose?mobile menu icon

  • The best quality formats are FullHD (1080p), 2K (1440p), 4K (2160p) and 8K (4320p). The higher the resolution of your screen, the higher the video quality should be. However, there are other factors to consider: download speed, amount of free space, and device performance during playback.

mobile menu iconWhy does my computer freeze when loading a "After Effects Expressions 403 - Triggers Using Markers" video?mobile menu icon

  • The browser/computer should not freeze completely! If this happens, please report it with a link to the video. Sometimes videos cannot be downloaded directly in a suitable format, so we have added the ability to convert the file to the desired format. In some cases, this process may actively use computer resources.

mobile menu iconHow can I download "After Effects Expressions 403 - Triggers Using Markers" video to my phone?mobile menu icon

  • You can download a video to your smartphone using the website or the PWA application UDL Lite. It is also possible to send a download link via QR code using the UDL Helper extension.

mobile menu iconHow can I download an audio track (music) to MP3 "After Effects Expressions 403 - Triggers Using Markers"?mobile menu icon

  • The most convenient way is to use the UDL Client program, which supports converting video to MP3 format. In some cases, MP3 can also be downloaded through the UDL Helper extension.

mobile menu iconHow can I save a frame from a video "After Effects Expressions 403 - Triggers Using Markers"?mobile menu icon

  • This feature is available in the UDL Helper extension. Make sure that "Show the video snapshot button" is checked in the settings. A camera icon should appear in the lower right corner of the player to the left of the "Settings" icon. When you click on it, the current frame from the video will be saved to your computer in JPEG format.

mobile menu iconWhat's the price of all this stuff?mobile menu icon

  • It costs nothing. Our services are absolutely free for all users. There are no PRO subscriptions, no restrictions on the number or maximum length of downloaded videos.