By default, most nodes in Nuke attempt to process the current channels in the rgba set and place the output in those same channels. However, many nodes also contain an input dropdown menu which lets you select the channels you want to process, and an output dropdown menu to select the channel(s) where the results should be stored.
Some nodes also contain mask controls and a mask input connector, which let you select a channel for use as a matte to limit operations such as color corrections. Using these mechanisms, you can point the output of almost any node in the script to any available channel.
The script below attempts to clarify these concepts. Note the script generates six channels (though it could just as well generate 1023). The steps below describe how each channel was created.
|
A six-channel script. |
1. | The script reads in the foreground, creating three channels (red, green, and blue), which are by default assigned to the rgba set. Channel count: 3 |
2. | A low contrast key (soft) is pulled and assigned to a new layer called mattes. Channel count: 4 |
3. | A high contrast key (hard) is pulled and also assigned to the mattes layer. Channel count: 5 |
4. | The mattes.hard and mattes.soft channels are mixed to form the final matte (alpha), which is assigned to the rgba layer. Channel count: 6 |
Suppose now that you wanted to perform a color correction using the output of the Soft Matte node as a mask for the correction. There’s no need to pipe the output from that Soft Matte node - it already exists in the data stream along with the other five channels that were created.
You simply attach a color correction node, such as HueCorrect, then select the appropriate channel from the mask controls, for example mattes.soft.
NOTE: The mattes portion of the name indicates the parent layer.