MYSTERIOUS Dynamic Line COLORS / Davinci Resolve Fusion Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey guys my name is william justus i make videos on davinci resolve animations and effects the other day i got a message from michael he was setting up an animation with two points he had a line set up between these two points with a tracker and he had a question so he said hey william justice big fan of your channel i like that so you track two points you have the line between them can you make the line change color based on how far apart the two points are thanks michael so you mean like this we have two points with a line moving closer together and further apart and we have a line color change i've done some videos similar to this in the past where i've done quite a bit of tracking and i'm going to have some links in the description below for those if you want to check out more about the tracking we're going to do real quick on the track on this one and then we're going to take it a step further and really focus in on how to compute the distance between the points and use that to adjust the color obviously we could use keyframing to do this and adjust the color as the distance changed but i don't like using keyframes if i absolutely don't have to so we're going to do this in a little bit different way using some expressions to compute the actual distance and use that to dynamically change the color of the lines okay first step is we are going to track the points once the points are tracked we're going to connect those points up and create a line between the two points then we're going to add a bit of style to kind of make it look a little bit more interesting once we have that down we're going to use the actual positions of the points to compute the distance between them so they're closer together we're going to get a smaller distance bring them further apart and the distance will change once we have that number changing and dynamically adjusting we're going to use the distance number to adjust the color okay like this video and subscribe to my channel if you want to learn more about davinci resolve effects fusion and a whole lot of fun things that i have planned also check out my next video because it's going to be using this animation down here with the stretchy text i kind of created this a while back um also i'd really be interested to see how you might solve this problem once you see the way i did it um there's probably a lot better ways to do it maybe a lot more interesting ways to do it um it's always a challenge so i'd like to see what you come up with if you have any comments questions or a better solution which would be awesome make sure you leave it in the comments below i'd love to hear from you okay let's get this set up here we have this clip of these circles here and as i move them around we're going to track them and get the line set up and once we have that then we can set up the colors so to get started let's right click on the clip choose new fusion clip and then at the bottom of the screen click fusion to go into fusion all right let's set up the tracking we're going to go to the very first frame with media in one selected we're going to hit control space and type tracker and we have our tracker in you can see this little green box here we're going to grab the dot in the upper left hand corner of the inner box and drag it right into the middle of the first circle and size it to be just inside of there this is the first tracker it's going to track the circle on the left now we're going to do is go into the inspector under tracker list hit add and that's going to set up tracker 2 and we have this other tracker up here and we're going to do the same thing for the other circle we're going to drag it right into the middle of that circle you click the little uh corner to move it around expand the search area okay so we have both the tracker set up so what we need to do now is to track this it's going to follow each of the circles and create points for each of the positions make sure we're on the first frame for adaptive mode choose best match and hit track forward okay now we have the tracking point set for tracker 1 and tracker 2. now let's set up a line between each of these so we're going to take a background drag it into the note area let's set the background color to yellow in the inspector i'm going to take the background and merge it right on top of the tracker and the background is going to sit right there so what we need to do is mask out where our line is going to be to do that with background one selected click the polygon tool now we just need to draw our polygon in the viewer we're going to click one point and two points so there's our line now the polygon we can uncheck solid and bring up the border with the next step is to be able to control the positions of each of those points hit the select all points right click on one of the points choose polygon one polyline and choose publish points and you notice right down here we have our points this is the left point and the right point so all we need to do is connect each of those points to the tracker so right click on point zero connect to tracker one path position let's do the same for the second point right click on point one connect to tracker one tracker path to position and now we have our line that is following our tracked points all right so to change the color of this line all we really need to do is adjust the background and now we have a red line so we're going to try to automate all this first let's um change the line style just a little bit the background one selected let's choose the a blur node then with the blur node selected hit control space and we're going to search for soft glow and adjust the glow settings let's move these up and we throw a little displacement on it the soft glow once selected hit ctrl space and search for displace we're gonna take this fast noise and drag it in and connect that up to the green input on the displace with the fast noise selected we're going to boost the detail and contrast and scale these can really be anything that you want and we'll go into the to the displace choose the type of x y and we'll adjust the y reflect refraction the first method we're going to use to adjust the color is a color corrector node so with this place one selected hit control space and and search for cc and that's going to bring up the color corrector and add that in so we can adjust this color by changing the hue so we're going to create an expression that's going to adjust the hue based on the distance between the two points so how do we compute the distance first we need to get the positions of each of the points and then we can plug those into the distance formula so let's go to the tracker so we have tracker 1 and tracker 2. let's select tracker one and we're going to hover over tracked one center down here and if you look over to the bottom left of the screen you're going to see that property is called tracker one tracked center one let's go to tracker two hover over that and it's tracker one tracked center two so that those are going to give us our xy positions that are gonna allow us to compute the distance so i'm gonna pull up notepad and show you how the formula works so this is the x and y position of the first tracker and the x and y position of the second tracker so i'm gonna put the distance formula right down below so that we can get it figured out so the first thing we need to do is get the square root of the x difference and the y difference this is the exposition of 0.1 minus the exposition of 0.2 squared now let's get these the y position we have the y position minus the y position squared all right now that we have both of those we just need to get the square root all right so we have the square root of these two things added together so it's going to be just like that we're going to put this formula into a text node so we can see what's going on now there's our text node so let's move it up just a bit right there we're going to right click and say expression and we're going to plug our expression in right there so let's get back to notepad copy the expression and paste it in that is the distance between these two points so as you play as we play through you'll notice that the distance changes it gets bigger right there and then right in here you see it's a lot smaller to get the color to work we want the color value to go from zero right here and cycle all the way to one that's going to go through the whole range of colors to get this to go from zero to one we need to find the closest distance and the max distance so the closest these two are together it looks like it's a point zero eight five so let's jot that down what we need to do is take this distance and we're gonna we're gonna set that up as a average of the min versus the max so we're gonna put parentheses around this i'm gonna subtract off 0.085 so what that's going to do is it's going to take the minimum distance to about zero let's plug that in so now when we get in here you see it's just about zero now let's go find that max distance looks like it's about 0.53 so let's say let's say 0.54 i'm going to divide this by 0.54 and let's plug that in and that should get us close you kind of have to play around with the numbers a bit but yeah see it's almost one right there so we have a minimum of close to zero and a maximum of one which is exactly what we need for this color corrector so what we can do is right click on the hue do expression and plug in our formula and here we go this is the first way i came up with to adjust the color it you can't really choose the color it kind of goes along with the color spectrum so what i want to do now is take this formula and we're going to put it into a property on the polygon just so it's a little bit easier to find so right click on the polygon choose edit controls and let's type in distance and it's going to be a slider control hit okay and what that did is that added this user tab over here we're going to click that and here's our distance right click choose expression and we're going to plug in our formula we've created something called polygon 1 distance so we can use this anywhere we want to use our distance so let's go back to the color corrector and we're going to get rid of this ugly formula here and type in polygon 1.distance and it does the exact same thing you see the numbers are changing right here going from our pretty much zero to one when it's at the maximum okay let's say we want to pick our colors and not choose not just use the colors on the spectrum so let's get rid of this color corrector and we're gonna look at this take a look at this background up here and we're going to change this up just a little bit we're going to put in a merge node and plug the background of the merge node into the foreground of the merge node and we're going to take another background and plug it into the background of the merge node set the background to transparent connect up our polygon mask and then connect up that into the blur we have everything back this node right here is going to control our background color to be able to customize our colors let's uh i'm gonna bring up two viewers here and we'll put that background here so we just have a solid background what we're gonna do is we're gonna turn this into a gradient with background one selected choose type of gradient and let's set up some colors all you need to do is click in this bar where you want to create a color and then click the down below to set the color all right so we got a color spectrum going so what we're going to do is we're going to add a crop node onto this so here's our background and we're going to hit control space and search for crop select crop and hit one so we're going to for the for the crop we're going to set the x size all the way down we're going to make it really small well we'll make it like uh let me get five let's say six pixels so let's put the merge in viewer one so you can see right here we have that little red dot that's where everything got cropped out so we take a look at the crop and rewind right that so we want the crop to fill the whole area let's take the let's take this polygon mask off right there when we look at the merge we got a thin red line going down the middle all we need to do to get the line to fill the space is go to the merge node select edges and we're going to say wrap and what that's going to do is it's going to take that this thin line and wrap it to fill the whole background size so let's connect up our polygon again now we can adjust the color of the line by going to our crop and adjusting the x offset and what this is doing is we'll put the background here it's adjusting how far into this gradient we're cropping so if we just take a look at let's remove the polygon and just take a look at our merge so you can see that where we're cropping is in an orange section so if we move it all the way to the left which is zero it's going to be red and if we move it all the way to the right which is going to be like uh it's like around 1900 because we're 1920 by 1080 and you can see we're cropping right in here which is the green so let's connect back up our polygon now that we've created a solid from a gradient connect the polygon into the merge and we can adjust the line color by adjusting the x offset if we can adjust this crop we can customize the colors and how the gradients progress so let's right click choose expression and we know that the max offset is 1920. so we're going to 1920 and we're going to multiply that times our polygon one distance which is going to go from zero to one so it's basically a percentage so we're gonna go from zero to 1920 for the x offset based on our distance polygon one dot distance and you can see that we're right in there and as we adjust this distance so this is a small distance so we're going to be on the left-hand side and as the distance gets bigger you're going to see when it's at the biggest here it's going to be on the green side so now we have the color adjusting based off the distance between the two points with a gradient background for defining the progression of our colors now we don't have to have a gradient here you you could actually create color bars let me show you how to do that super quick now we just need to add a mask into each of these so we're going to take a rectangle mask put it in here instead of our gradient background we're going to plug in the color bars that we just created um let's see we'll put the color bars in the this viewer so we're gonna go to blue and it's gonna immediately jump to another color when it gets into that range all right let's put our gradient back and i'm gonna show you one more way to do this real quick um this is kind of a wacky way but it's kind of interesting at the same time still put it up there and let's add another background in and you can see it's default background color is black we can change it to whatever we want and what we're going to do is we're going to use on this background we're going to adjust each of these red blue and green by looking at this background one which is the gradient so with background seven selected we're going to right click on red and choose modify with probe right click on green and say modify with probe and right click on blue and say modify with probe what the probe is going to do is it's actually going to inspect an area of our gradient once we set it up and it's going to pull the color from that and use it right here when we set the modify width we actually created a modifier here so you can see we have three modifiers probe one two and three for the probe to work we need to give it the name of the image all right we're gonna be probing background one so let's go back to background seven modifiers and for the image to pro we're gonna type in background one and we're gonna add that in to each of the probe areas now notice that when we move this you can see right here we have this little arrow moving and that's the area that we're going to be probing the top probe is going to be for the red channel the next one is going to be for the green channel and the last one is the blue channel so this is going to be looking for the red blue and green values from here so all we need to do is for our position you notice as we change the position of these our values changing but we need the x position to be the same as our distance which is our zero to one so let's right click on position choose expression and for the x so it's a point with an x comma y so for x we're going to type in polygon 1 distance we use that same expression for each of the other probes right click expression and right click expression and you'll see that this is this is our probe in the blue area and as we change here you'll see that the probe is moving and it's picking up the color that's right underneath it so it's going into the blue and then into the green so you can see it follows along based on our distance um this is kind of a crazy way to do it but i thought it was kind of interesting in the same way what it's doing is adjusting the red blue and green values based on the distance you see these change as this distance changes all right so we got three different ways to set up the changing the color based on the distance between two points for a line that's being tracked hey guys thanks so much for watching if you have any comments questions or whatever make sure you leave them in below and i will get back to you i love hearing what you have to say if you enjoyed this video make sure you like it subscribe to the channel for more videos about davinci resolve fusion effects and creating animations lots of fun stuff coming soon thanks so much for watching [Music]
Info
Channel: William Justice
Views: 2,456
Rating: undefined out of 5
Keywords: Video Effects, Davinci, Davinci Resolve, Davinci Resolve 16, Fusion, Davinci Fusion, Tutorial, Filmmaking, Effects, tips, tricks, davinci resovle tips, william justice, Probe Modifier, Distance, Expressions, Tracking, Colored Line, tutorial
Id: 68WwMX7XdDM
Channel Id: undefined
Length: 17min 4sec (1024 seconds)
Published: Wed Sep 15 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.