Showing posts with label Articles. Show all posts
Showing posts with label Articles. Show all posts

Monday, June 3, 2013

How to generate motion vector fields by using the VectorGenerator node

The VectorGenerator node in NukeX is used to create the images with the motion vector fields. This node generates two sets of motion vectors for each frame which are stored in the vector channels. The output of the VectorGenerator node can be used with the nodes that take vector input such as the Kronos and MotionBlur nodes. The image with the fields contains an offset (x, y) per pixel. These offset values are used to wrap a neighboring frame into the current frame. Most of the frames in the sequence will have two neighbors therefore two vector fields are generated for each frame: backward vector and forward vector fields.

To add a VectorGenerator node to the Node Graph panel, select the node in the Node Graph panel from which you need to generate fields and then choose VectorGenerator from the Time menu; the VectorGenerator# node will be added to the Node Graph panel. Make sure the VectorGenerator# node is selected and then press 1 to view its output in the Viewer# panel. To view the forward motion vectors, select forward from the Channel Sets drop-down. Select backward from the Channel Sets drop-down to view the backward motion vectors. To view the backward and forward motion vectors, choose motion from the Channel Sets drop-down. Figure 1 through 4 show the input image, forward and backward motion vectors, forward, and backward motion vectors, respectively.

Friday, May 31, 2013

Create a Point Cloud by using the DepthToPoints Node

The DepthToPoints gizmo is used to generate a 3D point cloud from a depth pass and 3D camera. This gizmo takes the color and depth information in the image and then creates the image as a 3D point cloud. Then, you can use the points in the point cloud to line up any geometry in the 3D space. Make sure that the alpha channel of the image is not set to black. Figures 1 and Figure 2 display the color and depth information of an input image.
Figure 1
Figure 2
To generate a point cloud using DepthToPoints gizmo, you need to follow the steps given below:

Step - 1
Export a camera chan file from your 3D application.

Step - 2
Read in the input image having depth channel embedded in it; the Read1 node will be inserted into the Node Graph panel.

Step - 3
Add a DepthToPoints node from the 3D > Geometry menu; the DepthToPoints1 node will be inserted in the Node Graph panel.

Step - 4
Make a connection between the image input of the DepthToPoints1 node and Read1 node. If image contains normal data, connect it with the norm input of the DepthToPoints1 node.

Step - 5
Click on the empty area of the Node Graph panel and then add a Camera node from the 3D menu; the Camera1 node will be inserted in the Node Graph panel.

Step - 6
In the Camera tab of the Camera1 node properties panel, click on the file_menu icon; a flyout will be displayed.

Step - 7
Choose the Import chan file option from the flyout; the Chan File dialog box will be displayed. In this dialog box, navigate to the location where you saved the chan file and then select it. Next, choose the Open button from the dialog box.

Step - 8
Select the DepthToPoints1 node in the Node Graph and then press 1 to view the output in the Viewer1 panel. You will notice that point cloud is displayed in the Viewer1 panel but the position of the cloud is not proper. We need to connect the chan camera data to the DepthToPoints1 to get the correct camera angle.

Step - 9                                  
In the User tab of the DepthToPoints1 node properties panel, select the depth channel from the depth drop-down.

Step - 10
Connect the camera input of the DepthToPoints1 node with the Camera1 node; the point cloud will be displayed in the Viewer1 panel, refer to Figure 3.
Figure 3
By default, the DepthToPoints node displays the point cloud in a solid color. If you want to display the outline of the geometry in the Viewer panel, select the wireframe option from the display drop-down, refer to Figure 4.
Figure 4
Step - 11
Enter 0.1 in the point detail field; the density of the point cloud will change in the Viewer1 panel, refer Figure 5.
Figure 5
If you set the value 1 for the point detail field, all available points will be displayed in the Viewer panel. If you want to change the size of the points, enter a value in the point size field. Now, you can place a 3D geometry in the 3D space with help of the point cloud.

Thursday, May 30, 2013

Working with the ZDefocus node in Nuke 7 Part - 2

In continuation with the Part - 1 of this article, we will work with the remaining options available in the ZDefocus node properties panel. Read Part - 1 here.

Step - 1
Navigate to the following link and then download the image with the name city_illumination.jpg on your hardd drive.

Step – 2
Load the city_illumination.jpg file into the script; the Read1 node will be inserted in the Node Graph panel.

Step – 3
Make sure the Read1 node is selected and then press 1 to view its output in the Viewer1 panel, refer to Figure 1.
Figure 1
Step - 4
Connect a ZDefocus node to the Read1 node. You will notice an error message in the Viewer1 panel about the missing depth channel. This error is generated because by default the ZDefocus node looks for depth information in the depth.z channel which is selected by default in the depth channel drop-down and there is no depth channel available in the city_illumination.jpg file.

Step - 5
In the ZDefocus tab of the ZDefocus node properties panel, select rgba.alpha from the depth channel drop-down; an error message will be displayed in the Viewer1 panel about missing alpha channel.

Step - 6
In the Read1 node properties panel, select the auto alpha check box. You will notice in the Viewer1 panel that highlights are now out of focus, as shown in Figure 2.
Figure 2
By default, the disc option is selected in the filter type drop-down. As a result, a round disc filter will be applied to the image. The filter shape parameter is used to dissolve the shape between 0 (gaussian, blobby shape)  to 1(disc) range.

Step - 7
Enter 2 in the aspect ratio field. You will notice the cat's eye type effect in the Viewer1 panel, as shown in Figure 3.
Figure 3
The aspect ratio parameter controls the aspect ratio of the filter. The default ratio is 1:1.

