Sie sind auf Seite 1von 148

School of Animation NUKE

Study Material

Bachelor & Masters in


Animation & VFX,
Multimedia & Game Design

Subject
NUKE

Faculty –GAURAV NATH

School of Animation
Asian School of Media Studies

Page 1
School of Animation NUKE

Course Objectives :

The goal of the program is from beginners to professionals, Composting and vfx artist

Duration :1 Semester

Learning Outcomes :

Student can easily do Rotoscoping COLOUR CORRECTION Tracking 3d and


STEREOSCOPY COMPOSITING

Projects :

ROTOSCOPING THE VIDEO CILP


COMPOSTING THE LIVE ACTION WITH 3D
COMPOSTING THE 3D PASSES
CAMERA PROJECATION

Page 2
School of Animation NUKE

Page 3
School of Animation NUKE

TABLE OF CONTENTS
LESSON 1 : GETTING AROUND NUKE

LESSON 2 : FILE BROWSER AND REFORMAT

LESSON 3 : KEYING

LESSON 4 : TRANSFORMATION

LESSON 5 : COLOUR CORRECTION

LESSON 6 : PAINT

LESSON 7 : TRACKING

LESSON 8 : TEMPORAL OPERATIONS

LESSON 9 : WARPING

LESSON 10 : 3D COMPOSITING

LESSON 11 : STEREOSCOPY COMPOSITING

LESSON 12 : RENDERING

Page 4
School of Animation NUKE

LESSON 1 : GETTING AROUND NUKE

Understanding The Workflow


Nuke utilizes a node-based workflow, where you connect a series of nodes to read, process, and
manipulate images. Each node in the project—an image keyer, a colour correction, or a blur filter, for
example—performs an operation and contributes to the output. The process tree reads in the direction
the arrows point as shown in the diagram below.
Read Image #1 Image Keyer Image #1 Over Image #2Write Results to DiskBlurFilterRead Image #2
Process Tree
When you save a Nuke project, the Nuke project files are saved as plain text file. You will see a series of
sequential commands by using a text editor which are interpreted and executed when you render the
output.
The Nuke Window

Nuke’s default window is divided into three panes: the Node Graph / Curve Editor Pane, the Properties /
Script Editor Pane, and the Viewer Pane.

Page 5
School of Animation NUKE

GETTING AROUND NUKE

Onto these panes, you can add the following panels :


• Toolbars for selecting nodes.
• Node Graphs (also known as DAGs) for building node trees.
• Curve Editors for editing animation curves.
• Properties Bins for adjusting the nodes’ controls.
• Viewers for previewing the output.
• Script Editors for executing Python commands.
By default, there is a Node Graph panel in the lower left corner, a Viewer panel in the top left corner, and
a Properties Bin on the right.
Menu Bar

The menu bar is located on top of the Nuke window. Its menus, such as the File or Edit menu, let you
perform more general actions related to the whole script, the viewers, or editing, rather than certain
individual nodes.

File -------------------------------------------------------------- Commands for disk operations, including loading,


saving, and importing scripts.
Edit -------------------------------------------------------------- Editing functions, preferences, and project settings.
Layout -------------------------------------------------------------- Restoring and saving layouts.
Viewer ------------------------------------------------------------- Adding and connecting viewers.
Render ------------------------------------------------------------ Rendering the output.
Help --------------------------------------------------------------- Accessing a list of Hotkeys, user documentation,
training resources, tutorial files, and Nuke-related e-
mail lists.
Tool Bar
The tool bar is located on the left-hand side of the Nuke window. By default, it consists of thirteen icons.
The different nodes are grouped under these icons based on their functions. You use the tool bar to add
nodes to the Node Graph.
To make selections from the tool bar, click on an icon and select an option from the menu that appears.
To quickly browse through the menus in the tool bar, click and drag over the icons. Nuke opens and
closes the menus as you drag over them, making it easy to search for a particular node or find out what
the available menus contain.

You can press the middle mouse button on a menu icon to repeat the last item used from that menu. For
example, if you first select a <Blur> node from the Filter menu, you can then add another <Blur> node by
simply pressing the middle mouse button on the Filter icon

Page 6
School of Animation NUKE

IMAGE Image read and write nodes, built-in Nuke elements, and Viewer nodes.

Roto shapes, paint tools, film grain, fills, lens flares, sparkles, other vector-
DRAW based image tools.

TIME Retiming image sequences.

CHANNEL Channel management.

COLOUR Applying colour correction effects.

FILTER Applying convolve filters, such as blur, sharpen, edge detect, and erode.

KEYER Extracting procedural mattes.

MERGE Layering background and foreground elements.

TRANSFORM Translating, scaling, tracking, and stabilizing elements.

3D 3D compositing nodes and tools.

VIEWS Nodes for working with views and stereoscopic or multi-view material.

METADATA Metadata Information of the selected material.

OTHER Additional operators for script and viewer management.

Page 7
School of Animation NUKE

Understanding Nodes And The Node Graphs


Let’s bring in a nuke script.
1. Open a new script. The media files is in Lesson 1 / Scripts / rockstarv2.nk. This is a finished exercise
which we will be doing in lesson 4. But first, let’s learn about nodes and graphs.
2. The Node Graph pane is where you add nodes and build your node tree. When you add a node to the
panel, its properties panel appears in the Properties Bin on the right. This is where you can adjust the
node to produce the effect you’re after. To check the result, you can view the output in a <Viewer> Node.
Working With Nodes
Nodes are the basic building blocks of any composite. To create a new compositing script, you insert and
connect nodes to form a network of the operations you want to perform to layer and manipulate your
images.
Selecting Nodes
Nuke offers a number of options for selecting nodes. Selected nodes display in a highlight colour defined
in your preferences. The default highlight colour is light yellow.
• To select a single node: Click once on the node.
• To select multiple nodes: Press Shift while clicking on each node you want to select or drag on the
workspace to draw a marquee. Nuke selects all nodes inscribed by the marquee.
• To select all upstream nodes: Press Control (pc) / Command (mac) while dragging on a node . Nuke
selects all nodes that feed data to the selected node.

• Press Control + click (pc) / Command + click (mac) on the selected node’s control panel.

• Press Control + Shift + click (pc) / Command + Shift + click (mac) to select these upstream nodes.

Page 8
School of Animation NUKE

Viewer PaneNode Graph

To select all nodes in a script: Select Edit > Select all (or press Control (pc) + A / Command (mac) + A).
To select nodes by name: Choose Edit > Search, or press forward slash (/), and the node’s name . A
dialog appears. Type ‘Primatte’ and Click, OK. The <Primatte> node in your node graph will be
highlighted as light yellow.

Getting Around Your Node Graph


1. When you have huge scripts, you will need to zoom into the node graph. Once your node graphs is
not fully viewed in the Node Graph pane, the small navigator map on the lower right will appear. Click

Page 9
School of Animation NUKE

and drag the top left corner of the navigator map to enlarge it.
2. Click inside the small window on the shaded area to move around your script.
3. To view the whole script again, press ‘F’ key to fit the script into your pane. The navigator map
will not show if the whole script is viewed.
4. To view only the node graph, press the spacebar to expand the node graph view. This is a
toggle function. Press spacebar again to go back to the previous view. You can expand any of the
pane in Nuke.
5. To pan with the mouse, press Alt (pc) / Option (mac) and drag the mouse pointer over the
workspace. The script moves with your pointer.
6. To zoom in: Move your mouse pointer over the area you want to zoom in on, and press the plus
key (+) repeatedly until the workspace displays the script at the desired scale. Press Alt (pc) / Option
(mac) and drag right while holding down the middle mouse button.
7. To zoom out: Move your mouse pointer over the area you want to zoom out from, and press
the minus key (-) repeatedly until the workspace displays the script at the desired scale or press
Alt (pc) / Option (mac) and drag left while holding down the middle mouse button.
Customizing The Nodes
1. Select the <Primatte> Node. Double click it to put its properties information into the properties pane.
2. In the title field on top of the properties panel, you should see the current name of the node. Delete
that name and enter a new name ‘My-Keyer’ in its place. The changed name is reflected on the node
graph. To change the colour of the node, click on the node colour assignment box will display the
colour controls. Pick a new colour for your node, and see the changes both on the line surrounding
its own properties panel and in the node graph. Select Nodes that is directly attach to your current
Node .

Node Notes
1. You can leave comments and change the font name and colour of your node. This is a great way to
leave information for someone who is taking over your script.

Page 10
School of Animation NUKE

2. In the properties panel, click the <Node> tab at the top of the dialog. Its attributes appear.
3. Type any comments regarding the node in the label field. These will appear on the surface of the node.
From the font pull down menu, select the font type for any text on the node.
4. Use the buttons on the right to bold or emphasize the text.
5. Enter the font size in the font size field.
6. Click colour to choose a new font colour. The Select colour dialog appears, allowing you to select the
desired

7. There 4 tick box at the bottom of the node information panel. When selected:
• Hide input - hide the arrows coming into this selected node. (check the results on the node graph)
• Cached - will always keep the output result in memory, so that it can be read quickly when changing
things connected to it.
• Postage stamp - It will create a small image in the selected node indicating its output.
• Disable - ignore this node when processing. Using the Hotkey ‘D’ will have the same result. The node has a cross
over it to indicate that it has been disabled.

Managing The Properties Panel


You can limit the number of properties panels that can be open in the Properties Bin. To do so, enter the
maximum number of properties panels in the field on the Properties Bin.

Lock The Properties Bin

Empty The Properties Bin

When you lock the Properties panel , all the new control panels will float. To empty the Properties Bin
and close all the properties panels in it, click the remove all panels button.

Other Controls On All Properties Panels Other Controls On All Properties Panels
Double click on the node <guitar_rotoMaskaa>. Check on the viewer to see a beizer shape on the guitar.
Click on the box on the right and change the colour to a pick. The outline is now pick in colour. This is
very helpful when the background colour is too close to the outline of your shape.

Page 11
School of Animation NUKE

1. Let’s add a <HueShift> node to change the colour of the stage node. Click off and do
not select any node.
2. There are 3 ways of adding a node.
3. You can select by using the tool bar. Click on the colour icon and side
menu will come out and you can select <HueShift> to insert the node into the
node graph view.

4. The faster way is to right click on the node graph pane and open the
contextual menu. Simply right click on any empty gray area in the node graph to
activate it.

Page 12
School of Animation NUKE

5. If the node has Hotkey assigned, then simple type the Hotkey to bring in the
node. If not, simply press ‘tab’ and start typing ‘HueShift’. As you do, nodes that
have Hue will start displaying inside the box. Select HueShift from the selection
and the node will be added into the node graph pane.

6. Your node at the moment not connected to any script. Simply select the node
and bring it between the stage and the <Primatte> node. When their paths are
crossed, the arrow connecting will highlight. Once you released the mouse, the
<HueShift> node will be connected to the tree.

Page 13
School of Animation NUKE

7. To disconnect a node: Drag the head or tail of the connecting arrow to an empty area of the workspace
OR Select the lower node in the tree and press Control + D (pc) / Command + D (mac).

8. To reconnect a node: Drag on the head or tail of the connecting arrow and drop it over the centre of
the node to which you want to connect.

9. Some nodes like <Light Wrap> and <Merge> node has labels A and B. Nuke distinguishes the dual
inputs that may run into a <Merge> node with the labels A and B. A refers to the foreground element, and
B to the background element. Nuke always copies from the A input to the B. This means that if you later
decide to disable the node associated with an A input, the data stream will keep flowing, because it will,
by default, use the B input.

10.To delete nodes: Select the node or nodes you want to delete. Select Edit > Erase (or press Delete).
11.To duplicate a connecting arrow: Shift + drag the connecting arrow on top of the node you want to
create a connection to. Nuke duplicates the connecting arrow, leaving the original connection untouched.

12.To bend connecting arrows: Select the node before the connector you want to bend. From the tool
bar, select Other > Dot. A dot appears after the selected node, causing a bend in the connector. Drag the
dot as necessary to reposition the bend. You can also add a dot to an existing connection by pressing
Control (pc) / Command (mac) and clicking on the yellow dot that appears on the connecting arrow.

Indicators On Nodes

Page 14
School of Animation NUKE

Some nodes have tiny indicators, like the small A on the top right hand side of <guitar_Maskaa> node.
There are several indicators that can appear on the nodes in the Node Graph, depending on what you
are doing. The following table describes what each indicator means.

Grouping Nodes

You can group nodes in the Node Graph using the <Backdrop> node or the <Group> node. The
<Backdrop> node adds a background box behind the nodes, separating the nodes visually from the rest
of the node tree. A <Group> node, instead, combines a set of nodes into a single node, acting as a
nesting container for those nodes.

Grouping Nodes With The Backdrop Node You can use the <Backdrop> node to visually group nodes
in the Node Graph. Inserting a <Backdrop> node creates a box behind the nodes. When you move the
box, all the nodes that overlap the box are moved, too. By inserting several backdrop nodes, you can
group the nodes in your node tree onto boxes of different colours and titles. This makes it easier to find a
particular node in a large node tree, for example.

To group nodes with a <Backdrop> node: 
1. Select Other > Backdrop. A <Backdrop> node box appears
in the Node Graph.

2. Drag the triangle in the lower right corner of the box to resize the box as necessary.

Page 15
School of Animation NUKE

3. Click on the box title bar and drag it to move the box behind the nodes together. If there are any nodes
on the box, they move together with the box.

4. Put the backdrop behind the above nodes and now you can move them together.

Grouping Nodes With The Group Node

You can use the <Group> node to nest multiple nodes inside a single node. To group nodes with a
<Group> node:

1. Select all the nodes you want to nest inside the <Group> node.

