After Effects: Trigger Animations with Markers (No Keyframes)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] this video is sponsored by squarespace what's going on guys vincent here from the crew joe.net hope y'all doing well out there today's after effects quick tip we're actually answering a question from the community member and they basically asked how to actually create reactive dynamic animations and trigger animations using markers within after effects now shameless plug this is actually similar to how my tight flow preset works for after effects basically it's a preset that allows you to create really nice easing overshoot bouncing text animations easily it's name your own price link down below check it out but basically in that tool you have the option to actually enable markers and use markers to actually trigger the actual animation itself and so this is what we're talking about today in this quick tip so traditionally if you wanted to create an opacity fade and fade out for example you need to go to the opacity set a keyframe for zero move forward instead of keeping for 100 move forward set another keyframe and then move forward again and then set it back to zero and so effectively you've done four separate steps you've created four separate keyframes and if you wanted to change the timing you need to go ahead and move it backwards and forwards if you want to change the individual keyframe timings you need to push this back and move this forward kind of keep it in sync and if you have multiple keyframes it's kind of confusing so this is actually kind of visually messy and it's kind of a little bit too messy for something so simple like an opacity fade in right so this is where triggering stuff with markers might actually come in handy and so let's go and take a look at how we do that really quickly using expressions so i'm going to delete this set it back to 100. let's go ahead and add a few markers here so i've recently built a tkl keyboard so i don't actually have a numpad anymore so if you don't have a numpad you can go to layer go to marker and go ahead and hit add marker or if you have a numpad you can go ahead and hit the asterisk key so i'm going to go ahead and do that i'm going to go ahead and move forward and add another marker just for demonstration purposes and i'm going to go ahead and double click on them and just add a comment right here i'm going to call this one in i'm going to call this one out and this is so that we can just reference the right keyframes um for this tutorial right here and so we have two markers let's go ahead and try to do a quick little fade in using these markers so i want you know maybe half a second before this marker right here to begin the fade in so that when i get to this marker i'll be completely faded in and then once i hit this point in time again i want to start the transition here and fade out in 0.5 seconds so that's my goal so let's go ahead and go to the opacity property here hit t on the keyboard to build the opacity and go ahead and hit alt or option on the keyboard and go ahead and click the stopwatch to enable expressions so the first thing i want to do is i want to go ahead and access the timing of these markers right i need the timing of these markers so i can kind of time things up with math and so how do we access this i'm going to create a new variable called var marker in and so what is marker in going to equal it's going to equal this layer marker key one and type in time and so i recently switched to linear switches from tactile switches and so if you haven't tried linear and you're sleeping on it try it i love it it's pretty cool it feels buttery smooth and so basically what this is saying is hey look at this layer look at all the markers so now we're dealing with markers now now look at key number one and so this is hard coded now i'll show you guys another way to do this in another tutorial to be a little bit more dynamic but in this particular case we're saying hey go to this layer look at the markers and look at the first marker key one this is this one right here if you wanted to access the second marker this one right here you would just change this to number two three four five six so on and so forth and we don't watch the marker we want the time of the marker so in this particular case this marker occurs somewhere around two seconds so cool marker in equals roughly two seconds because this is where this marker is let's go ahead and do the same thing for marker out this layer marker dot key 2 dot time semicolon it will create one last variable var der equals 0.5 and so this is going to be the duration and usually when we're talking about time it's usually in seconds and so our duration is going to be 0.5 of a second cool so now that we have our variables let's go ahead and make this work and we're using my favorite very powerful expression the linear expression so you can go to the play button right here go to interpolation and go to linear this one right here or you can just manually type it hit a semicolon and so this is just going to show you kind of the pre-filled parameters that it wants so the first parameter right here t is basically the iterator this is something that usually changes it's either the index or time typically we use time because it's always changing but typically this first property always changes in some sort of way and when it changes from t min to t max it's going to remap and actually draw value 1 to value 2. now i know that sounds very very confusing so basically t is always changing and when t is between t min to t max our value one is going to linearly change to value two so t is going to be the driving machine and when t is in between t min and t max then that means it's going to this expression is going to linearly you know change a value one and pretty much automate it and transition it to value two by itself so you want to keyframe it basically so cool so this is typically time so we're going to type in time now t-min i'm going to type in marker in minus duration okay t max is going to be our actual marker in and our value is going to be from 0 to 100. and so this is this basically just takes care of the first fade in part and so you might need to pause the video and kind of think about what i just typed in here so we're saying the time so time is always increasing right typically whenever we play something time is increasing so when the time is between the marker the first marker minus 0.5 so somewhere right here when it's between here and the marker in time which is right here then it's going to increase the opacity from zero to a hundred so when you're at marker in minus point five or beyond you're at zero and then once you you know transition to the marker in time which is right here it'll fade the opacity to 100 so it's going to animate from 0 to 100 based on the marker in minus 0.5 seconds to marker in now you know you can always change this duration to whatever you want one second two seconds three seconds whatever it is but if i go ahead and hit okay you're going to see that you know our text is zero and then once you're 0.5 seconds away from the marker then it transitions to 0 to 100 until you get to the marker and that's it and so cool this is the fade in part um now how do i do the fade out part it would be very very similar right so you know ignore this time instead we'll do marker end to marker n plus duration 100 to zero so basically it's saying whenever you're at the marker and then whenever you're transitioning to marker plus the point five seconds out here it's going to transition from 100 opacity to zero and this would pretty much work to fade out but somehow we have to combine the two right because we want both we don't just want fade in and we don't want just fade out we want both fading and fade out and so a little trick is to either do you know the first minus the second or you can do something called math min and it's going to take the min the minimum of these two values right here so i'm going to copy this comma notice how i just deleted one of my parentheses we need to add that back in so the math min looks like this and basically you want to type in the first linear expression and then add a comma between the two and then paste the second linear expression in there and so it should look something like this be careful because after effects deletes parentheses sometimes because charges are autocorrected auto assumes and i got an error it's actually not marker and it's marker out here go ahead okay and perfect so basically it's going to take the minimum of the two linears and so if it can fade out it will fade out basically and so here as you can see we have zero and then half a second in it fades in and it'll stay in and then once it hits this point point five seconds out it'll fade out now there are actually other properties you can actually access with this this is just kind of a basic tutorial but for example i have this empty text layer right here i'm going to use the source text to kind of show you what you can access and read in with expressions so if i go ahead and pick whip to our layer right here which which has the markers we can actually go into here and type in marker to access all the markers go to key one which is again our in marker right here and you can actually go ahead and read the comment and so by doing this you can actually see that we actually have access and you know we can read in the actual comments so here it says in right here um and so if we change it to two it'll read the second marker and i'll say out and so basically you can actually read this information in and you can do an fl statement and check to see you know what the marker says and do something based on what the marker says another thing you can do so you can actually read the total number of keys right so if you type in marker and type in num keys it should return two right here because we have two total markers right here and with this you can actually loop through all the markers and you know filter through all of them and see you know what the comment says or you know do whatever you want but basically this is just some ways to kind of manipulate around and go ahead and kind of read all the marker data and do something with it which is very very cool so one last example here i have another composition i have a square shape layer and i have these two null points right here and so what if i wanted to do the same exact thing but i want to animate not opacity but position right and so this is basically the same idea we can go into the position property hit p on the keyboard go ahead and hit alt or option and go ahead and type in var marker in it's going to equal this layer marker key one dot time and then same thing with var marker out this layer marker key 2 time all right cool so we have our markers and so what can do again is you can go to the linear parameter type in time and whenever we're at the marker in through marker out so whenever the time is between marker in a marker out we're going to animate the position from you know we can enter in any hard-coded value right here um like zero zero zero two five five five or whatever but i have these nulls right here so i'm gonna hit p on the keyboard position and we can actually link it up so we can start from the start null hit a comma and go ahead and link to the end null right here and so what this says is you know here we have the time and whenever time is between marker and a marker out whenever it's in between those times we're going to animate the position from the start null position to the end null position and so we have now is uh our square is auto animating from one null to the other null based on the timing of our markers and so we can change this all up and things will still dynamically animate and we can shift the markers in time and things will animate dynamically based on the markers before i go i want to give a quick thanks to our sponsors over at squarespace for sponsoring today's video squarespace is the alumni platform to create an amazing website but it's for your store online business or portfolio they have amazing theme to choose from fully customizable so you can make it the way you want to look like without having any code knowledge required they have awesome 24 hour support and best of all if you use the promo code don't you i check out you can actually save 10 off your order and support the dojo so check it out over at squarespace.com dojo squarespace the number one place to create an amazing website and again this is just a very very basic tutorial on how to get started using markers to kind of animate animations you can actually do more complex things like drive different animation cycles and drive different animation pre-columns and do more complex animations based on what the comment says and all sorts of things with keyframes and markers it's really crazy what you can do by reading kind of marker data in and kind of driving it using markers and you know cycle through complex cycles and different pre-made animations using markers um you can also reference the endpoint of your layers and trigger things by the end point and markers and there's a lot of things you can do and i'll post more information down below about markers and how to use them in expressions links down below in the video description if you guys found this video helpful go ahead and give this video a thumbs up subscribe for more videos like this and please please please leave a comment down below for the youtube algorithm my name is vincent nguyen from the career of dojo and i'll see you guys next time bye guys you
Info
Channel: Creative Dojo
Views: 6,700
Rating: undefined out of 5
Keywords: after effects, motion graphics, motion design, after effects tutorial, after effects project file, after effects templates, motion graphics tutorial, motion design tutorial, after effects expressions, after effects markers, control animation with markers after effects, after effects animate with markers, after effects expressions tutorial, after effects expression basics, after effects automate animation, after effects auto fade expression, after effects linear expression
Id: HznxC9yOQbw
Channel Id: undefined
Length: 14min 51sec (891 seconds)
Published: Sun Feb 28 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.