Step - 8
Enter 1 in the aspect ratio field. Next, select bladed from the filter type drop-down; the highlights in the Viewer1 panel will displayed in shape of iris blades, as shown in Figure 4.
Figure 4
Step - 9
Enter 3 in the bladed field; the highlights in the Viewer1 panel will display in the shape which is made of 3 iris blades, as shown in Figure 5.
Figure 5
The roundness parameter is used control the rounding of the polygon edges of the filter. If you set zero value for this parameter, no rounding will occur. The rotation parameter is used to define the rotation of the filter in degrees. The inner size parameter is used to control the size of the inner polygon. The inner feather parameter is used to add feathering around the outward and inward edges of the inner polygon. The inner brightness controls the brightness of the inner polygon. Adjust these parameter as per your requirement.

Step - 10
Select the catadioptric check box. This check box is used to produce annular defocused areas thus producing the donut-shaped highlights. The catadioptric parameter is used to control the catadioptric hole in the bokeh. This parameter will only be available, if you select the catadioptric check box. Figure 6 shows the bokeh created using the following values:

filter type: bladed
aspect ratio: 1.04
blades: 7
roundness: 0
roatation: 66
inner size: 0.105
inner feather: 0.285
inner brightness: 0.07
catadioptric: Selected
catadioptric size: 0.41
Figure 6
Step - 11
Select the gamma correction check box; a gamma curve of 2.2 will be applied on the image before blurring and then reversed for the final result. This will make the bokeh more pronounced, as shown in Figure 7.
Figure 7
Step - 12
Check the bloom check box to make the highlights more visible. When you select the check box, the bloom threshold and bloom gain parameters will become active. The highlights above the value specified by the bloom threshold value will be multiplied with the values specified for the bloom gain parameter.

Step - 13
Enter 0.88 and 2.44 in the bloom threshold and bloom gain parameters, respectively. Figure 8 shows the highlights after entering the value.
Figure 8
If you select filter shape setup from the output drop-down, the filter shape which is responsible for the shape of  the highlights will be displayed in the Viewer1 panel, as shown in Figure 9.
Figure 9
Step - 14
Select bladed from the filter type drop-down and then adjust the parameter corresponding to bladed filter type. You will notice the change in the shape in the Viewer1 panel.

Next, you will apply a custom filter to the ZDefocus node. You can create a filter image using a Flare or Roto node.

Step - 15
Rest the ZDefocus node properties. Next, select rgba.alpha from the depth channel drop-down.

Step - 16
Click on the empty area of the Node Graph panel and then add Constant node. Next, set its size to 255x255. The added Constant1 node will act as a place holder for the Flare node.

Step - 17
Make sure the Constant1 node is selected in the Node Graph panel and then connect a Flare node with it. Next, press 1 to view the output of the Flare1 node in the Viewer1 panel.

Step - 18
In the Viewer1 panel, use the position widget to position the flare at the center of the Constant node's result.

Step - 19
In the Flare tab of the Flare1 node properties panel, enter 16 and 1 in the edge flattening and corner sharpness parameters, respectively.

Step - 20
Connect the filter input of the ZDefocus1 node with the Flare1 node.

Step - 21
Select the ZDefocus1 node and then press 1 to view its output.

Step - 22
In the ZDefocus1 node properties panel, select image from the filter type drop-down; an error message will be displayed in the Viewer1 panel because the filter image has no alpha channel embedded in it. To rectify it, select rgba.red from the filter channel drop-down.

You will  notice in the Viewer1 panel that the shape of the highlights is changed according to the output of the Flare1 node.

This concludes part - 2 of "Working with ZDefocus node".

Wednesday, May 15, 2013

Read Node

This node is used to load images from the disk. This node converts all imported images to the native 32-bit linear RGB workspace. It supports file formats such as Cineon, TIFF, PSD, OpenEXR, HDRI, RAW Camera data, and so on. To add a Read node to the Node Graph panel, choose Read from the Image menu or press R; the Read File(s) dialog box will be displayed. In this dialog box, navigate to the desired file and then choose the Open button; the Read# node will be inserted in the Node Graph panel and its properties panel will be displayed with the Read tab chosen in the Properties Bin, as show in Figure 1. Various options available in the Read# node properties panel are discussed next.
Figure 1 The Read1 node properties panel

READ TAB
The options available in this tab are used to read files from the disk, set format, set proxy and proxy format, set frame range, and colorspace. These options are discussed next.

file
This parameter displays the path of the file which is loaded using the Read# node. To change the file, you can click on the folder icon located next to this parameter; the Read#:Replace dialog box will be displayed. Next, navigate to the desired file and then choose the Open button to replace the file.

cache locally
The options in this drop-down are used to set the option for the local caching in a specified folder. Local caching helps in faster reloading of the files. To set the location of the folder for local cache, choose Edit > Preferences from the menu bar; the Preferences dialog box will be displayed. In this dialog box, you can set the local cache folder by modifying the localise to parameter value. Next, choose the Save Prefs button to save the changes made and then close the dialog box. The cache locally drop-down has three options, namely auto, always, and never.

format
The options in this drop-down are used to set the size and pixel aspect ratio of the loaded image. By default, NukeX matches it with the size and pixel aspect information stored in the header of the loaded image.

proxy
This parameter is used to set path for the proxy file. Generally, a proxy file is a low res version of the full res file and is used when proxy mode is on and the required resolution is less than or equal to the size of the file.

proxy format
The options in the proxy format drop-down are used to select the size and aspect ratio of the proxy file.

