- [Instructor] The Roto node's sophistication
gives it great power and flexibility
to solve a number of masking problems.
However, this sophistication also creates confusion
as to how to set it up for specific situations.
In this video, we'll see how to set up the Roto node
for a variety of common production situations.
Now, one of the first things we want to be clear on
is what controls the size of the Roto node.
So, I'm hooked up to this Read node here.
And as you can see, it's a 512 by 372.
If I hook up to the Roto node
and switch to the alpha channel,
it's adopted the same size as the image it's connected to.
That's fine.
What do you get if it's not connected to an image?
Let's see.
Okay, what we have now is,
I'm going to punch up Project Settings to show you,
it's taken on the Full Size Format of the Project Settings.
So, if you don't connect it to anything,
it's going to get its size from Project Settings.
Now, what if you want it to be some nonstandard size?
You don't want it hooked to an image,
you just want it to be a particular size.
Well, that's an easy one.
Grab yourself a Reformat node,
set it for whatever size you want your Roto to be
and hook your Roto up to it.
And voila, it'll adopt the resolution of the Reformat node
just as though it were an image.
Alright, then.
Let's take a look at masking an operation.
Clear our Property bin and switch our viewer back to RGB
and hook up to this very lovely Read node.
So, I've got a Grade node attached here.
And if I open that up and I blast it with a big Gain,
obviously the entire plate is going to get blasted, okay?
So, what we do is, I have a Roto node here
that's got a Shape drawn there.
And hooking it up to the mask input of the Grade node.
Boom, okay.
Now it's just affecting that part of the picture.
Now, let's open up the Grade node here.
Take a look, watch right here.
So, I disconnect this, you see?
The Grade node has sensed
that there was a connection which is now gone.
So, any time you hook something up to that mask input,
it'll automatically, click, select it.
If you want to disable it for some reason,
you can just turn off the little X there, okay?
Now it's going to apply the Gain to the entire plate.
That looks much better.
Okay, moving right along.
Let's clear the Property bin.
We are in RGB.
And let's hook up to this Read node here.
Now, the example we just saw was where we piped
the mask into the mask input of the Grade node.
But there's another workflow where you may want to
put the mask in the alpha channel.
Now, this image has no alpha channel.
So, if I then put a Roto node here
and add my Roto thing to the alpha channel.
There you go.
Now, I want this Grade node here to use it.
How do we do that?
That's done right here.
This time, however, the Grade node didn't jump to it.
It did not know.
Frankly, I don't think it cares
if there's anything in the alpha channel.
You have to tell it.
So, please use the RGB alpha channel
as the mask for my operation.
Then I can take my Gain up to two and it's just going to hit
the face, the area that I have masked, okay?
Alright, lovely.
Okay, well, we'll clear that.
Let's cruise over here and talk about
Garbage matting a greenscreen.
Now, there's two ways you can Garbage matte a greenscreen.
I'm going to hook up to my Roto node,
cause I've just drawn the Shape here
but I haven't got it configured, alright?
You can mask it off in the greenscreen itself
before the keyer, and that'll flood fill the whole area
with a lovely solid green that the keyer's going to love.
Or after the keyer, you can mask off the key itself.
So, this is the first case where we're going to
Garbage matte upstream of the keyer.
So, what I need to do is flood fill the RGB layers
with a beautiful green out here.
So, how do we do that?
Well, first we're going to have to select our node.
Then we're going to have to switch
the output of the Roto node to RGB.
Alright, well, I got a flood fill on RGB,
but it's in the wrong location.
So, here's how we fix that.
We go to the Shape tab and we say Invert.
Okay, now it's flood filling outside of my character,
but it's not the right color.
How do we fix that?
Well, we come up to the eyedropper tool of the Roto node,
cruise in here, and sample a color
to flood fill the outside.
And that's how we do a Garbage matte
on the greenscreen upstream of the keyer.
Now, the other case we talked about
was Garbage matting after the key.
So, here we are to our original greenscreen.
I use Primatte to pull a quick and dirty key.
And I've got lots of schmutz out here.
So, I need to Garbage matte that.
So, we'll open up this Roto node.
And by drawing the Shape by default
it's going to flood fill that whole area with white, okay?
Which is not what we want.
So, we'll select the Shape.
Go to the Shape tab and say Invert.
Okay, got the right place, but the wrong color.
To make it black, I'll simply grab the color slider
and pull that down to zero.
And there we have it.
I've now Garbage matted the key after the keyer.
Alright, moving right along.
Okay, let's go back to RGB here and take a look at this jet.
Now, this is a nice four channel CGI premultiplied render.
What I want to do is I want to erase the nose of this jet
before it comps over the background.
So, I drew the Roto, but I haven't set it up yet.
If we look in the alpha channel,
you can see it's output to the alpha,
which we can see right up here.
What I want to do, however, is change my Shape
to be a four channel Shape.
I want to write black into RGBA.
So, let's set output to RGBA.
Now I've got white everywhere, which is close but no cigar.
Then we go to the Shape tab
and we select the Shape in question and we say be black.
Okay, and now I've erased my jet.
By the way, the erasure occurs here, okay?
So, it's erased in the Roto5 node.
And then when it comps over, the front of the jet is gone.
Okay?
There is another workflow.
And that's to do the masking in a Merge node, okay?
So, here we've got the same four channel CGI jet.
And I got it comped over the background.
Now, I've drawn this Roto,
and the rule for the Merge node mask input is
that it will composite everywhere the mask input is white.
So, if we look at this guy, we see it's all white here.
So, I'm going to get the tail end of the jet.
And the front end is going to be erased.
Let's see if that works.
Alright, so, back to the jet.
Hit the Over node.
Hook up our mask input to this guy, and a-ha!
Look at that, okay?
So, the mask input in the Over node
will only perform the merged operation
within the white part of the masked node.
Unless of course you come over here and tell it to invert.
Ha, then you can change the rule to black. (laughs)
But you knew that.
Okay, now here's a situation where I have
an alpha channel that's got something in it, okay?
But I've drawn a Roto
and I have added this to the alpha channel.
In this case, though,
I don't want the jet to be there anymore.
How do I get rid of the jet and keep my alpha channel?
Well, that's done right here in Replace.
This is what this means, is replace the alpha.
Remember, my output is set for alpha.
So, this says replace the incoming alpha channel
with my alpha channel.
And there it is.
Lastly, let's take a look at
how we would isolate an element.
I've got this cute graphic here.
And what I want to do is isolate this little icon guy
and comp it over this background.
So, how do we do that?
Well, we attach a Roto node to the item in question.
I've already drawn my Shape
into the alpha channel as before.
But now we go to set premultiply to RGB, boom, alright?
So, I have premultiplied the RGB channel.
And now I've got a lovely isolated element
with its own alpha channel ready to comp.
Come over here to the Merge node and admire the comp.
As we've seen, the Roto node can solve
a great many types of masking problems,
but it's difficult to remember
all of the possible combinations and permutations.
Use this video as a handy reference guide
to look up how to set the Roto node
for your real-world production problems.