2. Select Other > Group (or press Control + G (pc) / Command + G (mac) on the Node Graph.

3. All the selected nodes are collapsed into a group. The original nodes are still in the layout and can be
deleted if you like. The internal structure of the <Group> node is shown on a separate tab that opens.

Page 16
School of Animation NUKE

Cloning Nodes

You can clone nodes in preparation for pasting them elsewhere in a script. Cloned nodes Inherit the
values of their parent, but unlike copied nodes, they also maintain an active link with their parents’
values. If you alter the values of one, the other automatically inherits these changes.

Clones are helpful for maintaining consistent setups across multiple elements. For example, you might
use clones to apply an identical film grain setup to a series of elements shot on the same stock. Should
you need later to make changes to the setup, these changes would automatically ripple throughout the
script.

To clone nodes:

1. Select the node or nodes you want to clone.

2. Choose Edit > Clone or (Alt + K (pc) / Option + K (mac).

Nuke clones the node(s), whilst maintaining an active link to the parental node(s). The clone status is
indicated with an orange line that connects the clone to its parent node. The nodes also share the same
name.

To declone nodes: 
1 . S elect


odes you the node
want orclone.
to de n 
2. C hoose E dit
Shift + K (pc) / Option + Shift + K (mac)).

Nuke removes the clone status of the selected nodes.

Page 17
School of Animation NUKE

Viewer Nodes And Viewer Pane

Viewer nodes, unlike process nodes, don’t alter data in any way; rather, they act as windows on it. Each
viewer node displays the render output of any connected process nodes in the viewer panel. These
nodes do not produce output for rendering; they generate display data only.

At the end of script, you will see the viewer node. Each viewer has Hotkeys to select up to 10 inputs.

1. Let’s bring in another image. Type ‘R’ Hotkey or right click to choose from the contextual menu >
image > read. Go to Lesson One / Media / seaside_still.tif and bring in the image.

2. Currently, we cannot see this image in the <Viewer> node. Let’s assign it to this <Viewer> node by
typing ‘2’. You can see that a number 2 appears on the arrow, joining to the same <Viewer> node. This
means that seaside_still.tif is assign to video input 2. Now you can toggle between 1 and 2 input.

3. Your mouse must be in the viewer pane before you can swap the viewer’s input.

Panning And Zooming The Viewer Window

To pan the frame: hold the Alt key and drag on the display. The frame follows the mouse pointer. To
recentre the frame: Press F.

Timeline Controls

Drag the orange marker along the timeline to quickly cue to a specific frame. The number of the current
frame appears in the Current field above the timeline. You can also cue to a frame by typing its number
directly into this field. By default, Nuke automatically adjusts the timeline of every Viewer window to show
the frame range defined in your Project Settings. If no frame range is defined, the frame range of the first
image you read in is used as the global frame range.

Page 18
School of Animation NUKE

To have the viewer adjust the timeline to show the ‘in’ and ‘out’ frames of the current input clip, select
Input from the frame range source menu. To adjust the playback range for the current viewer window,
Control + drag (pc) / Command + drag (mac) the red playback range marker on the timeline to a new ‘in’
and ‘out’ frames.

The fps field (frames-per-second) initially displays the project’s playback speed. Nuke will attempt to
maintain this speed throughout playback, although this adjusts depending on the resolution of the
imagery and your hardware configuration. The Frame Increment field let you specify the number of
frames by which the Previous increment / Next increment buttons cue the sequence.

Page 19
School of Animation NUKE

Page 20
School of Animation NUKE

1. Let’s choose <Split Horizontal>. The Node graph pane is now divided into 2.

2. Click and drag the <Curve Editor> pane to the empty pane. Now you can view both Node Graph and
Curve Editor at the same time as shown below.

3. To close the pane, simply click on the X icon on the top right. Drag the divider to the right or left to
open the Node graph pane.

Page 21
School of Animation NUKE

Page 22
School of Animation NUKE

Page 23
School of Animation NUKE

1. Select the Read Node <rocker_girl> and set it in video input 1. Select the node <Light Wrap> and set
the result to video input 2. So when you switch between 1 and 2, you should see the girl before and after
she is processed.

2. From the viewer composite list in the middle, select under. The two images are displayed split-screen
in the Viewer. There are 5 viewer composite display mode. <->is none, <over> , <under>, <minus> and
<wipe>.

3. Drag the handles of the cross hair to adjust the wipe:

1. Drag the cross hair centre to change its position. 


2. Drag the long handle (on the right) to rotate the wipe. 


3. Drag the arc handle to cross-dissolve the second image. 


4. When you are finished with the split-screen,select none (-) from the viewer composite list. 


Page 24
School of Animation NUKE

Page 25
School of Animation NUKE

Customizing Your Layout

Nuke gives you several options for customizing the window layout. There are 6 window layouts already
setup. They can be found on the menu under <Layout>.

1. Choose Layout > Restore Layout x to apply a previously saved layout. You can also save your layouts.
From the menu bar, choose Layout > Save Layout to save the current layout.

2. To select a predefined colour scheme, click the right mouse button and choose Edit > Preferences.
Then click the Choose a Preset button and select a colour scheme.

3. Define other appearance options, such as window colours and fonts, by changing the settings under
Edit > Preferences > the Node Graph tab.

Page 26
School of Animation NUKE

Defining Common Favorite Directories

Favorite directories can be accessed by artists with a single click from any Nuke file browser. Typically
you would create these favorites for common directories on a project.

Let’s set the directories up for our lessons. Whenever you load or save files in Nuke, you’ll see a browser
similar to the one shown below. The directory navigation buttons let you create or access the directory
from which you wish to read or write data. The navigation controls let you move through the directory
structure, bookmark favorite directories, and create new directory folders.

To use the navigation controls:

5. Click the Add Directory button to create a new directory at your current position in the file hierarchy. 


6. Click Up one directory to ascend one directory level closer to the root. 


7. Click Home to access the directory defined as your local working directory. 


8. Click Root to ascend to the very top of your local drive or server’s file hierarchy. 


9. Click Work to access the directory you (or your system administrator) defined as your network working
directory. 


10. Click the + button to add a directory bookmark. 


11. Click the edit button to edit the name or path name to a bookmark. 


12. Click the - button to remove a directory bookmark. 


Page 27
School of Animation NUKE

13. Select *.nk to display only Nuke script files. 


14. Select * to display all files (except hidden files), regardless of whether they’re associated with Nuke. 


15. Select .* * to display all files, including hidden files. 


16. Select */ to display directory names, but not their contents. 


17. Check Sequences to display image sequences as single titles, as in fgelement.%04d.cin 1- 50 rather
than 
fgelement.0001 .c
the + icon, a pop up window will appear. Click on all the categories if you want this path to be seen
in all the different browser. Click ok and now it

will appear on the side menu. 
Path Name Field 
 The path name field displays the current
directory path, let you navigate to a new path, and also enter a filename for scripts and rendered
images.

Page 28
School of Animation NUKE

18. To preview files in the file browser: 
C lick the black ar


The file browser expands to include a small viewer.
19. Let’s bring in mini_combine.exr in Lesson 2 / Media / mini_cooper. Select the file and click <Open>
to bring it into Nuke. To view it in the viewer, make sure that the image is attached to the <Viewer>
node.
20. The image information will show on the right side in the Properties menu. This shows the
information regarding this file.

This is also where you can set proxy settings for this image. You can also set proxy settings for the whole
project under Edit > Project Settings or Hotkey ‘S’ in either the Node Graph Pane or Properties Pane.

Page 29
School of Animation NUKE

Page 30
School of Animation NUKE

Change the proxy scale to 0.2 and now your image’s resolution is now only 20% of the
original. When <proxy format> is the chosen method, you use the <proxy> button to toggle
the resolution defined under Project Settings panel. In this method, you choose what format
to proxy your script to e.g. HD to Pal format.

To activate <down-res>:

Choose 4 from the <down-res> list to change the display resolution to 25% of full
resolution. Now the viewer shows the result of adding this <down-res> factor on top of the
current proxy mode.

Locking The Range

Inside Project Settings panel, you can set the amount of frames for the entire project by
defining the frame range. This frame range changes when you have different length of
media. If you do not want the range to change, then you must tick ‘lock range’. Then the
frame range will not adjust itself.

Page 31
School of Animation NUKE

The frame range of the first sequence you read in is used as the global frame range if the ‘lock range’
function is not ticked. If you add a <Checkerboard> node, the length will also be set to the ‘lock range’.

Loading Image Sequences

When you are ready to start compositing, you may want to begin by importing a background or
foreground image sequence. Typically, you would read in both full and proxy-resolution versions of the
sequence. You can read in several image sequences in one go.

Nuke reads images from their native format, but the <Read> node outputs the result using a linear
colourspace. If necessary, you can change the Colourspace option in the <Read> node’s properties
panel, or insert a Color >Colorspace node to select the colour scheme you want to output or calculate.

Page 32
School of Animation NUKE

Missing Frames

When working in a compositing environment, many elements come from different sources e.g. 3D
animation in the process of rendering while you started your compositing script. When you read the file
sequences in, you can select the following :

21. error - flag an error message if there is an error in your file sequences. 


22. black - show a black frame if there is an error in your file sequences. 


23. checkerboard - show a checkerboard if there is an error in your file sequences nearest frame - replace
the error 
frame with the nearest n
images through scaling, cropping, and pixel aspect adjustments. By setting the bounding box using
Crop, we can minimize processing and rendering times. 
Reformatting Images 
 This section we
learn how to use scaling operations with specific regard to reformatting elements to match specific
resolutions and pixel aspect ratios. Nuke includes at least two nodes designed for reformatting
elements: <Reformat> and <Crop>. When you read in elements, Nuke stores their format settings
and makes them available to the <Reformat> node. You can then apply one of the existing formats
to your images, or create, edit, and delete formats yourself. 


24. Setting The Project 


25. 1. Open a new script. The media files is in Lesson 2 / Media.

26. 
 2. Type Hotkey ‘R’ or contextual menu under Image > Read to bring in under Mini_Cooper /
mini.full.tga and connect it to the <Viewer> node. 


27. 3. Click Transform > Reformat to insert a <Reformat> node before the <Viewer> node.

28. 4. There are 3 types to choose :<to format>,<to box> and <scale>. 


29. 5. Select the format you wish to edit from the output format pull down list or from the same list, select
edit. The Edit format dialog appears. Edit the name, file size, image area, and pixel aspect fields as
necessary. 


30. 6. Click OK to save the changes to the format. 


Page 33
School of Animation NUKE

Reformat Using < Scale >

1. In the scale fields, enter scale factors for the width and the height. Click the 2 button to scale both
directions together using the same scale factor.

2. Use the resize type pull down menu to choose the method by which you preserve or override the
original pixel aspect ratio. From the < resize type > pull down list, you can choose:

31. Width - to scale the original so that it fills the output width. 


32. Height - to scale the original so that it fills the output height. 


33. Fit - to scale the original so that its smallest side fills the output width or height. 


34. Fill - to scale the original so that its longest side fills the output width or height. 


35. Distort - to scale the original so that both sides fill the output dimensions. 


3. Choose the appropriate filtering algorithm from the filter pull down list. When scaling an image with
Key, Simon, and Rifmen filters, you may see a (ringing) haloing effect on the mattes, which is caused by
pixel sharpening these filters employ. If necessary, check clamp to correct this problem.

Page 34
School of Animation NUKE

Cropping Elements

1. Delete the <Reformat> node and replace in its location with Transform > Crop.

2. Define the crop boundaries: In the viewer, drag on any side of the frame to reposition it. In the Crop
properties panel, increment or decrement the box field (x stands for left side; y, for bottom side; r, for right
side; and t, for top side).

3. To fill the cropped portion with black, check black outside. To fill the cropped portion by expanding the
edges of the image, uncheck black outside. To adjust the image output format to match the cropped
image, check reformat.

4. Increment the softness field if you wish to vignette the edges of the cropped portion.

Adjusting The Bounding Box

The bounding box defines the area of the frame that Nuke sees as having valid image data. The larger
the bounding box is, the longer it takes Nuke to process and render the images. To minimize processing
and rendering time, you can crop the bounding box. To adjust the bounding box, you can use the
<AdjBBox> node. The <AdjBBox> node Let’s you both crop and expand the bounding box edges. If
needed, you can also add a black outside edge to the bounding box using the <BlackOutside> node.

The Bounding Box And Black Outside Node The <AdjBBox> node let you expand or crop the edges of
the bounding box by a specified number of pixels.

For example, if you have an image with lots of black (0,0,0,0), you can adjust the bounding box to contain
just the useful area so that Nuke won’t waste time computing results where there is no change.

Page 35
School of Animation NUKE

1. Delete the <Crop> node and replace in its location with Transform >AdjustBBox.

2. In the <AdjBBox> node controls, adjust the Add Pixels slider to increase or decrease the size of the
bounding box. By default, 25 pixels are added to the edges of the bounding box. Nuke expands or crops
the edges of the bounding

box. If the bounding box is cropped, whatever is outside the bounding box area gets replicated towards
the edges of the image.

3. If necessary, you can remove these replicated edge pixels and fill everything outside the bounding box
area with black. To do this, use the <BlackOutside> node.

4. Click Transform >BlackOutside to insert the node after the <AdjBBox> node. Nuke fills everything
outside the bounding box area with black.

Understanding Channels

Digital images generally consist of the four standard channels: red, green, blue, and alpha. Nuke allows
you to create or import additional channels as masks, lighting passes, and other types of image data. A
Nuke script can include up to 1023 uniquely named channels per compositing script.

For example, you can combine multiple render passes from a 3D scene—an image from the red, green,
and blue channels, a depth mask (z-depth channel), a shadow pass, a specular pass, lighting passes,
and multiple mattes all stored within one image sequence in your composite.

Think of a channel as a container that contains image data. Once created or read into your composite,
the image 
data stored in a cha
with something else or the channel is removed. All channels in a script must exist as part of channel set
(also called a layer). You’re probably familiar with the default channel set—RGBA—which includes the
channels with pixel values of red, green, and blue, and also the alpha channel for transparency. The
channel set list is a group of image channels treated as a single layer. All channels in a composite must
belong to at least one channel set.

Creating Channels And Channel Sets

This section we learn how to create a single multi channel image by using a series of images. It’s
important to understand that many types of nodes allow you to direct their output to a specific channel
and parent channel set. You have the option of processing these channels in each subsequent node, or
leaving them unchanged.

Page 36
School of Animation NUKE

Create A New Channel Set And / Or Channel :

1. Open the properties panel for the < node. Make sure your viewer shows image. 2. Go to the viewer,
from the channels pull down list, select new.

3. The above dialog box will appear. Under Name, enter the name of the channel set. Click on the <
button for the channels to be filled automatically. Let’s go ahead and create 4 new channels.

4. When you check your newly created channels, they are all empty. This is because there are no
information in those layers yet. We need to copy the right information into the right channels.

5. We can do so by using the Channel > Copy node.

Channel Copy Node

Page 37
School of Animation NUKE

The Channel > Copy node features a simplified set of options. Channel > Copy has just two controls: one
for specifying the channel to copy, and one for specifying the destination channel for output.

1. Click Channel > Copy to insert a <Copy> node before the <Viewer> node of <Mini.full.tga> image or
type Hotkey ‘K’.

2. Detach the rest of the images from the viewer.

3. First, we are going to add the shadow pass image <mini.shadow.tga> into <mini.full.tga>’s channel
layer. Select the <Copy> node in the Properties panel.

4. Attached <copy> A to <mini.shadow.tga> and B to <mini.full.tga>.

5. The right set of box refers to <mini.shadow.tga>’s current channel (RGBA) and the left side refers to
the <mini.full. tga>’s new channels that we just created. Now go back to viewer, and you should be able
to display <mini.shadow> image into the new channel.

6. Continue to do the same for the rest of the images on the same tree as show in the diagram. Type
Hotkey ‘W’ or contextual menu under Image > Write and render the single image out in OpenEXR format.

7. Click on the file button to set where to save this file. Upon selecting location, type <
yourfilename.%04d.exr >. To output all channels, change the <Write> node’s Output list from RGB to All
Channels, select the OpenEXR file format, and then execute the render. Type <1> for one frame render
and <1,100 > to render an image sequences.

8. Currently the OpenEXR format (.exr) is the only file format that supports unlimited channels. Now you
have a new image with multiple channels.

Merging Images

With Nuke, you can merge images in a wide variety of ways. The <Merge> node is used for layering
multiple images together. The <Merge> node with its compositing algorithms allows you to control just
how your images are combined. When layering images with the <Merge> node, you need to select a
compositing algorithm that determines how the pixel values from one input are calculated with the pixel
values from the other to create the new pixel values that are output as the merged image.

The operation menu in the <Merge> node’s control panel houses a large number of different compositing
algorithms, giving you great flexibility when building your composite. Here are some of the more common
operations available.

Page 38
School of Animation NUKE

Page 39
School of Animation NUKE

Using Channels
Now that you have created a multi channel open exr image, let’s bring it in and use it in a color correction
situation. By using the different channel information, you will be able to color correct parts of the image
accurately.
Setting The Project
1. Type Hotkey ‘R’ or contextual menu under Image > Read to bring in Mini_Cooper / mini.combine.exr
and connect it to the <Viewer> node.
2. In the viewer, you should be able to see the different channels and the image you just created.

3. To extract the desired channel out, insert Channel > Shuffle node, in between the image and the
viewer. The first one will be the mini.diffuse channel.

Page 40
School of Animation NUKE

4. Rename the <Shuffle> node’s name to Shuffle_diffuse and under the left ‘in 1’, select <mini_diffuse>.
Do another <Shuffle> node, this time select <mini_specular>.
5. To merge <Shuffle_specular> and <Shuffle_diffuse> together, type ‘M’ to bring in the <Merge> node.
In the <Merge> node, under ‘operation’, change from the default <over> to <plus>.

6. Add a Color Correction > Grade, or Hotkey ‘G’ to insert between <Shuffle_specular> and <Merge>. Try
changing the gamma factor in the <Grade> Node. Only that one channel set is affected.

7. Now for the shadows. Add another <Shuffle> node, this time select <mini.shadow>.

Page 41
School of Animation NUKE

8. Keeping in mind we will need to reorder the A and B, the shadow layer is at the bottom and the
specular layer is on top. Add another <Merge> node. This time, under ‘operation’, change from the
default <over> to <multiply>.

9. Add another <Grade> node under <Shuffle_shadow>, and now you can control the shadow
information. Now we need to add a background for our 3D image. Let’s check if there is any alpha by
using the Hotkey ‘A’ in the viewer.

10. The alpha is missing. We can shuffle out the alpha from the original and use it to make a holdout
matte. Add another <Shuffle> node, select the alpha channel . Rename it <Shuffle_alpha>.

11.<Merge1 (plus)>’s node has a triangle on both side. From the right side triangle, an arrow indicated
that it is the mask channel and point it to <Shuffle_alpha>. Now the alpha channel is assigned. Type ‘A’
for alpha in the viewer to check for the results.

12. Type ‘R’ to read in the background, Mini_background /mini_background_combine.exr. Add another
<Merge> node to complete the composition.

Page 42
School of Animation NUKE

Keying
Keying is one of those fundamental compositing skills. You can’t composite anything until you have
mattes pulled for the elements you want to layer together. One keying operation seldom produces an
acceptable matte. Image quality, lighting conditions, subject motion, colours—even camera moves—
affect the steps required to get a clean matte f
 or your composite.
matte by processing the pixel values in the image channels, revealing another image behind it.

So how do you get a clean matte in Nuke? The best approach is to understand the strengths of each
keying tool and combine them as needed. This tutorial shows how to pull keys in Nuke and how to layer
the results with channel operations, merge nodes, and rotoshapes.
Keying Video
Nuke’s Keyer node provides standard controls for pulling luma keys, green and blue screens, and colour
channels. The Keyer node is a basic keyer with less features than Primatte. But sometime that is all we
need. Let’s use this Keyer node.
Setting The Project

1. Open a new script. The media files is in Lesson 3 / Media.

2. Type Hotkey ‘R’ or contextual menu under Image > Read to bring in Windy_hair / windy_hair.exr and
connect it to the <Viewer> node. Check out the red, blue and green channels of image by cycling through
R, G, B key. To get the full RGB again, if you are viewing Red Channel, type R again.

3. The blue channel is not that bad. We are going to use the <Keyer> node to pull the matte from there.
Now the Keyer is a basic keyer under the Keyer>Keyer . Under the Keyer’s properties menu, select
<bluescreen>.

4. In the control panel for the <Keyer> node, you’ll see the range graph. The range graph is where you’ll
adjust the low and high pixel values of the matte. The first yellow handle on the left determines the low or
transparent values of the key and second handle, on the upper-right, determines your high or opaque
values.
5. Drag the second yellow handle to the right until it reads .90 (approximately), and watch the effect in the
viewer in the alpha channel. Type A to see the Alpha channel and A again to see full color. Play with it
until you are happy with your result. My setting gets the matte inside out. That is ok since a simple invert
will do the trick.

Page 43
School of Animation NUKE

6. Add the <Invert> node by clicking Color > Invert and add the node between the <Viewer> and the
<Keyer> node. Make sure in channels <alpha> is selected.

7. Under Filter > Erode (Blur) , use <Erode> to control the edges. My settings (erode_settings) is just a
small amount. In the properties menu of this node, size is set to 1 and blur is set to 0.53.

8. Add a <Premult> node by clicking Merge >Premult.

What Is Premultiply?

Basically, colour can be stored in two different ways in an image with an alpha channel, straight or pre-
multiplied. Straight is easy. Basically, the RGB is left as it is, and the transparency is stored in the alpha
channel. Pre-multiplied means that the RGB is actually (mathematically) multiplied by the value of the
alpha channel. Without the Premult node, the blue background (like a transparent overlay) will be added
to the final comp. To take that out, use the Premult node. Let’s continue with the lesson.

9. Insert a <HueCorrect> node to get rid of the blue spill between the hair. For the compositor,
HueCorrect is obviously of greatest use in diminishing green, blue, or red- screen spill. Nuke’s
<HueCorrect> node let you make precision adjustments to the levels of saturation in a range of hues.
You do so via edits toa series of suppression curves. By choosing which curve you edit and how much of
that curve you alter, you can precisely limit the influence of the effect.

10.Select the blue channel in the properties panel of <HueCorrect> node. Sample the blue by pressing
down the Control (pc) / Command (mac) key while your pointer is over the blue area of the image. The
area will be indicated on the properties panel. Select the point closer to the blue area selected and move
the point downwards. Watch the viewer for the change of color.

Page 44
School of Animation NUKE

11.Now we deal with the background. Type Hotkey ‘R’or contextual menu under Image > Read to bring in
Windy_hair /seaside_still.tif. This will be the background for the girl.

12.A <Blur> node is added to have some control of the background. The <Blur> node is in Filter > Blur or
HotKey ‘B’. Set the blur size to 1.7. Under <Channels>, set it to <all>.

13.We can merge the keyed image to the background now. Type HotKey ‘M’ or under Merge > Merge.
Take a look at

your comp. It does not look right. Part of being a compositing artist is to train up your critical eye so you
can analyse your trouble spot and find solution to your compositing problem. This is also the baby step
toward becoming a T.D. or T.S. (Technical Director or Technical Supervisor).

14.The foreground plate is not matching with the background plate in the area of black and white region.

Page 45
School of Animation NUKE

This is the region of color that is also known as blackpoint and whitepoint of the image. When both plates
do not match, the composited shot will not look right. So we need to correct this by adding the <Grade>
node, matching the foreground image’s black point and white point to the background image’s black point
and white point.
Sampling White And Black Points With The Grade Node
The <Grade> node let you define white and black points by sampling pixels from a viewer frame. So let’s
find those points on the Windy hair girl clip.
Define With Grade:
1. In the <Grade> node properties panel, use the channels pull down list to select the channels you wish
to process. 2. Click the blackpoint parameter’s colour swatch. The eye dropper icon appears.
3. In the viewer, press Control + Shift (pc) / Command + Shift (mac) while clicking on the pixel you want
to define as the blackpoint (typically the darkest pixel). Do the same for the whitepoint (typically the
lightest pixel).

4. Insert a <Grade> node between <HueCorrect> node and <Merge> node. Inside <Grade> node, you
should find blackpoint and whitepoint. Go to the picker box of black and select it. We are going to make
the foreground plate match the background. Find the black area around the rocks. These are shadows
that is usually the darkest point in the picture. Control (pc) / Command (mac) click to select it. Check out
the settings on the grade. It is now set to 0,0,0. As suspected it is the blackest point.

5. Now we look for the White point , This time I am look at the foreground plate. The white of her eyes
looks like a good spot to use as the white point. Control (pc) / Command (mac) click on it. The whole
image gets brighten up. Basically we have just reassign the white point and black point of the foreground
plate.

You can fine-tune the corrections by adjusting the lift and gain slider. Lift controls the shadow and black
areas while the gain controls the highlight and bright areas.

Page 46
School of Animation NUKE

6. You can use the <Light Wrap> node to create background reflections on foreground elements. The
node simulates scattering of light around the edges of your foreground element. So let’s finish the comp
with a <Light Wrap> node.

7. Click Other > All Plugins > Updates first. The list of plugins will rebuild and you should find <Light
Warp> there. Connect LightWrap’s A to the Merge node and B to blurred background node.

8. In the properties panel of <Light Wrap>, set Diffuse as 48.5 and Intensity 0.5.

9. Select the <Viewer> node, right click to go to Render > Flipbook Selected or HotKey Alt + F (pc) /
Option + F (mac). A dialog box will pop out and ask for the frame range.

10.Flipbooking a sequence refers to rendering out range of images (typically at proxy resolution), then
playing them back in order to accurately assess the motion characteristics of added effects.

How Primatte Works

The Primattechromakey algorithm is a sophisticated method of colour space segmentation that can be
easily explained to help a user achieve maximum effectiveness with the tool. Primatte node comes in 3

Page 47
School of Animation NUKE

types :Primatte, Primatte RT and Primatte RT+. Basically Primatte segments all the colours in the
foreground image into one of four separate categories. The result is a ‘spill suppressed’ foreground
image and a matte which is used to apply the modified foreground to a suitable background. Primatte RT
and Primatte RT+ algorithms will produce a less accurate key. Primatte works in 3D RGB colour space.
Here is a visual representation of the Primatte algorithm after an image has been processed.

Primatte will work equally well with any colour backing screen. It does not have to be a specific shade of
green or blue.
Setting the Project
1. Open a new script. The media files is in Lesson 3 / Media
2. Type Hotkey ‘R’ or contextual menu under Image > Read to bring in Rock_Star /
Rocker_girl/rocker_girl.exr and connect it to the <Viewer> node. Check out the red, blue and green
channels of image by cycling through R, G, B. To get the full RGB again, if you are viewing Red Channel,
type R again.
3. Type Hotkey ‘R’ or contextual menu under Image > Read to bring in Rock_Star / Stage/stage.exr and
connect it to the <Viewer> node. This will be her background.
4. This time we will be using the <Primatte> node to key her out. Click Keyer>Primatte and insert the
node between the <Viewer> and the <Image> node. Attach <Rock Star> to A and Stage to B of the
<Primatte> node.

Primatte Controls

The Primatte algorithm mode delivers the best results and supports both
the Solid Colour and the Complement Colour spill suppression methods. It
is the algorithm that uses three multi-faceted polyhedrons to separate the
3D RGB colorspace. It is also the default algorithm mode and, because it is
computationally intensive, it may take the longest to render. First we look at
some of the initalise section of Primatte.

Page 48
School of Animation NUKE

Auto-Compute
The Auto-Compute button can be used as the first step in the Primatte operation.
The purpose is to try and do the first three steps of the Primatte Operation for
you. It will try to automatically detect the backing screen colour, remove it and do
some clean-up on the foreground and background noise. If the clip was shot with
an evenly lit, well saturated backing screen, the Auto-Compute button will leave
you with an image that may only need some spill removal to complete your
keying operation.

auto FG Factor

Page 49
School of Animation NUKE

The auto FG Factor slider can be used to modify how the Auto-Compute algorithm deals with foreground
noise. Change the position of this slider and you can see the results of the Auto-Compute operation
change.
auto BG Factor
The auto BG Factor slider can be used to modify how the Auto-Compute algorithm deals with
background noise. Change the position of this slider and you can see the results of the Auto-Compute
operation change.
Degrain Tools
The Degrain tools are used when a foreground image is very grainy like with film noise. As a result of the
grain, when backing screen noise is completely removed, the edges of the foreground object often
become harsh and jagged leading to a poor key. These tools were created to, hopefully, help when a
compositing artist is faced with a grainy image.
Degrain Type
The Degrain type selector gives the user a range of grain removal from ‘none’ to ‘large’. If the foreground
image has 
a large
n amount
induced pixel of film grai
noise, you may lose a good edge to the foreground
object when trying to clean all the grain noise with the Clean BG Noise Actions mode. These tools allow
the user to clean up the grain noise without affecting the quality of the key. Let’s continue with the
exercise by using tools from the Actions Section.
Select Operation
Color Picker
Select Background Colour
1. When this operational mode is selected, the Primatte operation will be initially computed by having the
user sample the target background colour within the image window. Under operation <Select BG Color>,
click on the picker, holding down the Control (pc) / Command (mac) and sample the blue background of
Rocker_girl.
2. Clean Background Noise. When this operational mode is selected, the user samples pixels on the
image window known to be 100% background. White noisy areas in the 100% background region will
become black. This is usually the second step in using Primatte. Switch the operational mode to <Select
BG Noise>.

3. Click on the picker, holding down the Control (pc) / Command (mac) and sample the noise from the
Alpha channel of the Rocker_girl. Zoom in tight to pick up any small noise on the edge of the matte.

LPERSIS
MOANTT3E
4. Clean Foreground Noise by switching the operational mode to <Clean FG Noise>. When this

Page 50
School of Animation NUKE

operational mode is selected, the user samples pixels on the image window known to be 100%
foreground. The colour of the sampled pixels will be registered by Primatte to be the same colour as in
the original foreground image. This will make dark gray areas in the 100% foreground region become
white. This is usually the third step in using Primatte.

5. Spill Sponge. When this operational mode is selected, the background colour component in the
sampled pixels (
 or spill) within the image
selected. This operation can only be used once on a particular colour and the amount of spill suppression
applied is not adjustable. It is the fastest way to remove spill from a composite image. For more accurate
spill suppression, a Fine Tuning or Spill (+) operation should follow or be used instead. This can usually
be the fourth (and final) step in using Primatte unless additional adjustments are necessary.

6. Matte Sponge. When this operational mode is selected, the sampled colour within the image window
becomes 100% foreground. However, if the sampled colour is already keyed out and removed, it leaves
the current ‘suppressed’ colour. It only affects the key or matte information. This tool is usually used to
quickly remove stray transparent pixels that have appeared during the chroma keying procedure. It is a
quick and easy way to make final adjustments to a composite.

7. Restore Detail. With this mode selected, the completely transparent background region sampled in the
image window becomes translucent. This operation is useful for restoring lost hair details, thin wisps of
smoke etc. It shrinks the small polyhedron slightly.

Dealing With Spills

Page 51
School of Animation NUKE

Primatte deal with Spills in the Spill Process Section. The light from the original blue or green screen
spills over onto the image with the performers resulting in “blue spill”or “green spill” and creating an
unwanted haze around your subject.

Choose from 4 different spill process : 
n o s uppres


Replaces thes ion
 complement

spill colour
with the complement of the backing screen colour. solidcolour

Replaces the spill colour with a ‘user selected’ solid colour.

de focused background

Replaces the spill colour with colours from a de focused version of the background image.

After adjusting Primatte, let’s look at the composition so far. Play around the footage and you will see that
there are blue spills reflected on the guitar that will mess with our alpha channel since we are keying
blue. We have to deal with this and keep the reflection to sell the shot.

In the visual effects industry, the term rotoscoping refers to the technique of manually creating a matte for
an element on a live-action plate so it may be composited over another background.

The term : Garbage matte is a rough, simple matte isolating unwanted elements from the primary
element. In this case, we are trying to isolate the areas which the guitar reflect the chroma blue screen.
Let’s take a look at the full_comp_ rockstar_V2.nk.

Page 52
School of Animation NUKE

Step One
The <Primatte key> node.

Step Two
Step Two

Controlling the blue reflection on the guitar by rotoscoping. This is the part where
the unwanted blue reflection on the guitar has to be corrected.

1. A bezier shape is drawn and animated from frame 20 to frame 50. To draw a
bezier, insert a <Bezier> node by click Draw > Bezier or HotKey ‘P’. Attach the
node directly to the <Rocker Girl> image node.

2. Holding down the Control (pc) / Command (mac) , click and draw a bezier
shape surrounding the guitar. Rename your node to ‘guitar_rotoMaskaa’.

Page 53
School of Animation NUKE

3. Frame 20 to 50 there are some blue spills reflected on the shinny guitar surface. So let’s put some
keyframes for the bezier. Go to frame 20, click on the animation button and choose ‘Set key’. Once the
key is set, make sure ‘Autokey’ is ticked. Future keyframes will be automatically inserted in shape.

4. You will also need to animate the Opacity Settings to turn on the Matte / Alpha of the rotoshape at a
particular time.

5. In the Opacity, set keyframe to 0 on frame 24. Select ‘Set key’ in the keyframe menu and go to frame
25 and set opacity to 1. Add another keyframe at frame 49 with opacity to 1, and at frame 50, opacity
keyframed at 0.

Page 54
School of Animation NUKE

6. Using constant setting for the key frames in Curve Editor should do the trick.
Control + A (pc) / Command + A (mac) to select all the keyframes in the graph
then choose <Constant> for keyframe interpolation for both the opacity and
shape keyframes.

7. Nuke features two main nodes for channel swapping: <Shuffle> and
<ShuffleCopy>. The <Shuffle> node let you rearrange the channels from a single
image (1 input) and then output the result to the next node in your compositing
tree. <ShuffleCopy> node let you rearrange channels from two images (2 inputs)
and output the result.

8. Insert a <ShuffleCopy> node to copy the alpha channel from the bezier to the
Primatte output. What you get is only the rotoshape . Add a <Premult> node to
isolate the Blue Reflection. Click Merge >Premult and insert the node after
<ShuffleCopy> node.

9. Now that we have isolated that area. Time to key it out with a <Keyer> node.
Add a <Keyer> node after the <Premult> node and change its name to
‘Dealing_Blue_Glare’ .

10.Under the <Keyer> node, switch the operation to ‘bluescreen’ and adjust the

Page 55
School of Animation NUKE

range to key the blue reflected spills from the guitar.

11.Adjust the range to .69 and .90. Type ‘A’ to view the alpha channel in the
viewer.

12.Add an additional <Blur> node to blur the alpha channel. Click Filter > Blur or
Hotkey ‘B’. Under the channel menu of the Blur properties, select <alpha> to
blur. Now the problematic areas are isolated.

Step Three

Page 56
School of Animation NUKE

Now that the problematic guitar areas are isolated, we can start colorcorrecting it
by using <HueCorrect> node. Nuke’s <HueCorrect> node let you make precision
adjustments to the levels of saturation in a range of hues. You do so via edits to
a series of suppression curves. By choosing which curve you edit and how much
of that curve you alter, you can precisely limit the influence of the effect.

1. Take from the <rocker_girl> image node and use <HueCorrect> node to
suppress and desaturate the offending blue on the guitar. Check in the range of
Frame 22 to 50. The alpha area isolated in guitar A

2. Using Control (pc) / Command (mac) click on the blue reflected area you
should be able to see a line indicating where the blue colour is appearing on the
HueCorrect graph display. Select the Sat’s curve and click on the curve points
and bring it down.

Page 57
School of Animation NUKE

3. Copy the alpha channel from Step Two Controlling the blue reflection to Step
Three Blue_reflect_color correction’s RGB by using the <ShuffleCopy> node.

4. Add another <Premult> node after <ShuffleCopy> node before merging all
together.

5. Click Merge > Merge or HotKey ‘M’, add a <Merge> node using the <Over>
operation, putting the output from corrected tree over the initial Primatte key tree.
Playback and check your comp.

6. The blue reflection spills are now corrected. 
ight


7 . Add an additional <L
Wrap> node for a better edge on the comp. Click Others > All Plugins
>LightWrap.

8. You can use the <LightWrap> node to create background reflections on


foreground elements. The node creates a reflection of light around the edges of
your foreground element by blending in whatever is in the background. Set the
LightWrap’s Diffuse to 1.5 and set the Intensity to 5.5. That should do it.

Page 58
School of Animation NUKE

Colour Correction And Colour Space


Nuke works in 32-bit floating point bit depth (colour precision) colour space and
is resolution independent. So you 
c an read your imag
chosen resolutions. Color correction is an important aspect of visual effects.
Defining tonal range (the blackpoint, whitepoint, and neutral value) is typically the
first step in colourcorrecting a clip. Tonal range adjustments often improve
contrast, but more importantly, they set the stage for subsequent colour
corrections by properly dividing the colourspace into shadow, midtone, and
highlight regions. You can accomplish that by using Nuke’s colour correction
nodes to adjust the appearance of the images in your composites.

Making Tonal Adjustments


Several of Nuke’s colour correction effects offer tonal adjustment tools. Of these,
Grade and Histogram are probably the most intuitive to operate. We start the
lesson by using Histogram.

Using Histogram

Page 59
School of Animation NUKE

1. Open a new script. The media files is in Lesson 4 / Media.

2. Type Hotkey ‘R’ or contextual menu under Image > Read to bring in under
<RedDog.dpx> and connect it to the <Viewer> node.

3. Attach the <Histogram> node to the Image viewer. Color > Histogram.

4. Connect a <Viewer>node to the output of the <Histogram> node so you can


see the effect of your changes.

5. Drag the input range slider until it lines up with the initial boundary of the
histogram.

6. Set the Histogram’s value of the input range from 0.02, 1.01995 and 0.71. The
color of image’s white and black points are now more spread out.

Page 60
School of Animation NUKE

Using The Grade Node


The <Grade> node let you define white and black points by sampling pixels from
a Viewer frame. 
1 . Alt + C (pc) / Opti
node. 
2 . C lick C olor > G
appropriate place in your script. 3

 . S ometime it is har
blackest or whitest point is in the image. Here are some tools to help.

Adjust Display Gain And Gamma


The gain and gamma sliders let you adjust the displayed image, without affecting
your final output. These controls are useful for tasks like spotting holes in mattes.
You can boost or reduce gain by entering a multiplier (exposure value), dragging
on the slider, or using the F-Stop arrows. Adjust the gain slider in order to find
the brightest and darkest areas of your image Boost or reduce gamma by
entering a gamma multiplier or dragging the gamma slider.

4. Connect a <Viewer> node to the output of the <Grade> node so you can see
the effect of your changes. In the <Grade> properties panel, use the channels
pull down list to select the channels you wish to process.

5. To find out where the blackest point in your image is, use the gain toggle to
move the gain slider to 64. Now you can see where the darkest point is. Its about
the dog’s nose. Toggle the gain back by clicking on it.

6. Click the blackpoint parameter’s colour swatch. The eye dropper icon appears.

7. In the Viewer pane, press Control + Shift (pc) / Command + Shift (mac) while
clicking on the pixel you want to define as the blackpoint (typically the darkest
pixel).

8. Now you can see where the whitest point is. It is in the dog’s eye. Toggle the
gamma back by clicking on it. Move it to about 0.15. Now you can see the
whitest point is the in the dog’s eye.

9. Click the whitepoint parameter’s colour swatch. The eye dropper icon appears.

10.In the Viewer pane, press Control + Shift (pc) / Command + Shift (mac) while

Page 61
School of Animation NUKE

clicking on the pixel you want to define as the white point (typically the lightest
pixel).

11. This is typically called one light grade. Its a process that all color correction
should take as a first step.

12.Make sure when you are selecting the black and white points, that you are
selecting from the original image and not the graded one.

Making Basic Corrections


Adjustments to contrast, gamma, gain, and offset often comprise the bulk of the
work in colour correction. Nuke’s ColorCorrect node will be used in this section of
the lesson.

Using Sliders
1. The <ColorCorrect> node is particularly convenient for making quick
adjustments to contrast, gamma, gain, and offset. A single window houses
sliders for all these basic corrections and allows you to apply these to a clip’s
master (entire tonal range), shadows, midtones, or highlights.

2. To adjust contrast, gain, gamma or offset with the <ColorCorrect> node: Click
Color >ColorCorrect (or press C) to insert a <ColorCorrect> node at the
appropriate place in your script.

3Connect a <Viewer> node to the output of the <ColorCorrect> node so you can
see the effect of your changes. 


4In the ColorCorrect properties panel, use the channels pull-down list to select
the channels you wish to process. 


Page 62
School of Animation NUKE

5. Drag the slider appropriate to the region you want to affect an operation you
want to apply. For example, to brighten the images highlights, you would drag on
the highlights gain slider. Remember too that you can use the colour sliders to
apply any of the corrections on a per channel basis by clicking on the rgba
values ‘4’ indicated in the diagram below.

Using Colour Curves


If you prefer to work with colour curves, you can use the <ColorLookup> node to
make contrast, gamma, gain, and offset adjustments (and, in fact, many others).
Colour curves refer to line graphs of a given colour channel’s brightness. The
horizontal axis represents the channel’s original, or input, values, and the vertical
axis represents the channel’s new, or output values.

1. Go to Color >ColorLookup and add the node to the image.

Page 63
School of Animation NUKE

2. You can edit the <ColorLookup> node’s colour curves to make all of the types
of corrections that are possible through the <ColorCorrect> node and you can
generally make these corrections with more flexibility and precision than is
possible with sliders.

3. In the Color Lookup properties panel, click red, green, blue, or alpha if you
want to limit the subsequent operations to a particular channel.

4. You can select multiple curves in order to edit one curve with reference to
another. Otherwise, select the master curve.

5. In the viewer, Ctrl +drag (pc) / Cmd+drag (mac) to sample color. the cursor
over the pixels you want to sample for the correction.

6. In the Color Lookup properties panel, press Control + Alt (pc) / Command +
Option (mac) while clicking on the curve to set points at the places where the
red, green, and blue lines intersect with the colour curve.

7. Edit the position of the points and adjust the tangent handles to adjust the
curve shape for the colour correction.

Page 64
School of Animation NUKE

Masking Colour Corrections


Virtually all the colour correction effects in Nuke include mask parameters that let
you limit the correction to the non- black pixel values of a matte image.

We continue with the lesson. We have graded the dog but the white fur still have
a yellow tint. So we are going to mask out the white fur and colour correct that
yellow tint.

1. Click Keyer>Keyer to bring in the <Keyer> node to do a soft key over his fur.
Attached the node under the <Grade> node.

2. Add a <Color Correction> node after the <Keyer> node. Color >ColorCorrect
or HotKey ‘C’

3. Open the node’s properties panel and locate the mask controls. The mask
controls are located at the ranges bab of the <ColorCorrect> node.

4. From the first pull down menu, select a channel from the node’s mask input as
the matte. Connect the mask to the node with the mask input connector, if you
haven’t already done so or simply assign it in the <ColorCorrection> node.

Page 65
School of Animation NUKE

Page 66
School of Animation NUKE

Making Hue, Saturation And Value Adjustments


For certain colour correction tasks like spill suppression, you ideally want to
influence only a very narrow range of colour values. For such tasks, it’s often
helpful to use effects that employ the Hue, Saturation, and Value (HSV) colour
model. As its name indicates, the HSV colour model breaks colour into three
components :

36. Hue, which refers to the colour’s location on the traditional colour wheel. 


37. Saturation, which refers to the extent to which the colour has ‘soaked up’ its
hue. 


38. Value, which refers to the brightness of the colour. 
Nukeeffects


ffers o that
allow you to correct the hue, saturation, and value components individually
or collectively. C
 orrecting Hue 
 Nuke’s HueCorrect node let you make
precision adjustments to the levels of saturation in a range of hues. You do
so via edits to a series of suppression curves. By choosing which curve you
edit and how much of that curve you alter, you can precisely limit the
influence of the effect. For the compositor, HueCorrect is obviously of
greatest use in diminishing green, blue, or red-screen spill. 
1 . Open a ne
script. The media files is in Lesson 4 / Media 2

 . Type Hotkey ‘R ’ or
contextual menu under Image > Read to bring in ‘MorphB.dpx’ and connect
it to the <Viewer> node. 
 . Attach the <H
3
image and <Viewer> node. In the HueCorrect properties panel, choose the
channels you want to influence: 
4. C lick sat to
green, blue, and alpha) equally. 
5 . C lick lum to
with luminance weighting in effect (meaning that the red channel receives
approximately 30% of the effect; the green, 60%; and the blue, 10%). 