frame range
The fields corresponding to the frame range parameter are used to set the first and last frames of the image sequence. There are two drop-downs corresponding to the frame range parameter. These drop-downs are used to set the behavior of the Read# node while calculating the frames outside the range specified for the fields. By default, hold is selected in these two drop-downs. As a result, NukeX holds the first and last frames for out of range frames specified by the first and last fields. Other three options available are loop, bounce, and black. The loop option is used to continuously loop the sequence for out of range frames. The bounce option is used to loop the sequence repeatedly back and forth for out of range frames. The black option is used to replace out of range frames with black frames.

frame
The options in the frame drop-down are used to set the frame mode. By default, the expression option is selected in this drop-down. You can enter an expression in the field located next to this drop-down. If the start at option is selected, the playback will not start until the playhead reaches the frame specified in the frame field. If you select the offset option, the frame displayed will be offset by the value specified in the field located next to the frame drop-down.

original range
The fields corresponding to the original range parameter are used to set the original frame range of the loaded images.

missing frames
The options in the on_error drop-down corresponding to the missing frame parameter are used to specify the action needed to be taken if the Read node encounters any error in loading the frames. By default, the error option is selected in the missing frame drop-down. As a result, NukeX displays No Such file or directory error message in the Viewer panel. If the black option is selected from the drop-down, the missing frame is filled with the black color. When the Checkerboard option is selected from this drop-down, the missing frame is filled with a checkerboard pattern. The nearest frame option from this drop-down is used to replace the missing frame by the nearest frame in the sequence. The reload button is used to re-read images from the disk.

colorspace
The options in the colorspace drop-down are used to specify the lookup table (LUT) that is used to convert values that NukeX uses internally. By default, the default option is selected in this drop-down. As a result, NukeX collects information from the header of the image. When the premultiplied check box is selected and alpha channel is available in the input image, NukeX first divides the color channels by the alpha channel before converting from the colorspace and then multiply by the alpha channel afterwards. This helps in removing artifacts from the input images. If you select the raw data check box, NukeX does not convert the data.

SEQUENCES TAB
The options in this tab are used to import a sequence script. These options are discussed next.

import sequence
This button is used to import a sequence script. This script builds a frame sequence list from an EDL file. On choosing this button, the Sequence File dialog box will be displayed. Next, you need to navigate to the script and then choose the Open button to import the script.

frame sequence
This field is used to access multiple sequences using the single read node where the naming of sequences does not follow the numeric sequence.

timecode
This parameter is used to display the timecode if it is included in the image. It displays timecode of the last opened file.

edge code
This parameter is used to display the edge code if it is in the image. It displays the edge code of the most recently opened image.

Tuesday, May 14, 2013

Removing Metadata

To remove metadata, choose the + button in the ModifyMetaData# node properties panel; a placeholder will be created in the metadata box. Next, double-click on the cell under action to display a flyout and then choose remove from the flyout. Invoke the Pick Metadata key dialog box as discussed earlier. Select the keys to be removed from the dialog box and then choose the OK button; the selected key will be removed from the metadata. To cancel an existing action choose the - (minus) button from the ModifyMetaData node properties panel.
Note: When you delete a key from the metadata, it only affects the ModifyMetaData node calculations. It does not alter the embedded metadata in the input images.

Editing Metadata

To edit metadata, in the ModifyMetaData# node properties panel, choose the + button; a placeholder will be created in the metadata box, refer to Figure art18-1. Next, double-click on the first cell under key column header; the Pick metadata key dialog box will be displayed, refer to Figure art18-2. In this dialog box, first select the key that you need to edit and then choose the OK button. Now, edit the value(s) and key(s) as required.

The ModifyMetaData1 node properties panel
Figure art18-1 The ModifyMetaData1 node properties panel
The Pick metadata key dialog box
Figure art18-2 The Pick metadata key dialog box

Adding Metadata


To add metadata, select the node whose metadata you need to add and then choose the ModifyMetaData node from the MetaData menu; the ModifyMetaData# node will be connected with the selected node and its properties panel will be displayed. In this properties panel, choose the + button from the ModifyMetaData tab; a placeholder will be created in the metadata box, refer to Figure 1.

Next, double-click on the first cell under the key column header; the Pick metadata key dialog box will be displayed, refer to Figure 2. Enter a new name in the field located at the bottom of the dialog box and then choose the OK button. Now, double-click on the first cell under the value column header and then enter the value in it; the new key and its value will now flow downstream.
The ModifyMetaData1 node properties panel
Figure 1 The ModifyMetaData1 node properties panel
The Pick metadata key dialog box
Figure 2 The Pick metadata key dialog box

Comparing Metadata

To compare metadata between the two inputs, add the CompareMetaData node from the MetaData menu and then connect the nodes that you need to compare with the A and B inputs of the CompareMetaData# node, refer to Figure art16-1. On doing so, the CompareMetaData node will display a list of keys where there is difference in the metadata of the two input images, refer to Figure 2.
Figure art16-1 The Read1 and Read2 nodes connected to the CompareMetaData1 node
Figure 1 The Read1 and Read2 nodes connected to the CompareMetaData1 node
The CompareMetaData1 node displaying  difference in the keys of the two input images
Figure 2 The CompareMetaData1 node displaying
difference in the keys of the two input images

Viewing Metadata

Metadata is data within the data. It is information such as original bit depth, width, height, and so on of an image which is embedded in it. NukeX reads the embedded metadata information and passes it down to the process tree. You can change the metadata information in NukeX and also embed the new metadata to an image. You can access metadata nodes from the Metadata menu which is displayed on choosing the MetaData button from the Nodes toolbar. In this section, you will learn how to view, edit, and render the metadata.

