DaVinci Resolve Fusion: “Overshoot Expression” Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi this is simon obstal and welcome to another tutorial for blackmagic fusion now in my recent easing curves tutorial we looked at a whole range of animation expressions and i promised you some more so today we're going to be building a classic overshoot expression and we're going to be building this as a rig that you can link a whole load of other stuff up to and of course you'll be able to save it and reuse it again and again so it's going to be very useful i think so let's make a start so let's set up a very simple project i'm going to create a background let's have a look at that and just to make sure we can see what it is and then i'm going to copy that and paste it and i'm going to make this let's say 100 pixels square let's change its color so it's something different and then merge it over our background have a look at that zoom out and i'm going to turn off that overlay and to make things clear i'm going to re-label this merge as an in in caps and then what i'm going to do is i'm going to add an expression to the center in the merge center so right click modify with expression and you'll see our square is now popped down to the bottom left hand corner at zero on x and y so let's come over to the modifiers tab and first of all what i want to do is i want to set up the config and i'm going to come back when i've done that and explain what i've done so what i've done is i've hidden all the uh the point controls and i've renamed numbers one to nine as progress function start value end value start time end time amplitude frequency and decay so first of all let's enter an expression on the progress in other words n1 so right click expression and this is going to be min open brackets one comma time over n6 close brackets and let's just set the ends time while we're at it so this is going to be in frames i'm just going to extend my um timeline to be 125 i think so my end time which is n6 i'm going to set to 75 frames now for the time being i'm just going to add an expression for the function basically copies n1 into n2 so add an expression and set that to n1 and i also want an end value and i'm going to make that one so what's going to happen is with this basic expression the square is going to move from the left of the screen in other words 0 to 1 which is the right of the screen so that's our end value our start value is 0. so then over on the point out i'm just going to set that y expression to 0.5 to bring it up into the center there and then for the x expression i'm going to type n2 which is our function times n4 which is the uh end value so now if we press play you'll see that we move across the frame and we reach our destination at frame 75 so scrub back you can see that we've we've reached one at frame 75. now it's all very well but we actually want to be able to affect the start position as well we've got our end value but we want to be able to bring the start value into play as well so let's come over to our expression and i'm going to put what we've got into brackets and then i'm going to type plus open brackets n3 which is our start value times open brackets 1 minus n2 close brackets close brackets and now we can change up these start and end values so i'm going to go for 0.1 for the start value and let's go for point nine on the end value and you'll see that already i'm at the beginning here and already our start value is is working so if i press play you'll see that we move across and at the end we hit 0.9 at frame 75 and if i were to come over to this expression and delete that first part of it the the original part that we entered we can see exactly what's happening with this second part so we start at the n3 position and over time that n3 value reduces to zero so this is what we're adding to our start to create that offset and as we get closer to the end the value of that offset reduces to nothing so restore it and we get that so what we also need to be able to do is we need to control time so we just got a basic function for time here which is only looking at the end time that's the n6 value so we need to get a little bit fancier so what i'm going to do is i'm going to copy and paste this expression here open it up so you can see and i'll uh you you can read it off the the screen here just uh i won't bother reading it out so this means that we can now adjust our start time so if i wanted a start time of 25 you can see that at the beginning nothing happens and then at frame 25 we it all kicks off and we again will hit our end time at 75. so you can see that's now brought this other value into play and so basically what we're doing is saying if the start time is less than n5 which is our start time here then enter a value of zero in other words give us no progress otherwise give us the progress that we asked for before but subtract the offset from it and that's what we're doing there and another thing we can do is to make this function a little bit fancier so what i'm going to do is actually create a cubic ease in and you'll be familiar with this if you looked at my easing curves tutorial so what i'm going to do is n one to the power of three and let's just look how that works you see you get that acceleration effect and i think that's going to work nicely for our overshoot and so now we need to look at the expression that's going to give us this overshoot now our overshoot expression is going to be based on a decaying sine wave and i want us to have a look at what that looks like on its own before we actually get to the overshoot so i'm going to grab an expression and enter it into this point expression x and i also want to add some values for my amplitude frequency and decay so for my amplitude i'm going to have one for my frequency i'm going to have 5 and my decay 0.05 and now let's have a look what happens if we press play and you'll see that it bounces left and right and gradually slows to a halt so let's just have a look quick look at that expression so obviously a sine wave is a wave that oscillates between negative one down here and positive one up here and for example i could increase the amplitude of that wave by multiplying it by two and you can see we've now doubled that distance so we go from negative two to positive two and we could increase the frequency of the wave by multiplying the value of x so x times two and we've now got a faster wave as it were now i've very quickly just changed those amplitude and frequency values just to be able to show you the decay function so i've put all of that in brackets and if i divide that by exponential x you'll see that the sine wave gradually starts to decay and we can decay faster if we multiply x by a factor so depending on that factor we can decay faster or slower so that's the basis of what we're going to be looking at here so let's come over to the expression and you can see that that's what we're using here we're using sine and we're using time to drive it now n7 is the amplitude so we're multiplying that sine function by the amplitude in order to get the amount of of bounce the the height as it were of the sine wave and we're multiplying time by the frequency that's n8 won't explain the pi bit but i will explain this here which is an exponential function that uses our decay value n9 on time and we're taking the result of everything else and dividing it by that decay function so let's have just have a look at that again and you can see how that works let's just maybe reduce that amplitude so it's a little bit more obvious let's go for 0.5 and you can see how that works we could increase the frequency to 10 for example and we get a more jittery bounce and so on so that's how we're going to make the overshoot by tacking this onto the end of our previous the conceived animation effectively so i'm just going to reset those values so amplitude 1 frequency 5 decay leave it as is and i'm going to come over to the point out and i'm going to paste in a whole new expression and this is quite a big one as you can see on the screen but it's relatively speaking it's simple what it's saying is if time is less than n6 now let's come over and see n6 is the end time so if time is less than that then use that original function that we we looked at quite closely the one that basically just creates this animation between the start and end values otherwise let's use that decaying sine wave function and you can see that's pretty much the same thing it's a little bit more fancy because we've got this component here which basically allows us to get this oscillation in phase with the the original animation so let's have a look at how that looks i think i'm just going to just change the start value to zero and maybe to the start time let's bring that back down to zero and let's have a look how this looks you can see we've got that nice speeding up function because of that that's cubic ease in and then we've got that bounce at the end and again we could just change that amplitude to 2 if we wanted make it more of a bounce and we could increase that frequency to say eight so it's more jittery and the greater the value of this decay so if we go 4.1 you'll see that it slows down very quickly let's even go for 0.5 almost nothing just a tiny little bounce on the end there so finally i want us to take a look at what i did with my demo here that's got these different six different types of animation and they're all linked to that main expression in actual fact as you see that anime merge i've disconnected from everything else i've just set up some values here so i've got a start value of 0 n value of 3 and time of 30 amplitude 20 frequency 5 and decay 0.05 if you want to follow along with these and all i'm doing with each of these merges so that's the first merge up here on the left what i've done is i've linked the blend value of that so this is the this is what that looks like and you can see i've linked this to anim center x and what i've done is i've entered an offset of negative two just to get it within range otherwise it's going to be sort of blending up towards three because of my input value and you'll notice that i've got a max expression in there if i take off that max expression you'll understand why and if we look at that you'll see that at the beginning is we have a sort of a negative two blend value and that's no good and what this max expression does is it doesn't allow that input value to go below zero so that's quite a simple one so let's look at the next one what is that that is this one here this scale so again i've linked that size value to anim center x and again i've got an offset of -1 just to get it into the range that i want it to be what's the next one over here this this is rotation i've linked the angle to anim center x and i've multiplied by 180 to get more of a spin because obviously we've got quite a low input value so that's looking like that next one along is this one down here and this is actually in fact our original so it's sliding in from the left here that's just a version of what we've already got and you'll notice i've divided that by 3.5 again just to get it into the space that i want so next one is this one here and if we look at that that is coming down from the top so it's it's basically using this one here it's applying it to the y-axis and if we move along the final one i have used a transform here and i've added it to the uh the aspect ratio and i've moved the pivot point down on y so that's something that top one there if we look you'll see it's it grows up like that now the advantage of all these being linked to this one control is that we can change any of these values so for example if we doubled the amplitude it's going to double the amplitude for all of the for all of the linked items and the same thing with the frequency if we were to increase the frequency to 10 all those things are going to jitter much more quickly because of that global value that we've been able to set in this master control as it were so there you have it i hope that's explained most of it as you see it's kind of just basically built up a couple of simple building blocks and we're using that uh decaying sine wave really to create that bounce and as i say tagging it on to the end of our original animation so i hope that's been useful thanks very much for watching and i hope to see you again another time
Info
Channel: Simon Ubsdell
Views: 3,421
Rating: undefined out of 5
Keywords:
Id: tT7dWJARrrY
Channel Id: undefined
Length: 16min 44sec (1004 seconds)
Published: Sun Jul 31 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.