How To Create Reusable tools with Gizmos in Nuke with Tony Lyons @CompositingMentor

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone i'm tony lyons today i'm going to be covering some useful tips and tricks for gizmo creation in nuke over the years of collecting and learning from tool creators inspecting and modifying existing tools making some of my own tools and assembling the nuke survival toolkit i've discovered a handful of useful tips and tricks for making new gizmos i'm happy to share some of those with you in this video let's get started if you want to get quicker and better at creating gizmos in nuke you have to familiarize yourself with the user knob editing toolbar which is at the top of the property menus in this little pen icon if you click it it will reveal a list of icons that represent knobs that you can add to the gizmo with the editing mode enabled just drag and drop some of these icons onto the face of the group gizmo properties and it will start adding knobs for you you can click and drag existing knobs to change the order of them and really customize your user interface so you can kind of move everything along you can even select multiple knobs and move them at the same time in order to get rid of a knob that you have on the gizmo just select what you want to delete and you start dragging it and a garbage bin will appear on the little bottom left and you just drag them into the garbage and it is deleted and you can always undo or redo any changes that you've made if you want to add a knob from one of the tools that are inside of the group you can go to the properties of the node inside the group that you want to grab the knob from and you select the knob and just drag it onto the face of your gizmo you'll be able to tell when a knob is user created when has this orange dot next to it and you can tell when a knob is linked to one of the nodes inside of the group when it has this gray shaded circle next to it so we can tell the channels and multiply knobs are coming from the grade inside the group if i disable the toolbar for a second and start moving around the multiply slider you can see that the multiply is moving in the grade node and in the gizmo face and that is because it is a length knob and that kind of means that it is a cloned knob so these two knobs are identical and that's why they move in tandem so you can see the channels are also changing the grade the user creator knobs will not do anything by default because you need to link them to a knob inside the group yourself so let's go ahead and do that with this slider we can open the properties of the saturation and by just ctrl dragging this animation menu on this slider here to the saturation slider we can make a link now so that our knob on the front of our gizmo controls the saturation slider of the saturation node inside notice that this is an expression link so when i change the knob on the front of the gizmo it's controlling the saturation but i cannot control the saturation and control the front of the gizmo because the link is one way so it makes a keyframe which is fine you just delete the key so that is uh the major difference between the the two types of uh knobs the user knobs and the linked knobs here if you remember i could change my multiply from either direction inside the group or outside the group and it is changing whereas the expression link knob is going to change only from the face of the gizmo down to the node that is controlling inside let's go back to the editing mode by clicking on the pen if you want to enter and change the properties of any knob just click on the orange circle on the knob itself from here you can change the actual knob name and also the label of the knob which is how it appears in the gizmo interface the little eyeball icon will hide any knobs that you want and you can use the x icon to delete any knob right away if you need some help remembering what the icons stand for in the toolbar and you are familiar with the old manage user knobs menu then uh you can actually just look at this ad drop down which has the exact same order as all the icons in the toolbar and this is the name of that corresponding icon so it's a little bit of a cheat sheet or a reference for what all these icons stand for and they're in the exact same order to demonstrate how fast using the new toolbar is from the old manage user knob setup i did a little test to just time myself to see how quickly i could add all the knobs in the menu in both of the methods so let's build two identical gizmos with some user created knobs and some knobs linked from inside the gizmo and we will see how the speed comparison is using the toolbar was about three times faster than the old manage user knob menu the main reason being that the knobs from the toolbar actually come with default knob names so you don't have to worry about naming them like you did in the old method so that speeds you up and allows you to start testing your gizmo right away and the second reason is just that it's more intuitive and easier to drag and drop from the properties menu of the nodes that are inside gizmo to the face of the gizmo let's talk about inputs on gizmos so let's just say we have the small projection setup here just a project 3d a card scanline render and we'd like to turn this into a group into a gizmo so if you or just like the nodes that you'd like and hit control g it's going to give you four inputs right here so one two three four if we jump inside the group we can see that every single pipe that was available for an input has received an input node and so we spread them out here because they were on top of each other so all these have the inputs the inputs are in no particular order so you might want to rearrange them or even delete some of them for example if we didn't need this background to have an input we can just delete that but if we go to the outside of our node we'll notice that we still have four inputs that's because that we've deleted input number three but we still have input number four uh so even though we deleted three it still is registering as four inputs so that's not a problem just copy and paste and you'll have input three and you can delete four you can plug that into the camera there and then when we go back now we should have only three inputs so you might need to delete the inputs or remake them to make sure that there's a certain amount that you have so i'm just going to put the inside of the gizmo side by side with the node graph so you can see what is going on when i change some things you'll notice that each input has a number and that's just the numbers that are next to these input nodes you're going to want to rename your inputs so that they make a little bit more sense to you there's two options for renaming your inputs and both have to do with renaming the node itself so by default it's going to detect any text after the word input this capital i uh input word here so if i put project cam here you'll see that it's going to label the the previously one input as projecting it's going to completely ignore the uh the input in the beginning uh alternatively you could just uh rename the entire input uh and that's just a matter of choice uh personally i like to leave it saying input since i'll know that it is an input when i just look at it from afar but you can just rename the entire node if you'd like and so it's a nice clear label of what the input is going to be called so let's do that for all of our input i'll name uh this one image and i'll name the bottom one let's call it render camera so you can see the gizmo has all the named inputs now and we know exactly where to plug things into but you're going to have a problem if you have multiple inputs which is that if you disable the gizmo it can only pick one of the inputs to actually default to to pass through this is the b pipe or the pass through the gizmo so when the node is disabled where does it look to and that is called input zero so each of the inputs starting at zero labeled they have numbers so zero one two three four so after you've named your inputs it can be a little bit difficult to find which input was originally input zero uh and and is the b pipe of course you can disable the group and you know just try to sort it out from there obviously right now it's the projection camera so that's gonna be input but there's a clever trick to actually display the input number of each input it's a hidden knob actually in the input so if i go to the label of the input node itself we're going to use a small tcl expression and we're just going to say square brackets value space and number and then close the brackets so the square brackets and value number so this is going to display a hidden knob called number and this number is referring to the number of the nodes and you can see right now it's being labeled so actually this is the true order of the numbers of the inputs so you can see that our uh projection camera was input zero so that is the default input that is going to be called upon when we're disabling the node so that's where the node is going to default to i want my node to default to the image input so we're going to have to swap these two around so i'm just going to uh quickly swap these around and then i will change the name so i will say uh input image i'm going to write a 2 so it doesn't conflict for the moment then i'm going to rename this to a projection camera and then finally delete the two so now i've just swapped these around you can see that this input which is number zero is now at the top and when i disable the node i am defaulting to the image input if your gizmo only has one input it really doesn't need a label since there is no other input to confuse it with so you can just go ahead to the input one that is created with your gizmo and just delete the one and that'll leave your input unlabeled so that it looks a little bit more aesthetically pleasing for the next example of what we can do now that we know the input numbers i've made a small gizmo just as a demonstration and on the left side here here is the the actual node graph of nuke and on the right side here it's just the what is inside this uh distortion gizmo that i've just made and it's very simple i'll click on the result here and it's very simple i have some noise that is inside of the gizmo being made and it is being used uh to drive an eye distort which is distorting the image so this is the result of the original image and now we have a noise driving it and i've just included the settings of the noise at the front of the gizmo here so for example you could change the noise size so this is just a noise texture driving an eye distort and distorting the image let's just say that i did not want to use the noise texture that comes inside of the gizmo but i wanted to plug in my own texture let's say i wanted to plug in this uh image of fire that i i just grabbed online on the distortion gizmo i've created a texture input and there is a switch node in the gizmo so you can see here the switch is currently going to the noise the custom noise here that is inside the gizmo but if we want to add a an image i've exposed this texture input by default the gizmo is not going to know what to do when you plug this texture into it so we need to tell the gizmo to identify when an input is being used and from there we can drive this switch so let's do that now so we're going to go into the properties of the switch node and go to the which slider here we're going to add an expression this expression we're going to use square brackets we're going to say exists space parent dot input now the reason why we have to say parent.input and not just input is because the switch has inputs and the group has inputs and when we're inside of the group and we're on a node that's already inside of the group when we say parent now we're talking about the actual gizmo that's one level above it so it's referring to the group or the gizmo that the node is inside of and this next part is where knowing the input numbers is important so we have image as input 0 and the texture as input 1 and we need to identify whether or not there's an input in input 1 which is the texture so we're going to put input 1 and then we're going to close the brackets so this is brackets exists parent.input 1. so literally does there exist an input already connected to input1 we're going to click ok and you'll see that our expression working and so now when we're looking at the result of our distortion gizmo if we plug in the fire image you can see that it is changing and if we highlight the stream inside of the gizmo so now you see the node graph inside the gizmo is highlighted you can see that it is indeed switching when we plug in the image let's just say that you had the numbers of the switch node swapped so that uh you wanted the zero input to be the texture and the one to be the noise now it's sort of doing the opposite so with any expression you can add a exclamation mark to be the beginning of the expression and it's going to do the the inverse of the uh the boolean which is uh zero or one so if it's one it's going to be zero and if it's zero it's going to be one so it does the exact opposite so now you can see if we look at our switch so when there is no texture it is going to one and now when there is a texture it will go to zero so that's just because of the exclamation point at the beginning of the expression so this is a good way of making your gizmo a little bit more dynamic if there's something plugged into one of the inputs i'm a big believer that for the majority of gizmos that you create that you're going to want to include a mask and a mix option in the gizmo it might seem like a trivial thing but when you're in the heat of production uh you don't want to be making dissolve nodes in order to mix your favorite tool or a key mix in order to be using it as a mask when you need it so you want these kind of basic functions available already in your gizmo for convenience for when you're using it so here i have a fancy color correct uh gizmo that i've just made which is basically just a sepia tone and i'm going to add a mask to this gizmo so i can isolate uh where i want it so let's just say i will make this portion of the image have the color correction there's many ways to make this mask work with the gizmo but i'm going to show you maybe a lesser known way that i found to be very convenient and that uh i'd like to share with everybody so the first thing we're going to need is another input for the mask so we'll make that right now input and instead of one i'll just call it mask so here we have uh the blank label is the main input and i'm just checking that yes it still disables and then we'll have the mask input so i'll move this mask down here and what we're going to want to do is push our stream over so you can consider this uh the the right nodes here being uh the substance of our gizmo and we're going to make a the left just sort of the b stream then we're going to make a merge node just a normal merge node we're going to set the operation to copy now when a merge node is set to copy it does exactly the same thing as a key mix with a couple exceptions i went ahead and set up an example of the difference between using a key mix and using a merge set to copy and the results are identical for the actual image results but there's a couple things that make the merge node a little more friendly for the use case of the gizmo the key mix you'll notice is taking into consideration the roto shape from the mask in the bounding box so even though neither a nor b has any bounding box information outside of the the canvas that when we do the key mix it's actually taking into consideration the roto shape whereas the copy node does not so because neither a nor b go outside of the canvas bounding box when we copy it even though our roto is uh the same it is not changing our bounding box which is very nice the second difference between the keymix and the merge copy comes from what happens when we unplug the mask so on a keymix if you unplug the mask it defaults to the b stream so basically the keymix says show me a wherever this mask is so if there is no mask it's going to just show b with a merge copy however it's a little bit different since the operation is copying a by default when we remove the mask it assumes that you want to copy a completely and so you're limiting the area where a is being copied so even though they give you the same result the key mix defaults to the b stream and the merge copy defaults to the a stream another way of saying it is if there's no mask input show me 100 of a and only limit it whenever there's a mask plugged in and you can see how this could be very handy for the inside of a gizmo so let's add it so we have the merge copy node inside of the gizmo and we're going to connect it so that the b pipe is directing back to the input and then we're going to plug in the a input to the result of the gizmo or the guts of the gizmo here so that'll be our color correct from there i'm just going to plug the mask of the merge copy into the mask input and right away we're going to see that it's doing exactly what we want we don't get any errors and we don't get any problems and when we unplug we don't have to detect for an input because actually the merge node is doing it for us so we can see that it's working we change our mask and we're getting exactly what we want with no problems once we unplug it if we there is no mask it's going to default to the a input of the copy which is our gizmo guts our color correction in this case now that we have a functioning mask we actually want to expose some of those settings and it's incredibly easy with this submerged copy so open up the merge copy properties and if we turn on the gizmo editing pen tool if we just select the entire bottom of the merge node we can just drag and drop it right on to our gizmo face and now we have the exact same setup as you see in the actual merge node on our gizmo so you can see that we can change the incoming uh mask input uh from alpha to any channel that we want we have the inject invert and fringe buttons and we also get the free mix slider so we actually get everything for free with one simple note of the merged copy and it's super convenient to add to your gizmo the next trick involves adding a channels option to your gizmo now this is not going to work in every single case for every single gizmo and it's limited to you know certain cases oftentimes color corrections gizmos that are about color corrections you're able to do this channels option also filters sometimes you're able to do this channel options but there are certain nodes like blink script or expressions that you cannot do to every channel at the same time so this won't work in all scenarios but let's just say you have a case where you could add all channels i'll show you how to do this actually also with this merge copy so the first thing you're going to want to do is make sure that the nodes that are contained in your gizmo are applied to all channels so in this case i just have a color correct and a grade and i'll put them to all channels but let's just say i add another node a blur that will also be set to all channels so the key would be to make your gizmo work for all the channels and then we want to select our channels using this merge copy so we'd only be affecting the channels that we're copying over in the end so i've just added an extra layer here called bg called background and i just injected in another image here of this nice bavarian landscape and now we can confirm that this image has multiple layers if we go here you can see bg and rgba and so let's make our fancy color correct gizmo work on all the channels if i open the properties of the merge copy inside of the gizmo you'll see that it has this also merge option here so what i'm going to do first is change the a channel b channels and output to none [Music] so now that they're all set to none the gizmo is actually not doing anything if we change this also merge to all channels then we can just use this also merge to select any channel that we want for example just the bg so i'll put it back to all for now and if i open up the properties of the gizmo we can actually use the editing tool again to once again just drag and drop that to the top here and instead of also merge we're gonna want to call it channels so if i just name it channels and display here channels so now we have a functioning channels option you might want to add a divider line just to make it nice and organized so if i want to confirm that it's working i can just take a look at my bg layer and you can see that the color correction is also being applied to the bg layer now if i change this back to rgba you can see that it's left alone or i can just make it affect only the bg layer and if i switch it back to rgba then nothing is happening so we have a functioning channels option for our gizmo i'm going to leave the channels as rgba for now so the user has the option to change it to all channels but it will be default to be rgba i'll go ahead and delete this viewer from inside the gizmo you can see that this merge copy node is actually doing a lot of heavy lifting for us it's allowing us to add a mask and mix along with a channels option for our gizmo all in one node [Music]
Info
Channel: Foundry
Views: 10,586
Rating: undefined out of 5
Keywords: visual effects breakdown, visual effects artist, visual effects showreel, visual effects behind the scenes, visual effects video, visual effects course, visual effects animation, visual effects art, visual effects beginner, visual effects bts, visual effects compilation, visual effects channel, visual effects company, visual effects cgi, visual effects compositing, visual effects career, visual effects demo, visual effects examples, visual effects film
Id: ad6PEW5Z-wA
Channel Id: undefined
Length: 23min 37sec (1417 seconds)
Published: Mon Jun 06 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.