To view the metadata embedded to an image, select the node whose metadata you want to view and then choose the MetaData button from the Nodes toolbar; the MetaData menu will be displayed. Next, choose ViewMetaData from the menu; the ViewMetaData# node will be inserted in the Node Graph panel. You can view the metadata information in the ViewMetaData tab of the ViewMetaData# properties panel, as shown in Figure 1.
The metadata information displayed in the  ViewMetaData1 node properties panel
Figure 1 The metadata information displayed in the
ViewMetaData1 node properties panel
To filter the metadata list, you can use the search metadata for field in the ViewMetaData# node properties panel. To do so, enter a filter criteria in this field; the filtered information will be displayed in the ViewMetaData tab of the properties panel of the node. Fox example, if you enter input in the search metadata for field and then press ENTER; the keys and values having the word input will be displayed in the properties panel, refer to Figure 2. By default, filtering is done for both keys and values. However, you can limit it to keys or values by selecting the keys only or values only option from the within drop-down of the ViewMetaData# properties panel.
The filtered metadata list displayed for key input
Figure 2 The filtered metadata list displayed for key input
Tip: The keys can be referenced while writing expressions.
Note: 1. While viewing the metadata information of a QuickTime file, the ViewMetaData node does not display the gamma or bit depth, refer to Figure 3.
2. If you add the ViewMetaData node after the Merge node having two inputs A and B, you can specify the input whose metadata will flow downstream. To do so, select A or B option in the metadata from drop-down from the Merge tab of the Merge node properties panel.
The metadata of a QuickTime file displayed in  the ViewMetaData# node properties panel
Figure 3 The metadata of a QuickTime file displayed in
the ViewMetaData# node properties panel

Working with Properties Panel Controls

NukeX gives you various types of controls to edit values in the properties panel, refer to Figure 1. These controls are discussed next.

Figure 1 The parameter controls in the ColorCorrect1 node properties panel
FIELDS
You can enter values directly in the input fields or use arrow keys (UP and DOWN) to increase or decrease the values. When arrow keys are used, the change in the value of the field depends on the initial position of the cursor. For example, if the current value of the field is 125.25 and you need to change it to 126.25; place your cursor after 2 and press UP ARROW once. Now, if you press DOWN ARROW twice, new field value will be 124.25. You can also enter expressions into the fields. Additionally, you can enter formulae in the input fields for quick calculations. For example, if you enter 1280/2 in a field and then press ENTER, NukeX will return a value of 640.
Tip: You can also increase or decrease field values using the mouse wheel. To do so, place the cursor in the field and then scroll mouse wheel. If the mouse wheel is not available then press and hold ALT and drag the field values.
SLIDERS
To set a value with the slider, drag the slider knob as required or click on the scale located beneath the slider. To reset a slider to its default value press and hold CTRL and click on the slider.

CHANNELS
By default, NukeX uses single value for the R, G, B, and A channels. For example, if in the ColorCorrect1 node properties panel you set the gain field value to 1.2, this value will simultaneously affect the R, G, B and A channels, refer to Figure 2. You can choose the field’s Channel chooser button to switch between single and multiple values. As a result, an array of input fields will be displayed for editing channel values individually. The number on the button indicates the number of input fields available when you choose this button, refer to Figure 3.
Figure 2 The value 1.2 applied to all channels in the gain field of
the ColorCorrect1 properties panel
Figure 3 Separate r, g, b, and a channels displayed for the
gain field of the ColorCorrect1 properties panel
COLOR WHEEL
On choosing the field’s Color wheel button, the color picker window will be displayed along with the color sliders and color wheel. The color sliders and color wheel in this window are used to set the precise color values. To make sliders horizontal in this window, resize the dialog box. When the size of the window is wide enough, sliders are placed horizontally, refer to Figure 4.
Figure 4 The color picker window displayed on choosing the Color wheel button
 from the properties panel of the Grade1 node
To change the slider set displayed in the color picker window, choose TMI (Temperature, Magenta/Green, Intensity), HSV (Hue, Saturation, Value), or RGB (Red, Green, Blue) button from the color picker window, refer to Figure 4. To enable dynamic colors for the sliders background, choose the Dyn button. Choose the Show the color wheel button to cycle through color wheel states, the color wheel, and square, refer to Figure 5. Choose the color swatch button to show or hide the color swatches in the color picker window, refer to Figure 6.

Figure 13-5 The color wheel states
Figure 6 Color swatches displayed in the color picker
window on choosing the color swatch button

Drag the white triangle located at the edge of the color wheel to adjust the hue, refer to Figure 7. Drag the white circle located inside the color wheel to adjust the saturation, refer to Figure 7.
Figure 7 Controls on the color wheel
To affect only the hue of the selected color, press and hold CTRL and then drag the white triangle of the color wheel. Similarly, press and hold the SHIFT key and drag the white circle to change only the saturation, refer to Figures 8 and 9.
Figure 8 Changing only the hue values
Figure 13-9 Changing only the saturation values
You can also zoom and pan inside the color wheel. To zoom in or out in the color wheel, press and hold ALT and then drag the cursor up or down using the middle mouse button. To pan in the color wheel, press and hold ALT and then drag the cursor on it. To reset the zoom or pan operation, middle mouse click on the color wheel. The slider labels on the color wheel window are used to increment color values precisely. To increase the value by 0.01, right click on the label. To decrease the value by 0.01, left-click on the label. If you want to change the value by 0.1 or 0.001, use SHIFT or ALT. To open another color picker window while keeping the previously opened color picker window open, CTRL+click on the another parameter’s color picker button.
Figure 10 The slider labels

Node Tab

This tab is found on the properties panel of every node, refer to Figure 1. The parameters in this tab are discussed next.

Figure 1 Parameters on the Node tab
label
This field is used to add comments about the node. You can use basic HTML markup in this field.

font
The options in this drop-down are used to change the font of the text displayed on the node. The bold and italic buttons are used to bold or italicize text displayed on the node.

