Nuke tutorial | Basics of expression node inside Nuke | How to use expression node as a compositor

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] okay so we are inside nuke here and as you can see this is the expression node and this is the properties of expression node before explaining much of the properties of the expression node i'm going to take a peek inside nukes official reference guide like what is expression node and what it states over there so let's jump into the nukes official reference guide okay so we are inside a nuke official reference guide as you can see over here and it states that expression allows you to apply complex mathematical formulas to a channels values using c like syntax expressions if necessary you can apply different expressions to different sets of channels and there are tons of informations here so if you have time please read through all this information and learn things better as we are in the middle of the tutorial we don't have enough time to explore or read all these informations but i will definitely add the link to this website in the description of the video so kindly go there and check it out if you want to read further we are back inside nuke and let's see how our properties of expression node looks like it might be little confusing for beginners because you don't have any kind of floating point sliders or any other kind of controls here you can write mathematical formulas for red channel inside this knob and for green channel inside here and blue channel and alpha channel respectively and also we have some other knobs which i'm going to explain it later in this video so stick to the tutorial so before explaining what we have to write here i'm going to take color wheel note so let's take color wheel node here i'm going to connect the expression node into the color wheel as you can see color wheel is basically a mix or a combination of three colors that is red green blue you can verify that by going over into specific or those individual channels like red green blue so yeah so that's a mix up of those three colors red green blue so i'm going to take the properties of expression node and here we have let's write red here as this is a red channel and green here instead of red i'm just going to write r the shortcut of red channel is r you can see it over here so instead of green i can write g b and alpha as well so now if you can see same we don't have any changes right so i'm going to alter the properties a bit here so instead of green channel i'm going to type par and let's view again you can see a sudden change over here in the color so i just copied our channel into green channel same like which we do inside shuffle note if you go inside green channel now you can see the same r channel you can verify that here red and green channel are both similar right now because we just copied our channel into the green channel by just typing r inside the green channel knob that's pretty easy right but it's not that easy because you have to learn the basics then it will be easy for you so i'm going to reverse it as g or make it default again so i'm going to sample a pixel over here of that specific pixel you will know what's the value of color pixel or specifically the value of red green blue here the value of red channel in that pixel is 0.00509 or something like that and inside green it's 0.00579 and in blue channel it's one so let's suppose if i'm going to add one to the blue channel just see the value over here [Music] even though you are seeing a big difference in the screen we will just concentrate on that specific pixel now you can see the value of blue inside this pixel is 2 because initially it was 1 now we added 1 to that value so totally 1 plus 1 is equal to 2. here if i'm writing g plus 2 let's see how our result looks like you can see a major difference here but if you see the value you can see 2 is added into that green channels value so pure mathematics again if you learn the basics then it's going to be very easy in your work now what this knobs are used for any idea okay i'm going to explain it now so let's suppose if i'm writing a complex mathematical formula here i'm going to put a open and close bracket here let's suppose this is my mathematical formula and i'm going to write this multiple times or i'm going to copy and paste this over and over inside this specific channel so instead of doing or copying and pasting it over and over you can do one thing just delete all this stuff and let's suppose this is my mathematical formula i'm going to cut this and paste it over here and here you can assign a variable for that specific formula so i'm just typing cc here even i can type mad looks vfx or something like that but i'm just making it simple so let's type cc so here we have assigned a variable to the specific formula instead of writing this whole formula here i can just type in cc we arrive at the same result or same output so these knobs can be used for assigning variable for complex mathematical or long mathematical formulas which we will tend to use inside each individual channels multiple times so i hope you got the basics of the properties of expression node if there are any doubts please comment it down again a small request if you feel this video is informative please give a like and comment down your thoughts as well so definitely that's a motivation for me to do more videos in this channel so please hit that like button okay so if you are a compositor or if you are a prop artist you might have used sd maps in your work or you might have heard about using uv maps for transformations so let's see how we can create a uv map using this expression node it's kind of very simple so let's see how is that so we have the expression node here and we have the properties over here let's type in x we have pure red inside the viewer that means x is the horizontal pixel coordinates for this format let's divide this x with the width of the format you can see a gradient over here same here you can type y that means vertical pixel coordinates and divide this with the height of the format so yes we have a uv map here now let's take an image and check our uv map is working or not so i just loaded an image here and i'm going to take sd map node here okay inside the properties of html let's choose the uv channel as rgb and let's compare input and output you can see there's a slight mismatch that is because let's copy the expression node and paste it over here and i'm going to remove this completely and just show you what the row x and y coordinate looks like let's view on this expression node as you can see there's a pixel mismatch here like i'm going to just remove y there's a section of black pixel left over here so that is causing the issues okay so here if you add plus 0.5 you can see the changes over here so i'm going to add here 0.5 and just put a open and close bracket i'm copying that and pasting it over here same with the y coordinates as well so now if you compare the result you can see it matches perfectly yeah that's it you have your uv map ready for your transformation so okay so now we are going to use expression node for manipulating or displaying this image here we are going to do some mathematics inside expression node for displaying this image okay so here i'm going to take an expression node [Music] i'm going to type in red green blue just similar to the first example instead of green i can write r let's see what the result looks like oh the green is completely gone but we have a different tint right now instead of r i'm going to write r plus b and let's see what's the result somewhat little brighter than the other result so i'm going to put an open and close bracket here and you can divide this by two wow this looks little better than the other result right so we can just write a different set of formulas or whatever formulas you feels like that's the best result you can just keep on writing so i feel like this is the best result which i can produce or even you can just type it like by four or by six we have different results so if you want something like this you can just put that value over here or here i'm going to write it as 2 so instead of typing this formula just blindly i'm going to write an if or else condition here so let's write g that means the pixel values on green channel when it is greater than red channel then it should produce a result of say r plus b divided by 2 or else you can just simply leave it as green i hope you understood the formula and now you can see we have a good dispel result using this formula so the formula is simple if the pixel value of green channel is greater than r then the result should be r plus b that means addition of blue and red channel and the result is divided by two or else it should be green itself so you can alter this formula in any directions unless you get your desired results so i would say there are numerous possibilities with expression node for displaying so if you are using expression node in your work definitely i would say you will learn a lot of mathematical formulas and lots of basics of compositing as well please go ahead and use expression for your displaying and see how it works okay so now let's use expression node for some alpha refining so it's it's going to be very interesting so please concentrate on this part specifically i have an input over here and as you can see there is nothing inside alpha so i'm going to take a keyer node or i would say i would take a key light note to extract some alpha so i connected the source pipe into the input and um just check the speaker and let's average out this area and we have an alpha here which is not that refined we can fine tune a bit with this screen gain or something like that but i'm not going to do like that so instead of using all these properties i'm going to teach you how we can use expression node for this so that you can learn how we can use expression node for alpha refining i'm going to take an expression node and let's connect that into the key light maybe you can put in alpha over here okay so take the properties of expression node and you can see there is nothing over here so first of all i'm going to create a new knob here i'm going to click on this let's drag a floating point slider there's a new tab which is named as user and inside that we have a floating point slider so i'm going to edit this as some alpha value right i'm going to copy and paste it over here and let's edit the tab name as well so what we can keep let's keep alpha or let's keep value okay and let's copy and paste it over here so we have a tab named value and again inside that we have a floating point slider named alpha value so let's click on this again come back to the expression tab and let's type in some mathematical formula or i would say if or else equation here so here i'm going to refine only the alpha channel if you want to do that specifically to other channels you can do that as well just copy this formula to the other channels and that will be done so i'm just going to do that in the alpha channel i'm going to write an equation here if any doubts please comment it down i will clarify on that so let's write like alpha is greater than you can write a value here so instead of writing this value i already created a slider here you can see the name of the slider is alpha value so i'm going to write alpha value here and just put question mark that is one or else zero straight away we are seeing some results over here so let's go into the value tab and let's alter the property and see how we have a control for the alpha refining this is so amazing right we just created a new gizmo kind of thing so it's that easy to tune any alpha using this expression also again there are many websites in internet explaining the importance and applications of using expression node inside nuke i will definitely link some of those websites in the description of the video check out those websites as well so you can learn a lot there i hope this tutorial is useful to you if you feel like this is useful please hit that like button and also comment down your thoughts i know there will be a lot of questions regarding this tutorial so please comment down that as well seeing your likes and comments are a real motivation for me to do lot of tutorials and a lot of contents in matlock vfx so until next tutorial it's my manu signing off thank you for watching [Music] you
Info
Channel: madlookz VFX
Views: 4,584
Rating: undefined out of 5
Keywords: Visualeffects, Nuke tutorials, Boris FX, Silhouette tutorials, Roto tutorials, Paint-Prep in nuke, Compositing tutorials, Nuke compositing, VFX interviews, vfx and animation, vfx jobs, vfx jobs in india, vfx jobs in canada, Vfx podcast, animation podcast, vfx interviews, Animation interviews, vfx industry, vfx student, vfx india, vfxpodcasts, vfxtalkshow, vfx, Expression node in nuke, basics of expression node, expressions in nuke, programming in nuke, nuke td, compositor
Id: 8iMOlkkQF7c
Channel Id: undefined
Length: 12min 47sec (767 seconds)
Published: Tue Jul 12 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.