6.Click red to influence only the red channel. 


7.Click green to influence only the green channel. 


8.Click blue to influence only the blue channel. 


9.Click r_sup suppress only the red channel. 


10.Click g_sup suppress only the green channel.

11.Edit the curve as necessary—typically this means dragging down on control


points in the hue region that you wish to suppress.

12.Select the ‘sat’ of <HueCorrect>node,in the HueCorrect properties panel,

Page 67
School of Animation NUKE

press Control + Alt (pc) / Command + Alt (mac) while clicking on the curve to plot
a particular pixel’s value on the curve.

Page 68
School of Animation NUKE

Using The Transform Node


The <Transform> and <TransformMasked> nodes let you not only translate
elements, but also rotate, scale, and skew them from a single properties panel.
<TransformMasked> is identical to <Transform> except that it offers controls for
assigning a mask to protect certain areas of the frame from translations.
Practice
1. Type Hotkey ‘R’ or contextual menu under Image > Read to bring in Lesson 5
/ Media/box/Openbox.dpx and connect it to the <Viewer> node.
2. Add Transform > Transform node, or Hotkey ‘T’ to insert between the image
and the <Viewer>. Practice the transformation overlay.
The Card3D Transform Node
Another 2D Transform node is Card3D. You’ll note when viewing the output of a