note_font_size
This field is used to change the size of the text displayed on the node.

color
This button is used to change the color of text displayed on the node in the Node Graph panel.

hide input
This check box is used to hide the incoming pipe of the node.

cached
This check box is used to keep the output data of the node in the memory so that it can be read quickly.

disable
This check box is used to disable or re-enable the node.

always in dope sheet
By default, the node will be displayed in the Dope Sheet panel when its properties panel is open. On selecting this check box, the node always opens in the Dope Sheet panel.

bookmark
When this check box is selected, the node is shown in the bookmark list.

postage stamp
This check box is used to display a thumbnail render of node’s output on its tile in the Node Graph panel.

static frame

This field is used to specify the frame number to be used for generating the postage stamp.

Saturday, May 11, 2013

Enhancing Workflow

Some nodes in the Other category of the Nodes toolbar are used to enhance the workflow. The StickyNote node is used to add notes to the Node bpanel. The notes can be text or HTML markup. Generally, they are used as annotations to other nodes in the Node Graph panel. You can use the Dot node to make bends in the connecting pipes. It helps you in organizing your script better. The PostageStamp node is used to display a thumbnail render of the output at the current frame. This node does not alter the data stream. The nodes used to enhance the workflow are discussed next.

Using the StickyNote Node
The StickyNote node is used to add annotation to nodes in the Node Graph panel. To add a note to the Node Graph panel, click on the area of the Node Graph panel where you need to add a note. Next, choose the Other button from the Nodes toolbar; the Other menu will be displayed. Now, choose StickyNote from the menu; the note will be displayed in the Node Graph panel. To change the note text, enter new text in the label field of the StickyNote# node properties panel. You can also enter HTML markup such as <b> your_note_text_here </b> for note to appear in bold or <i> your_note_text_here </i> for note to appear in italics in the Node Graph panel. You can also add an image to your note. To do so, use <img src=”your_logo.png”/> HTML markup.
Note: The commonly used image formats can be used for the logo but using the png format is highly recommended. Also, you need to save the image files in the plug-in path directory (C:\Program Files\Nuke7.0v4\plugins) in order to make images appear on the notes.
The Precomp node is also used to enhance the workflow. To know more about this node, click here. The Dot node is used to create bend in the pipes that connects two nodes. This node helps in organizing the node network in the Node Graph panel. To know the use of this node, click here.

This article is taken from the Nuke Book: The Foundry Nuke 7 for Compositors.

Grouping Nodes

You can group (visually organize) nodes in the Node Graph panel using the Backdrop node or the Group node. The Backdrop node is used to visually organize areas of the Node Graph panel. The Group node is used to group several nodes into a single node, and the group node thus created acts as a container for these nodes. The Backdrop and Group nodes are discussed next.

Grouping Nodes Using the Backdrop Node
To group nodes using the Backdrop node in the Node Graph panel, choose the Other button from the toolbar; the Other menu will be displayed. Next, choose Backdrop from the menu; the BackdropNode# will be inserted in the Node properties panel, refer to Figure 1. In the Node Graph panel, drag the triangle on the lower right corner of the Backdrop node to increase its size, as required. Next, press and hold the left mouse button over the title of the box and then drag the node and slip it under the nodes that you need to visually organize, refer to Figure 2. Next, click on the empty area of the Node Graph panel and then drag the title of the Backdrop# node. You will notice that nodes grouped using it move together with it.
Figure 1 The BackdropNode1 node inserted in the Node Graph panel

Figure 2 The Grade1Blur2, and ColorCorrect2 nodes visually grouped using the BackdropNode1 node
To display the properties panel of the Backdrop node, double-click on it in the Node Graph panel. To change the color of the Backdrop node, choose the tile_color button from the BackdropNode# properties panel; the BackdropNode#.title_color window will be displayed. Next, select the color as required. To change the name of the Backdrop node, enter the new name in the name field of the Backdrop node properties panel. To delete the Backdrop node and the nodes it contains, click once on the title of the node and then press DELETE. To delete only the Backdrop node, CTRL+click on the title of the node and then press DELETE.

Grouping Nodes Using a Group Node
To group nodes using the Group node, select the nodes that you need to group. If you want to replace the original nodes with the Group node, choose Edit > Node > Group > Collapse to Group from the menu bar or press CTRL+G; the Group# node will be inserted in the Node Graph panel. Also, a new panel will be displayed with the name Group# Node Graph.

To expand (ungroup) a group, select the Group# node in the Node Graph panel and then choose Edit > Node > Group > Expand Group from the menu bar or press CTRL+ALT+G. To open the Node Graph panel for the group, select the Group# node in the Node Graph panel and then choose Edit > Node > Group > Open Group Node Graph from the menu bar or press CTRL+ENTER. Alternatively, you can press the show button in the Group# node properties panel.

To keep the selected nodes in the Node Graph panel, choose Edit > Node > Group > Copy Node To Group from the menu bar or press CTRL+ALT+SHIFT+G; a free floating Group# node will be created in the Node Graph panel along with a separate Group# Node Graph panel.

This article is taken from the Nuke Book: The Foundry Nuke 7 for Compositors.

Cloning nodes

Clones are used to maintain consistency throughout the script. Cloned nodes inherit the values of their parent nodes maintaining an active link with them.
Note: You can not clone gizmos used in NukeX even if they are user created or built-in.
To clone a node, select the node in the Node Graph panel. Next, choose Edit > Clone from the menu bar or press ALT+K; NukeX will create a clone of the selected node and maintain an active link with the parent node. A clone indicator (C) will be displayed on both the nodes and they also share the same name. To declone nodes, select them and then choose Edit > Declone from the menu bar or press ALT+SHIFT+K; NukeX will declone the selected nodes and remove the active link. Two nodes can be forced to be clones in a script. To do so, select first node. Next, press and hold SHIFT and then select the second node. Next, choose Edit > Force Clone from the menu bar or press CTRL+ALT+SHIFT+K; NukeX will make the first node as forced clone of the second node.

This article is taken from the Nuke Book: The Foundry Nuke 7 for Compositors.

Editing Nodes in the Node Graph panel

Standard shortcut keys (CTRL+C, CTRL+V, and CTRL+X) are used to perform editing operations on the nodes. To copy a node in the memory, select the node and then choose Edit > Copy from the menu bar. Next, click on the empty area of the workspace to deselect any selected node and then choose Edit > Paste from the menu bar; an exact copy of the selected node is created in the Node Graph panel.
Note: When you paste nodes, NukeX automatically connects them to the node that is selected before the paste command.
You can also copy nodes to the files. To do so, select the node that you need to copy in the Node Graph panel. Next, choose File > Export Nodes As Script from the menu bar; the Export Nodes As Script dialog box will be displayed. Next, navigate to the folder where you want to save the script and enter name of the script in the pathname field. Next, choose the Save button. NukeX will save the selected node as a script with the specified name. Start Notepad and open the saved script in it to view its content. Figure 1 shows the content of the ColorCorrect node script opened in Notepad application.
Figure 1 The ColorCorrect node script displayed in Notepad
You can import the saved script files in NukeX as a node. To do so, choose File > Import Script from the menu bar; the Import Script dialog box will be displayed. Next, navigate to the folder where you have saved the script and then select the script file. Next, choose the Open button from the dialog box; the selected script file will be imported in the Node Graph panel.

To cut the node from the Node Graph panel, select the node and then choose Edit > Cut from the menu bar; NukeX will remove the selected node from the script and write it to the memory. Next, select the node that you need to connect with the node in the memory. Choose Edit > Paste from the menu bar; NukeX will insert nodes to the Node Graph panel from the memory.

To create a duplicate node, select the node in the Node Graph panel and then choose Edit > Duplicate from the menu bar or press ALT+C. A duplicate of the selected node will be created in the Node Graph panel. To delete a node, select the node in the Node Graph panel and then choose Edit > Erase from the menu bar or press DELETE; the selected node will be removed from the Node Graph panel. To disable or enable a node, select the node that you want to disable or enable in the Node Graph panel and then choose Edit > Node > Disable/Enable from the menu bar.
Tip: To toggle between enable and disable modes of a node, press D.
This article is taken from the Nuke Book: The Foundry Nuke 7 for Compositors

Selecting, Replacing, and Renaming Nodes

When you select nodes in the Node Graph panel, the selected nodes are displayed in a light yellow color. Various methods of selecting the nodes are discussed next. To select a single node, click on the node once. To select multiple nodes, press and hold SHIFT and then click on each node that you need to select. Alternatively, you can draw a marquee selection around the nodes to be selected. All the nodes that lie within the marquee will be selected. To invert a selection, choose Edit > Invert Selection from the menu bar.

To select all upstream nodes, press and hold CTRL while dragging a node; all upstream nodes that feed data to the dragged node will be selected. Next, click once in the empty workspace to clear the selection. To select all downstream and upstream nodes connected to a node, click once on the node and then choose Edit > Select Connected Nodes from the menu bar. Alternatively, you can press CTRL+ALT+A to select all nodes connected to the selected node. To select all nodes, choose Edit > Select All from the menu bar. Alternatively, press CTRL+A to select all nodes in a script.
Tip: Press and hold CTRL+SHIFT and then click to select one or more nodes without clearing the selection made earlier.
To select a node by its name, choose Edit > Search from the menu bar; the Nuke dialog box will be displayed. Type the name of the node in the search field and then choose the OK button; the node will be selected in the Node Graph panel. Also, the selected node will be centered in the visible workspace area. You can also use wild cards to select nodes by the name. You can use asterisks for multiple alphanumeric search strings and question marks for representing a single character search.

You can also select nodes based on their color, class, and label. For example, to select nodes based on the color, select a node and then choose Edit > Select Similar > Color from the menu bar; all nodes having the same color will be selected in the Node Graph panel.

Replacing Nodes
To replace a node, select the node in the Node Graph panel that you need to replace. Next, press and hold CTRL and create new node using the Nodes toolbar, shortcut menu, or the TAB menu; the selected node will be replaced by the new node.
Tip: To replace a node with the TAB menu, select the node in the Node Graph panel that you need to replace. Next, press TAB and then type first few characters of the name of the node. Next, press and hold CTRL and then select the new node from the TAB menu. If you are using a hotkey, you can not replace nodes using this method.
This article is taken from the Nuke Book: The Foundry Nuke 7 for Compositors.

Working with node connections

Once you add nodes to the Node Graph panel, you need to establish the connections between nodes to form a network. Most of the nodes have the Input, Output, and Mask connectors. These connectors determine the order in which the data stream is passed through the nodes. Figure 1 shows the connectors on the Blur1 node. Some nodes such as Merge has two input connectors: A and B. Figure-1 shows the connectors of a Merge node.

Figure 1 The Blur1 and Merge1 nodes
Disconnecting Nodes
To disconnect a node, press and hold the left mouse button on the head or tail of the connecting arrow and then drag the cursor to an empty area of the Node Graph panel. Alternatively, you can select the node and then press CTRL+D.

Reconnecting Nodes
To reconnect a node, press and hold the left mouse button on the head or tail of the connecting arrow of the node that you want to connect. Now, drag the cursor to the center of the node to which you need to make the connection and then release the left mouse button; a connection will be established between the two nodes. Alternatively, select the node (lower in the hierarchy) that you want to connect and then press and hold SHIFT. Next, select the node that you need to connect to and then press Y; a connection will be established between the two nodes.