Page 69
School of Animation NUKE

<Card3D> node that it displays an overlay for executing spatial transformations.


This overlay is often a faster alternative to the properties panel.

• There are 3 axis : X axis (transform in left or right direction), Y axis


(transform in the up or down directions and Z axis (transform in the front or back
direction). Press Control (pc) /Command (mac) while dragging to rotate the
frame on any axis.

Setting The Project


1. Open a new script. The media files is in Lesson 5 / Media.

2. Type Hotkey ‘R’ or contextual menu under Image > Read to bring in all the
images in these folders :<Box><Butterman> and <Stars> and connect it to the
<Viewer> node.

3. You can open the finished script under Lesson 5/ Scripts/


Butterman_box_pop.nk and take a look at the animation. The fairylike butterman
image layer is keyframed to fly out of the box, with sparkles around.

4. This is where we bring in the rendered 3D model ‘butterman’. The model is a


pretty simple body but with a r
 ather intricate
it is flying. We are going to do something about it. Play the image sequence and
you will notice the glow in the middle is kind of lacking too. In this lesson, we will
deal with that as well.

5. Attach the <Viewer> node to <Open_box> sequence. You will see that the
lady is opening the box and the Butterman flying around. We need to match the
animation of Butterman by keyframing the <Transform> node. The objective is to
keyframebutterman to fly out of the box, behind the box cover and match its
action to the Girl’s eye.

6. Lastly let’s check on the stars sequence popping out when the box open by
attaching the viewer buffer 3.

Page 70
School of Animation NUKE

7. Add add merge > Merge or Hotkey ‘M’. Merge A to Butterman and B to the girl
with the box. You can quickly merge Butterman over Open Box and take a look.

8. Play the current script and you can see our lady is actually looking at some
thing flying out of the box. We have to match her movement with the flight of the
Butterfly man by using a <Transform> node. Add a <Transform> node before
<Merge> node. Click Transform > transform or Hotkey ‘T’. We do transform by
keyframing.

Animating Parameters

Page 71
School of Animation NUKE

Animating a parameter or keyframing refers to the change of value over time.


You do so by setting keyframes on frames at which you explicitly define a value
and allowing Nuke to interpolate the values in between. You can animate most of
Nuke’s parameters in this manner.

Set Keyframes
1. Use the <Viewer> node to move to a frame where you want to place a key.

2. Click the animation button next to the parameter you want to animate.

3. Select <Set key> from the drop down menu. The parameter’s input field turns
cyan in colour, indicating that a keyframe has been inserted. Nuke enters the
auto-key mode: when you change the parameter’s value at another frame, it will
automatically create a keyframe for you. You can also set a key for all the
controls in a node. To do so, select <Set key> on all knobs from grey area of the
properties panel from the right-click menu.

4. Go to the next frame where you want to place a key.

5. Edit the parameter’s value using the input field, regular slider etc. The moment
you change the value, Nuke creates or replace a keyframe.

6. Use the Viewer’s scrubber to preview the result.

TRANSFTo Delete A Single Keyframe :

1. Use the Viewer’s next keyframe and previous keyframe buttons to cue to the

Page 72
School of Animation NUKE

keyframe that you want to remove. Notice that the scrub bar indicates keyframes
with a light cyan mark.

2. Click the animation button. 
3 . S elect ‘Dele

4. Select ‘No animation’ to remove all keyframes from the parameter, and sets
the static value to match that of the current frame.

Using The Curve Editor


To reveal an animation curve:

1. Click the animation menu button next to the parameter whose curve you wish
to view. Select <Curve editor>. The Curve Editor panel appears with the selected
parameter’s curve. The vertical, or y axis, denotes the value of the parameter.
The horizontal, or x axis, shows the time in frame unit.

To Remove A Curve From The Editor :


1. In the parameter tree on the left, click the + and - signs to expand and
collapse the hierarchy as necessary.

The Foundry Training Central Asia Pg 70 copyright © Fatbars Limited 2010

2. Select a curve in the parameter tree, and press <Delete>.

To Zoom In Or Out In The Editor :


1. Click on the area you want to zoom in on or out of.

2. Press the + button to zoom in, or the - button to zoom out or scroll up with the

Page 73
School of Animation NUKE

mouse wheel to zoom in, or down to zoom out.

To Add Points To A Curve :


1. Click on the curve you want to edit. The curve turns yellow to indicate it’s
selected.

2. Control + Alt + click (pc) / Command + Alt + click (mac) on the part of the
curve editor you want to add a point to. You can add points both on the curve
and outside the curve.

To Select Points On A Curve :


1. To select individual points, click on the point you want to select. 
2 . To select
multiple points, Shift + click on the points, or drag a marquee around them. 3. To
select all points, press Control + A (pc) / Command + A (mac)

To Interpolate Parts Of A Curve :


1. Select the point(s) between or around which you want to interpolate the curve.

2. Right click on the Editor. Select Interpolation and the type of interpolation you
want to use. Choose Constant , Linear , Smooth, Catmull-Rom , Cubic,
Horizontal, Break, Before > Constant or Linear or After > Constant or Linear.

OLRE
MSSAOTNION5

To Repeat A Portion Of The Curve Throughout The Curve :


1. Right-click on the editor and select Predefined > Loop. The Loop dialogue
opens. 
2 . In
op the enter
field, F irst frame of lo of the portion you want
first frame
to repeat throughout the curve. 3. In the Last frame of loop field, enter the last

Page 74
School of Animation NUKE

frame of the portion you want to repeat. Click OK.

To Reverse A Curve :
Right-click on the editor and select Predefined > Reverse.

Some nodes under the Transform menu have their own controls for adding
motion blur to transformations. Transform, TransformMasked , Card3D,
CornerPin2D, Reconcile3D , Tracker and Stabilize2D. These controls allow you
to create motion blur without adding a separate node for it. Rather than
averaging the results of several whole images computed at steps over the
shutter period, a number of samples are taken at many random times over the
shutter period. This effectively gives many more “steps” and thus a smoother
looking result for a smaller total number of computations.

When using several of these nodes in a row, the motion blur is concatenated,
and the last Transform in the chain defines the motion blur applied.

In the motionblur field, enter the sampling rate. This affects the number of times
the input is sampled over the shutter time. The higher the rate, the smoother the
result. In many cases, a value of 1.0 is enough. Setting the value to 0 produces
no motion blur.

In the shutter field, enter the number of frames the shutter stays open when
motion blurring. For example, a value of 0.5 would correspond to half a frame.
Increasing the value produces more blur, and decreasing the value less.

Shutteroffset to control when the sampling of the input starts relative to the frame

Page 75
School of Animation NUKE

being rendered, analogous to when the camera shutter opened to capture


corresponding film or video footage you might have at the same frame.

Choosing A Filtering Algorithm


Spatial transformations involve remapping pixels from their original positions to
new positions. The question arises as to what values to assign remapped pixels.
Particularly in high contrast areas can create problems with image quality

For example, the figure above shows a close up a high contrast feature that has
been rotated clockwise by 45 degrees. The remapped pixels have retained their
original values, but the result is a highly aliased, or jaggy, edge.

The Filter selection in the <Transform> node is for dealing with problems due to
the spatial transformation of the image, such as ringing, aliasing, jaggy edges.
The solution is to apply a more sophisticated filtering algorithm to determine 
the
values of remapped pixels—one that takes into account, in some fashion, the
values of neighboring pixels. For example, applying Nuke’s cubic algorithm to the
above rotation, results in a softer, less jagged edge

Now that we know more about keyframing. Let’s continue with the project.

1. The transform control on the <Transform> node to control the scale, rotate
and translate. Just click and drag to move the Butterman layer around. Now look
at the <Transform> node parameters. Before adding any keyframes, we need to
plan the keyframe animation paths to match her movement.

2. Let’s start the first key frame of butterman at the properties panel of the

Page 76
School of Animation NUKE

<Transform> node..

3. On the first frame, he is still in the box. Nuke has Auto Keyframing ability. After
you set the first key, the Auto key will kick in. So let’s position the Butterman to
the first position. We have it fly out of the box so we want to move to slightly
below the open box. Set your first keyframe by going to Animation button and
select <Set key>. Now move play head forward and watch the lady’s eyes. See
where she is looking at and change direction. Move the Butterman by clicking on
the transform handles and move it to the position we want.

4. Proceed to follow where she is staring and move Butterman according. As you
can see every time you move the Transform handle a new keyframe is setup.
You can also click on the Curve Editor and see where your keyframes are. Play
back what you have set up and adjust accordingly. Now you have your
transformation all setup, its time to look at how to get the box in front.

For reference, you can set keyframes at the following :

Frame 1 : x 576 and y 72


 Frame 30 : x 533 and y 216


 Frame 39 : x 464 and y 596

Frame 43 : x 402 and y 610

Frame 48 : x 214 and y 672

Frame 56 : x 828 and y 676

Frame 63 : x 544 and y 560

Frame 75 : x 524 and y 564

5. Now you can see Butterman flying around, in sync with the girls’ eye
movement. You should also see the animation path. If you do not want to see the
path, you can toggle the overlay on /off by pressing the ‘O’ key.

6. But Butterman is coming out in front of the box. So we need to create a bezier
to help mask that part out. Add a <Bezier> node by clicking Draw > Bezier or
Hotkey ‘P’.

Page 77
School of Animation NUKE

7. Let’s start by drawing the Bezier mask. While pressing the Ctrl + Alt (pc)
Option + Command (mac), click over the viewer to draw a bezier shape around
the box.

8. To adjust the bezierpoints, right click on the point and choose break. This will
let you adjust the tangents individually. Drag the points and adjust the tangents—
the handles on each side of the points—to refine the rotoshape. One of the
features in Nuke’s bezier control is the ability to control the blur edge of each
point.

9. To split the blur points out from a single point, select the point, right click to
select <blur>. A secondary point will appear. When you move either points, both
points will move together. If you want to separate both points to increase the
distance between them, Control (pc) / Command (mac) select any of the points
to move independently. In the properties panel of <Bezier> node, under <extra
blur> and <fall off>, adjust the values till you achieve the kind of blur desired.

10.Now we need to animate this Bezier over time, following the movement of the
box opening to create a moving matte to make it look like Buttermaniscoming out
of the box instead of being in front of it.

11.Auto Key function is on for the Bezier. Now let’s animate the shape over time.
For your reference, shape keyframes are set at frame 1, 22 , 28, 34, 36, 43, 49,
55 and 75.

Now we have the mask, let’s use it. Its time to put the bezier in. We want
Butterman to be in the box not in front of it. We can just take the Bezier output
and drag it into the <Merge> node we are using right now.

Page 78
School of Animation NUKE

1. Pipe the Bezier(alpha) shape into the <Merge (over)> node. Now, Butterman
is behind the box.

2. Add a <Blur> node to help soften the alpha out. Filter > Blur or Hotkey ‘B’. We
are going to keyframe this blur so it will only blur when Butterman is coming out.
This makes it look like part of Butterman’s glow ‘leaks’ out of the box a tiny bit
before flying away.

3. Keyframe<Blur> ‘size’ to 0 at frame 30, then on frame 33 is set to about 13.8


and on frame 38, set it back to 0.

Bring in the Stars


1. The Stars need to be behind the box as well. We can use the same Bezier
mask by Merging both Butterman and the Little Star layer together. Hotkey ‘M’ or
click under Merge > Merge to add the <Merge> node. Connect A to Butterman
and B to the Stars.

2. Attach this <Merge> node to the <Merge> node with the Bezier Mask and now
both Stars and Butterman are behind the box.

3. But the Stars are out too early. So we need to add another node to set when
the Stars are blending in. Click Merge > Blend to add the <Blend> node. This

Page 79
School of Animation NUKE

node is similar to an opacity function.

4. Set keyframes at Channel 1. Go to frame 29 and set Channel 1 to 0. Go to


frame 30 and set Channel 1 to 1. Now the stars suddenly appear as they pop
themselves into the scene.

5. Add a Filter > Glow for the stars to have a little something extra for their layer.

6. Add an additional <Grade> node under the <Girl with the box> node to make
her scene darker. Under Color > Grade or Hotkey ‘G’. Play the compostiion to
see the finished work.

Using Paint
Nuke features a vector-based RotoPaint node to help with tasks like rig removal,
garbage matting and dust busting. You can draw Bezier and B-Spline shapes
with individual and layer group attributes, including per-point and global feather,

Page 80
School of Animation NUKE

motion blur, blending modes and individual or hierarchical 2D transformations.


The Paint node accepts a single foreground input and up to three background
inputs. It requires only the foreground input and uses the optional background
inputs with the Reveal tool and the Clone tool.

To connect the RotoPaintnode :

1. Click Draw >RotoPaint to add a new <RotoPaint> node or press <P> on the
Node Graph.

2. Drag the <bg> input to the node that you want to apply RotoPaint to.

3. If you plan to reveal pixels from a background element, drag the bg1 input to
the node whose output you wish to use. Repeat the above as necessary with the
bg2 and bg3 inputs.

Page 81
School of Animation NUKE

by default <0.5>. Enter an onion skin value to adjust the opacity of the overlay.
You can also toggle the Hotkey ‘T’ to enable or disable onion skin.

5. Start painting. The pointer overlay depicts both the source of the offset and the
destination as a circle (the diameter of which represents the breadth of the
stroke).

Drawing Shapes

Page 82
School of Animation NUKE

Any given RotoPaint node can hold several shapes. 6. Select the <Bezier> tool
in the RotoPaint toolbar.

7. Draw a shape in the Viewer by clicking to create the outlines that make up
your shape. While drawing, you can click+drag to create a point and adjust its
tangent handles. With the tangent handles, you can adjust the shape of your
curve.

8. Press <Shift> while moving the tangent handles to move both handles at the
same time, keeping the angle con- sistent.

9. Press Control + click (pc) / Command + click (mac) to temporarily break the
angle.

10.To close your shape, press Return or click the first point of your shape.
Changing to a different tool also closes a shape. By default, closing a shape
activates the <Select> tool.

11.With the <Select> tool active, you can Shift + click to bring up the transform
handle box, which you can use to further transform your shape or particular
points in your shape.

Selecting the Output Format and Channels


In the RotoPaint control panel, you can select one output channel or many to
indicate the channels where the results of your changes should be stored. If you
have no input connected, select an output format using format as show below.

Page 83
School of Animation NUKE

12.You can use the output mask drop-down to select a channel where RotoPaint
will output a mask for what it rendered. By default, the channel is none, but if you
choose a channel in the list, the output mask box will be checked. The mask can
be useful, for example, if you need to apply grain to the areas you’ve painted, but
you don’t want to double up the grain in other areas.

13.Premultiply multiplies the chosen input channels with a mask representing the
paint strokes and shapes.

14.From the clip to menu, select how you want to restrict the output image:

39. no clip - Do not restrict the output image. 


40. bbox - Restrict the output image to the incoming bounding box. 


41. format - Restrict the output image to the incoming for- mat area (the default). 


42. unionbbox+format - Restrict the output image to a combination of the bounding


box and the incoming format 
a rea. 


43. intersectbbox+format - Restrict the output image to an intersection of the


bounding box and incoming format 
 rea.
 1 5.F orm
a
has no input connected. 


44. Setting the Project 



16.Open a new script. The media files are in Lesson 6 / Media. 


17.Type Hotkey ‘R’ or contextual menu under Image > Read to bring in
Open_sea / open_sea.tif and connect it to the <Viewer> node. There seems to
be some digital noise (dirt) on some of the frames around 5. This happens quite
a bit in outdoor shots. 


45. Hotkey ‘P’ to add the <RotoPaint> node. Select the Clone brush. Use Shift +
Click and Control + Click drag (pc) / Command + Click drag (mac) to select
the brush size and clone location. 


Page 84
School of Animation NUKE

Editing Existing Stroke/Shape Timing


When editing an existing stroke/shape, you can edit the range of frames during
which a stroke/shape is visible. The lifetime of a stroke/shape/group is also
visible in the Life column in the stroke/shape list. By default, a shape is visible on
all frames, whereas a stroke is only visible on one frame, the frame it was
painted on.

Page 85
School of Animation NUKE

18.Make sure you have selected <Stroke will only be visible in this frame>. This
will make sure the stroke only applies to this frame.

19.Continue with your clone brush and advance the frames with the right arrow
key. You can also go backwards with the left arrow key.

20. There should be other scratches till frame 11. After you are done, press play
to check out your corrections.

Transforming Strokes/ Shapes/Groups (Transform tab)


To apply spatial transformations to your strokes, shapes, or groups, you can use
the translate, rotate, scale, skew, and center controls under the Transform tab

46. translate - to move the stroke/shape on x and y axis. 



47. rotate - to spin a stroke/shape around the pivot point. Use center to position the
pivot point. 

48. scale - to resize a curve. Use center to position the pivot point. 

49. skew - to rotate the curve of your stroke/shape around the pivot point. Use
center to position the pivot point. 

Editing Shape Specific Attributes (Shape tab) 
 The RotoPaint control
panel includes a set of controls that you mainly need when you’re editing the
attributes of a shape. You can find these, in the Shape tab in the control panel. 


adding and removing feather 


adding motion blur to a shape

50. 
 Editing Brush Hardness (Stroke tab) 
 On the Stroke tab, you can
set the hardness of the stroke using the brush hardness slider. When using
a tablet, you can also tie a stroke’s hardness to pen pressure by checking
the hardness box next to pressure alters. 
 When you are animating a stroke
or a part of it over a range of frames, you can use the write on sliders under
the Stroke tab in the control panel to adjust the order in which the dabs on
the stroke appear over these frames. 


write on start - slide to choose where along the stroke length the
paint begins. 0 is the start of the stroke, 1 is the end. 

write on end - slide to choose where along the stroke length the paint
ends. 

51. Editing Brush Type (Stroke tab) 
 On the Stroke tab, you can choose the
type of brush you want to use for the stroke. Select: 


Page 86
School of Animation NUKE

paint - to use a normal paint brush. 



smear - to use a smear brush on the plate. 

blur - to blur your plate with the brush stroke. 

sharpen - to sharpen your plate with the brush stroke.

 Editing Clone or Reveal Attributes (Clone tab) 
 When you are using
the Clone or Reveal Tool, you can adjust the controls under the Clone tab to
transform the input that’s being cloned or revealed. 

translate - to move the source image on x and y axis. 


rotate - to spin the source image around a pivot point. 


scale - to resize the source image by adding or removing pixels. Use center to
position the pivot point. 


skew - to rotate the pixel columns of the source image around the pivot point.
Use center to position the pivot 
point. 


filter - to choose the appropriate filtering algorithm. 


time offset - to clone or reveal pixels from a different frame. Time offset is either
relative to the current frame (-1 is t
 he frame previou
absolute (1 is the first frame in the clip). 


Animating Strokes/ Shapes 
 All strokes/shapes that appear on more than


one frame can be animated. By default, the ‘autokey’ option is on, which means
your changes to a stroke/shape will automatically create keyframes and animate
your stroke/shape. You can also access all the curves and shapes in the Curve
Editor. 
 o animate stroke
T
‘autokey’ function off, you can still create key frames manually. You can set key
frames to the entire stroke/shape, or the stroke/shape’s curve, transformation or
attributes. Activate <Select all> Tool (the pointer) to see the RotoPaint Toolbar
as shown below. 


Untick<autokey> to keyframe manually

Move to the frame where you want to create a keyframe and select your
stroke/shape.Do one of the following:
52. If you want to create a key that is set to animate the entire stroke/shape, right-
click on the stroke/shape and select set key > all. 


Page 87
School of Animation NUKE

53. If you want to create a key that is set to animate a position, right-click on the
stroke/shape and select set key > shape. 

54. If you want to create a key that is set to animate transformation, right-click on
the stroke/shape and select set key > transform. 

55. If you want to create a key that is set to animate attributes, right-click on the
stroke/shape and select set key > attributes. 

If you have ‘autokey’ turned off, you can only adjust a point in a shape/stroke at a
keyframe. In other words, in order to make changes to a point, you either have to
move to an existing key frame on the timeline, or you need to create a new key
frame first.
To delete a key frame:
Using the Viewer timeline, scrub to the frame where you want to delete a key
frame. In the stroke/shape list, select the stroke/shape whose key you want to
delete.
Do one of the following:
10. If you want to delete a key that is set to animate the entire stroke/shape,
right-click on the stroke/shape and select delete key > all. 

11. If you want to delete a key that is set to animate a position, right-click on
the stroke/shape and select delete key > shape. 


Page 88
School of Animation NUKE

DustBust Node
DustBust is another node that can help you help with tasks like rig removal and
dust busting. Using the same image, let’s use <DustBust> node instead to clean
up the area.
21.Add a <DustBust> node to open_sea image node. You can find DustBust in
Draw >DustBust.
22.By pressing Alt + Command (pc), Option + Command (mac), click on the
viewer and you will get these boxes with a dot in the middle. These are Dustbust
boxes. You can move them around by click and hold on the middle dot and drag
them. Once you drag one of them over some area you want to dust bust you will
see that it will suck in some of the surrounding pixels and cover up the dust.

Page 89
School of Animation NUKE

23.You can change the box shape by clicking on the corner and drag.
24.You can also change how the dusk bust box suck in the pixel by clicking and
dragging the middle dot and extend a line out. You can move the line around and
see how it affects the dust bust effect.
25. You can press ‘O’ key to turn overlay off to check the corrections. Press ‘O
again to see the vector lines again.

26.In the Properties panel of <Dustbust> node, you can change the edge
hardness to sharpen the edge by moving the slider to the right and left.

27.Experiment to see what suits your situation.

Tracking And Stabilising


In this lesson, we will be using a 2D tracker that allows you to extract animation
data from the position, size, and rotation of an image. Using these trackers'
information, you can apply the data directly to transform and matchmove another
element. Or use it to stabilise the image.

Before you track, it’s important to playback the image several times. This will
help you identify the best features for the process, as well as any problems with
motion blur or features moving out of frame. For some images, you may need to
filter or colour-correct the image to boost the visibility of features before you
attempt to track them. Nuke saves the result as animation data, so you can
disable the filter nodes or colour correction after you get a successful track.

It is a good practice to apply a slight blur, degrain, or denoise filter to the image
sequence before you start tracking the footage.

Tracking An Image
The 2D Tracker can analyse the movement of up to four different features in a
single image. Nuke generates one animation curve or track for each feature. A
single track is usually sufficient to record a feature’s horizontal and vertical

Page 90
School of Animation NUKE

position across the 2D plane. Two or more tracks are required to extrapolate
scaling and rotation.

Positioning Track Anchors


A pattern and search area accompany each track anchor. The pattern area
surrounds the grid of pixels that the system attempts to follow across multiple
frames. This pattern should be as distinct as possible from the surrounding
frames, and remain visible throughout the majority of the sequence. For
example, you might choose as a pattern a high- contrast window corner which
stays in frame throughout an entire shot. The search area defines the portion of
the frame in which the system looks for the pattern.

Positioning track anchors involves moving and sizing the boundaries of both the
search and pattern areas. Start by moving both boundaries over the pattern to be
tracked, then fine tune the position and size of each. In the end, the search area
must be larger than the pattern area. The search area contains the space where
the tracker will search for the pattern. The pattern area contains the pixels that
the tracker will attempt to “lock onto” for the track.

To move both the search and pattern boundaries : Drag on the frame to select
both boundaries with the marquee. Click on the border of either boundary, then
drag both over the pattern to be tracked (stop when the pattern boundary
overlay’s x sits directly on top the feature).

To adjust the size and position of either the search or pattern boundaries : Click
to the line-portion of either boundary to select it. Drag to reposition or scale the
boundary.

One-Point, Two-Point, Three-Point and Four-Point

Page 91
School of Animation NUKE

• One-point tracking.Track one feature’s horizontal (x-axis) and vertical


(y-axis) position, with little or no perspective change on the image. You
can apply this information to move other elements in the composite or
apply the inverse to stabilise the image.

56. Two-point tracking. Track horizontal and vertical position for two
features. The feature positions, relative to each 
o ther, indicate
whether the image is rotating clockwise or counter-clockwise (z-axis
rotation). In some cases, two t
 racking poi
the scaling of the features, as well. 


57. Three-point tracking. Track horizontal and vertical position for three
features. Provides all the benefits of two-point t
 racking with an
additional set of tracking data for more accuracy on z-rotation and
scaling. 


58. Four-point tracking. Again, all the benefits of the lesser tracks with an
additional set of tracking data. Three-point is u

 sually sufficie
most 2D tracking needs, but four- point makes it possible to distort
and matchmove another element into the four points, or corners, of
the features you track. That’s why four-point tracking is typically
called cornerpin tracking. 


59. Tracking And Trackers 
 Take the path of least resistance, when
compositing a shot, with minimal rotoscoping work “ said by a wise
old compositing artists. This is the exercise that is typical usage of 4
point tracking. Example placing an image onto a computer screen,
watch, digital display, sign board etc. The node that we are using is
under Transform->Tracker node. This tacker node has 4 point tacking
but you can selectively switch on or off the Trackers. 
 One of the
keying strategy we use is to stabilise the shot first, before we do any

Page 92
School of Animation NUKE

keying or compositing. In this lesson, that is what we are going to do.


Together, there will be two scripts. 
 You can load the two finished
scripts to take a look. 


watch_comp (the script which we use stabilise) 


watch_comp_primematte.nk (the script which we finished the comp)


Setting The Project

1. Open a new script. The media files is in Lesson 7 / Media. 


2. Type Hotkey ‘R’ or contextual menu under Image > Read to bring in

Page 93
School of Animation NUKE

Watch / watch.exr and connect it to the<Viewer> node. The sequence that


we are going to stabilise is the watch with the Green Key inside.

3. Click Transform > Tracker to insert a <Tracker> node before the viewer
node.

4. Track the four dots on the watch surface. As you can see the tracking
dots are just small dots without uniform shape. It is not squared on. This
actually is very common when you receive a footage that has been shot
where you do not have any control. As part of being a compositor, we
have to clean up the tracking dots and reference crosses.

5. To clean it up, we have to track the dots, get the tracking data, clean up
the green surface by removing tracking points.

6. Set up your <Tracker> for 4 points tracking. Adjust the tracking pattern
and search boxes accordingly. Track the image.

Calculating The Track :Once you’ve properly placed the track anchors
and sized the search and pattern areas, you’re ready to calculate the
track(s). You calculate tracks by using the buttons under Tracker controls
in the Tracker properties panel. You can track the sequence in either
direction. There are situations when tracking backwards would allow you
to get more accurate tracks when a feature exhibits a lot of scaling— when
the distance between the feature and the camera changes.

To calculate tracks : 


1. In the Tracker properties panel, check the enable box for each track you
wish to calculate.

2. In the Tracker properties panel, click either the frame forward or

Page 94
School of Animation NUKE

backward buttons to move to the previous or next frame. Move through a


few frames in this manner to ensure that all enabled track anchors are
“sticking” to their patterns. If a particular track anchor doesn’t stick,
experiment with a different position.

3. Once all track anchors stick, click the Tracker’s track forward or track
backward buttons to analyse the whole sequence.

When calculating multiple tracks simultaneously, you may find that some
tracks stick with accuracy to the pattern, while others require resetting and
reanalysis. When you’re happy with a given track, uncheck its enable box.
This protects it from recalculation, and let you test other location for
trackers that are less successful. If you need to start over with a given track
anchor, you can reset the size of its search and pattern boxes and wipe its
existing tracking data. To clear a track’s animation data: Check the enable
box for only the track anchor whose track you wish to remove. Under
Animation Controls, click the clear all button. The selected track’s
transformational data is wiped. To only clear animation forward or
backward of the current frame, click clear fwd or clear bkwd.

Re-tracking Part Of A Track

A tracking pattern may become unusable when it moves out of frame, is


hidden by another image feature, or because of motion blur. When this
happens, you can re-track the unusable part of the track with new search
and pattern areas while keeping the track data consistent. The end result is
a continuous track calculated from multiple patterns.

To re-track part of a track with a new search area:


 1. Check the enable box for only the track that requires re-tracking. 


Page 95
School of Animation NUKE

2. Cue the Viewer to the last frame where the existing tracking is usable.

3. Control+drag (pc) Command+drag (mac) the track anchor to reposition


the search and pattern areas without affecting the position of the track
point. The offset allows Nuke to continue the track with the assumption
that the offset feature remains at the same relative distance to the original
feature.

4. Click the Tracker’s track forward (or backward button, if you are
tracking backwards) to continue calculating the track using the new
pattern. Because the track point has been offset from the new search area
to the new search area, the new track values continue smoothly from the
existing ones.

Manipulating Track Curves And Smoothing Tracks


A track is essentially just key-frames data. So each track has animation
curves which you can edit in order to refine a track. You can also smooth
tracks using the Tracker controls.

Moving Track Points With Curves:


1. In the Tracker properties panel, click the animation button next to the
track you wish to edit, then select Curve Editor. The Animation editor
displays the x and y curves for the track (these plot the position of each
track point over time).

2. Select the points on these curves which you wish to manipulate. (Click
to select individual points; drag to select multiple points with the
marquee; or press Crtl+A to select all points.)

3. Drag the points to adjust their values. As you do so, the tracker overlay
on the Viewer changes shape to reflect the new positions of the track
points.

Page 96
School of Animation NUKE

Smoothing Tracks
Once applied to an element, some tracks may be too much jittery. This is
commonly caused by the Tracker too precisely following the pattern. You
can use the Tracker controls or apply smoothing filters to a track’s curves
in order to remove such jitter.

Method 1 of smoothing tracks : 
1 . In the Tracker c


<Transform> tab.

2. In the smooth fields, enter the number of frames you want to average
together to smooth the transformation. You can smooth the translate (T),
rotate (R), and scale (S) separately.

Method 2 of smoothing tracks :

1. In the Tracker properties panel, click the animation button next to the track you
wish to edit, then select <Curve Editor>. The Animation editor displays the x and
y curves for the track (these plot the position of each track point over time).

2. Select the points on these curves which require smoothing. (Click to select
individual points; drag to select multiple points with the marquee; or press
Control + A (pc) / Command + A (mac) to select all points.)

3. Right-click on the editor and select Edit > Filter to apply the smoothing filter.
This sets new values on each point based on the average values of their
neighboring points. Enter the number of times to apply the smoothing filter in the
dialog that appears.

Applying Tracking Data Using Tracker Controls

Page 97
School of Animation NUKE

The simplest way to apply tracking data to the input image or other nodes is to
use the controls of the <Tracker> node itself. Here, we look at using these
controls to stabilise or matchmove footage. If you need to apply a cornerpin track
to another node, you need to do it via linking expressions.

Using the <Stabilize2D> Node


The <Stabilize2D> node is designed to remove unwanted camera movement,
rotation, and / or scaling from an image sequence. The node requires data from
only a single track to stabilise movement; and two tracks if you need to stabilise
for rotation and / or scaling. The basic procedure for using <Stabilize2D> is to
first use the Tracker node to generate the required tracks, then follow the
<Tracker> node with a <Stabilize2D> node. To this node, you apply the tracking
data in inverse form, thus negating the unwanted transformations.

Stabilising Elements
The <Tracker> node’s controls let you remove motion, such as unwanted
camera shake, from the node’s input clip. After tracking, go to the <Settings> tab
of the Tracker properties panel. From the warp type pull down menu, select the
transformations that you want Nuke to take into account when stabilising the
image, for example Translate / Rotate / Scale. Go to the <Transform> tab. Under
transform, select <stabilize>. Nuke stabilises the footage, locking its elements to
the same position within the composite.

Page 98
School of Animation NUKE

Continue With The Project


1. After the tracking is done, go to the <Transform> tab in the <Tracker> node.
Click on the <transform> drop down menu.

2. Select <stabilize>. Change the name of the Tracker to Stabilised_TRS. We


are doing 4-points tracking with Translation, Rotation and Scale. Check out the
result and play it back.

3. Everything else moves except for the 4 black dots. Save the script.

4. Now we have the tracking data. We can import the data to another script later.
Time to clean up the watch’s green surface. Attach a <Paint> node to the
stabilised node.

5. Click Draw> Paint to insert a Paint node after <Stablized_TRS> node. The
dots and crosses are now locked down by the Tracker. All we need to do is to
clone the surround pixels to cover up the dots and crosses.

6. Use the Clone Tool. Change the size of the brush to fit what you want to do by
pressing Shift + Click to change size of the brush. To change where you clone
from, hold down Control + Click (pc) / Command + Click (mac) then drag to start
changing.

Page 99
School of Animation NUKE

7. Start cloning and watch out around the edge. Now you should have a very
clean watch surface.

8. Add a <Write> node to output your result as a file sequence. Open a new
folder on the desktop and save the files as ‘stablewatch.%04d.exr’ for this
exercise.

Page
100
School of Animation NUKE

We have just finished doing what we call a ‘Pre comp’. This is usually where we
clean up tracking points and perform general custodian duties. Now we are
ready for the second part of the lesson. There are many ways to composite this
shot with graphics inside the watch. This is just one way of doing it. You will no
doubt find different ways and develop techniques once you get more familiar with
NUKE. But for now, let’s take a look at the finished script
‘watch_comp_primematte.nk’.
Setting The Project
Open a new script. The script files are in Lesson 7 / Scripts. First, we open the
finished comp script ‘watch_comp_ primematte.nk’ to take a look.

Page
101
School of Animation NUKE

We start by tackling the watch graphics first. (Step One)


1. Type Hotkey ‘R’ or contextual menu under Image > Read to bring in Graphics
/ watchgraphics.tif and connect it to the <Viewer> node. This is the graphics
sequence that we are going to put inside the watch.
2. Type Hotkey ‘R’ or contextual menu under Image > Read to bring in
stabWatch / stableWatch.exr and connect it to the <Viewer> node. You can use
the sequence that you have just written out or just use this sequence included in
the lesson.

PreProcess_Graphics Group
1. You will notice the watch graphics is 512 by 512. This information is displayed
in the <Read> properties panel. The graphics need to be reformatted to the right
size.
2. Add a <Grade> node to control the graphics colour and especially black and
white points. Click Color> Grade or Hotkey ‘G’ to insert a <Grade> node before
the <Viewer> node. Under the <Grade> properties panel, change multiply to 0.58
and gamma to 0.94.

Page
102
School of Animation NUKE

3. Click Transform > Reformat to insert a <Reformat> node after the <Grade>
node. This is to reformat the watch graphics into HD format. Make sure your
Project Settings is set to the same format. Type ‘S’ to get to the Project Settings.
4. Lastly, Click Transform > Transform to scale, rotate and move to match the
face. Hotkey ‘T’. Under the <Transform> properties panel, change translate to x -
40 and y -75.
5. Now we start tackling the watch key (Step Two).

1. First we need to key the green out of our watch. Connect the <Primatte> node

Page
103
School of Animation NUKE

to <StableWatch> image node. The Primattekeyer includes a quick “Auto-


Compute” option that evaluates your image and determines a good baseline key.
From there, you can easily tweak the settings and generate an acceptable matte.
Select the green with select Background color. Hold the Control (pc) /Command
(mac) key down and sample the targeted background colour. Release the mouse
button and Primatte will start the compositing process.
2. The second and third steps in using Primatte require viewing the matte or
alpha in the Viewer window. Press the ‘A’ key on the keyboard to change to the
Alpha view. Change from <Select BG Colour> to <Clean BG Noise>. If there are
any white regions in the dark, `bluescreen area’, it is ‘noise’ (or shades of blue
that did not get picked up on the first sample) and should be removed.
3. If there are dark regions in the middle of the mostly white foreground object,
that is, if the key is not 100% in some portion of the targeted foreground, choose
<Clean FG Noise> from the pop-up menu. Use the same techniques as for
<Clean BG Noise>, but this time sample the dark pixels in the foreground area
until that area is as white as possible. We just need a general key since we are
not doing any comp using Primatte. We are trying to extract the green surface as
a Key / Matte / Alpha and use it to cut the Graphics. The Matte size needs to be
adjustable, so an <Erode> Node (Filter > Erode) was added to control the size.
4. The Blur will help the edge of the matte a bit. In the properties menu of Blur,
under ‘Channel’ select <alpha> and under ‘size’ set 2.8.

5. Now we start tackling the shadow part of the watch (Step Three). This is
where additional details make a better effect shot.

Page
104
School of Animation NUKE

Shadowkey Group (Step Three)


1. A bezier shape was drawn around the watch surface. This is to help exclude
the rest of the watch. Get a <Bezier> node by using Hotkey ‘P’ or Draw >Beizer.
Holding down the control key, start drawing the bezier points on the viewer.

2. A <ShuffleCopy> node can swap a maximum of 8 channels. The


<ShuffleCopy>nodes is used to put the shape into the alpha channel of the
image. Follow the flow of the nodes and you will see. The <ShuffleCopy> node is
under Channel. One of the differences between <Shuffle> and <ShuffleCopy>
nodes is <Shuffle> node only has one input source but <ShuffleCopy> node has

Page
105
School of Animation NUKE

two input sources.

3. Add a <Premult> node before the <Keyer> node to premulitply the image. 


4. Use the <Keyer> node to get the luminance signal. Click Keyer>Keyer to
insert a <Keyer> node after the Premult node. We want to keep the shadow that
was cast on the watch surface by the bezel of the watch. Do not over blow the
key. Keep the shadow.

5. Using <ShuffleCopy> node, switch the green channel to the key / alpha
channel of the watch surface graphics. Now we had just translated the shadow of
the watch surface to the new background graphics.
6. Add a <Premult> node and merge it back to main group. 

7. To view the result, attach a <Viewer> node to the end of the script and press

Page
106
School of Animation NUKE

‘A’ to check the alpha.

Watch Face Group (Step Four)


1. By desaturating the green colour into grey, this will help make the comp more
convincing. Nuke’s <HueCorrect> node let you make precision adjustments to
the levels of saturation in a range of hues. You do so via edits to a series of

Page
107
School of Animation NUKE

suppression curves.

2. For the compositor, <HueCorrect> is obviously of greatest use in diminishing


green, blue, or red screen spill. Sample the colour by holding down the Control
(pc) /Command (mac) key. A ‘red dot’ appear and will correspond the colour
information with the image in the <HueCorrect> node. Edit the curve by dragging
down on control points in the hue region that you wish to suppress.

3. In the HueCorrect properties panel, choose the sat and the lum channels.

4. We will also need to add a <ShuffleCopy> node to copy the key from primatte
into the result of PreProcess_ Graphics Group. Now we have a watch surface
with a slightly larger key.

Main Group (Step Five)


1. This is where we put the whole thing together. We take the <HueCorrect>
node green watch surface and Merge it (using over) with the Watch graphics
Tree from Watch Face Group.

Page
108
School of Animation NUKE

2. Notice the end result from <Merge> node is sent to ShadowKey group to
further process the Watch Surface.
3. We no longer need the alpha channel coming from the Watch Face Group, so
with <Shuffle> node we switch the alpha channel to black.
4. The end result from ShadowKey group is merged back after the <Shuffle>
node. This <Merge> node uses <Conjoint-over>. What this does is it compares
the mattes between image A and image B, and image A is shown if it is bigger
than image B. That is why we shuffle the image matte from the previous step to
Black.
5. The Tracker node (Stablized TRS1) from the watch_comp (previously used to
Stabilise the watch shot) is copied over. Add another <Transform> node, go to
the <Transform> tab in the Properties panel, and select <Add jitter> to make the
comp move.

Page
109
School of Animation NUKE

6. You can add additional ‘glare’ to the watch comp by activating the nodes in the
watch_comp_primatte.nk

7. View your finished comp in proxy, render a flipbook or write the comp out with
a <Write> node.

Page
110
School of Animation NUKE

3D COMLPEOSSOIT

3D COMPOSTING
Nuke’s 3D workspace allows you to setup a 3D composite for camera moves, set
replacement, and other applications where you need to simulate a “real’ 3
dimensional environment. Although the 3D workspace has many potential uses,
you’re most likely to use it—at least initially—to create pan-and-tile scenes. Nuke
is able to take high resolution images and create a parallex scene. These scenes
are created with 2D image planes arranged into a curved shape, and then
rendered out through an animated camera to give the illusion of a seamless
environment.

Overview

Page
111
School of Animation NUKE

We start by getting to know our way in Nuke, by learning how to set up a 3D


scene in Nuke, and how to add objects, cameras in the 3D workspace. You’ll
also see how to texture objects, transform objects and cameras, and render out
scenes for use in other areas of your script.
The 3D nodes in Nuke appear as round shapes to differentiate them from nodes
that perform 2D operations. You cannot always link a round shape node (3D
node) directly to a square node (2D node). However, you can apply an image to
a geometry shape like a card which is part of a Scene node. It will get clearer as
we start with a simple scene.
Setting The Project
1. Open a new script. The script opens as a 2D scene. Let’s add a geometry
sphere by clicking 3D > Geometry > Sphere. Attached it to the <Viewer> node.
Notice the viewer has been switched from 2D view to 3D view.
2. Type ‘S’ and set the Project settings to HD.

3. You can also switch to the 3D view by using the Hotkey ‘V’ or to other 3D
views listed in the diagram. Once you attached the <Sphere> node to the
<Viewer> node. Besides the view chang, you are placed inside the sphere.
Press ‘F’ to view the sphere from the outside.

4. Bring in a camera by clicking on 3D > Camera. 5. To navigate in the 3D


Viewer :
60. Dolly: Press Alt (pc) / Option (mac) and middle-mouse-button drag. 

61. Pan: Press Alt (pc) / Option (mac) and left-mouse-button drag. 

62. Tilt: Press Control (pc) / Command (mac) and left-mouse-button drag. 

63. Spin: Press Control (pc) / Command (mac) and left-mouse-button drag. 

64. Roll: Press Control +Shift (pc) / Command + Shift (mac) and left-mouse-button
drag. 

65. Look through camera: Select a camera object, press ‘H’. 

66. Fit the scene: Press ‘F’ to fit the entire 3D scene within the viewer. 
6 . The

Page
112
School of Animation NUKE

media files are in Lesson 8 / Media. Type Hotkey ‘R’ or contextual menu
under Image > Read to bring in Stills / Clouds.tif and connect it to the
<Viewer> node. 
7 . If you pres
the sphere. To see the camera, we must change the viewing status of the
Sphere. 


67.
8. Select the Sphere. Under the Sphere’s Properties panel, under display pop up
menu, select <off>. Now you can see the camera. Select the camera’s axis and
translate in the z axis, out of the sphere position. Turn the display back to
textured + lines to see the sphere again.

9. To change the 3D Viewer display properties :

Open the Preferences window (Shift + S), and select the Viewers tab. 


Make the desired changes to the 3D bg and fgcolours.



 From the 3D control type list, select the navigation control scheme you want to
use (Nuke, Maya, Houdini, or Lightwave).

Page
113
School of Animation NUKE

10.Connect <Clouds.tif> to the <Sphere> node. Straight away the clouds.tiff is


mapped around the sphere. Next, we are going to learn how to control the cloud
map.

11. Because the cloud image is 2D, we can put a <Transform> node below the
image to control the location and scale of the image on the sphere. Add
Transform >Transform node. Go to scale and type in 0.5. The image is now
scaled down but the sphere remains at the original size.

12. Now to scale the sphere. Because the sphere is a 3D geometry, you cannot
link the transform node directly to it. You need a node from the 3D > Modify
>TransformGeo.

Page
114
School of Animation NUKE

13.Add TransformGeo below the Sphere. In the Properties panel, go to uniform


scale and type in 1.5. Now both the sphere and the cloud map is scaled up.

Camera Views
To see what the camera sees, we must have a camera. We have already added
the camera. So let’s look through it To look through a camera: 


1. Press ‘V’ to make sure you are looking through the 3D perspective view, and
not one of the orthographic views.
2. The camera and camera icon must be selected to view through that chosen
camera.

3. This selection does not change the camera used for rendering. This changes
only the camera to “look through” for the current 3D Viewer. Cameras in the
current data stream automatically appear in the list of cameras you can select.
To select a camera that doesn’t appear in list, double-click the camera node to

Page
115
School of Animation NUKE

open its panel, and it will be added to the list.

The Scene Node


Regardless of its location in your script, the Scene node is the highest-level node
in the scene hierarchy because it references all the elements in a 3D
workspace—all the geometric objects, cameras, and materials. Combining all the
elements in a 3D workspace. Your script may contain multiple Scene nodes,
cameras and 3D render nodes. So let’s add ours at the end of the current tree.

• To add a <Scene> node: Click 3D > Scene. Attach the <Scene> node after
<TransformGeo> node. Now all that above is grouped into a single scene.

The ScanlineRender Node Every <Scene> node in a script should be


connected to a <ScanlineRender> node, which tells Nuke to render the results of
the scene and defines the camera to render the scene from. The
<ScanlineRender> node also allows you to toggle between a 2D and 3D view of
the scene.

Select the <Scene> node and add a <ScanlineRender> node:


1. Choose 3D >ScanlineRender from the toolbar. Connect the obj / scn input to
Scene 1.
2. Connect the cam input to Camera1.

Page
116
School of Animation NUKE

3. Connect the optional bg input to composite a background image into the


scene. If you attach a <Constant> node, its resolution becomes the output
resolution for the ScanlineRender node. Under image > Constant.
Hotkey ‘Tab’ or on the viewer, select 2D, now you will see how this 3D scene
looks in 2D. Add a <Write> node at the end to render the scene to your chosen
format.
3D Scene Geometry :Nuke includes several options for inserting 3D
geometry into your scenes. You can create primitive shapes, such as cards,
cubes, and spheres, as well as import models created in other 3D applications.

These are the types of objects you can include in a Nuke 3D scene, and each
object is represented by a 3D node in the script:
68. Cards 


69. Cubes 


70. Cylinders 


71. Spheres 


72. OBJ (Wavefront) objects 


73. Axis 


74. Cameras 


75. Lights 


Transform Handles Of A 3D Object 
 Transform handles appear when a


3D object with transform capabilities is loaded into the Properties Bin. The
colours of the handles correspond to the axes available in 3D space: red
transforms the x-axis, green transforms the y-axis, and blue transforms the z-
axis. 
 To move an object with the transform handles: 


Drag an object to move it on any axis. 
S hift + drag to c


one axis. 


Page
117
School of Animation NUKE

To rotate an object with the transform handles: 


Control + drag (pc) / Command + drag (mac) to rotate the object on any axis. 

Control + Shift + drag (pc) / Command + Shift + drag (mac) to constrain the
rotation to one axis. 

Working with Cards 
 A card is the simplest type of object you can add to a
scene (and probably the type you will use most often). It’s merely a plane onto
which you can map a texture—typically a clip you are using as part of a pan-and
tile setup. A card object may be deformed as a bilinear or bicubic object with
controls contained in the card’s parameters. Card nodes have extended bicubics
(bicubics with more control points). They allow you to subdivide a card, giving
you finer control for warping an area.


 Deforming Card Objects 
 The Deform tab on the <Card> node


Properties panel let you convert the card into a mesh surface that may be pulled
and reshaped. A bicubic deformation offers the greatest degree of surface
elasticity. You can add any number of control points on the card and translate
these points and their tangents in any direction. The control point tangents exert
a magnetic-like influence over the objects’ surface. 


Modifying Objects Using an Image 
 With the <DisplaceGeo> node, you


can modify geometry based on an image. When using the node, each vertex is
displaced along its normal with a value corresponding to the image pixel the
vertex’s uv attribute points to. The higher 
 the pixel value, the greater the
displacement.

Modifying Objects Using A Perlin Noise Function :The next lesson


we will be using the <ProcGeo> node. It let you modify your 3D objects using a
Perlin noise function that creates seemingly random noise. For example, you
could use the <ProcGeo> node to generate animated noise for rippling waves or
clouds, or to create a terrain from a flat card.

Page
118
School of Animation NUKE

Adding Lights
3D scenes always look better with the lights on. You can add lights in Nuke like
other similar 3D software. The nodes under the Lights panel let you control the
lighting in your scene. Using these nodes, you can bring objects out or push
them back, create an illusion of depth, simulate the conditions in the real world,
or simply alter the feeling of the scene. Nuke features four types of light you can
use in your 3D scenes: direct light, point light, spot light, and environment light.

Page
119
School of Animation NUKE

Direct Light
A direct light is a light that emits parallel light in one direction. It appears to
illuminate all objects with equal intensity, as if it was coming from a far away
source. Being at an infinite distance from the objects, direct light has orientation,
but no position. A real world example of a direct light is the sun. You can use
direct light to simulate sunlight and moonlight, for example.
Point Light
A point light is a point in 3D space that emits light in every direction. A real world
example of a point light is a light bulb. You can use point light to simulate light
bulbs, lamps, and candles, for example.
Spot Light
A spot light is a point in 3D space that emits a cone-shaped light in a given
direction. A real world example of a spot light is a desk lamp.
Environment Light
An environment light emits multi-coloured light based on an input image. This
image-based lighting is generated using High Dynamic Range Images (HDRI).
When HDR images are created, several differently exposed images are
combined to produce a single image of the surrounding environment. As a result,
HDR images have a wide range of values between light and dark areas, and
represent the lighting conditions of the real world more accurately.

To use environment light, you first need to shoot a real life environment as an

Page
120
School of Animation NUKE

HDR image. Using the Environment Maps node, you then convert this image into
a spherical mapped image. The sphere is used to surround the 3D objects, so
that the mapped image colour illuminates them.

To finish the scene, let’s add a single light into the scene. 
1 . S elect 3D
> Light to insert a <Light> node into your script. 
2 . F or the light to af
scene, it must be attached to it. Attach <Light> node to the <Scene 1> node.
Instantly, you can see that the light is influencing the geometry. In the Properties
panel of the <Light> node, under light type, select <Point>

3. Change the colour of the light slightly to a yellow tint and increase the
intensity. The whole scene will be much brighter now.

4. To control how much light the object gets from the light source (based on the
distance between the object and the light source), use the falloff type menu. A
Linear type diminishes the light at a fixed rate as it travels from the object,
whereas Quadratic and Cubic types diminish the light at an exponential rate. If
you select <No Falloff>, the distance between the light source and the object
does not affect the lighting.

5. Change the different fallout type to see the different effect. You can keyframe
the lights to move on your terrain.

Projection Cameras

Page
121
School of Animation NUKE

In addition to viewing and rendering a 3D scene, cameras can also project a 2D


still image or image sequence onto geometry in the scene. This is similar to the
front-projection systems used in practical photography, where a background
image or other element is projected onto the stage and photographed with other
elements.

Projecting Textures With The Project3D Node


The <Project3D> node projects an input image through a camera onto the 3D
object. To use the <Project3D> node:
1. Select 3D >Shader> Project to insert a <Project3D> node after the image you
want to project. Connect a Camera node to the <Project3D> node’s cam input.
Change the name of the camera to Project_Camera. Under the properties panel
of this node, you will find settings for the projection camera. If the projection is
used for the reconstruction of a real set with real cameras, then camera data like
focal length and focal distance can be adapted inside Nuke’s Camera.
2. Type Hotkey ‘R’ or contextual menu under Image > Read to bring in Still / and
connect it to the <Project 3D> node.
3. Insert a <3D geometry> node, for example a cube after the <Project3D> node
and connect it to a <Scene> node.
4. Move the Projection_Camera away from the cube, and the results is that the
clouds is now projected onto the cube.
5. Insert a <ScanlineRender> node from 3D >ScanlineRender. Add a
<Constant> node to the bg as before. But add a new camera to the scene.
6. This new camera will be seeing the projected result, but not controlling the
projection.
7. Attach <ScanlineRender> node to the <Viewer> node and you can see the
scene in 2D view by pressing ‘tab’ or change on the right side of the Viewer.

Page
122
School of Animation NUKE

Page
123
School of Animation NUKE

Animating the Camera


1. We need to check to make sure the pan animation with the camera is what we
want first. This is because the positioning of the elements depend on the camera
moves.

2. Type ‘S’ for Project settings and set it to HD. 3



 . We are going t
keyframes with a linear interpolation. But first, the camera’s position in the 3D
space.

4. Place the camera in at the first keyframe at x 0.2293 y -0.0909 z 1.5560. Set a
keyframe there by clicking on the animation button and choose ‘Set key’. The
cyan colour will appear on the information keyframed Go to the last frame 99,
and type in x -0.1164 y -0.060 z 11.71. Nuke automatically sets a new keyframe
after the first keyframe is inserted.

5. Now to check the scene in 2D. Attach the clouds’ tree to a <Scene> node.
Then the <Scene> node to a <ScanlineRender> node. The keyframed camera to
the camera source of the <ScanlineRender> node and a <Constant> node to the
bg source.

6. Attached a <Viewer> to see the scene in 2D. A nice slow pan across a sunset
scene.Now to add some trees.

Page
124
School of Animation NUKE

Importing Camera Data :Often in realistic comp, we need to import camera


data from other sources. For the next exercise, we used Andersson
Technologies LLC’s SynthEyesTM to generate this data.

Page
125
School of Animation NUKE

TEMPORAL OPERATIONS
This lesson is about the temporal or time-based operations in Nuke. You learn
how to distort time by slowing down, speeding up, or reverse clips, applying
motion blur with TimeBlur Filter.
Distorting Time
Time distortion changes the length of time required to playback a clip in your
composite. These operations generally fall under one of two categories: retiming
and warping.
Retiming is the process of slowing playback by adding frames, or accelerating
playback by subtracting frames.
Warping is the process of slowing down, speeding up, or even reversing
playback on a clip without necessarily altering the overall length.
Simple Retiming
Nuke’s Retime node let you change the playback time for all the frames in a clip
or for range of frames within the clip. It does this by dropping or duplicating
frames. You can also use it to reverse the clip playback.
Setting the Project
1. Open a new script. The media files are in Lesson 9 / Media.
2. Type Hotkey ‘R’ or contextual menu under Image > Read to bring in hand /
hand.dpx and connect it to the <Viewer> node. This was a Red file (R3D )
format. Nuke 5.2 now can read Red files directly into Nuke and converted them
into a dpx format.

Page
126
School of Animation NUKE

When you read a R3D file, there are Properties panels in the <Read> node
by default tohelp you decode into REDspace. The gamma curve is also set
to REDlog. As R3D (Redcode Raw Video Image) is a raw format, inside
the<Read> node, the debayer function is still on debayer detail.
You can also control other settings like exposure, contrast, brightness. 

For this lesson, the actual red file had been exported into dpx using
<FrameRange> and <Reformat> node to 
sportion
elect a of the file and
reformat into a HD size dpx file. 

For your reference, a diagram of the Red file properties is included in this
lesson. 

Add a <Grade> node to adjust the black and white points of the image.
Under Color > Grade or Hotkey ‘G’ .

Page
127
School of Animation NUKE

Click Time > Retime to insert a <Retime> node into your script.
 Enter a
value in the speed parameter. Values higher than 1 increase playback
speed; values less than 1 decrease playback speed. 
 Check the reverse box
if you want to play the clip backwards—making the last frame the first, the
first frame the last, and so on. Increase the shutter parameter to enable
frame-blending.

Page
128
School of Animation NUKE

To retime a range of frames in a clip :

1. Choose Time > Retime to insert a <Retime> node into your script.
2. Check the boxes for input range and enter the “in” and “out” frames.

Frame Blending
The <FrameBlend> node interpolates frames by generating an additive
composite of the frames that precede and follow it, rather than creating mere
copies between the existing frames. This method creates “ghosting” around
all fast moving features and may look odd when viewed as part of a still
frame, but will contribute to smoother motion during actual playback.

OFlow Retiming
The <OFlow> node generates high-quality retiming operations analysing the
movement of all pixels in the frames and then rendering new “in-between”
images based on that analysis. This node can also add motion blur or enhance
the existing motion blur in the image.

Page
129
School of Animation NUKE

Setting The Project


1. Open a new script. The media files are in Lesson 9 / Media.
2. Type Hotkey ‘R’ or contextual menu under Image > Read to bring in under
“xxxxx” and connect it to the <Viewer> node.
3. Click Time >OFlow to insert a <Oflow> node into your script. 
4. S et the sp
of the output clip. A value of 0.5 will slow the movement down. 5

 . There are 3
methods of calculation - Frame / Blend / Motion. This sets the interpolation
algorithm.
Frame - the nearest original frame is displayed. 

Blend - a mix between two frames is used for the in-between frame. This is
quick to render and is useful when t
 weaking the timing on
efore
setting the method to motion. 

Motion - vector interpolation is used to calculate the in between frame.

 6. In this lesson, we are going to use <Source Frame> to control the speed
change. 

7. You can map input to output frames to retime the clip by switching Timing from
<Speed> to <Source Frame>.

Page
130
School of Animation NUKE


 8. Type ‘S’ for Project settings and set the frame range from the original ’82 /
108’ to ’82 /220’. 

9. Under <OFlow> node Properties panel, select ‘Source Frame’ under Timing.

10.Go to frame 82 to set the first keyframe. Under Frame, click on the keyframe
icon and choose ‘Set Key’ on the contextural menu. 


11.Go to frame 200 and set the next keyframe by setting the Frame to 93. At
frame 93 in the original clip, the hand just reaches the keys. By setting the
keyframe at 200, you effectively stretch frame 93 to frame 200. 


12. Go to frame 220 and finish the Optical flow exercise by setting another
keyframe ‘108’. You just moved the last frame of the original clip ‘108’ to frame
‘220’. 


13. Go the animation button and select <Curve Editor> to view the animation
curve. Select the different methods to see the interpolation.

Page
131
School of Animation NUKE

OFlow Parameters
The following table describes the different parameters in the <OFlow> node’s
controls.

OFlow Function
Parameter

Method Sets the interpolation algorithm.


Frame - the nearest original frame is displayed. 

Blend - a mix between two frames is used for the in-between frame.
This is quick t
 o re
curve before setting the 
method to motion. 

Motion - vector interpolation is used to calculate the in between frame.

Page
132
School of Animation NUKE

Timing Sets how to control the new timing of the clip.

Speed - select this if you wish to describe the retiming in terms of


“double speed” or “half speed”. 

Source Frame - select this if you wish to describe the retiming in
terms of “at frame 100 in the output clip I want to see frame 50 of
the source clip”. You’ll need to set at least 2 keyframes for this
method to work. 

Frame This parameter is active only if timing is set to Frame. Use this to specify
the source frame at the current frame in the time bar. For example, to
slow down a 50 frame clip by half set the Frame to 1 at frame 1 and the
Frame to 50 at frame 100. The resulting animation curve will result in a
half-speed retime

Speed This parameter is only active if Timing is set to Speed. Values below 1
slow down the clip. Values above 1 speed up movement.

Filtering Sets the quality of the filtering when producing in-between frames.
Normal - uses bilinear interpolation which gives good results and is a lot
quicker than extreme. 

Extreme - uses a sinc interpolation filter to give a sharper picture but
takes a lot longer to render. 

Warp Mode Sets how to control the new timing of the clip.
Simple - this is the quickest option, but may produce poor results
around moving objects and image edges. 

Normal - this is the default option with better treatment of moving
objects and image edges. 

Occlusions - this is the advanced option which attempts to reduce
the level of background dragging that occurs between foreground
and background objects. 


Correct Local motion estimation is highly dependent upon the idea that the
Luminance brightness of objects don’t vary through a sequence. Where brightness
varies rapidly - for example a highlight moving across the bodywork of a
car - the motion calculation will perform poorly. The luminance of a shot
can come from other sources too - such as an overall flicker problem. In
these cases where there is a global luminance shift, toggling this control
on will allow the local motion estimation algorithm to take account of
overall brightness changes between frames.

Page
133
School of Animation NUKE

Shutter Time Sets the equivalent Shutter Time of the retimed sequence. A shutter time
of 1 is equivalent to averaging over plus and minus half an input frame
which is equivalent to a shutter angle of 360 degrees.

Shutter Sets the number of in-between images used to create an output image
Samples during the shutter time. Increase this value for smoother motion blur, but
note that it takes much longer to render.

Vector Detail Adjust this to vary the resolution of the vector field. Large vector fields
take longer to process, but contain more detail and may help to isolate
smaller motion in the scene. A value of 1 will generate a vector for every
pixel. A value of 0.5 will generate a vector at every other pixel. For some
sequences, a high vector detail near 1.0 generates too much unwanted
local motion detail and often a low value will give a better result.

Smoothness Vector fields usually have two important qualities: they should accurately
match similar pixels in one image to another and they should be smooth
rather than noisy. Often it is necessary to trade one of these qualities off
against the other. A high smoothness will miss lots of local detail, but is
less likely to provide you with the odd spurious vector. A low smoothness
will concentrate on detail matching, even 
if t
The default value of 0.5 should work well for most sequences.

Block Size The vector generation algorithm subdivides the image into small blocks,
and separately tracks them. Block Size defines the width and height of
these subdivisions. Smaller values will produce noisy data, whereas
larger values may produce data that is lacking in detail. This value
should rarely need editing; some sequences may benefit from using
large block sizes to help the algorithm track regions better where the
algorithm isn’t “locking on” to the overall motion in the sequence.

Tolerances For efficiency, much of the local motion estimation is done on luminance
only - i.e. using monochrome images. The tolerances parameters allow
you to tune the weight of each colour channel when calculating the
image luminance. These parameters rarely need tuning.

Weight Red The red weighting used when calculating the vector field.

Weight Green The red weighting used when calculating the vector field.

Weight Blue The blue weighting used when calculating the vector field

Page
134
School of Animation NUKE

Warping
Warping refers to manipulating an image so that elements in the image are distorted. Warps are
transformations that
only affect some of the pixels in an image rather than all of them. For example, you might make an
animal’s eyes bigger
or a person’s smile wider without affecting the rest of their features.

Warping Images Using The GridWarp Node


The GridWarp node allows you to warp images by transferring image information from one bezier grid
onto another.
When using this node, you first create the source grid, which defines where to warp from. Next, you
create the
destination grid, which defines where to warp the image to. This grid can be a duplicate of the source
grid, or you can
draw it separately. When you manipulate the destination grid, the corresponding warp is applied to the
source image.

1. Open a new script.


2. Add the <GridWarp> node between <Premult> and <Merge> node. Click under Transform > GridWarp
to insert a

<GridWarp> node.
3. Connect both the src and the dst input and a Viewer to the image.
4. When the GridWarp properties panel is open, you can see the source and destination grids appear as
small
overlays in the viewer. The source grid is pink, and the destination grid blue. In the following steps, you
use the pink
source grid to define which areas you want to warp and the blue destination grid to define where to warp
these areas
to.

Page
135
School of Animation NUKE

5. To make the grids the same size as the input image, click the ‘image size’ buttons under both Source
Grid and Destination Grid.

6. For now, check hide under Destination Grid to hide the blue destination grid in the Viewer. This way,
you can’t accidentally distort the image yet.

Page
136
School of Animation NUKE

7. When Warping, the pixels around the area do move because accommodating the change this way
often produces
more realistic results. However, the distortion lessens the further you get from the moved pixels. You also
have some
control over which pixels are moved and which are not, and can isolate the warp to a small area.
8. The ideal situation, the subject you are going to warp is a subject you can key out or rotoscope to
isolate it from its
background before you create the warp. This way, you can be sure that the background stays intact. The
mini cooper.
exr has alpha channel and the shadow and the background are all separate elements. So this is an idea
situation.
9. You can use the grid lines to isolate the areas you do not want to warp. You do this by adding lines
between the
area you intend to warp and the area you don’t want to change. We want to move only the front and back
of the mini
cooper. The middle section of the car is not warping. So let’s add more points to the grid.
10. Click on <add> button on the source grid and hide the destination grid. Click on an existing grid line in
the Viewer.
If you click on a horizontal line, a vertical line is added to the grid. If you click on a vertical line, a
horizontal line is added
to the grid. The lines can be further apart in the areas that you don’t intend to warp

Page
137
School of Animation NUKE

11. When you select a point, four tangent handles appear around it. You can use these handles to modify
the curves
connecting the points.
12. To move several points together, draw a marquee around them and use the transformation overlay
that appears.
Try enlarging the front wheel. Select the points surrounding the wheel and the 2D Transformation
Overlay will appear for you to adjust.

STEREOSCOPY COMPOSITING
What is Stereoscopic imaging?
Stereoscopic imaging or 3-D (three-dimensional) imaging is any technique capable of recording three-
dimensional visual information or creating the illusion of depth in an image. The illusion of depth in a
photograph, movie, or other two-dimensional image is created by presenting a slightly different image to
each eye. The easiest way to create depth perception in the brain is to provide the eyes of the viewer
with two different images, representing two perspectives of the same object, with a minor deviation
similar to the perspectives that both eyes naturally receive in binocular vision.

One way of viewing stereoscopic images is by making anaglyph images. Anaglyph images are used to
provide a stereoscopic 3D effect, when viewed with 2-color glasses (each lens a chromatically opposite
color, usually red and cyan). Images are made up of two color layers, superimposed, but offset with
respect to each other to produce a depth effect.

Nuke let you work on stereoscopic material just like you would on any other images. However, there are
also a few stereo-specific settings and nodes that you need to be aware of when compositing

Page
138
School of Animation NUKE

stereoscopic material. This lesson teaches you how to set up your stereo project, read in, color correct,
use the <stereo> nodes, and render the final
output.
Setting the Views for the Script
1. Open a new script. Click under Edit > Project Settings or Hotkey ‘S’. Go under Views tab in the
properties menu.
Every time you have a new script, the Main View is created. This time we need stereoscopic views.

2.At the bottom, click ‘Set up view for stereo’. The left and the right view will be created automatically.
Now your views are set for stereoscopic project. Tick “Use colours in UI?” to make the Viewer’s left and
right views use the colors defined in the Project Settings.

Reading A Stereoscopic Pair


Now the view is set, we can read in Stereoscopic Pair as a single <Image> node. But there are some
rules that must
be followed.
1. The views must be set to left and right before reading the Stereoscopic Pair.
2. The files must be named correctly, for example Bear.left.001.tif and Bear.right.001.tif.
3. Both left and right files must be in the same folder.
Setting The Project
1. Open a new script.
2. Instead of just selecting the files, select one of the files and change from 3dsbear.left.%04d. tif 1-66 to
3dsbear.%V.%04d.tif 1-66. When a variable like %V is used, Nuke reads in the missing inputs and
combines all inputs
into a single output.
3. The image sequences will come in as a single node. Connect the <Image> node to a <Viewer> node.
Click on the
left and right view selection to see each of the views.

Page
139
School of Animation NUKE

Displaying Views In the Viewer


1. Once you have a single stereoscopic image node in your script, there are many ways to display the
views.
2. Select Views > Stereo > SideBySide to insert a <SideBySide> node.
3. If you want to swap the views around in the <Viewer> node, click the swap button. The <Viewer> node
displays the two selected views simultaneously, so you can easily compare them.

To Display A Blend Between Two views :


1. Select Views > Stereo > MixViews to insert a <MixViews> node into your script. Delete the
<Sidebyside> node.
2. This node displays a blend between two views in the <Viewer> node, allowing you to check how
elements in these
views are aligned.
3. In the MixViews controls, use the views buttons or pull down menus to select the two views to blend
between.
4. To control the blend between the views, adjust the mix slider. Setting the slider to 0 or 1 displays only
one of the
views. Values between 0 and 1 produce different blends between the views.

Converting Images Into Anaglyph

Page
140
School of Animation NUKE

You can use the <Anaglyph> node to convert your inputs into anaglyph images, which produce a 3D
effect when viewed with 2-colour anaglyph glasses, usually red and cyan. Anaglyph images are made up
of 2 color layers,
superimposed but with content offset to produce a depth effect.
To Convert Your Images Into Anaglyph :
1. Select Views > Stereo > Anaglyph to insert an <Anaglyph> node in an appropriate place in your script.
Delete the <MixViews> node.
2. Use the views controls in the Anaglyph properties panel to select which views you want to use for the
left and the right eye. Nuke converts the input images into grey scale anaglyph images. The left input is
filtered to remove blue and green, and the right view to remove red.

3. To add colour into the images, drag right on the amtcolour slider, or insert a value between 0 (grey
scale) and 1(coloured) into the amtcolour input field.
4. To control where the images appear in relation to the screen when viewed with anaglyph glasses,
enter a value in the horizontal offset input field. Shift the horizontal offset to change the apparent depth of
the image. To have the Images appear in front of the screen, you would usually enter a negative value.
To have the images appear further away, you would usually enter a positive value. (This is not the case if
you have swapped the left and right views
around.)

If your files are not in the same folder or in the right naming format, then you will need to use the
<JoinViews> node.

Joining Two Separate Files Into One Stereoscopic Image Node

Page
141
School of Animation NUKE

1. Read in both 3dsbear.left.tif and bear.right.tif image sequences using Image > Read or the Hotkey ‘R’
as before.
2. To insert a <JoinViews> node, select Views > JoinViews.
3. Connect the inputs of the <JoinViews> node into the appropriate <Read> nodes. There should be an
input for each view you have created in the project settings. The inputs are labeled with the name of the
view.
4. If you have assigned colours to the views and checked <Use colours in UI?> on the Views tab of your
project settings, the connecting arrows will reflect the view colours. If this does not happen and the
arrows are black, you may have connected the inputs the wrong way around. Check that you have
connected each <Read> node to the correct
input of the <JoinViews> node. Nuke combines the inputs into a single output.

Page
142
School of Animation NUKE

A lot of times you would want to extract all views, process them individually, and then merge them
together, using the SplitAndJoin menu items. It first extracts all the views you have set up in your project
settings and then merges them back together. It’s no different to use several <OneView> nodes together
with a <JoinViews> node, but makes working faster, because you do not need to add each node in a
separate go.

Color Correction In S3D


In many cases, the colors between the left and right views come in with differences between them, as in
the case of 3dsBear. The left side is more red and the right side has more green. Now we are going to
learn how to use a single <MultiView> node to control which side to apply the color change.
Selecting Which Views To Apply Changes To
By default, Nuke applies any changes you make to all views of the processed node. To apply changes to
a particular view only (for example, the left view but not the right), you must first split the view off in the
node’s controls.

Page
143
School of Animation NUKE

RENDERING
Nuke supports a fast, high-quality internal renderer, with superior colour resolution and dynamic range
without a
slowdown in the workflow. These are some of the key features of Nuke’s rendering engine :
• Multi-threaded rendering to take advantage of multiple processors in its calculations.
• Scanline (as opposed to buffer-based) rendering allows you to immediately see portions of render
output.
• Calculations performed with 32-bit precision, using linear light levels.

Previewing In A Nuke Viewer


When you connect a viewer to a given node’s output (by selecting the node and pressing a number key),
Nuke
immediately starts rendering the output in the viewer using all available local processors.
Keep in mind the following tips in order to speed up this type of preview rendering:
• First, if you don’t need to evaluate the whole image, zoom into the area of interest. Nuke will then
render only the
portion of scanlines visible within the viewer.
Alternatively, you can use the viewer’s region of interest (ROI) feature to render only a portion of the
image, while seeing
that result in the context of the whole image. Click the viewer’s ROI button to toggle on /off this render
feature.

Flipbooking Sequences
Flipbooking a sequence refers to rendering out range of images (typically at proxy resolution), then
playing them back
in order to accurately access the motion characteristics of added effects.
Two options for flipbooking within Nuke :
• You can enable automatic disk caching of rendered frames, then play these frames back using Nuke’s
native
viewer. This option does not let you define a specific playback rate.
• Or you can render out a temporary image sequences to FrameCycler, a RAM-buffering playback utility
which is
automatically installed with your copy of Nuke and plays back sequences at the defined frame rate.

Page
144
School of Animation NUKE

Flipbooking Within Nuke


To flipbook image sequences inside the Nuke viewer, you must first enable the automatic disk caching of
rendered
frames. You do so by setting two preferences that define the location and size of the cache. Once you set
these
preferences, the Nuke viewer automatically saves to disk 8-bit-per-channel versions of every frame it
displays. When
you play through sequences in the viewer, it reads, where possible, from this cache of pre rendered
images, making
real-time play back possible (depending, of course, on image resolution and your hardware
configuration).
Let’s bring in a script in Lesson 8 / Scripts / Parallex.nk. Press the play button and the image sequence
begin to
cache the prerendered scene. In the menu under Nuke 5.2 / Preferences or Hotkey ‘Command’, you will
display the
preferences dialog window.
To enable automatic disk caching of rendered frames:
1. In the disk cache field, enter the path name of the directory in which you want to store the flipbook
images (for
example, c:/temp).
2. From the disk cache size drop down, select the number of gigabytes you want to allow the image
cache to
consume (5 is the recommended value).
3. Click the Save Prefs button to update preferences and then restart Nuke.
The viewer will now cache each frame it displays in the directory specified. When you click the playback
buttons on the
viewer, or drag on the scrub bar, Nuke will read in images from this cache.

Page
145
School of Animation NUKE

Note that the cached images have unique names reflecting their point of output location in the script. This
means that
you can cache images from multiple nodes in the script without overwriting previously cached images.

Flipbooking within FrameCycler


To flipbook an image sequence inside FrameCycler:

1. Select the node whose output you wish to see flipbooked. That should be <ScanlineRender> node.
2. Select the <ScanlineRender> node, which should be the last node of the script and right click to add
Render >
Flipbook selected (or press Alt + F (pc) / Option + F (mac)). Nuke renders as a temporary sequence the
output of the
selected node using the frame range and resolution defined in the script’s settings. This may take a few
moments.
3. Once the render is complete, Nuke launches Framecycler and loads in the temporary sequence. You
can play it
back and view it using Framecycler’s media controls.

Note If you select a <Write> node in the step above, you must first click its Render button in order to
manually render
its output to the destination defined in the file field. This step is necessary only in the case of <Write>
nodes.

Page
146
School of Animation NUKE

FrameCycler

IRIDAS was founded in 2000 in Munich, Germany. IRIDAS Framecycler comes packed with many
features to
complement flipbooking. FrameCycler is the industry leader in uncompressed playback of frame-based
and video file
formats at SD, HD, 2K, and higher resolutions. FrameCycler applications are used by content creators to
review their
work, by filmmakers and postproduction facilities for digital dailies, and in venues for entertainment,
education, and
research. Log onto www.iridas.com for more information.
Rendering Output
Nuke can render images locally— on your workstation— or it can be setup to render images on a
network render farm.
Before rendering, verify that your project settings have the correct output format and proxy format
selected.
Render Resolution and Format
To view and change the proxy resolution for the current script file, choose Edit > Project Settings from the
menu bar, or
press ‘S’ with the mouse pointer over the Node Graph or the Properties Bin.
From the Project Settings properties panel, you can select a new render format from the list of predefined
resolutions,
and toggle proxy rendering. You can also choose the new option under either full size format or proxy
format or use the
proxy scale fields to define custom render resolutions for the composite. When rendering in proxy mode,
use the pull
down menu on the right to select whether to use the resolution defined under proxy format or proxy scale.

Page
147
School of Animation NUKE

Output (Write) Nodes


With the correct resolution and format selected, you then insert <Write> nodes to indicate where you
want to render
images from the script.
Delete the <Flipbook> node and add a <Write> node instead. <Write> node is usually placed at the
bottom of the
compositing tree to render the final output. However, a <Write> node has both In and Out connectors, so
it may be
embedded anywhere in the compositing tree.
** If you are rendering .mov files, you can choose the QuickTime codec from the codec pull down menu,
and adjust
advanced codec options by clicking the advanced button. If you are using 64-bit Windows, you cannot
render
QuickTime files. This is because Apple has not released QuickTime for 64-bit Windows

Executing Renders
You can execute renders for a single <Write> node or all <Write> nodes in your compositing script.
To render a single <Write> node:
1. Connect a <Viewer> node to the <Write> node you want to render and verify that the correct resolution
is displayed
for output.
2. If necessary, press (Control + P (pc) / Command + P (mac) to toggle between full-res and proxy
resolution. The
displayed output resolution will be used for rendering.
3. With the desired <Write> node selected, choose Render > Render selected (or press F7).
4. Nuke prompts for a frame range. Enter the start and end frames, separated by a comma (i.e., 1,100),
and then click
OK. To render all <Write> nodes in the script: Choose Render > Render all (or press F5).

Page
148