Extracting Nodes
To extract the node, select the node that you need to extract from the node network and then choose Edit > Extract from the menu bar; the selected node will be extracted from the node network and will be placed as a free floating node in the Node Graph panel. Alternatively, you can press CTRL+SHIFT+X to extract the node. Figure 2 shows the Grade2 node extracted from the node network.

Figure 2 The extracted Grade2 node
Swapping Inputs of Nodes
Some nodes like Merge have two inputs: A and B. To swap the A input with the B input, make sure that the Merge node is selected in the Node Graph panel and then choose Edit > Node > Swap A - B from the menu bar. Alternatively, you can press SHIFT+X to swap the inputs. Figures 3 and 4 show the default and swapped inputs, respectively.

Figure 3 The default A and B inputs

Figure 4 The swapped inputs
Starting a New Branch from a Node
To create a new branch from a node, select the node from which you want to create a new branch. Next, press and hold SHIFT and then add new node using the Nodes toolbar, TAB menu, shortcut menu, or the shortcut key. Figure 5 shows two branches originating from the Blur3 node.

Figure 5  The branches originating from the Blur3 node

Duplicating the Connecting Arrow
To duplicate the connecting arrow, press and hold SHIFT and then drag the head of the output connecting arrow; a duplicate connection pipe will be displayed. Next, drop the pipe onto the node that you want to connect. This will duplicate the connecting arrow without affecting the original connection. Figure 6 shows a duplicate output arrow connected to the Grade2 node from the Blur2 node.

Figure 6  Duplicating a connecting arrow
This article is taken from the Nuke Book: The Foundry Nuke 7 for Compositors.

Inserting and Manipulating Nodes

You can insert a node in the Node Graph panel by using the Nodes toolbar, the TAB menu, the shortcut menu, or shortcut keys. All these methods are discussed next.

Inserting Nodes Using the Nodes Toolbar
To insert a node using the Nodes toolbar, choose the required category button from it and then choose the node from the menu displayed. Figure 1 shows the nodes available in the Image menu. The chosen node will be inserted in the Node Graph panel, refer to Figure 2. You will notice that whenever you insert a new node in the Node Graph panel, its properties panel will be displayed in the Properties Bin, refer to Figure 3.
Tip: You can insert the last chosen node from the Nodes toolbar by pressing the middle mouse button on the category button.
Figure 1 The Image menu displayed on choosing the Image button
Figure 2  The Constant1 node inserted in the Node Graph panel on choosing Constant from the Image menu
Figure 3 The Constant1 node properties panel displayed on inserting the Constant1 node in the Node Graph panel
Figure 4 The Constant1 node connected to the port 1 of the Viewer1 node
Inserting Nodes Using the Shortcut Menu
To insert a node using the shortcut menu, right-click on the Node Graph panel; a shortcut menu will be displayed. Choose the required category from it; a cascading menu will be displayed, refer to Figure 5. Choose the node from the cascading menu as required to insert it in the Node Graph panel.

Figure 5  Partial view of the Draw cascading menu

Note: If a node is selected in the Node Graph panel then on adding a new node, it will be automatically connected to the selected node, else it will be a free floating node.

Inserting Nodes Using the TAB Menu
To insert a node using the TAB menu, hover the cursor over the Node Graph panel and then press TAB; the TAB menu will be displayed. Next, type the first few characters of the name of the node to be inserted in the TAB field; NukeX will display all the nodes whose names begin with the typed characters. You can use the UP or DOWN arrow key to navigate through the menu. Next, select the required node in the TAB menu and then press ENTER; the selected node will be inserted in the Node Graph panel.
Tip: To reinsert the last node from the TAB menu, press TAB followed by ENTER.
Inserting Nodes Using the Shortcut Keys
To insert a node using the shortcut keys, click on the Node Graph panel to make it active and then press the shortcut key corresponding to the node that you need to add. The shortcut keys corresponding to the nodes are displayed in the category menus. These menus are displayed when you choose the category button from the Nodes toolbar.

This article is taken from the Nuke Book: The Foundry Nuke 7 for Compositors.

Working with Viewer Controls

The Viewer controls are used to navigate in the timeline, select channels, adjust the zoom scale factor, toggle proxy mode, adjust gamma and gain of the display, choose camera, create wipes, and set the Viewer process methods. Some of the Viewer controls are discussed next:

Channel Sets, Channel List, and Channel Display Style
The options in the Channel Sets drop-down are used to define a set of color channels to be displayed in the Viewer panel. By default, rgba is selected in this drop-down, refer to Figure 1. The options in the Channel List drop-down are used to define the channel that will be displayed when the A key is pressed. By default, NukeX displays the alpha channel (rgba.alpha) when the A key is pressed. However, you can select any available channel from the Channel List drop-down. The options in the Channel Display Style drop-down, located next to the Channel List drop-down, are used to set the style of the selected channel of the node.

Figure 1 The Channel Sets, Channel List, and Channel Display Style drop-downs
The alpha channel can be displayed as the red overlay at the top of the RGB channels. To do so, Select Matte overlay from the Channel Display Style drop-down. Alternatively, hover the cursor over the Viewer1 panel and then press M; the alpha channel will be displayed as a red overlay on the top of the RGB channels.

By default, RGB is selected in the Channel Display Style drop-down. You can select the R, G, B or A option from this drop-down to display the red, green, blue, or alpha channel, respectively. To display a single channel, click on the Channel Display Style drop-down and select channels to be displayed. Alternatively, you can hover the cursor on the Viewer panel and then press R, G, B, or A to display the red, green, blue, or alpha channels, respectively in the Viewer panel.

downrez
Every Viewer panel has a downrez drop-down. The options in the downrez drop-down are used to reduce the resolution of the Viewer panel. This helps in switching between various lower display resolutions for faster display calculations. Reducing display resolution of the Viewer panel results in faster display of high resolution sequences, without affecting the actual rendered output.

gamma and gain
The gamma and gain sliders are used to adjust the gamma and gain of the displayed image in the Viewer panel, refer to Figure 2. You can alter the display data stream without affecting the rendered output by changing values on these sliders. Generally, these controls are used to fill holes in mattes. The gain toggle and gamma toggle buttons are used to switch between the default values of the sliders (1) and the last adjustment made.

Figure 2 The gamma and gain sliders
The Zebra-Stripe button located on the top right corner of the Viewer panel is used to apply stripes to all the pixels having beyond the 0 to 1 range, as shown in Figure 3.

Figure 3  The out of range pixels displayed as zebra stripes
Pause
The Pause button is used to stop the Viewer panel from updating each time the changes are made to a NukeX script. If this button is active, the Viewer panel displays the last rendered frame. To activate the auto updating, choose this button again. Alternatively, press P to toggle automatic updates on and off. The button which is located on immediate left of the Pause button is used to force NukeX to recalculate the image. Alternatively, you can press U to recalculate the image.

Timeline
Timeline controls are used to play back image sequences, set frame range, set playback speed, jump to a specific frame, and generate flipbook previews, refer to Figure 4. The timeline also displays the keyframes that are created during animation. The Viewer panel shows the frame range defined in the Project Settings panel. If no frame range is defined, NukeX sets the frame range of the first image sequence that it reads.


Figure 4 The timeline controls
Navigating in the Timeline
You can also pan and zoom in the timeline just as in the Viewer# panel. To do so, hold ALT+LMB and then drag the timeline; the option in the Timeline range drop-down will change to Custom, refer to Figure 5. To change the zoom scale of the timeline, hold ALT+MMB and then drag the cursor to the left or the right. Alternatively, you can use the mouse wheel to change the zoom scale of the timeline.


Figure 5 The scaled timeline
Adjusting the Playback Range
You can adjust the playback range of the Viewer panel. To do so, press CTRL and then drag the orange playback range markers on the timeline to define the first and last frames of the footage. The frame_range_lock button located on the extreme right of the timeline is used to toggle between the new playback range and the visible timeline range, refer to Figure 6.

Figure 6 The playback range
The fps field displays the playback speed as specified in the project settings. NukeX attempts to maintain this speed, however, it might vary depending on the resolution of the footage and hardware configuration.

Jumping to a Specific Frame
You can also jump to a specific frame. To do so, choose File > Goto Frame from the menu bar; the Goto Frame dialog box will be displayed. Alternatively, press ALT+G to invoke the Goto Frame dialog box. Next, enter the desired frame number in the Frame field and then choose the OK button.

Setting the Playback Mode
You can set the playback mode by using the End of playback range behavior button located next to the Playback rate field. It is a toggle button which is used to switch between the three modes: Loop, Stop, and Bounce. These modes define the behavior of the playback when the time marker reaches the end of the timeline.

Loop: By default, this button is active. As a result, the sequence is looped continuously.

Stop: This button is used to play the sequence to the head or tail of the playback range.

Bounce: This button is used to play the sequence repeatedly back and forth.

Synchronizing Viewport Playback
The Lock/Unlock button is used to toggle the synchronized playback of the Viewer# panel. By default, all Viewer panels are locked. Therefore, if you change the current frame in a Viewer panel, all other Viewer panels will display the changed current frame number.

Creating Flipbook Previews
The Flipbook this viewer button is used to generate the flipbook preview of the selected time range. On choosing this button; the Flipbook dialog box will be displayed. Next, specify the values as required in this dialog box and then choose the OK button; the Progress dialog box will be displayed. This dialog box will disappear once the progress percentage reaches 100 and then the FrameCycler window will be displayed. Next, preview the sequence in the FrameCycler window.

Playback performance
The Playback performance button is used to stop redrawing GUI every frame during the Viewer playback. As a result, frames playback rate is optimized when playing from the RAM cache. It stops redrawing of all knobs, postage stamps, autolabels, Curve Editor, and Dope Sheet. On choosing this button again, NukeX updates the GUI to the current frame.

You can also toggle this button by selecting the optimize Viewer during playback check box from the Viewer tab of the Viewer# node properties panel. You can view the Viewer# node properties panel by hovering the cursor over the Viewer# panel and then pressing S. You can make this feature default for all the Viewer panels. To do so, choose Edit > Preferences from the menu bar; the Preferences dialog box will be displayed. In this dialog box, select the optimize Viewer during playback check box from the Viewers tab.

Displaying Image Pixels Information
The pixel value indicator is located at the bottom of the Viewer panel, as shown in Figure 7. It displays information about the pixel underneath the cursor. You can follow the methods given next to sample a single pixel or a range of pixels:

Figure 7  The pixel value indicator

  • Press and hold CTRL and click on the Viewer panel to sample a single pixel from the Viewer panel.
  • Press and hold CTRL+SHIFT and then drag the cursor to the Viewer panel to sample a region; a red rectangle will be drawn on the Viewer panel and pixels will be sampled within that region.
  • Press and hold CTRL+ALT and then click on the Viewer panel to sample a single pixel from the node’s input.
  • Press and hold CTRL+ALT+SHIFT and then drag on the Viewer panel to sample a region from the node’s input.
This article is taken from the Nuke Book: The Foundry Nuke 7 for Compositors.