100% found this document useful (1 vote)
5K views1,149 pages

Nuke6.0v5 UserGuide

The Foundry assumes no responsibility or liability for any errors or inaccuracies that may appear in This User Guide. Use of This User Guide and the Nuke software is subject to an End User License Agreement. The EULA expressly prohibits any action that could adversely affect the property rights of The Foundry and / or The Foundry's licensors.

Uploaded by

tralenuvole
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
5K views1,149 pages

Nuke6.0v5 UserGuide

The Foundry assumes no responsibility or liability for any errors or inaccuracies that may appear in This User Guide. Use of This User Guide and the Nuke software is subject to an End User License Agreement. The EULA expressly prohibits any action that could adversely affect the property rights of The Foundry and / or The Foundry's licensors.

Uploaded by

tralenuvole
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

USER GUIDE

Nuke 6.0v5

The Foundry Visual Effects Software

Tinder Box1 The Foundry


Nuke™ User Guide. Copyright © 2010 The Foundry Visionmongers Ltd. All Rights Reserved. Use of this User Guide and the Nuke
software is subject to an End User License Agreement (the "EULA"), the terms of which are incorporated herein by reference. This
User Guide and the Nuke software may be used or copied only in accordance with the terms of the EULA. This User Guide, the Nuke
software and all intellectual property rights relating thereto are and shall remain the sole property of The Foundry Visionmongers Ltd.
("The Foundry") and/or The Foundry's licensors.

The EULA can be read in the Nuke User Guide, Appendix E.

The Foundry assumes no responsibility or liability for any errors or inaccuracies that may appear in this User Guide and this User
Guide is subject to change without notice. The content of this User Guide is furnished for informational use only.

Except as permitted by the EULA, no part of this User Guide may be reproduced, stored in a retrieval system or transmitted, in any
form or by any means, electronic, mechanical, recording or otherwise, without the prior written permission of The Foundry. To the
extent that the EULA authorizes the making of copies of this User Guide, such copies shall be reproduced with all copyright,
trademark and other proprietary rights notices included herein. The EULA expressly prohibits any action that could adversely affect
the property rights of The Foundry and/or The Foundry's licensors, including, but not limited to, the removal of the following (or any
other copyright, trademark or other proprietary rights notice included herein):

Nuke™ compositing software © 2010 The Foundry Visionmongers Ltd. All Rights Reserved.

Nuke™ is a trademark of The Foundry Visionmongers Ltd.

Digital Domain ® is a registered trademark of Digital Domain, Inc.

Primatte™ keyer tool © 1997-2010 Photron USA, Inc. All Rights Reserved.

Primatte™ is a trademark of IMAGICA Corp.

Primatte™ patent is held by IMAGICA Corp.

In addition to those names set forth on this page, the names of other actual companies and products mentioned in this User Guide
(including, but not limited to, those set forth below) may be the trademarks or service marks, or registered trademarks or service
marks, of their respective owners in the United States and/or other countries. No association with any company or product is intended
or inferred by the mention of its name in this User Guide.

ACADEMY AWARD ® is a registered service mark of the Academy of Motion Picture Arts and Sciences.

Linux ® is a registered trademark of Linus Torvalds.

Windows ® is the registered trademark of Microsoft Corporation.

Mac, Mac OS, Tiger, Shake, Final Cut Pro and QuickTime are trademarks of Apple, Inc., registered in the U.S. and other countries.

Adobe ® and Photoshop ® are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or
other countries.

The Foundry Tinder Box1


Maya ® is a registered trademark of Autodesk, Inc., in the USA and other countries.

Houdini ® is a registered trademark of Side Effects Software, Inc.

Boujou is a trademark of 2d3 Ltd.

3D-Equalizer is a trademark of Science.D.Visions.

FrameCycler ® is a registered trademark of Iridas, Inc. OpenGL ® is a trademark or registered trademark of Silicon Graphics, Inc., in
the United States and/or other countries worldwide.

Cineon™ is a trademark of Eastman Kodak Company.

Stereoscopic images courtesy of Mr. Henry Chung, HKSC (http://www.stereoscopy.com/henry/). Images illustrating warping and
morphing courtesy of Ron Brinkmann (http://www.digitalcompositing.com). Images from “The Day After Tomorrow” ©2004
courtesy of and copyright by 20th Century Fox. Images from "Stealth" courtesy of and copyright by Sony Pictures Inc. Images from
"xXx" ©2002 courtesy of and copyright by Columbia Pictures Industries. All rights reserved by their respective owners in the United
States and/or other countries.

The Foundry
1 Wardour Street
London
W1D 6PA
UK

Rev: April 19, 2010

The Foundry Tinder Box1


CONTENTS 4

Contents

PREFACE
About this Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Viewing Online Help . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Contacting Customer Support. . . . . . . . . . . . . . . . . . . 27

GETTING STARTED
About the Chapters. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

INSTALLATION AND System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30


Windows and Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
LICENSING Mac OS X. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Licensing Nuke . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Obtaining Licenses . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Installing Licenses. . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Installing Nuke . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Installation on Windows . . . . . . . . . . . . . . . . . . . . . . . 35
Installation on Linux . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Installation on Mac OS X . . . . . . . . . . . . . . . . . . . . . . 40
Launching Nuke. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Launching the Commercial Version . . . . . . . . . . . . . . . 41
Launching the Nuke Personal Learning Edition (PLE) . 43
About the Personal Learning Edition . . . . . . . . . . . . . . . . . 44
PLE versus the Commercial Version of Nuke . . . . . . . 44

THE NUKE PLUG-IN What Is the Nuke Plug-in Installer . . . . . . . . . . . . . . . . . . . 47


INSTALLER Accessing the Nuke Plug-in Installer . . . . . . . . . . . . . . . . . 47
Getting an Overview of the Plug-ins . . . . . . . . . . . . . . . . . 47

The Foundry Nuke 6.0v5


CONTENTS 5

Viewing Details of Plug-ins . . . . . . . . . . . . . . . . . . . . . . . . 47


Downloading Plug-ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48

USING THE INTERFACE Understanding the Workflow . . . . . . . . . . . . . . . . . . . . . . . 49


The Nuke Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Panes and Panels . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Tabbed Panels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Toolbar, Menu Bar and Content Menus . . . . . . . . . . . 53
Using the Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Using the Menu Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Working with Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Adding Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Selecting Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Replacing Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Renaming Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Editing Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Cloning Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Disabling and Deleting Nodes . . . . . . . . . . . . . . . . . . . 66
Connecting Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Indicators on Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Searching for Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Viewing Information on Nodes . . . . . . . . . . . . . . . . . . 73
Customizing the Node Display . . . . . . . . . . . . . . . . . . 73
Navigating Inside the Node Graph . . . . . . . . . . . . . . . . . . . 75
Panning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Zooming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Fitting Selected Nodes in the Node Graph . . . . . . . . . 78
Fitting the Node Tree in the Node Graph . . . . . . . . . . 78
Properties panels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Managing the Properties Bin . . . . . . . . . . . . . . . . . . . 79
Controls That Appear on All Properties Panels . . . . . 80
Displaying Parameters . . . . . . . . . . . . . . . . . . . . . . . . 84
Using Input Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

The Foundry Nuke 6.0v5


CONTENTS 6

Using Sliders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Separating Channels . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Using the Color Picker and Color Controls . . . . . . . . . 87
Using Color Sliders and Color Wheel . . . . . . . . . . . . . 88
Animating Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Working with Animated Parameters . . . . . . . . . . . . . . 94
Animated Parameters and the Curve Editor . . . . . . . . 96
Using the Curve Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Displaying Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Editing Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Viewers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Adding Viewer Nodes . . . . . . . . . . . . . . . . . . . . . . . . 112
Connecting Viewer Nodes . . . . . . . . . . . . . . . . . . . . . 113
Toggling Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Panning and Zooming the Viewer Window . . . . . . . . 114
Hiding Floating Viewers . . . . . . . . . . . . . . . . . . . . . . 116
Using the Viewer Controls . . . . . . . . . . . . . . . . . . . . 116
Using the Viewer Composite Display Modes . . . . . . 142
Hiding and Showing Viewer Toolbars . . . . . . . . . . . . 145
Locking the Viewer Zoom Level . . . . . . . . . . . . . . . . 145
Using the File Browser . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Undoing and Redoing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Progress Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Customizing the Interface. . . . . . . . . . . . . . . . . . . . . . . . . 150
Interface Layouts . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

MANAGING SCRIPTS Working with Multiple Image Formats . . . . . . . . . . . . . . . 156


8-, 16-, and 32-Bit Image Processing . . . . . . . . . . . . . . . 156
Setting Up Your Script . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Name, Timespan, and Frame Rate. . . . . . . . . . . . . . . 157
Full-size Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Proxy Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Image Caching. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

The Foundry Nuke 6.0v5


CONTENTS 7

The Cache Directory . . . . . . . . . . . . . . . . . . . . . . . . . 168


Defining the Settings for Caching. . . . . . . . . . . . . . . 169
Clearing the Disk Cache . . . . . . . . . . . . . . . . . . . . . . 170
Using the DiskCache Node . . . . . . . . . . . . . . . . . . . . 170
Saving Scripts and Recovering Backups . . . . . . . . . . . . . . 172
Saving Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Automatic Backup of Scripts. . . . . . . . . . . . . . . . . . . 173
Recovering Backups . . . . . . . . . . . . . . . . . . . . . . . . . 175
Loading Image Sequences . . . . . . . . . . . . . . . . . . . . . . . . . 176
Loading Images from an External File Browser. . . . . 179
Naming Conventions . . . . . . . . . . . . . . . . . . . . . . . . . 179
Changing the Relation Between the Current Frame and
the Frame Read in . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Reformatting Image Sequences . . . . . . . . . . . . . . . . . . . . 183
Loading Nuke Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Closing Nuke Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Defining Frame Ranges . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
File Name Search and Replace . . . . . . . . . . . . . . . . . . . . . 186
Displaying Script Information . . . . . . . . . . . . . . . . . . . . . . 187
Grouping Nodes in the Node Graph . . . . . . . . . . . . . . . . . 188
Grouping Nodes with the Backdrop Node. . . . . . . . . 188
Grouping Nodes with the Group Node . . . . . . . . . . . 191
Adding Notes to the Node Graph . . . . . . . . . . . . . . . . . . . 193
Using the Precomp Node . . . . . . . . . . . . . . . . . . . . . . . . . 194
Creating Precomp Nodes . . . . . . . . . . . . . . . . . . . . . 195
Using a Precomp Node to Speed up Rendering . . . . 198
Precomp Revisions . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Collaborative Workflow Example . . . . . . . . . . . . . . . 201
Working with File Metadata . . . . . . . . . . . . . . . . . . . . . . . 202
Metadata in Nuke . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Viewing Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
Comparing Metadata Between Inputs. . . . . . . . . . . . 205
Modifying Metadata . . . . . . . . . . . . . . . . . . . . . . . . . 205

The Foundry Nuke 6.0v5


CONTENTS 8

Copying Metadata from One Input to Another and


Filtering Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . 209
Adding a Timecode to Metadata. . . . . . . . . . . . . . . . 210
Rendering Metadata . . . . . . . . . . . . . . . . . . . . . . . . . 211
Accessing Metadata via TCL Expressions . . . . . . . . . 212
Accessing Metadata via Python . . . . . . . . . . . . . . . . 213

REFERENCE
Organisation of the Section . . . . . . . . . . . . . . . . . . . . . . . 214

REFORMATTING Reformatting Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217


Using the Reformat Node . . . . . . . . . . . . . . . . . . . . . 217
ELEMENTS Cropping Elements . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Adjusting the Bounding Box . . . . . . . . . . . . . . . . . . . . . . . 225
Resizing the Bounding Box . . . . . . . . . . . . . . . . . . . . 226
Copying a Bounding Box from One Input to Another 227
Adding a Black Outside Edge to the Bounding Box . 229

CHANNELS Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231


Understanding Channels . . . . . . . . . . . . . . . . . . . . . . 231
Understanding Channel Sets (Layers) . . . . . . . . . . . . 231
Creating Channels and Channel Sets . . . . . . . . . . . . . . . . 232
Calling Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
Selecting Input Channels. . . . . . . . . . . . . . . . . . . . . . 236
Selecting Masks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
Tracing Channels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Renaming Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
Removing Channels and Channel Sets . . . . . . . . . . . . . . . 241
Swapping Channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
Channels from Input 1 . . . . . . . . . . . . . . . . . . . . . . . 242
Channels from Input 2 . . . . . . . . . . . . . . . . . . . . . . . 242
Channel Outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Assigning Constants . . . . . . . . . . . . . . . . . . . . . . . . . 244

The Foundry Nuke 6.0v5


CONTENTS 9

Creating Swap Channel Sets . . . . . . . . . . . . . . . . . . . 245


In Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245

MERGING IMAGES Layering Images Together with the Merge Node . . . . . . . 247
Merge Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
Generating Contact Sheets . . . . . . . . . . . . . . . . . . . . . . . . 259
Copying a Rectangle from One Image to Another . . . . . . 263

COLOR CORRECTION AND Making Tonal Adjustments . . . . . . . . . . . . . . . . . . . . . . . . 267


Using Histograms . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
COLOR SPACE Sampling White and Black points . . . . . . . . . . . . . . . 269
Making Basic Corrections . . . . . . . . . . . . . . . . . . . . . 270
Using Sliders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
Using Color Curves . . . . . . . . . . . . . . . . . . . . . . . . . . 272
Making Hue, Saturation, and Value Adjustments . . . . . . . 276
Correcting HSV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Correcting Hue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
Correcting Saturation . . . . . . . . . . . . . . . . . . . . . . . . 282
Masking Color Corrections . . . . . . . . . . . . . . . . . . . . . . . . 283
Applying Grain. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
Using Synthetic Grain . . . . . . . . . . . . . . . . . . . . . . . . 285
Using Practical Grain. . . . . . . . . . . . . . . . . . . . . . . . . 286
Applying Mathematical Operations to Channels . . . . . . . 290
Clamping Channel Values . . . . . . . . . . . . . . . . . . . . . 290
Offsetting Channel Values . . . . . . . . . . . . . . . . . . . . 291
Inverting Channel Values . . . . . . . . . . . . . . . . . . . . . 292
Multiplying Channel Values. . . . . . . . . . . . . . . . . . . . 293
Applying Expressions to Channel Values . . . . . . . . . 294
Transforming the Color Space . . . . . . . . . . . . . . . . . . . . . 296
Overriding the Default Cineon Conversion . . . . . . . . 296
Making Other Color Space Conversions . . . . . . . . . . 297
Changing the Viewer Color Space . . . . . . . . . . . . . . . 298

The Foundry Nuke 6.0v5


CONTENTS 10

TRANSFORMING Transforming in 2D. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300


Using the 2D Transformation Overlay . . . . . . . . . . . 300
ELEMENTS Choosing a Filtering Algorithm . . . . . . . . . . . . . . . . . 302
Translating Elements. . . . . . . . . . . . . . . . . . . . . . . . . 308
Rotating Elements. . . . . . . . . . . . . . . . . . . . . . . . . . . 310
Scaling Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
Skewing Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . 313
Applying Core Transformations in 2.5D . . . . . . . . . . . . . . 314
Adding a Card3D Node . . . . . . . . . . . . . . . . . . . . . . . 315
Specifying the Order of Operations . . . . . . . . . . . . . 315
Choosing a Filtering Algorithm . . . . . . . . . . . . . . . . . 315
Using the 3D Transformation Handles . . . . . . . . . . . 316
Translating Elements. . . . . . . . . . . . . . . . . . . . . . . . . 317
Rotating Elements. . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Scaling Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Skewing Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Adding Motion Blur . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Replicating the Input Image Across the Output . . . . . . . . 322

TRACKING AND Tracking an Image. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324


Activating Track Anchors . . . . . . . . . . . . . . . . . . . . . 327
STABILIZING Positioning Track Anchors . . . . . . . . . . . . . . . . . . . . 328
Calculating the Track . . . . . . . . . . . . . . . . . . . . . . . . 329
Retracking Part of a Track . . . . . . . . . . . . . . . . . . . . . . . . 331
Editing Tracks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
Manipulating the Track Overlays . . . . . . . . . . . . . . . 332
Manipulating Track Curves and Smoothing Tracks. . 333
Tracking and Multiview Projects . . . . . . . . . . . . . . . . 335
Applying Tracking Data. . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Applying Tracking Data Using Tracker Controls . . . . 337
Applying Tracking Data Via Linking Expressions . . . 338

KEYING WITH PRIMATTE Accessing Primatte from Nuke . . . . . . . . . . . . . . . . . . . . . 346

The Foundry Nuke 6.0v5


CONTENTS 11

Primatte Basic Operation Tutorial . . . . . . . . . . . . . . . . . . 347


Auto-Compute. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Select BG Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
Clean BG Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Clean FG Noise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
Spill Removal - Method #1 . . . . . . . . . . . . . . . . . . . . 355
Spill Removal - Method #2 . . . . . . . . . . . . . . . . . . . . 356
Spill Removal - Method #3 . . . . . . . . . . . . . . . . . . . . 358
Repeatable Sampling Tools. . . . . . . . . . . . . . . . . . . . . . . . 358
The Spill Sampling Tools . . . . . . . . . . . . . . . . . . . . . . 359
The Matte Sampling Tools . . . . . . . . . . . . . . . . . . . . 360
The Detail Sampling Tools. . . . . . . . . . . . . . . . . . . . . 360
Spill Replacement Options . . . . . . . . . . . . . . . . . . . . . . . . 361
No Suppression (no suppression) . . . . . . . . . . . . . . . 361
Complemental Replacement Mode (complement) . . . 362
Solid Color Replacement Mode (solid color) . . . . . . . 362
Defocus Spill Replacement (defocused background). 363
Primatte Tools and Buttons . . . . . . . . . . . . . . . . . . . . . . . 365
Initialize Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
Degrain Section. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
Actions Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 376
Fine Tuning Section. . . . . . . . . . . . . . . . . . . . . . . . . . 380
Spill Process Section . . . . . . . . . . . . . . . . . . . . . . . . . 382
Output Section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
The Primatte Algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . 384
Explanation of how Primatte works . . . . . . . . . . . . . 385
Explanation of how Primatte RT+ works . . . . . . . . . 396
Explanation of how Primatte RT works . . . . . . . . . . 397
Contact Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
Main office . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
Primatte office . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
Proprietary Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399

The Foundry Nuke 6.0v5


CONTENTS 12

KEYING WITH KEYLIGHT Quick Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400


Basic Keying . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
Picking the Screen Color . . . . . . . . . . . . . . . . . . . . . . 402
Screen Matte. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Viewing the Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Keying More . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
Advanced Keying. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
Under The Hood . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
View . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
Screen Color . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Clip Black and White . . . . . . . . . . . . . . . . . . . . . . . . . 417
Screen Gain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Screen Balance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
PreBlur . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Screen Processing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422
Mattes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
Inside and Outside Masks. . . . . . . . . . . . . . . . . . . . . 426
Source Alpha . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
Color Replacement . . . . . . . . . . . . . . . . . . . . . . . . . . 428

USING ROTOPAINT Quick Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431


Connecting the RotoPaint Node . . . . . . . . . . . . . . . . . . . . 432
Working with the Toolbars . . . . . . . . . . . . . . . . . . . . . . . . 433
Working with the Stroke/Shape List . . . . . . . . . . . . . . . . . 434
Drawing Paint Strokes . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
Using the Brush Tool . . . . . . . . . . . . . . . . . . . . . . . . 439
Using the Eraser Tool . . . . . . . . . . . . . . . . . . . . . . . . 440
Using the Clone Tool. . . . . . . . . . . . . . . . . . . . . . . . . 440
Using the Reveal Tool . . . . . . . . . . . . . . . . . . . . . . . . 443
Using the Blur Tool . . . . . . . . . . . . . . . . . . . . . . . . . . 444
Using the Sharpen Tool. . . . . . . . . . . . . . . . . . . . . . . 445
Using the Smear Tool . . . . . . . . . . . . . . . . . . . . . . . . 446

The Foundry Nuke 6.0v5


CONTENTS 13

Using the Dodge Tool . . . . . . . . . . . . . . . . . . . . . . . . 447


Using the Burn Tool . . . . . . . . . . . . . . . . . . . . . . . . . 448
Drawing Shapes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
Using the Bezier Tool . . . . . . . . . . . . . . . . . . . . . . . . 451
Using the B-Spline Tool . . . . . . . . . . . . . . . . . . . . . . 453
Using the Ellipse and Rectangle Tools . . . . . . . . . . . 454
Setting a Default RotoPaint Tool . . . . . . . . . . . . . . . . . . . 456
Selecting the Output Format and Channels . . . . . . . . . . . 457
Selecting Existing Strokes/Shapes for Editing . . . . . . . . . 459
Editing Existing Stroke/Shape Attributes . . . . . . . . . . . . . 461
Editing Attributes Common to Strokes and Shapes . 462
Transforming Strokes/Shapes/Groups . . . . . . . . . . . 465
Adjusting Mask Controls. . . . . . . . . . . . . . . . . . . . . . 466
Editing Shape Specific Attributes . . . . . . . . . . . . . . . 467
Editing Stroke Specific Attributes. . . . . . . . . . . . . . . 469
Editing Clone or Reveal Attributes . . . . . . . . . . . . . . 472
Editing Existing Stroke/Shape Timing. . . . . . . . . . . . . . . . 473
Editing Existing Stroke/Shape Stack Order . . . . . . . . . . . 474
Editing Existing Stroke/Shape Curves. . . . . . . . . . . . . . . . 474
Animating Strokes/Shapes . . . . . . . . . . . . . . . . . . . . . . . . 477
Copying, Pasting, and Cutting Stroke Positions . . . . . . . . 481
Copying Point Positions . . . . . . . . . . . . . . . . . . . . . . 481
Pasting Point Positions. . . . . . . . . . . . . . . . . . . . . . . 481
Cutting Point Positions . . . . . . . . . . . . . . . . . . . . . . . 482
RotoPaint and Stereoscopic Projects . . . . . . . . . . . . . . . . 483
Where Are the Bezier and Paint Nodes . . . . . . . . . . . . . . 483

TEMPORAL OPERATIONS Distorting Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484


Simple Retiming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
Interpolation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 486
Frame-blending . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
OFlow Retiming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
OFlow Parameters. . . . . . . . . . . . . . . . . . . . . . . . . . . 491

The Foundry Nuke 6.0v5


CONTENTS 14

Warping Clips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496


Global Frame Range and Speed. . . . . . . . . . . . . . . . . 499
Applying the TimeBlur Filter . . . . . . . . . . . . . . . . . . . . . . . 500
Editing Clips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
Slipping Clips. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
Cutting Clips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
Splicing Clips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504

WARPING AND Warping. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507


Warping Images Using the GridWarp Node . . . . . . . 508
MORPHING IMAGES Warping an Image Using the SplineWarp Node . . . . 516
Animating Warps. . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
Morphing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525

CREATING EFFECTS Background Reflections on Foreground Elements . . . . . . 533


Creating Star Filter Effects on Image Highlights . . . . . . . 537
Creating Text Overlays . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
Creating a Text Overlay . . . . . . . . . . . . . . . . . . . . . . 541
Repositioning and Transforming Text . . . . . . . . . . . 546
Fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
Changing the Text Color . . . . . . . . . . . . . . . . . . . . . . 553

ANALYZING FRAME Analysing and Matching Frame Sequences . . . . . . . . . . . . 555


SEQUENCES

3D COMPOSITING Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562


Setting Up a Scene . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563
The Scene Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . 564
The ScanlineRender Node . . . . . . . . . . . . . . . . . . . . . 564
The Camera Node . . . . . . . . . . . . . . . . . . . . . . . . . . . 565
Using the 3D Viewer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 566
3D Scene Geometry. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 570

The Foundry Nuke 6.0v5


CONTENTS 15

Working with Cards. . . . . . . . . . . . . . . . . . . . . . . . . . 571


Working with Cubes . . . . . . . . . . . . . . . . . . . . . . . . . 576
Working with Spheres . . . . . . . . . . . . . . . . . . . . . . . . 578
Working with OBJ Objects. . . . . . . . . . . . . . . . . . . . . 580
Parenting to Axis Objects . . . . . . . . . . . . . . . . . . . . . 582
Merging Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
Object Material Properties . . . . . . . . . . . . . . . . . . . . . . . . 584
Projecting Textures onto Objects. . . . . . . . . . . . . . . . . . . 591
Projecting Textures with the UVProject node . . . . . 591
Projecting Textures with the Project3D Node . . . . . 592
Replacing Material Channels with a Constant Color. . . . . 593
Merging Shaders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
Merging Two Shader Nodes . . . . . . . . . . . . . . . . . . . 595
Merging a Material with the Objects Behind . . . . . . 597
Object Display Properties . . . . . . . . . . . . . . . . . . . . . . . . . 602
Transforming Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
Using the Transform Handles . . . . . . . . . . . . . . . . . . 605
Transforming from the Node Properties Panel. . . . . 606
Transformations and the Pivot Point . . . . . . . . . . . . 607
Using the TransformGeo Node . . . . . . . . . . . . . . . . . 608
Modifying Object Shapes . . . . . . . . . . . . . . . . . . . . . . . . . 612
Modifying Objects Using Lookup Curves . . . . . . . . . 612
Modifying Objects Using a Power Function . . . . . . . 614
Modifying Objects Using an Image . . . . . . . . . . . . . . 616
Modifying Objects Using a Perlin Noise Function. . . 619
Modifying Objects Using a Distortion Function . . . . 620
Modifying Objects Using a Trilinear Interpolation . . 621
Lighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
Direct Light . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623
Point Light. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
Spot Light . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625
Environment Light . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
The Light Node . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630

The Foundry Nuke 6.0v5


CONTENTS 16

Manipulating Object Normals . . . . . . . . . . . . . . . . . . . . . . 631


Working with Cameras . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
Projection Cameras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634
First a Little Math... . . . . . . . . . . . . . . . . . . . . . . . . . 635
Setting Up the Projection Camera Script . . . . . . . . . 635
Adding Motion Blur to the 3D Scene . . . . . . . . . . . . . . . . 638
Importing Channel Files, Cameras, Lights, Transforms, and
Meshes from Other Applications . . . . . . . . . . . . . . . . . . . 641
Applying Tracks to an Object . . . . . . . . . . . . . . . . . . 642
Working with .fbx Files . . . . . . . . . . . . . . . . . . . . . . . 643
Importing Cameras from Boujou . . . . . . . . . . . . . . . . 651
Rendering a 3D Scene. . . . . . . . . . . . . . . . . . . . . . . . . . . . 653
Adjusting the Render Parameters . . . . . . . . . . . . . . . 653

WORKING WITH Setting Up Views for the Script . . . . . . . . . . . . . . . . . . . . 655


STEREOSCOPIC PROJECTS Loading Multi-View Images . . . . . . . . . . . . . . . . . . . . . . . 660
Displaying Views in the Viewer . . . . . . . . . . . . . . . . . . . . 662
Selecting which Views to Apply Changes to . . . . . . . . . . . 666
Splitting Views Off . . . . . . . . . . . . . . . . . . . . . . . . . . 666
Selecting the View to Process When Using the
RotoPaint Node. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 669
Performing Different Actions on Different Views . . . . . . 669
Reproducing Changes Made to One View. . . . . . . . . . . . . 670
Reproducing Paint Strokes . . . . . . . . . . . . . . . . . . . . 671
Reproducing Roto Shapes . . . . . . . . . . . . . . . . . . . . . 674
Reproducing X and Y Values. . . . . . . . . . . . . . . . . . . 675
Swapping Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 677
Converting Images into Anaglyph . . . . . . . . . . . . . . . . . . . 678
Changing Convergence . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
Previewing and Rendering Stereoscopic Images . . . . . . . 689
Flipbooking Stereo Images within FrameCycler . . . . 689
Rendering Stereoscopic Images . . . . . . . . . . . . . . . . 690

The Foundry Nuke 6.0v5


CONTENTS 17

PREVIEWS AND Previewing Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692


Previewing in a Nuke Viewer . . . . . . . . . . . . . . . . . . 692
RENDERING Flipbooking Sequences . . . . . . . . . . . . . . . . . . . . . . . 693
Previewing on an External Broadcast Video Monitor697
Rendering Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
Render Resolution and Format . . . . . . . . . . . . . . . . . 699
Output (Write) Nodes . . . . . . . . . . . . . . . . . . . . . . . . 701
File Name Conventions for Rendered Images . . . . . . 706
Changing the Numbering of Rendered Frames . . . . . 707
Using a Write Node to Read in the Rendered Image 710
Render Farms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712

EXPRESSIONS Understanding Expression Syntax . . . . . . . . . . . . . . . . . . 713


Linking Expressions. . . . . . . . . . . . . . . . . . . . . . . . . . 713
Adding Mathematical Functions to Expressions. . . . . . . . 718

SETTING INTERFACE Displaying the Preferences Dialog . . . . . . . . . . . . . . . . . . 727


PREFERENCES Changing Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 727
Saving Preferences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 728
Resetting Preferences. . . . . . . . . . . . . . . . . . . . . . . . . . . . 729
The Available Preference Settings . . . . . . . . . . . . . . . . . . 729
Preferences Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
Windows Tab. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 734
Control Panels Tab . . . . . . . . . . . . . . . . . . . . . . . . . . 737
Appearance Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . 739
Node Colors Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
Node Graph Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . 742
Viewers Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
Script Editor Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754

THE SCRIPT EDITOR AND Workflow. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 756


PYTHON Using the Script Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . 757
Example Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763

The Foundry Nuke 6.0v5


CONTENTS 18

Creating Nodes and Setting Their Parameters . . . . . 763


Assigning Variables. . . . . . . . . . . . . . . . . . . . . . . . . . 766
Adding Parameters to Nodes . . . . . . . . . . . . . . . . . . 767
Connecting Nodes and Setting Their Inputs . . . . . . . 768
Setting Default Values for Controls . . . . . . . . . . . . . 769
Rendering with the Write Node . . . . . . . . . . . . . . . . 770
Listing a Node’s Controls . . . . . . . . . . . . . . . . . . . . . 771
Undoing and Redoing Actions. . . . . . . . . . . . . . . . . . 772
Frame Navigation . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
Setting Frame Ranges Using Python. . . . . . . . . . . . . 774
Copying an Animation Curve Between Nodes . . . . . . 777
Overriding the Creation of a Particular Node. . . . . . 778
Getting Information on the Nuke Environment You Are
Running . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 779
Accessing Node Metadata . . . . . . . . . . . . . . . . . . . . 781
Creating Dialogs and Panels . . . . . . . . . . . . . . . . . . . 781
Creating Progress Bar Dialogs . . . . . . . . . . . . . . . . . 789
Clearing Out the Current Nuke (.nk) Script . . . . . . . . 790
Creating Views for a Stereoscopic Project . . . . . . . . 790
Adjusting Parameter Values in Stereo Projects . . . . 791
Automating Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . 791
Getting Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 793
More Documentation . . . . . . . . . . . . . . . . . . . . . . . . 793
Viewing More Examples . . . . . . . . . . . . . . . . . . . . . . 793
Using the Help Statement . . . . . . . . . . . . . . . . . . . . . 794
Python on the Web . . . . . . . . . . . . . . . . . . . . . . . . . . 794
Python Callbacks Embedded in Scripts and Nodes . . . . . . 795
onUserCreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
onCreate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 797
onScriptLoad . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
onScriptSave . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
onScriptClose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799
onDestroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 799
knobChanged. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800

The Foundry Nuke 6.0v5


CONTENTS 19

updateUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 801
autolabel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802
beforeRender . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 802
beforeFrameRender. . . . . . . . . . . . . . . . . . . . . . . . . . 804
afterFrameRender . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
afterRender . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 805
filenameFilter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806
Using wxPython in Nuke to Write Custom GUIs. . . . . . . . 807
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 807
General Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . 809
Using PyQt4 in Nuke to Write Custom GUIs. . . . . . . . . . . 810
Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 811
General Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . 812
Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813

CONFIGURING NUKE What Is a Terminal and How Do I Use One?. . . . . . . . . . . 816


Command Line Operations . . . . . . . . . . . . . . . . . . . . . . . . 817
Environment Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . 825
Setting Environment Variables . . . . . . . . . . . . . . . . . 825
Nuke Environment Variables. . . . . . . . . . . . . . . . . . . 830
Loading Gizmos, NDK Plug-ins, and TCL scripts. . . . . . . . 833
Loading Python Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . 834
Loading OFX Plug-ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . 835
Defining Common Favourite Directories . . . . . . . . . . . . . . 836
Handling File Paths Cross Platform . . . . . . . . . . . . . . . . . 838
Defining Custom Menus and Toolbars . . . . . . . . . . . . . . . 840
Defining Common Image Formats . . . . . . . . . . . . . . . . . . . 849
Gizmos, Custom Plug-ins, and Generic TCL Scripts . . . . . 850
Creating and Sourcing Gizmos . . . . . . . . . . . . . . . . . 851
Custom Plug-ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . 869
Sourcing TCL Procedure . . . . . . . . . . . . . . . . . . . . . . 869
Template Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 870

The Foundry Nuke 6.0v5


CONTENTS 20

Defining Common Preferences . . . . . . . . . . . . . . . . . . . . . 871


Altering a Script’s Lookup Tables (LUTs) . . . . . . . . . . . . . 874
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 874
Displaying, Adding, Editing, and Deleting LUTs . . . . 875
Selecting the LUT to Use . . . . . . . . . . . . . . . . . . . . . 878
Default LUT settings . . . . . . . . . . . . . . . . . . . . . . . . . 879
Example Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
Creating Custom Viewer Processes . . . . . . . . . . . . . . . . . 881
Using a Gizmo as a Custom Viewer Process. . . . . . . 884
Applying Custom Viewer Processes to Images . . . . . 889

NUKEX
NukeX Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 891
Installing NukeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
Licensing NukeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
Launching NukeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
On Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 892
On Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 893
On Mac OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 893

CAMERA TRACKING Connecting the CameraTracker Node . . . . . . . . . . . . . . . . 895


Tracking Features in a Sequence . . . . . . . . . . . . . . . . . . . 895
Seeding Tracks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 896
Setting Tracking Parameters. . . . . . . . . . . . . . . . . . . 896
Masking out Regions of the Image . . . . . . . . . . . . . . 898
Viewing tracks and track information . . . . . . . . . . . 899
Creating Manual Tracks . . . . . . . . . . . . . . . . . . . . . . 899
Setting the Camera Parameters . . . . . . . . . . . . . . . . . . . . 901
Adjusting the Camera Parameters . . . . . . . . . . . . . . 901
Accounting for Lens Distortion. . . . . . . . . . . . . . . . . . . . . 902
Solving the Camera Position . . . . . . . . . . . . . . . . . . . . . . . 904
Transforming the Scene . . . . . . . . . . . . . . . . . . . . . . . . . . 905

The Foundry Nuke 6.0v5


CONTENTS 21

Adjusting the Virtual Camera . . . . . . . . . . . . . . . . . . . . . . 906


Deleting Tracks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
Using the Point Cloud . . . . . . . . . . . . . . . . . . . . . . . . . . . . 908
Setting Points on Ground Origin or Different Axes . 909
Setting a Ground Plane . . . . . . . . . . . . . . . . . . . . . . . 909
Scaling a Scene . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 909
Attaching Objects to the Footage . . . . . . . . . . . . . . 910
Copying Translate and Rotate Values . . . . . . . . . . . 911
Exporting a Point Cloud . . . . . . . . . . . . . . . . . . . . . . . . . . 911
Tracking Multiview Projects . . . . . . . . . . . . . . . . . . . . . . . 911

ADDING AND REMOVING Quick Start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 913


LENS DISTORTION Calculating Lens Distortion Automatically . . . . . . . . . . . . 914
Image Analysis Parameters. . . . . . . . . . . . . . . . . . . . 915
Analyzing Distortion Using a Grid . . . . . . . . . . . . . . . . . . 916
Grid Analysis Parameters . . . . . . . . . . . . . . . . . . . . . 916
Analyzing Distortion Using Lines . . . . . . . . . . . . . . . . . . . 917
Line Analysis Parameters . . . . . . . . . . . . . . . . . . . . . 917
Adjusting LensDistortion Parameters. . . . . . . . . . . . . . . . 918
Calculating the Distortion on One Image and Applying it to
Another . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 920
Applying Lens Distortion to a Card Node . . . . . . . . . . . . . 921

GENERATING DEPTH How is the Depth Calculated?. . . . . . . . . . . . . . . . . . . . . . 922


MAPS Connecting DepthGenerator . . . . . . . . . . . . . . . . . . . . . . . 923
To connect the DepthGenerator node . . . . . . . . . . . 923
Generating a Depth Map. . . . . . . . . . . . . . . . . . . . . . . . . . 924

TUTORIALS
The Projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 927
Installing the Project Files . . . . . . . . . . . . . . . . . . . . . . . . 927

The Foundry Nuke 6.0v5


CONTENTS 22

TUTORIAL 1: COMPOSITI Starting Nuke . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 931


NG BASICS Using the Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 932
Using the Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 932
Customizing Your Layout . . . . . . . . . . . . . . . . . . . . . . . . . 934
Saving Files and File Backup . . . . . . . . . . . . . . . . . . . . . . . 937
Setting Up the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . 940
Working with Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 941
Connection Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . 946
Importing Image Sequences . . . . . . . . . . . . . . . . . . . . . . . 949
Navigating Inside the Windows . . . . . . . . . . . . . . . . . . . . 953
Working with Viewers. . . . . . . . . . . . . . . . . . . . . . . . . . . . 954
Reformatting Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . 962
Using Proxies and “Down-res” . . . . . . . . . . . . . . . . . . . . . 963
Compositing Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 965
Color-correcting Images . . . . . . . . . . . . . . . . . . . . . . . . . . 969
Masking Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 971
To create and apply a Bezier mask . . . . . . . . . . . . . . 971
Creating Flipbook Previews. . . . . . . . . . . . . . . . . . . . . . . . 972
Rendering Final Output. . . . . . . . . . . . . . . . . . . . . . . . . . . 973
Epilog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 978

TUTORIAL 2: TRACKING, One-Point, Two-Point, Three-Point, Four . . . . . . . . . . . . 980


STABILISING AND Open the Tutorial Project File. . . . . . . . . . . . . . . . . . . . . . 982
MATCHMOVING Tracking a Single Feature . . . . . . . . . . . . . . . . . . . . . . . . . 983
Tracking Obscured Features . . . . . . . . . . . . . . . . . . . . . . . 988
Stabilising Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 991
Matchmoving Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . 994
Epilog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 998

TUTORIAL 3: KEYING Open the Tutorial Project File. . . . . . . . . . . . . . . . . . . . . 1000


AND MATTES Keying with Primatte . . . . . . . . . . . . . . . . . . . . . . . . . . . 1001

The Foundry Nuke 6.0v5


CONTENTS 23

Image-based Keying . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1009


Rotoscoping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1018
Keying Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1026
Epilog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1039

TUTORIAL 4: 3D The Basic 3D System . . . . . . . . . . . . . . . . . . . . . . . . . . . 1040


INTEGRATION The 3D Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1041
The Geometry or Scene Node . . . . . . . . . . . . . . . . . 1042
The Camera Node . . . . . . . . . . . . . . . . . . . . . . . . . . 1042
The ScanlineRender Node . . . . . . . . . . . . . . . . . . . . 1042
Open the Tutorial Project File. . . . . . . . . . . . . . . . . . . . . 1043
Setting Up a 3D System . . . . . . . . . . . . . . . . . . . . . . . . . 1045
Making a Scene . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1054
Merging and Constraining Objects . . . . . . . . . . . . . . . . . 1058
Animating a Scene . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1062
Working with Geometry . . . . . . . . . . . . . . . . . . . . . . . . . 1067
Lighting and Surface Properties . . . . . . . . . . . . . . . . . . . 1076
Epilog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1080

APPENDICES
Organisation of the Section . . . . . . . . . . . . . . . . . . . . . . 1082

APPENDIX A: HOT KEYS Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1083


Node Graphs, Viewers, Curve Editors, Script Editors, and
Properties Bins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1084
Properties Panels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1085
Node Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1086
Editing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1089
Viewers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1089
3D Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1094
RotoPaint Draw. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1094

The Foundry Nuke 6.0v5


CONTENTS 24

Curve Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1097


Script Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1099
Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1099
Content Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1099
Color Picker. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1100

APPENDIX B: SUPPORTED Supported Image Formats. . . . . . . . . . . . . . . . . . . . . . . . 1102


FILE FORMATS
APPENDIX C: Terms (and Conditions) . . . . . . . . . . . . . . . . . . . . . . . . . . 1106
CONVERTING FROM Node Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1108
Image Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1109
SHAKE TO NUKE Color Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1110
Filter Nodes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1112
Key Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1113
Layer Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1114
Transform Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . 1116
Warp Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1117
Other Nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1118

APPENDIX D: THIRD
PARTY LICENSES

APPENDIX E: END USER


LICENSING AGREEMENT

INDEX
A-Z . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1137

The Foundry Nuke 6.0v5


PREFACE
uke is an Academy Award® winning compositor. It
N has been used to create extraordinary images on
scores of feature films, including Avatar, District 9,
Australia, The Dark Knight, Quantum of Solace, The Curious
Case of Benjamin Button, Iron Man, Transformers, Pirates of
the Caribbean: At World’s End, and countless commercials
and music videos.

About this Manual This manual consists of four sections:


1. Getting Started, which teaches you how to acquire a
licence and install Nuke, use the interface and work with
script files.
2. Reference, which describes key features of Nuke in more
detail. You can dip in and out of this section depending
on what you’re interested in.
3. Tutorials, which are designed to show you how to solve
common compositing problems and help you really learn
Nuke.
4. Appendices, which include the available hot keys,
supported file formats, a Shake to Nuke conversion
course, and the end user license agreement.

If you are new to Nuke, we recommend that you start by


familiarizing yourself with the Getting Started section and
working your way through the Tutorials. These two sections
should give you a good base to build on when creating your
own scripts. If you then need an answer to a specific
problem or want to learn how to use a specific feature, you
PREFACE 26
Getting Help

can always turn to the Reference section. All the sections


are color-coded to make it easier for you to find what you
are looking for.

Throughout this user guide, we assume you have a basic


knowledge of computer graphics and

digital compositing theory, as well as proficiency with the


operating system for which Nuke is installed.

Note For the most up-to-date information, please see the Nuke
product page and the latest Nuke user guide on our web site
at www.thefoundry.co.uk.

Getting Help

Viewing Online Help Nuke features several forms of online help:


• Most controls offer concise instructions in the form of
tool tips. To display the tool tips, move your mouse
pointer over an interface control or a node parameter.

The Foundry Nuke 6.0v4


PREFACE 27
Getting Help

• Many properties panels include contextual descriptions of


the node’s parameters. To display these descriptions,
click the ? icon.

• Finally, you can click the Help menu to access the


following:
• Key Assignments - a list of hot keys.
• Documentation - this user guide, the Nuke Developer
Kit (NKD), and documentation for using FrameCycler,
Python, TCL, and expressions in Nuke.
• Training - FX PHD's Compositor's Guide to Nuke train-
ing videos, and a list of other training resources.
• Tutorials - grain samples, and the files used with the
tutorials in this user guide.
• Mailing Lists - information on Nuke-related e-mail
lists.

Contacting Customer Should questions arise that this manual or the online help
Support system fails to address, you can contact Customer Support
directly via e-mail at [email protected] or via
telephone to our London office on +44 (0)20 7434 0449 or
to our Los Angeles office on (310) 399 4555 during office
hours.

The Foundry Nuke 6.0v4


GETTING STARTED

B y now, you are probably itching to dive into and play


with Nuke, so let’s get you started. This section pro-
vides you with all you need to start compositing with
Nuke. For more detailed information on Nuke and its func-
tions, see the "Reference" section on page 214 in this man-
ual.

About the Chapters Before you can start exploring Nuke’s wonders, you of
course need to install Nuke on your machine. For
instructions on how to do so and launch either the
commercial version of Nuke or the Nuke Personal Learning
Edition, refer to Chapter 1: "Installation and Licensing" on
page 30.

After the installation, you’ll come across the Nuke Plug-in


Installer. With this application, you can easily get
information on plug-ins you can use with Nuke and download
them. For more information on the Nuke Plug-in Installer, go
to Chapter 2: "The Nuke Plug-in Installer", on page 47.

Once you have successfully installed and launched Nuke, you


can sit back and start familiarizing yourself with the
interface. Chapter 3: "Using the Interface" on page 49 is
designed to help you understand the workflow, the
workspace and the different controls. It also provides you
with information on adjusting the interface to suit your
preferences.
GETTING STARTED 29
About the Chapters

Finally, to learn about scripts and script management, turn


to Chapter 4: "Managing Scripts" on page 156.

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 30
System Requirements

1 INSTALLATION AND LICENSING

We know the installation and licensing of a new application


can be a boring task that you just want to be done with as
soon as possible. To help you with that, this chapter guides
you to the point where you have an open workspace of Nuke
in front of you and are ready to start compositing to your
heart’s content, whether it be with the commercial version of
Nuke or the Nuke Personal Learning Edition (PLE).

System Before you do anything else, check the system requirements


Requirements to make sure your computer can run Nuke.

Windows and Linux • 550 MHZ Pentium III or newer processor


• Windows XP (with Service Pack 2 or later), or CentOS 4.5.
• 5 GB disk space available for caching and temporary files
• 512 MB RAM (minimum requirement)
• Workstation-class graphics card, such as NVIDIA Quadro
series, ATI FireGL series, or newer. Driver support for
OpenGL 1.4.
To enable optional GPU acceleration of certain effects,
you need OpenGL 1.4 with support for floating point tex-
tures and GLSL.
• Display with at least 1280 x 1024 pixel resolution and
24-bit color
• Three-button mouse

Note To avoid graphical problems, such as text disappearing in


the Viewer and Node Graph, it is important to keep your

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 31
Licensing Nuke

graphics card drivers up-to-date. Driver updates can be


obtained from the web sites of the graphics card
manufacturers (for example, www.nvidia.com and
www.ati.com).

Mac OS X • Intel processor and Mac OS X 10.5 “Leopard” or 10.6


“Snow Leopard” (32-bit only)
• 5 GB of disk space available for caching and temporary
files
• 512 MB of RAM (minimum requirement)
• AGP or PCI Express graphics card with at least 32 MB of
video memory
• Display with at least 1280 x 1024 pixel resolution and
24-bit color
• Three-button mouse

Licensing Nuke If you simply want to try out or learn Nuke, you can run the
Nuke Personal Learning Edition (PLE) without a license key.
The PLE allows you to explore practically all Nuke’s features,
but prevents the commercial use of the application. To use
the PLE, you only need to install Nuke on your machine (see
“Installing Nuke” on page 35) and launch it in a special way
described in “Launching the Nuke Personal Learning Edition
(PLE)” on page 43. “About the Personal Learning Edition” on
page 44 also provides you with more information on the PLE
and how it differs from the commercial version of Nuke.

To use the commercial version of Nuke, you need a valid


license key. You can obtain one by purchasing Nuke or by
requesting a time-limited demo license. The instructions
below tell you how to get a license key and what to do with

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 32
Licensing Nuke

it. Without a valid license key, the commercial version of


Nuke will fail to run.

Nuke uses FLEXlm encryption in the license keys. Node-


locked (uncounted) and floating (counted) licenses are
supported. We also supply a suite of tools to manage and
monitor floating licenses running on a server across a
network of machines. These tools are called Foundry FLEXlm
Tools (FFT) and can be downloaded free of charge from our
web site at www.thefoundry.co.uk/licensing. The Foundry
FLEXlm Tools should be installed on the server.

Obtaining Licenses You can request licenses by contacting The Foundry. To


generate you a license key, we need to know your System ID.
The System ID (sometimes called lmhostid) returns a unique
number for your computer. We lock our license keys to the
System ID.

To display your System ID, do any of the following:


• Download the Foundry System ID (FSID) utility from
www.thefoundry.co.uk/licensing and run it. Your System
ID will be displayed in the window that opens.
• Install and try to launch the commercial version Nuke
without a valid license (see “Installing Nuke” on page 35
and “Launching Nuke” on page 41). Your System ID
number is displayed in the license error you get.
• Download the Foundry FLEXlm Tools (FFT) free of charge
from our web site and run the following command in a
terminal shell:
./lmutil lmhostid

Just so you know what a System ID number looks like, here’s


an example: 000ea641d7a1.

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 33
Licensing Nuke

Once you have provided us with your System ID number and


a license key has been generated for you, you will receive the
license key in an e-mail or Internet download. The license key
is contained in a text file called foundry.lic.

Here is an example node-locked (uncounted) license for Nuke


that expires on 29 September 2010 for a computer running
Nuke with a System ID of 000a957bfde5. Node-locked
licenses allow you to run Nuke on one machine only.
INCREMENT nuke_i foundry 2009.0929 29-sep-2010
uncounted \
HOSTID=000a957bfde5 ISSUED=29-sep-2009 \
SIGN="00DA 99A9 E744 217E 8AD3 E7AF E289 C0C6 \
6B23 2891 AC01 0F50 E64D 8847 8B22 3A40 2BE9 \
A268 B7C2 4BC0 36AF"
INCREMENT nuke_r foundry 2009.0929 29-sep-2010
uncounted \
HOSTID=000a957bfde5 ISSUED=29-sep-2009 \
SIGN="03C9 1D0D 5503 EC34 2CAF 37C0 8731 5E57 \
06E8 C8CB E113 51EA 87C6 3BE8 242B 50AC 35EE \
6753 B3AB 3AC4 1559"

And here’s an example of a permanent floating license for a


server whose machine name is “red” with System ID
000ea641d7a1 communicating on port number 30001 that
will enable any version of Nuke built before 31 July 2009 to
run on up to 5 machines simultaneously.
SERVER red 000ea641d7a1 30001
VENDOR foundry
INCREMENT nuke_i foundry 2009.0731 permanent 5
ISSUED=15-jul-2009 SIGN="00DA 99A9 E744 217E
8AD3 E7AF
E289 C0C6 6B23 2891 AC01 0F50 E64D 8847 8B22
3A40 2BE9 A268 B7C2 4BC0 36AF"

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 34
Licensing Nuke

INCREMENT nuke_r foundry 2009.0731 permanent 5


ISSUED=15-jul-2009 START=31-jul-2009 SIGN="03C9
1D0D 5503
EC34 2CAF 37C0 8731 5E57 06E8 C8CB E113 51EA
87C6 3BE8 242B 50AC 35EE 6753 B3AB 3AC4 1559"

For information on what to do with the foundry.lic file, see


“Installing Licenses” below.

Installing Licenses Once a license has been created for you, you will receive
your license key (foundry.lic) in an e-mail or Internet
download. You should also receive the Foundry License
Installer (FLI) application to help you install the license key.
The instructions below tell you what to do with these.

To install a license:
1. Make sure you have saved both the license key
(foundry.lic) and the Foundry License Installer application
in the same directory. You should receive these by e-mail
or (if you purchased Nuke online) in a download.
2. Double-click on the Foundry License Installer application.
3. Click Install.
This checks the license file and installs it into the correct
directory.
If you installed a node-locked license key (a license that
allows you to run Nuke on one machine only), you’re
good to go. Proceed to “Launching Nuke” on page 41.
If you are installing a floating license key, you will be
asked whether you want to create a client license file.
You should accept and save the file. For more informa-
tion on how to install floating licenses, refer to the FFT
user guide, which you can download from our web site.

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 35
Installing Nuke

Further Reading There is a lot to learn about licenses, much of which is


beyond the scope of this manual. For more information on
licensing Nuke, displaying the System ID number, setting up
a floating license server, adding new license keys and
managing license usage across a network, you should read
the Foundry FLEXlm Tools User Guide, which can be
downloaded from our web site, www.thefoundry.co.uk/
licensing.

Installing Nuke Nuke 6.0 will install separately to any previous versions
installed. Nuke 6.0 is available to download from our web
site at www.thefoundry.co.uk. The downloads are in
compressed tar format (tgz) for Linux, exe for Windows, and
dmg format for Mac OS X. The installation procedure is the
same for both the Nuke Personal Learning Edition and the
commercial version of Nuke.

Installation on To install Nuke on Windows, do the following:


Windows 1. Download the correct installation file from our web site.
Which installation file you download depends on whether
you are using a 32- or a 64-bit machine.
2. Double-click on the file to install Nuke.
3. Follow the on-screen instructions. By default, Nuke is
installed to drive letter:\Program Files\Nuke 6.0v5
(unless you’re installing 32-bit Nuke on 64-bit Windows,
in which case the default location is drive letter:\Program
Files (x86)\Nuke 6.0v5).
4. Proceed to “Launching Nuke” on page 41.

Note On Windows, if you install Nuke to a network drive to run


from multiple computers, please ensure that the correct

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 36
Installing Nuke

Microsoft run time libraries are installed on each machine


that will run Nuke. To do this, run "vcredist_x86.exe" (32-bit)
or "vcredist_x64.exe" (64-bit) on each machine. The
appropriate one of these files can be found in the "VCRedist"
subdirectory in the folder where Nuke is installed - for
example, vcredist_x86.exe for the 32-bit version of Nuke.
Running Nuke without installing the libraries on your
machine may work correctly, particularly as many systems
(such as Windows Vista by default) will already have them. If
the libraries are not present, Nuke will still run correctly, but
some plug-ins may fail to load with error messages such as
"This application has failed to start because the application
configuration is incorrect. Reinstalling the application may
fix this problem."
Please note that these libraries are set up automatically on
the machine that runs the Nuke installer, so users installing
on their local machine will not need to worry about this
issue.

Installing Nuke from the Command Line


To install Nuke from the command line, do the following:
1. Download the correct .exe installation file from our web
site at www.thefoundry.co.uk. Which installation file you
download depends on whether you are using a 32- or a
64-bit machine.
2. To open a command prompt window, select Start > All
Programs > Accessories > Command Prompt.
3. Use the cd (change directory) command to move to the
directory where you saved the installation file. For
example, if you saved the installation file in C:\Temp, use
the following command and press Return:
cd \Temp

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 37
Installing Nuke

4. To install Nuke, do one of the following:


• To install Nuke and display the installation dialog, type
the name of the install file without the file extension
and press Return:
Nuke6.0v5-win-x86-release-32 (on a 32-bit
machine)
Nuke6.0v5-win-x86-release-64 (on a 64-bit
machine)
• To install Nuke silently so that the installer does not
prompt you for anything but displays a progress bar,
enter /silent after the installation command:
Nuke6.0v5-win-x86-release-32 /silent
Nuke6.0v5-win-x86-release-64 /silent
• To install Nuke silently so that nothing is displayed,
enter /verysilent after the installation command:
Nuke6.0v5-win-x86-release-32 /verysilent
Nuke6.0v5-win-x86-release-64 /verysilent

Note By running a silent install of Nuke, you agree to the terms of


the End User Licensing Agreement. To see this agreement,
please refer to “Appendix E: End User Licensing Agreement”
on page 1130 or run the installer in standard non-silent
mode.

Installation on Linux To install Nuke on Linux, do the following:


1. Download the correct .tgz installation file from our web
site at www.thefoundry.co.uk. Which installation file you
download depends on whether you are using a 32- or a
64-bit machine.
2. Extract the installer from the tgz archive with the
following terminal command:

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 38
Installing Nuke

tar xvzf Nuke6.0v5-linux-x86-release-32.tgz


(on a 32-bit machine)
tar xvzf Nuke6.0v5-linux-x86-release-64.tgz
(on a 64-bit machine)
This will give you an installer file.
3. Run the installer.
sudo ./Nuke6.0v5-linux-x86-release-32-
installer (on a 32-bit machine)
sudo ./Nuke6.0v5-linux-x86-release-64-
installer (on a 64-bit machine)
4. Follow the on-screen instructions. By default, Nuke is
installed to /usr/local/Nuke6.0v5.
5. If you didn’t add a license key during the installation, do
that now. Proceed to “Launching Nuke” on page 41.

Tip To install Nuke silently, you can simply unzip the installer
file. This creates the properly formed Nuke directory tree in
the current directory.
By installing Nuke silently, you agree to the terms of the End
User Licensing Agreement. To see this agreement, please
refer to “Appendix E: End User Licensing Agreement” on
page 1130 or run the installer in standard non-silent mode.

Installing Nuke Remotely from the Command Line


If you need to install Nuke on render machines using the
command line, do the following:
1. Download the correct .tgz installation file from our web
site at www.thefoundry.co.uk. Which installation file you
download depends on whether you are using a 32- or a
64-bit machine.
2. Extract the installer from the tgz archive with the
following terminal command:

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 39
Installing Nuke

tar xvzf Nuke6.0v5-linux-x86-release-32.tgz


(on a 32-bit machine)
tar xvzf Nuke6.0v5-linux-x86-release-64.tgz
(on a 64-bit machine)
This will give you an installer file.
3. Use the following terminal command to log in to your
render machine as root:
ssh root@render_machine
Replace render_machine with the name of your render
node.
4. Make a directory to install Nuke to:
mkdir /usr/local/Nuke6.0v5
5. Copy the installer file from the machine that you
downloaded it on to your render machine with a
command like:
scp root@download_machine:/tmp/Nuke6.0v5-
linux-x86-release-32-installer
root@render_machine:/usr/local/Nuke6.0v5/
(on a 32-bit machine)
scp root@download_machine:/tmp/Nuke6.0v5-
linux-x86-release-64-installer
root@render_machine:/usr/local/Nuke6.0v5/
(on a 64-bit machine)
Replace download_machine with the name of the machine
you downloaded the installer file to, and render_machine
with the name of your render node.
6. Unzip the installer file to unpack its contents into your
Nuke directory:
cd /usr/local/Nuke6.0v5unzip Nuke6.0v5-
linux-x86-release-32-installer (on a 32-bit
machine)
unzip Nuke6.0v5-linux-x86-release-64-
installer (on a 64-bit machine)
7. Repeat steps 3-6 for each render machine.

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 40
Installing Nuke

Installation on Mac OS To install Nuke on Mac OS X, do the following:


X 1. Download the correct .dmg installation file from our web
site at www.thefoundry.co.uk.
2. Double-click on the dmg archive to extract the pkg
installer. A pkg file is created.
3. Double-click on the pkg file.
4. Follow the on-screen instructions to install Nuke. By
default, Nuke is installed to
/Applications/Nuke6.0v5.
5. Proceed to “Launching Nuke” on page 41.

Installing Nuke Silently from the Command Line


1. Download the .dmg installation file from our web site at
www.thefoundry.co.uk.
2. Launch a Terminal window.
3. To mount the dmg installation file, use the hdiutil attach
command with the directory where you saved the
installation file. For example, if you saved the installation
file in Builds/Nuke, use the following command:
hdiutil attach /Builds/Nuke/Nuke6.0v5-mac-
x86-release-32.dmg
4. Enter the following command:
pushd /Volumes/Nuke6.0v5/
This stores the directory path in memory, so it can be
returned to later.
5. To install Nuke, use the following command:
sudo installer -pkg Nuke6.0v5-mac-x86-
release-32.pkg -target "/"
You are prompted for a password.
6. Enter the following command:
popd

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 41
Launching Nuke

This changes to the directory stored by the pushd com-


mand.
7. Finally, use the following command to eject the mounted
disk image:
hdiutil detach /Volumes/Nuke6.0v5

Note By running a silent install of Nuke, you agree to the terms of


the End User Licensing Agreement. To see this agreement,
please refer to “Appendix E: End User Licensing Agreement”
on page 1130 or run the installer in standard non-silent
mode.

Launching Nuke With the installation and licensing out of the way, you’re
ready to start compositing with Nuke. Depending on whether
you want to use the Nuke Personal Learning Edition or the
commercial version of Nuke, the procedure for launching
Nuke is slightly different. Both are described below,
beginning with the procedure for the commercial version.

Launching the To launch the commercial version of Nuke, do one of the


Commercial Version following:

On Windows
• Double-click the Nuke icon on the Desktop.
• Select Nuke6.0v5 (32/64 bit) from Start > All Programs
> The Foundry > Nuke6.0v5 (32/64 bit).

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 42
Launching Nuke

• Using a command prompt, navigate to the Nuke


application directory (by default, \Program
Files\Nuke6.0v5 or \Program Files (x86)\Nuke 6.0v5),
and enter nuke6.0.

The Nuke graphical interface appears.

On Mac OS X
• Click the Nuke dock icon.
• Open the Nuke application directory (by default, /
Applications/Nuke6.0v5(32/64 bit)/), and double-click
the Nuke icon (or list item).

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 43
Launching Nuke

• Open a terminal, navigate to /Applications/Nuke6.0v5-


32/Nuke6.0v5.app/Contents/MacOS, and enter ./
Nuke6.0.

The Nuke graphical interface appears.

On Linux
• Double-click the Nuke icon on the Desktop.
• Open the Nuke application directory (by default, /usr/
local/Nuke6.0v5/) and double-click the Nuke icon (or
list item).

• Open a terminal, navigate to the Nuke application


directory (by default, /usr/local/Nuke), and enter ./
Nuke6.0.

The Nuke graphical interface appears.

Launching the Nuke You launch the PLE from a terminal (a window where you can
Personal Learning enter commands directly rather than making selections
Edition (PLE) through a user interface).

To launch the PLE:


• On Windows: Select the Personal learning Edition from
Start > All Programs > The Foundry > Nuke6.0v5.

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 44
About the Personal Learning Edition

OR
Using a command prompt, navigate to the Nuke applica-
tion directory (by default, /Program Files/Nuke6.0v5), and
enter nuke6.0 --ple.
• On Linux: Open a terminal, navigate to the Nuke
application directory (by default, /usr/local/Nuke), and
enter ./Nuke6.0 --ple.
• On Mac OS X: Click the Nuke PLE dock icon.
OR
Open the Nuke application directory (by default, /Appli-
cations/Nuke6.0v5-32/), and double-click the
Nuke6.0v5 PLE icon (or list item).
OR
Open a terminal, navigate to /Applications/Nuke6.0v5/
Nuke6.0v5.app/Contents/MacOS, and enter ./Nuke6.0 --
ple.

About the Personal The Nuke Personal Learning Edition is a special version of
Learning Edition Nuke that you can run without a license. The Personal
Learning Edition is meant for personal, educational, and
other non-commercial use. It is aimed at students, industry
professionals, and others interested in Nuke. It includes all
the features of the commercial version of Nuke, offering you
a chance to explore and learn the application fully while
using it from the comfort of your own home.

PLE versus the The PLE is a fully functional version of Nuke, but, being
Commercial Version of aimed for non-commercial use only, it does differ from the
Nuke commercial version in some aspects. Here are the main
differences:

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 45
About the Personal Learning Edition

• Watermark. The PLE displays a watermark (shown below)


on any images in the Viewer as well as images rendered
out to files. This is to prevent the commercial use of the
images.

• External data storage. All external data storage is


encrypted in the PLE, including Nuke scripts (these are
saved with the extension .nkple), gizmos (saved with the
extension .gzple), and copying to the clipboard. Among
other things, this means the PLE saves files in an
encrypted format, unlike the commercial version of Nuke,
which saves scripts unencrypted as plain text. The
commercial version of Nuke cannot load files created with
the PLE.
The PLE, however, can load scripts and gizmos created
with the commercial version.
• Scripting. In PLE mode, Nuke restricts the amount of
nodes that can be retrieved at a time by scripting.
Functions such as "nuke.allNodes()" in Python will return
only the first 10 nodes available rather than all of them
at once, and scripts written to iterate through the Node
Graph will not be able to retrieve any more nodes beyond

The Foundry Nuke 6.0v5


INSTALLATION AND LICENSING 46
About the Personal Learning Edition

a set point. The commercial version of Nuke can retrieve


any and all nodes at any time as the command names
would suggest.
• WriteGeo. The WriteGeo node is disabled in the PLE.
• Primatte. The Primatte node is disabled in the PLE.
• FrameCycler. FrameCycler is disabled in the PLE.
• Monitor output. There is no video monitor output support
in the PLE.
• Plug-ins. Only plug-ins that are shipped with Nuke, such
as OFlow, can be used in the PLE. OFX plug-ins (such as
The Foundry's Furnace and Tinder) and custom plug-ins
compiled with the NDK can only be used in the commercial
version of Nuke.
• Command line rendering. It is not possible to render a PLE
script with -x from the command line.

In other respects, the PLE contains all the functionality of


the commercial version of Nuke.

The Foundry Nuke 6.0v5


THE NUKE PLUG-IN INSTALLER 47
What Is the Nuke Plug-in Installer

2 THE NUKE PLUG-IN INSTALLER

This chapter gives you an overview of The Nuke Plug-in


Installer application.

What Is the Nuke The Nuke Plug-in Installer is an application in Nuke that
Plug-in Installer gives you easy access to a large selection of useful plug-ins
to use with Nuke.

Accessing the Nuke The Nuke Plug-in Installer application is installed with Nuke,
Plug-in Installer so you don’t have to download or install it separately. The
application will open up after you have installed Nuke.

Getting an On the Plug-ins tab of the Nuke Plug-in Installer, you can
Overview of the have a look at the selection of plug-ins available through the
application.
Plug-ins

Viewing Details of To have a closer look at any of the plug-ins, just double-click
Plug-ins on the icon and move on to the Details tab. You’ll see a
HTML page with more detailed information on the plug-in. At
the bottom of the Details tab, you can select your operating
system and download the plug-in software by clicking the
Download selected platform button.

The Foundry Nuke 6.0v5


THE NUKE PLUG-IN INSTALLER 48
Downloading Plug-ins

Downloading Plug- When you’ve chosen a plug-in you want to download, do the
ins following:
1. Double-click it on the Plug-ins tab. This will open the
Plug-in information in the Details tab.
2. Select the operating system(s) you require using the
checkboxes at the bottom of the window.
3. Click the Download selected platforms button.
Nuke Plug-in Installer will prompt you to choose a down-
load destination for the plug-in and then automatically
start downloading it for you.
4. You’ll see a notification when the download is finished,
and after that you can install your plug-in by clicking the
Install button in the Plug-in Installer.

The Foundry Nuke 6.0v5


USING THE INTERFACE 49
Understanding the Workflow

3 USING THE INTERFACE

This chapter is designed to help you understand Nuke’s


workflow, learn how to use the interface, and customize the
interface to suit your preferences.

Understanding the Nuke utilizes a node-based work flow, where you connect a
Workflow series of nodes to read, process, and manipulate images.
Each node in the project—an image keyer, a color-
correction, or a blur filter, for example—performs an
operation and contributes to the output.

Figure 3.1: A Nuke project consists of a network of


linked operators called nodes.

Saved projects are called script files. You can open a Nuke
project file in a text editor, and you will see a series of
sequential commands which are interpreted and executed

The Foundry Nuke 6.0v5


USING THE INTERFACE 50
The Nuke Window

when you render the output.

Read
nodes

effect nodes Output node

Viewer node

Figure 3.2: A simple Nuke script.

In Figure 3.2, you see an example of a very simple Nuke


script. Two Read nodes reference image sequences on disk.
Effect nodes extract a matte and blur an image. A merge
node (named over) composites the foreground image over
the background. Finally, a Write node renders and outputs
the completed composite to disk. You’ll also see a Viewer
node, which displays the output of any node in the script.

The Nuke Window

Panes and Panels Nuke’s main window is divided into three panes: the Node
Graph/Curve Editor pane, the Properties/Script Editor pane,

The Foundry Nuke 6.0v5


USING THE INTERFACE 51
The Nuke Window

and the Viewer pane.

Viewer pane

Properties/Script Edi-
tor pane

Node Graph/Curve Editor pane

Figure 3.3: Empty main window.

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
• Progress panels for displaying progress bars
• 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

The Foundry Nuke 6.0v5


USING THE INTERFACE 52
The Nuke Window

Properties Bin on the right, as shown in Figure 3.4.

Viewer

Node Graph Properties Bin


with a node with properties
tree panels

Figure 3.4: Main window with a Node Graph, Viewer,


and Properties Bin.

The Node Graph 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.

You can open more panels using the content menus


described in “Toolbar, Menu Bar and Content Menus” below.
You can add several panels on the same pane and switch
between them by using the tabbed pages on top of the pane.

Tabbed Panels Panes are divided into tabbed panels on the top of the pane.

The Foundry Nuke 6.0v5


USING THE INTERFACE 53
The Nuke Window

To go to a different tab, simply click on the tab name.

Figure 3.5: Moving from the Properties tab to the


Script Editor tab.

To cycle through tabs, press Ctrl/Cmd+T.

Toolbar, Menu Bar and The Toolbar is located on the left-hand side of the Nuke
Content Menus window. By default, it consists of twelve icons. The different
nodes are grouped under these icons based on their
functions. You use the Toolbar to add nodes to the Node
Graph.

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

The Foundry Nuke 6.0v5


USING THE INTERFACE 54
The Nuke Window

editing, rather than certain individual nodes.

menu bar

Toolbar

Figure 3.6: The Toolbar and the menu bar.

In addition to the Toolbar and the menu bar, you should also
familiarize yourself with the content menus. They are the
gray checkered boxes in the top left corner of each pane. If
you click on the box, a pop-up menu opens. You can use the

The Foundry Nuke 6.0v5


USING THE INTERFACE 55
The Nuke Window

options in the pop-up menu to customize the window layout.

Figure 3.7: Using the content menus.

Finally, to work faster, you can right-click on the different


panels to display a pop-up menu with options related to that
particular panel.

Figure 3.8: A right-click menu in the Node Graph.

The Foundry Nuke 6.0v5


USING THE INTERFACE 56
Using the Toolbar

Using the Toolbar Nuke’s Toolbar includes the following icons:

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

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

Time Retiming image sequences.

Chan- Channel management.


nel

Color Applying color correction effects.

Filter Applying convolve filters, such as blur, sharpen, edge


detect, and erode.

Keyer Extracting procedural mattes.

Merge Layering background and foreground elements.

Trans- Translating, scaling, tracking, and stabilizing elements.


form

3D 3D compositing nodes and tools.

Views Nodes for working with views and stereoscopic or


multi-view material.

The Foundry Nuke 6.0v5


USING THE INTERFACE 57
Using the Toolbar

Icon Functions
Meta- Viewing, editing, and comparing image metadata.
data

Any installed plug-ins and custom menus that do not


have their own icon.

Other Additional operators for script and Viewer manage-


ment.

To display a tool tip that explains the icon’s


function, move your mouse pointer over the
icon.

To make selections from the Toolbar, click on an


icon and select an option from the menu that appears.

Figure 3.9: Selecting a node from the Toolbar.

To quickly browse through the menus in the Toolbar, click

The Foundry Nuke 6.0v5


USING THE INTERFACE 58
Using the Menu Bar

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.

Using the Menu Bar The Nuke menu bar includes these functions:

Menu Functions
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 hot keys, user documentation, release notes,
training resources, tutorial files, and Nuke-related e-mail lists.

To quickly browse through the available menus and see what


they contain, click on a menu and move the mouse pointer
over other menus. Nuke opens and closes the menus as you
go.

Working with Nodes are the basic building blocks of any composite. To
Nodes 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.

Adding Nodes You add nodes using the Toolbar, the Tab menu, or the
right-click menu. When you add a node, Nuke automatically

The Foundry Nuke 6.0v5


USING THE INTERFACE 59
Working with Nodes

connects it to the last selected node.

To add a node using the Toolbar:


1. To select the existing node that you want the new node
to follow, click on the node once.
2. Click an icon on the Toolbar and select a node from the
menu that appears. For example, if you want to add a
Blur node, click the Filter icon and select Blur.

Tip 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.

To add a node using the Tab menu:


1. To select the existing node that you want the new node
to follow, click on the node once.
2. Press the Tab key and start typing the name of the node
you want to create.
This opens a prompt displaying a list of matches.
3. To select the node you want to add from the list, either:
• click on it, or
• scroll to it with the Up and Down arrow keys and press
Return.

To add the last node created using this method, simply press
Tab and then Return.

The Foundry Nuke 6.0v5


USING THE INTERFACE 60
Working with Nodes

To add a node using the right-click menu:


1. Right-click on the existing node that you want the new
node to follow.
2. From the menu that opens, select the node you want to
add.

Tip You can also add nodes using keyboard shortcuts. Most
menus in the Toolbar include a note of the relevant hot key
next to the item in question.

To add a node in a new branch of the node tree:


1. To select the existing node that you want the new node
to follow, click on the node once.

2. Hold down Shift and create the node using the Toolbar,
Tab menu, or right-click menu. To add a node in a new
branch with the Tab menu, press the Tab key first, then
hold down Shift when selecting the new node.

The Foundry Nuke 6.0v5


USING THE INTERFACE 61
Working with Nodes

The node is added after the selected node in a new


branch of the node tree.

Selecting Nodes Nuke offers a number of options for selecting nodes.


Selected nodes display in a highlight color defined in your
preferences. The default highlight color 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.

Figure 3.10: Selecting multiple nodes with a marquee.

To select all upstream nodes:


Press Ctrl (Mac users press Cmd) while dragging on a node.
Nuke selects all nodes that feed data to the selected node.

The Foundry Nuke 6.0v5


USING THE INTERFACE 62
Working with Nodes

OR
Ctrl/Cmd + click to highlight these upstream nodes.
OR
Ctrl/Cmd + Shift + click to select these upstream nodes.

To select all nodes in a node tree:


Click on a node in the Node Graph and select Edit > Select
Connected Nodes (or press Ctrl/Cmd+Alt+A).

This selects all nodes in the node tree, whether they are
upstream or downstream from the current node. Nodes in
any other node trees are not selected.

To select all nodes in a script:


Select Edit > Select all (or press Ctrl/Cmd+A).

To select nodes by name:


1. Choose Edit > Search, or press the forward slash (/).
A dialog appears.
2. Type an alphanumeric string that is included in the
names of the nodes you wish to select. Click OK.

Tip When typing the above alphanumeric search string, you can
use asterisks (*) and question marks (?) as wild cards. An
asterisk stands for multiple alphanumeric characters. A
question mark represents just one character.

To invert a selection:
Select Edit > Invert Selection.

The Foundry Nuke 6.0v5


USING THE INTERFACE 63
Working with Nodes

Replacing Nodes To replace one node with another:


1. In the Node Graph, select the node you want to replace.
2. Hold down Ctrl (Cmd on a Mac) and create a new node
using the Toolbar, a right-click menu, or the Tab menu.
To replace a node with the Tab menu, press the Tab key
first, then hold down Ctrl/Cmd when selecting the new
node.
The new node replaces the selected node in the Node
Graph.

Note Note that you cannot replace nodes in this manner if you are
using a hotkey (such as B for the Blur node) to create the
new node.

Renaming Nodes To rename a node:


1. Double-click on the node to open its properties panel.
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 in its place.

OR
1. Click on the node in the Node Graph to select it.
2. Press N.
3. Enter a new name for the node in the rename field that
appears on top of the node.

The Foundry Nuke 6.0v5


USING THE INTERFACE 64
Working with Nodes

Editing Nodes To copy, paste, and perform other editing functions in the
compositing tree, you can use the standard editing keys (for
example, Ctrl/Cmd+C to copy, and Ctrl/Cmd+V to paste). You
can copy nodes to files or memory. Copied nodes inherit the
values of their parent, but these values, unlike those in
cloned nodes (see below), are not actively linked—that is,
you can assign different values to the original and the copy.

When you paste nodes, Nuke automatically connects them to


the node that is selected before the paste operation. If you
don’t want to connect anything, click on a blank area of the
workspace to deselect any selected nodes before pasting.

To copy nodes to memory:


1. Select the node or nodes you want to copy.
2. Choose Edit > Copy (or press Ctrl/Cmd+C).

To copy nodes to files:


1. Select the node or nodes you want to copy.
2. Choose File > Export nodes as script.
3. Navigate to the directory where you want to store the
node as a file.
4. Type a name for the node(s) at the end of the pathway,
followed by the extension .nk.

The Foundry Nuke 6.0v5


USING THE INTERFACE 65
Working with Nodes

To cut nodes:
1. Select the node or nodes you want to cut.
2. Choose Edit > Cut (or press Ctrl/Cmd+X).
Nuke removes the node(s) from the script and writes the
node(s) to memory.

To paste nodes from memory:


1. Select the node that you want the pasted node to follow.
2. Choose Edit > Paste (or press Ctrl/Cmd+V).
Nuke adds the nodes to the script, connecting them to
the node you selected in step 1.

To paste nodes from files:


1. Select the node that you want the pasted node to follow.
2. Choose File > Import script.
3. Navigate to the directory that stores the node file.
4. Select the node file, and click Import.
Nuke adds the nodes described by the file to the node
you selected in step 1.

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

The Foundry Nuke 6.0v5


USING THE INTERFACE 66
Working with Nodes

changes to the setup, these changes would automatically


ripple throughout the script.

Note You cannot clone gizmos. This applies to both gizmos


created in your facility and the nodes in the Nuke default
Toolbar that are in fact gizmos, such as the LightWrap node,
the Grain node, and the IBK nodes.
For more information on gizmos, see “Gizmos, Custom Plug-
ins, and Generic TCL Scripts” on page 850.

To clone nodes:
1. Select the node or nodes you want to clone.
2. Choose Edit > Clone or (press Alt+K).
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. Select the node or nodes you want to declone.
2. Choose Edit > Declone (or press Alt+Shift+K).
Nuke removes the clone status of the selected nodes.

Disabling and Deleting To disable nodes:


Nodes 1. Select the node or nodes you want to disable.
2. Select Edit > Node > Disable\Enable (or press D).
Nuke cancels the node(s)’s effect on the data stream.

To re-enable nodes:
1. Select the node or nodes you want to re-enable.

The Foundry Nuke 6.0v5


USING THE INTERFACE 67
Working with Nodes

2. Select Edit > Node > Disable\Enable (or press D).

To delete nodes:
1. Select the node or nodes you want to delete.
2. Select Edit > Erase (or press Delete).
Nuke removes the node(s) from the script.

Connecting Nodes As discussed, when you add or paste nodes into to a script,
Nuke automatically generates pipes between the currently
selected node and the new nodes. As you build up a script,
you’ll need to move these pipes, or run new pipes between
nodes. In Nuke, you make such modifications by dragging on
the back end of the pipe (the end without the arrowhead).

To disconnect a node:
Drag the head or tail of the connecting arrow to an empty
area of the workspace.
OR

The Foundry Nuke 6.0v5


USING THE INTERFACE 68
Working with Nodes

Select the lower node in the tree and press Ctrl+D (Mac
users press Cmd+D).

Figure 3.11: Disconnecting a pipe.

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

Figure 3.12: Reconnecting a pipe.

The Foundry Nuke 6.0v5


USING THE INTERFACE 69
Working with Nodes

Note 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.

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.

To add a node between two connected nodes:


Drag the node into the space between the already connected
nodes. As you do so you will see the link between these two
nodes become active. When that happens, simply release the
node you are dragging and it will automatically wire itself
into the network between the two nodes.

To bend connecting arrows:


1. Select the node before the connector you want to bend.
2. From the Toolbar, select Other > Dot. A dot appears
after the selected node, causing a bend in the connector.
3. Drag the dot as necessary to reposition the bend.

The Foundry Nuke 6.0v5


USING THE INTERFACE 70
Working with Nodes

Tip You can also add a dot to an existing connection by pressing


Ctrl (Cmd on a Mac) and clicking on the yellow dot that
appears on the connecting arrow.

Indicators on Nodes 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.

Indicator Where it appears What it means


The wide rectangles indicate the chan-
nels the node processes.
The thin rectangles indicate the chan-
nels that are passed through the node
untouched.
The node’s effect is limited by a mask
from the either the node’s primary
input or output.

The Foundry Nuke 6.0v5


USING THE INTERFACE 71
Working with Nodes

Indicator Where it appears What it means


The node has been disabled by press-
ing D or clicking the Disable button.

The node has been disabled using an


expression.

The node has been cloned. The indica-


tor appears on both the parent and the
child node.

One or more of the node parameters


are animated over time.

One or more of the node parameters


are being driven by an expression.

The Foundry Nuke 6.0v5


USING THE INTERFACE 72
Working with Nodes

Indicator Where it appears What it means


You are working with a multiview proj-
ect and have split off one or more
views in the node’s controls.

The full effect of the node is not in


use, because you have adjusted the
mix slider in the node’s controls.

Searching for Nodes Nuke’s Search feature allows you to search for nodes in your
script and select any matches found. As a search string, you
can enter all or part of a node name. For example, you can
search for all Blur nodes in your script by entering bl as the
search string.

Using regular expressions, you can also do more complex


searches, such as searching for all the Read and Write nodes
in a script.

To search for nodes:


1. Select Edit > Search (or press /) to bring up the search
dialog.
2. In the search field, enter the string you want to search
for.
If you want to search for all nodes in the script, enter *
(an asterisk).

The Foundry Nuke 6.0v5


USING THE INTERFACE 73
Working with Nodes

If you want to search for all Read nodes in the script,


enter Read.
If you want to search for all the Read and Write nodes,
enter the following expression:
(*Read*|*Write*)
3. Click OK.

Nuke searches for the nodes in the script and selects any
matches it finds.

Note When you enter expressions in the search dialog, remember


that the search field only takes regular expressions. Any
characters that have specific meanings in regular
expressions, such as [ and ], need to be preceded by the \
character.

Viewing Information You can obtain more detailed information from any node by
on Nodes selecting that node and then pressing the ’i’ key. This will
display an information window associated with that node,
particularly useful when troubleshooting.

Customizing the Node You can modify the color, name, and notes that a particular
Display node displays. Doing so can make it easier for other artists
to decipher the intent of your script. For example, you might

The Foundry Nuke 6.0v5


USING THE INTERFACE 74
Working with Nodes

color all nodes green that relate to keying.

Figure 3.13: Nodes can be color-coded according to


function.

To modify a node’s display characteristics:


1. Double-click on the node to display its properties panel.
2. Click the Node tab at the top of the dialog. Its attributes
appear.
3. Do any of the following:
• Enter a new name for the node on top of the old name.
• Click on the left color button to change the color
of the node. To copy a color of one node to
another, drag and drop the color button from the node
whose color you want to copy on top of the color but-
ton in the node whose color you want to change.
• Type any comments regarding the node in the label
field. These will appear on the surface of the node.
• From the font pulldown menu, select the font type for
any text on the node.
• Use the buttons on the right to bold or
emphasize the text.

The Foundry Nuke 6.0v5


USING THE INTERFACE 75
Navigating Inside the Node Graph

• Enter the font size in the font size


field.
• Click color to choose a new font color.
• The Select color dialog appears, allow-
ing you to select the desired color.

Tip You can also have Nuke automatically color-code nodes for
you based on their function. Select Edit > Preferences (or
press Shift+S) to open the Preferences dialog. Click on the
Node Colors tab, and check the autocolor option.
Thereafter, every time you add a node to a script, the node
will take on the color appropriate to its function. You can
edit these colors as necessary on the Node Colors tab of the
Preferences dialog.
• Check hide input to conceal the node’s incoming pipe.
This can enhance the readability of large scripts.
• Check postage stamp to display a thumbnail render of
the node’s output on its surface.

Navigating Inside
the Node Graph

Panning As scripts grow in complexity, you need to be able to pan to


a particular cluster of nodes quickly. The Node Graph offers
a couple of methods for doing so.

Panning with the Mouse


To pan with the mouse, press Alt and drag the mouse pointer
over the workspace. The script moves with your pointer.

The Foundry Nuke 6.0v5


USING THE INTERFACE 76
Navigating Inside the Node Graph

Note On Linux, Alt+drag may not work as expected. This is due to


the default window functionality on Gnome. To get around it,
you can use the Windows key instead of Alt when panning.
Alternatively, you can change your window preferences on
Gnome to fix the problem:
1. Select Applications > Preferences > Windows to open the
Window Preferences dialog.
2. Under Movement Key, select Super (“or Windows logo”).
You should now be able to pan with Alt+drag.

Panning with the Map


If your script spills over the edges of the workspace, a
navigator map automatically appears in the bottom-right
corner.

Figure 3.14: Panning with the map.

The map shows you a miniature view of the entire script and
the pink rectangle shows the portion of the script that you
see within the workspace borders.

To pan with the map, drag the pink rectangle to pan to a


different view of the script.

The Foundry Nuke 6.0v5


USING THE INTERFACE 77
Navigating Inside the Node Graph

When you pan or resize the window, the map automatically


appears when the workspace does not show the entire
script. When the whole script is contained within the window
border, then the map automatically disappears.

Tip The navigation map is resizeable. Drag on its upper left


corner to make it as large or small as you like.

Zooming You can zoom in on or out from the script in a couple of


ways.

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.
OR
Press Alt and drag right while holding down the middle
mouse button.

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 and drag left while holding down the middle mouse
button.

Note On Linux, Alt+middle drag may zoom the entire Nuke window
instead of the Node Graph. This is default functionality on
Gnome. To get around it, you can use the Windows key
instead of Alt when zooming.

The Foundry Nuke 6.0v5


USING THE INTERFACE 78
Properties panels

Alternatively, you can change your window preferences on


Gnome to fix the problem:
1. Select Applications > Preferences > Windows to open the
Window Preferences dialog.
2. Under Movement Key, select Super (“or Windows logo”).
You should now be able to zoom in and out of the Node
Graph with Alt+middle drag.

Fitting Selected Nodes To fit selected nodes in the Node Graph, press F.
in the Node Graph

Fitting the Node Tree To fit the entire the node tree in the Node Graph, click on the
in the Node Graph Node Graph to make sure no nodes are selected and press F.

Properties panels When you insert a node, its properties panel appears in the
Properties Bin with options to define the node’s output. You
can also open the properties panel later by doing any of the
following:
• Double-click on the node in the Node Graph.
• Ctrl+click on the node in the Node Graph (Mac users
Cmd+click).
• Select the node in the Node Graph and press Return.

The Foundry Nuke 6.0v5


USING THE INTERFACE 79
Properties panels

Tip To open a properties panel in a floating window,


Ctrl+Alt+click (Mac users Cmd+Alt+click) on the node.

Controls that appear on all

Figure 3.15: The Read node and its properties panel.

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

To lock the Properties Bin and have all new properties panels
appear in floating windows, click the lock button on the
Properties Bin.

To empty the Properties Bin and close all the properties


panels in it, click the remove all panels button.

The Foundry Nuke 6.0v5


USING THE INTERFACE 80
Properties panels

Tip You can also close all the properties panels in the Properties
Bin by Alt+clicking on the close (X) button of one of the
panels.

Controls That Appear These are the standard controls of every properties panel:
on All Properties
Panels Control Function
Hide or show the node’s tabbed pages.

Centers the node in the Node Graph.

Centers one of the node’s inputs in the Node Graph. Select


the input from the pulldown menu that appears.
name field You can enter a new name for the node here.
(for exam-
ple, Blur1)
(left) Changes the color of the node. You can drag and drop this
button on top of another color button to copy the color. To
revert to the default color defined in your Preferences,
right-click on the button and select Set color to default.
An X on the button indicates the color is unset, and the
color defined in the Preferences is used.
(right Changes the color used for the node’s controls in the
) Viewer. You can drag and drop this button on top of
another color button to copy the color. To revert to the
default color defined in your Preferences, right-click on the
button and select Set color to default.
An X on the button indicates the color is unset, and the
color defined in the Preferences is used.

The Foundry Nuke 6.0v5


USING THE INTERFACE 81
Properties panels

Control Function
Undoes the last change made to the node.

Redoes the last change undone.

Reverts any changes made after the properties panel was


opened.
Displays a pop-up help related to the node and its controls.

Floats the properties panel. Clicking this button again docks


the properties panel back in the Properties Bin if the Bin
exists.
Closes the properties panel. Alt+click this to close all the
properties panels in the Properties Bin. Ctrl/Cmd+click to
close all properties panels except the one clicked on.

Floating control panels also include the following buttons:

Control Function
Reverts any changes made after the properties panel was
opened.

Reverts any changes made after the properties panel was


opened and closes the properties panel. Hitting this but-
ton right after a node was created also deletes the node
from the Node Graph.
Closes the properties panel.

The Foundry Nuke 6.0v5


USING THE INTERFACE 82
Properties panels

Many properties panels also contain several tabbed pages.

tabbed pages

Figure 3.16: The Read node’s properties panel and the


Node tab.

On the Node tab, you can usually adjust the following

The Foundry Nuke 6.0v5


USING THE INTERFACE 83
Properties panels

controls:

Control Function
label Lets you add comments to the node. The comments
are displayed on the node’s surface.
If you like, you can use HTML in the label field. For
example, to have your comments appear in bold, you
can enter <b>My Comment</b>. To add an icon
called
MyIcon.png to the node, you can use <img src="MyI-
con.png"/>. Save the icon in your plug-in path direc-
tory. (For more information on plug-in path
directories, see “Loading Gizmos, NDK Plug-ins, and
TCL scripts” on page 833.) Most common image for-
mats will work, but we recommend using .png.
Note that the HTML has been changed to a slightly
non-standard form where newlines are significant. If
there is a newline character in your data, a new line
will be displayed in the label.
font Lets you change the font for any text displayed on
the node.
Bolds any text displayed on the node.

Emphasizes any text displayed on the node.

Lets you change the font size of any text displayed


on the node.
Lets you change the color of any text displayed on
the node.

hide input Check this to hide the node’s incoming pipe. This
control does not appear on all nodes.

The Foundry Nuke 6.0v5


USING THE INTERFACE 84
Properties panels

Control Function
cached Check this to keep the data upstream from the node
in memory, so that it can be read quickly. When this
is checked, a yellow line displays under the node in
the Node Graph.
postage stamp Check this to display a thumbnail render of the
node’s output on its surface.
disable Check this to disable the node. Uncheck to re-
enable. (You can also disable or re-enable a node by
selecting it in the Node Graph and pressing D.)

Displaying Parameters To display a node’s parameters:


Double-click the node. It’s properties panel appears.

Figure 3.17 shows the controls available for editing


parameters. Note that the presence of each control will vary
according to the parameter’s function.

slider input field

sample color from Viewer


animation
color picker button

switch between slider and channel values


Figure 3.17: Parameter controls.

Using Input Fields You can key values directly into a field, or use the arrow
keys to increment and decrement values.

The Foundry Nuke 6.0v5


USING THE INTERFACE 85
Properties panels

To key in field values:


1. Click in the field to select the value you wish to replace:
• Double-click to the left of the value to select only the
whole number digits.
• Double-click the right of the value to select only deci-
mal digits.
• Press Return or double-click on the decimal itself to
select all digits.
2. Type the value you want to replace the selection.

Tip You can also enter expressions (programmatic instructions


for generating values) into fields. You always start an
expression by typing =. See Chapter 17, "Expressions", on
page 713 for information about how to format expressions.

Tip Nuke also allows you to enter formulas into fields, making it
easy to do quick calculations. For example, if you wanted to
halve a value of 378, you could simply type 378/2 into a
field and press Enter to get 189.

You can increment or decrement field values by hundreds,


tens, tenths, hundredths, and so on. The magnitude of
change depends on the initial position of your cursor. For
example if you wanted to increment the initial value of
20.51 by ones, you would insert your cursor before the 0.

To increment and decrement a field value:


1. Click to insert the cursor just prior to the digit you want
to increment or decrement.
2. Press the up arrow to increment by unit, or the down
arrow to decrement by one unit.

The Foundry Nuke 6.0v5


USING THE INTERFACE 86
Properties panels

Tip You can also increment and decrement values using the
mouse wheel (if available) or by pressing Alt while dragging
on the value. The latter method is particularly useful for
tablet users.

Using Sliders To set a value with a slider:


Drag the knob to the desired value.
OR
Click the desired value on the graduated scale beneath the
slider.

To reset a slider to its default value:


Ctrl+click (Mac users Cmd+click) on the slider.

Separating Channels By default, many parameters in Nuke automatically gang


channels for you. For example, if you drag on the Gain slider
in the ColorCorrect node, you simultaneously affect the R, G,
and B channels (assuming you’re processing the RGB channel
set). You can, however, use the a parameter’s channel
chooser button to reveal and edit the values assigned to
individual channels.

To edit an individual channel’s value:


1. Click the parameter’s channel chooser button. The num-
ber on its surface lets you know how many channels are
available for editing. A series of input fields—one for
each individual channel—appears.

The Foundry Nuke 6.0v5


USING THE INTERFACE 87
Properties panels

2. Edit the values in any of the revealed input fields as


necessary.

You can also use a color slider for editing individual


channels. See “Using Color Sliders and Color Wheel” on
page 88.

Using the Color Picker Nuke offers a color picker for inputting values. Color pickers
and Color Controls are especially useful for setting white or black points, or for
color matching tasks, such as sampling values in a
background plate to color-correct a foreground image.

To use the color picker and color controls:


• Click the color picker button to display and make
color selections. The color picker window opens.
• To activate the eye dropper and sample colors
from the Viewer (see below), click the color
swatch button.
To copy a color from one color swatch to another, drag
and drop the color swatch with the desired color on top
of the swatch whose color you want to change.
• To toggle between using the slider and manually
entering values for each of the channels, click the
channel chooser button (which displays the number
of available channels).

color swatch
color picker
3-channel
Figure 3.18: Options for color selection.

The Foundry Nuke 6.0v5


USING THE INTERFACE 88
Properties panels

To sample a color from the Viewer:


1. In the parameters, click the color swatch to activate the
eye dropper.
2. Move your mouse pointer over the Viewer from which
you wish to copy color values.
3. Zoom and pan as necessary until the region from which
you want to sample is clearly visible.
4. Ctrl/Cmd+click to sample a color value from the Viewer,
or Ctrl/Cmd+Alt+click to sample a color from the node’s
input while viewing its output. To sample a region rather
than a single pixel’s color value, also press Shift. The
input fields associated with the color picker update to
reflect the color values of the sampled pixels. In the case
of a sampled region, Nuke inserts the average color
values of all inlying pixels.
5. If you didn’t manage to sample just the right pixel or
quite the right region, Ctrl/Cmd+click, Ctrl+Alt+click, Ctrl/
Cmd+Shift+click, or Ctrl/Cmd+Alt+Shift+click again. A new
overlay appears and the old one disappears.
6. When you’ve captured the right values, click the color
picker button again. The color swatch reappears
displaying the color or color average you sampled.

Using Color Sliders Some parameters offer color sliders and a color wheel for
and Color Wheel inputting values. These offer an intuitive and precise means
for assigning just the right color value to a parameter.

To display the color sliders and color wheel:


Click the parameter’s color picker button. The color
sliders and wheel appear.

The Foundry Nuke 6.0v5


USING THE INTERFACE 89
Properties panels

currently selected color


last selected color
original color
the available slider sets
show/hide the color wheel
show/hide the color swatches

use dynamic colors


for slider back-
grounds
Left/right-click the slider label to nudge the value
by 0.01.

Drag here to adjust saturation.


Drag here to adjust the hue.

To customize the color sliders and wheel window:


• From the TMI, HSV, and RGB buttons, select which slider
set you want to display. The available slider sets are
described below.
• To make the sliders horizontal rather than vertical, resize
the color sliders window. When the window is wide
enough, the sliders become horizontal.

• If you want the background of the sliders show what the


value of the color would be if the sliders were set to the
current position, click the Dyn button.

The Foundry Nuke 6.0v5


USING THE INTERFACE 90
Properties panels

• Click the color wheel button to cycle through three


states: the color wheel, the color square, and hide
color wheel/square.

• To hide or show the color swatches, toggle the


color swatches button.

To use the color wheel:


• To adjust the hue, drag the marker on the edge of the
color wheel/on the circle.

• To adjust the saturation, drag the marker inside the


wheel/square.

The Foundry Nuke 6.0v5


USING THE INTERFACE 91
Properties panels

Tip You can also Ctrl/Cmd+click on the color wheel to only affect
the hue of the selected color, and Shift+click to only affect
the saturation.
• To zoom in and out of the color wheel, press Alt and drag
right or left with the middle mouse button.
• To pan in the color wheel, press Alt and drag the mouse
pointer over the color wheel.
• To reset the zoom and/or pan, middle-click on the color
wheel.

To use the color sliders:


To increment the value by 0.01, right-click on the slider label
(e.g. R or A). To decrement the value by 0.01, left-click on
the label. Use Shift+click for 0.1, and Alt+click for 0.001.

You can also click and drag right or left on a label to scrub
the value up or down. Use Shift+drag to scrub faster, and
Alt+drag to scrub slower.

These are the functions of the TMI sliders:


• The temperature slider (T) lets you control apparent color
temperature by inversely affecting red and green values
(assuming your are processing the RGBA channel set).

The Foundry Nuke 6.0v5


USING THE INTERFACE 92
Properties panels

To cool (that is, increase the blue channel’s value, while


decreasing the red channel’s), drag up. To heat (increase
the red channel’s value, while decreasing the blue chan-
nel’s), drag down.
• The magenta/green slider (M) lets you control the mix of
green and magenta hues.
To add more magenta (increase the red and blue channel’s
values, while decreasing the green channel’s), drag up. To
add more green (increase the green channel’s value while
decreasing the red and blue channels’), drag down.
• The intensity slider (I) lets you simultaneously control the
red, green, and blue channel values.
To increase the value of all channels by the same amount,
drag up. To decrease the value of all channels by the same
amount, drag down.
To increase the channel’s value, drag up. To decrease it,
drag down.

These are the functions of the HSV sliders:


• The hue slider (H) lets you control the color’s location on
the traditional color wheel (for example, whether the
color is red, yellow, or violet).
• The saturation slider (S) lets you control the intensity or
purity of the color.
• The value slider (V) lets you control the brightness of the
color (the maximum of red, green, and blue values).

These are the functions of the RGB sliders:


• The red slider (R) lets you control the red channel’s value
(or the first channel in a channel set if you are processing
another set besides RBGA).

The Foundry Nuke 6.0v5


USING THE INTERFACE 93
Properties panels

To increase the channel’s value, drag up. To decrease it,


drag down.
• The green slider (G) lets you control the green channel’s
value (or the second channel in a channel set if you are
processing another set besides RBGA).
To increase the channel’s value, drag up. To decrease it,
drag down.
• The blue slider (B) lets you control the blue channel’s
value (or the third channel in a channel set if you are
processing another set besides RBGA).
To increase the channel’s value, drag up. To decrease it,
drag down.

The alpha slider is included in all three slider sets:


• The alpha slider (A) lets you control the alpha channel’s
value (or the fourth channel in a channel set if you are
processing another set besides RBGA).
To increase the channel’s value, drag up. To decrease it,
drag down.

To use the color swatches:


When you have found a good color, you may want to save it
in one of the color swatches for further use. To do so, adjust
the color wheel or sliders until you are happy with the color,
and right-click on the color swatch where you want to save
it. You can also drag and drop a color into a color swatch
from any other color button or swatch.

To open another color picker window:


To open another color picker window while keeping the first
window open, Ctrl/Cmd+click on another parameter’s color
picker button.

The Foundry Nuke 6.0v5


USING THE INTERFACE 94
Animating Parameters

To switch between the current and previous or


original color:
The rectangle above the sliders shows the original color (on
the right) next to the currently selected color (on the left).
When you drag the markers to adjust the color, the last
selected color is shown in between these. To switch between
the currently selected color and the original color, click on
the rectangle.

Animating Animating a parameter refers to changing its value over


Parameters time. You do so by setting key frames (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.

Working with The Animation menu lets you set key frames, delete keys,
Animated Parameters and perform other editing operations on the curves for

The Foundry Nuke 6.0v5


USING THE INTERFACE 95
Animating Parameters

animated parameters.

Figure 3.19: The animation menu.

To set key frames:


1. Use a Viewer to cue 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 turquoise, indicating that a
key frame has been inserted. Nuke enters the autokey
mode: when you change the parameters value at another
frame, it will automatically create a key frame 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 the properties
panel right-click menu.
4. Cue to the next frame where you want to place a key.
5. Edit the parameter’s value using the input field, regular
slider, or color slider. The moment you change the value,
Nuke creates a key frame.

The Foundry Nuke 6.0v5


USING THE INTERFACE 96
Animating Parameters

6. Continue adding key frames as necessary.


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

To delete a single key frame:


1. Use the Viewer’s next key frame and previous
key frame buttons to cue to the key frame
that you want to remove. Notice that the
scrub bar indicates key frames with a green mark.
2. Click the animation button.
3. Select Delete key from the drop down menu.
Nuke removes the key frame.

To delete all key frames from a parameter:


1. Click the animation button.
2. Select No animation from the drop down menu. A
confirmation dialog appears. Select Yes.
Nuke removes all key frames from the parameter, and
sets the static value to match that of the current frame.

Animated Parameters As you add key frames to a parameter, Nuke automatically


and the Curve Editor plots a curve on its Curve Editor panel, where each value (the
y axis) is plotted as it changes over time (the x axis). You can
add key frames, delete key frames, and even adjust the
interpolation between key frames without ever looking at
this curve. However, as the animation grows more complex,
you may find it easier to edit the animation by manipulating
this curve directly. For more information on how to do so,
see “Using the Curve Editor” below.

The Foundry Nuke 6.0v5


USING THE INTERFACE 97
Using the Curve Editor

Using the Curve


Editor

Displaying Curves To reveal an animation curve:


1. Click the animation button next to the parameter
whose curve you wish to view.
2. Select Curve editor. The Curve Editor panel appears
with a focus on the selected parameter’s curve.
The vertical, or y axis, denotes the value of the parame-
ter.
The horizontal, or x axis, denotes time (in frame units).

key
parame-

selected selected

current frame
expres-

Figure 3.20: Nuke’s Curve Editor panel.

To display curves in the Editor:


1. In the parameter tree on the left, click the + and - signs
to expand and collapse the hierarchy as necessary.
2. Click a parameter’s name to make its curve the focus of
the editor. To focus on multiple curves at the same time,
Shift+click on the names in the parameter tree.

The Foundry Nuke 6.0v5


USING THE INTERFACE 98
Using the Curve Editor

3. To display separate curves for each channel, separate


the channels for the relevant control in the node’s
properties panel.

The parameter tree on the left lets you focus on any curve in
the script.

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.
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 mouse wheel to zoom in, or down to
zoom out.

Tip To zoom to a custom area in the Curve Editor, middle-click


on the Editor and drag to select an area with a marquee.
When you release the mouse button, the Editor will zoom to
fit the selected area in the Editor.

To pan in the Editor:


Alt+drag over the editor.

To reset zoom and panning:


1. Right-click on the Curve Editor.

The Foundry Nuke 6.0v5


USING THE INTERFACE 99
Using the Curve Editor

2. From the menu that opens, select View > Frame All (or
press A on the Editor).
Nuke centers the curve in the Editor, resetting the zoom.

To center a portion of the curve in the editor:


1. Select the points you want to center in the editor.
2. Right-click on the Editor, and select View > Frame
Selected (or press F on the Editor).
Nuke centers the selected portion of the curve in the edi-
tor. If no points are selected, Nuke centers the selected
curve, or all curves.

Editing Curves You edit curves by moving the points on the curve to new
locations. If necessary, you can add more points to the
curve. You can also sketch curves freely, use the usual
editing functions such as copy and paste, smooth curves
with filtering, interpolate curves, loop, reverse or negate
curves, and use expressions to modify curves.

To add points to a curve:


1. Click on the curve you want to edit. The curve turns yel-
low to indicate it’s selected.
2. Ctrl+Alt+click (Mac users Cmd+Alt+click) 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.
OR
1. Right-click on the Editor and select Edit > Generate.
The Generate keys dialog opens.
2. In the Start at field, enter the first frame you want to
use as a key frame.

The Foundry Nuke 6.0v5


USING THE INTERFACE 100
Using the Curve Editor

3. In the End at field, enter the last frame you want to use
as a key frame.
4. In the Increment field, enter the frame increment you
want to use between the first and the last key frame. For
example, if you want every tenth frame to be a key
frame, enter 10.
5. In the last field, enter the value you want to use for y. If
you do not enter a value here, the key frames are added
to the current curve without modifying the curve shape.
6. Click OK.

To select points on a curve:


• To select individual points, click on the point you want to
select.
• To select multiple points, Shift+click on the points, or
drag a marquee around them.
A box is drawn around the points, and the points turn
white to indicate they have been selected.
• To select all points, press Ctrl+A (Mac users press
Cmd+A).
A box is drawn around the points, and the points turn
white to indicate they have been selected.

To move points on a curve:


• To move a point along either the x or y axis only, drag the
point to a new location.
• To move a point in any direction, Ctrl+drag (Mac users
Cmd+drag) the point to a new location.
• To adjust the values of a point numerically, select the
point and click on the x or y value that appears next to it.

The Foundry Nuke 6.0v5


USING THE INTERFACE 101
Using the Curve Editor

• By default, when you move a point, its position on the x


axis is rounded to the nearest integer. To disable this,
you can right-click on the Curve Editor and select Edit >
Frame Snap. You can also momentarily disable the
snapping by pressing Shift while moving a point.
• To move several points at the same time, select them and
drag the selection box to a new location.

To add or remove points to or from the selection box,


Shift+click on the points.
To resize and scale the selection box, drag its edges. If
the selection box is very narrow, you can press Ctrl/Cmd
when resizing it. This allows you to resize the box in one
dimension only. For example, if you have a box that’s wide
on the x axis but flat on the y axis, you can resize it in
this way along the x axis.
To avoid accidentally moving a point inside the selection
box, press Ctrl/Cmd+Shift when dragging the box to hide
the points inside the box.

The Foundry Nuke 6.0v5


USING THE INTERFACE 102
Using the Curve Editor

To adjust the slope around the points:


1. Select a point on the curve. Red tangent handles appear
on both sides of the point.

2. Drag the tangent handles to a new location. The curve


follows the handles.

To sketch a curve freely:


Press Alt+Ctrl+Shift (Mac users press Alt+Cmd+Shift) while
drawing a curve on the editor. Nuke sketches a curve that
follows your mouse movements.

Alt+Ctrl/Cmd+Shift

The Foundry Nuke 6.0v5


USING THE INTERFACE 103
Using the Curve Editor

To cut, copy, and paste selected points,


expressions, or curves:
1. Right-click on the Curve Editor.
2. From the menu that opens, select Edit and the editing
function you want to use on the entire curve, for
example:
• Edit > Copy > Copy Selected Keys to only copy the
points you have currently selected.
• Edit > Copy > Copy Curves to copy an entire curve.
• Edit > Copy > Copy Expressions to copy the expres-
sion that creates the curve.
• Edit > Copy > Copy Links to copy a curve and keep its
values linked to the original curve, so that if you
change the original, your changes also affect the cop-
ied curve.

To move selected points on the curve by a fixed


value:
1. Select all the points you want to move.
2. Right-click on the editor and select Edit > Move. The
Move Animation Keys dialog opens.
3. In the x and y fields, define how you want to move the
points along the x and y axes. For example, to shift the
selected points to the right by a value of 10, enter x+10
in the x field.

The Foundry Nuke 6.0v5


USING THE INTERFACE 104
Using the Curve Editor

4. In the slope and left slope fields, define how you want
to move the points’ tangent handles.

To smooth the curve with filtering:


1. Select the portion of the curve that needs smoothing.
2. Right-click on the editor and select Edit > Filter. The
Filter Multiple dialog opens.

3. In the No. of times to filter field, specify how many


times you want to filter the curve. Filtering sets new
values on each point based on the average values of their
neighbouring points. The more filtering, the smoother the
curve.

The Foundry Nuke 6.0v5


USING THE INTERFACE 105
Using the Curve Editor

before filtering after filtering

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. Select
• Constant to force a constant value after each selected
point.

• Linear to use linear interpolation. This produces sharp


changes at key frames and straight lines between them.

• Smooth to set the tangents’ slopes equal to the slope


between the key frame to the left and the key frame to

The Foundry Nuke 6.0v5


USING THE INTERFACE 106
Using the Curve Editor

the right if the selected point is between these two key


frames along the y axis. If the selected point is not
between these key frames and has a larger or smaller
value than both key frames, the tangents’ slopes are
made horizontal. This ensures the resulting curve never
exceeds the key frame
value
between the previous and
next key frame on y

not between the previous and


next key frame on y

• Catmull-Rom to set the tangents’ slope equal to the


slope between the key frame to the left and the key
frame to the right regardless of where the selected
point is located. The resulting curve can exceed the key
frame values.

The Foundry Nuke 6.0v5


USING THE INTERFACE 107
Using the Curve Editor

• Cubic to set the slope so that the second derivative is


continuous. This smoothens the curve.

• Horizontal to make the tangents horizontal, setting


the slope around the selected points to zero.

• Break to adjust the two tangents of a selected point


independent of each other.

• Before > Constant or Linear to interpolate the parts


of the curve that are on the left side of the first point.
This option only works if you have selected the first
point on the curve.

The Foundry Nuke 6.0v5


USING THE INTERFACE 108
Using the Curve Editor

constant linear

• After > Constant or Linear to only interpolate the


parts of the curve that are on the right side of the last
point. This option only works if you have selected the
last point on the curve.

constant linear

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 the First frame of loop field, enter first frame of the
portion you want to repeat throughout the curve.
3. In the Last frame of loop field, enter the last frame of
the portion you want to repeat.
4. Click OK.

The Foundry Nuke 6.0v5


USING THE INTERFACE 109
Using the Curve Editor

The shape of the curve between these frames is repeated


throughout the rest of the curve. The solid line repre-
sents the actual curve, and the dotted line the original
curve with the key frames.

the portion to loop

To reverse a curve:
Right-click on the editor and select Predefined > Reverse.

This makes the curve go backward in time. Both the new


curve and the original curve are displayed. The solid line
represents the actual curve, and the dotted line contains the
key frames that you can modify.

The Foundry Nuke 6.0v5


USING THE INTERFACE 110
Using the Curve Editor

before reverse after reverse

To negate a curve:
Right-click on the editor and select Predefined > Negate.

The curve becomes the negative of the key frames. For


example, a value of 5 turns into -5. Both the new curve and
the original curve are displayed. The solid line represents the
actual curve, and the dotted line contains the key frames
that you can modify.

before negate after negate

To use an expression to modify a curve:


Enter the expression in the expression field at the bottom of
the Curve Editor.

The Foundry Nuke 6.0v5


USING THE INTERFACE 111
Viewers

OR
1. Right-click on the Editor, and select Edit > Edit expres-
sion.
2. In the dialog that opens, type the expression you want to
use for the curve, for example, sin(x)/x.

3. Click OK.

Viewers 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. Viewer nodes are essential for quickly
assigning the right values to parameters because they allow
you to edit in context—that is, edit a given node’s
parameters upstream in a script while viewing the effect of
those changes downstream.

You can place as many Viewer nodes in a script as you wish,


which allows you to simultaneously view multiple outputs.
You can also pipe the output from up to ten process nodes
into single Viewer node, and then cycle through the various
displays. This allows you to easily compare an image before
and after processing by a given effect.

The Foundry Nuke 6.0v5


USING THE INTERFACE 112
Viewers

Note If you’re using the 32-bit version of Nuke, the maximum


image size the Nuke Viewer can display is 2^28 =
268,435,456 pixels. This is the same as 16k x 16k, 32k x
8k, 64k x 4k, or 128k x 2k. If your image is larger than this,
it will be resized and you will get the following warning:
Viewer image is clipped to <size> x <size>!
For example, if your image resolution is 60,000 x 4473,
Nuke is able to display the image because the number of
pixels is less than 2^28. However, if the resolution is
60,000 x 4474 (more than 2^28 pixels), the image will be
resized to 59998 x 4474.
In addition to the Viewer, this limit is also applied to the
bounding box of the images being passed between each
node.
If you’re using the 64-bit version of Nuke, however, the
maximum image size the Viewer can display is 64k x 64k (or
the equivalent number of total pixels at other resolutions).
Make sure though, that you have sufficient RAM memory
available if you want to use the maximum image size.

Adding Viewer Nodes Viewers have corresponding nodes that appear in the Node
Graph. These nodes do not produce output for rendering;
they generate display data only. You can connect Viewer
nodes as described in “Working with Nodes” on page 58. In
practice, you’ll work faster by using the Viewer hotkeys
described below.

To add a Viewer node:


1. Select the node whose output you wish to view.
2. Do one of the following:

The Foundry Nuke 6.0v5


USING THE INTERFACE 113
Viewers

• Using the menu bar, choose Viewer > Create New


Viewer.
• Using the Toolbar, choose Image > Viewer.
• Using a keyboard shortcut, press Ctrl+I (Mac users
press Cmd+I).
Nuke connects a Viewer node to the node you selected in
step 1, and displays the output of the node in the Viewer
panel. You can also insert a Viewer node and set up its
first connection by simply pressing 1 over the Node
Graph.

Connecting Viewer Once you add a Viewer node to the script, you can quickly
Nodes pipe any process node’s output to it simply by selecting the
process node then pressing any number key. Doing so pipes
the output to one of the ten input ports available on every

The Foundry Nuke 6.0v5


USING THE INTERFACE 114
Viewers

Viewer node (the 0 key represents the tenth slot).

Figure 3.21: A Viewer node with multiple inputs.


.

Toggling Views If a Viewer node has multiple inputs, like the one depicted
above, you can press the up or down arrow keys to quickly
cycle through the views (your cursor needs to be in the
Viewer window). To view a particular node press the number
key (1, 2, 3... 0) corresponding to the pipe number whose
contents you wish to view.

Panning and Zooming To pan the frame:


the Viewer Window Hold the Alt key and drag on the display. The frame follows
the mouse pointer.

The Foundry Nuke 6.0v5


USING THE INTERFACE 115
Viewers

Note On Linux, Alt+drag may not work as expected. This is due to


the default window functionality on Gnome. To get around it,
you can use the Windows key instead of Alt when panning.
Alternatively, you can change your window preferences on
Gnome to fix the problem:
1. Select Applications > Preferences > Windows to open the
Window Preferences dialog.
2. Under Movement Key, select Super (“or Windows logo”).
You should now be able to pan with Alt+drag.

To recenter the frame:


Press F.

To zoom in on the frame:


1. Move your pointer over the area of the display on which
you want to zoom.
2. Press the plus button (+) repeatedly until the frame
attains the desired scale.
OR
Select zoom in from the zoom pulldown menu
in the top right corner.

To zoom out from the frame:


1. Move your pointer over the area of the display from
which you want to zoom.
2. Press the minus button (-) repeatedly until the frame
displays at the desired scale.
OR
Select zoom out from the zoom pulldown
menu in the top right corner.

The Foundry Nuke 6.0v5


USING THE INTERFACE 116
Viewers

To restore the zoom to 100%:


Press Ctrl+1 (Mac users press Cmd+1).

Hiding Floating To hide a floating Viewer:


Viewers Press ‘ (the accent key).

To show a hidden floating Viewer:


Press ‘ (the accent key) again.

Using the Viewer A Viewer’s on-screen controls let you navigate the timeline,
Controls display channels, zoom, choose cameras (3D mode), and
create display wipes and composites.

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.

current
frame frame increment playback buttons

frame range source time marker


Figure 3.22: Timeline controls.

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

The Foundry Nuke 6.0v5


USING THE INTERFACE 117
Viewers

range of the first image you read in is used as the global


frame range.

Viewer timeline controls also have a frame range source


pulldown menu that you can use to define where the timeline
gets its frame range from. You can set this menu to Global,
Input, or Custom. Global is the default setting described
above.

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. The number of the first frame in
the clip is shown in the left end of the timeline and the
number of the last frame in the right end. If you change the
input of the Viewer, the frame range on the timeline is
adjusted accordingly.

To manually adjust the frame range for the current Viewer


window, pan and zoom on the timeline until you see the
desired frame range and Custom becomes selected in the
frame range source menu. Alt+drag to pan, and MMB+drag
to zoom in. You can also zoom in on or out of the timeline
using the mouse wheel. To reset the zoom, press the middle
mouse button over the timeline.

To adjust the playback range for the current Viewer window,


Ctrl+drag (Mac users Cmd+drag) the red playback range
marker on the timeline to a new “in” and “out” frames as
shown in Figure 3.23, or click on the frame range lock button

The Foundry Nuke 6.0v5


USING THE INTERFACE 118
Viewers

and enter a new playback range in the playback range field.

Figure 3.23: Adjusting the frame range for the current


Viewer.

To toggle between the new playback range and the visible


timeline range, click the button next to the playback range
field.

Figure 3.24: Playback is locked to Figure 3.25: The entire visible


the range defined in the playback timeline range is used.
range field.

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 lets you


specify the number of frames by which
the Previous increment/Next increment
buttons cue the sequence.

The following table lists the functions of the playback

The Foundry Nuke 6.0v5


USING THE INTERFACE 119
Viewers

buttons:

Buttons Functions
The First frame and Last frame buttons cue
the sequence to the first and last frame.
The Previous key frame and Next key frame
buttons cue the sequence to the script’s
previous or next key frame.
The Play backward and Play forward buttons
play the sequence backward or forward at
the script’s frame rate.
The Back 1 Frame and Forward 1 Frame but-
tons cue the sequence to the previous or
next frame.
The Stop button halts playback.

The Previous increment and Next increment


buttons cue forward or back by 10 frames
by default. These are useful for heavy key-
framing tasks. You can adjust the increment
value as necessary.

The Playback Mode button lets you control how many times
and in what direction the Viewer plays back the sequence.
Click the button to toggle between the following modes:

Button Function
Repeatedly play the sequence (loop).

The Foundry Nuke 6.0v5


USING THE INTERFACE 120
Viewers

Button Function
Play the sequence once from the current frame to the
head or tail (stop).
Repeatedly play the image back and forth from head to
tail.

Jumping to a Specific Frame


You can move quickly to a specific frame on the timeline by
choosing File > Go to frame (or by pressing Alt+G),
entering a frame number in the dialog that appears, and
clicking OK.

Synchronizing Viewer Playback


The Lock/Unlock button lets you toggle synchronized
playback of Viewer windows. By default, all Viewers are
locked—that is, if you cue to a frame in one Viewer, all other
Viewers follow suit.

Figure 3.26: Synchronizing Viewers.

When the lock icon changes from a closed lock to an open


lock, that Viewer’s playback becomes independent of other
Viewers, and not cued to the other Viewers.

The Foundry Nuke 6.0v5


USING THE INTERFACE 121
Viewers

Pausing the Display


The Pause button stops the Viewer from updating and holds
the last frame rendered. To reactivate display rendering for
all frames, press the button again.

Click to stop Viewer update.


Click to manually update
when Pause is active.
Figure 3.27: Pausing the display update of a Viewer.

You can click the render update button next to Pause (or
press U) to manually update the display while keeping Pause
active.

Displaying a Single Channel


You can press the R, G, B, and A keys on your keyboard to
display the red, green, blue, and alpha channels respectively.
Or, you can also select a channel from the RGB pulldown
menu in the top left corner.

Figure 3.28: Displaying a single channel.

Press one of the channel keys again to toggle back and

The Foundry Nuke 6.0v5


USING THE INTERFACE 122
Viewers

display all channels.

Tip If you press Shift while selecting the channel, your selection
only affects the currently active input of the Viewer node.
This way, you can display different channels from the
Viewer’s different inputs. For example, when keying it can be
useful to view the RBG channels from one input and the
alpha channel from another, and toggle between the two. To
achieve this, do the following:
1. Create a Viewer with several inputs. See “Connecting
Viewer Nodes” on page 113.
2. Activate one of the inputs by pressing its number (for
example 1) on the Viewer.
3. Press Shift and select RGB from the channel menu.
4. Activate another input (for example, input 2) by pressing
its number on the Viewer.
5. Press Shift and select A from the channel menu.
6. Toggle between the inputs by pressing their numbers or
the up and down arrow keys.

Channel Set and Channel Display Lists


The channel set list lets you choose a set of color channels
to display in the Viewer. By default, this is set to display the

The Foundry Nuke 6.0v5


USING THE INTERFACE 123
Viewers

rgba set, but you can choose any channel set in the data
stream.

Figure 3.29: The channel set and channel display lists.

The Channel list controls which channel appears when you


view the “alpha” channel. The default setting actually does
display the alpha channel when you press the A key;
however, you can change this by selecting any channel in the
data stream.

Figure 3.30: Selecting the channel to display when A


is pressed.

The Foundry Nuke 6.0v5


USING THE INTERFACE 124
Viewers

Superimposing an Image’s Alpha Channel over its


RGB Channels
When you’ve read in an image that has an alpha channel, you
can display the alpha channel as a red overlay on top of the
image’s red, green, and blue channels.

To display an image’s alpha channel on its RGB


channels:
1. Select Image > Read to read in an image.
2. Connect a Viewer node to the Read node.
By default, Nuke displays the red, green, and blue chan-
nels in the Viewer.

3. Click on the Viewer to make sure it’s the currently active


panel.
4. Press M.
Nuke displays the image’s alpha channel as a red overlay
on top of the RGB channels.

The Foundry Nuke 6.0v5


USING THE INTERFACE 125
Viewers

5. To return to the RGB display, press M again.

Image Format Labels


The Pixel Value indicator displays information about the
pixel underlying the pointer or about a sampled pixel or
region of pixels. (You can sample a single pixel from the
Viewer by pressing Ctrl/Cmd while clicking, a region from
the Viewer by pressing Ctrl/Cmd+Shift while dragging, a
single pixel from the node’s input by pressing Ctrl/Cmd+Alt
while clicking, and a region from the node’s input by pressing
Ctrl/Cmd+Alt+Shift while dragging.) From left to right, the
indicator displays the following about the current pixel or
sample: its x and y position; its Red, Green, Blue, and Alpha
values; and other values depending on the color type you
have selected from the color type menu on the right.

The Format indicator displays the image resolution and the


size of the bounding box.

Using the Zoom List


The Zoom list lets you select the magnification factor by
which the current image is displayed. This list also shows the

The Foundry Nuke 6.0v5


USING THE INTERFACE 126
Viewers

hotkeys to press to quickly switch between the different


zoom settings.

Figure 3.31: Selecting a display zoom.

Proxy Mode
Nuke can generate low-res proxies for displayed frames as
needed when you press Ctrl/Cmd+P or click the proxy mode
toggle button on the Viewer to activate the proxy display
mode.

Figure 3.32: Proxy mode toggle.

The Foundry Nuke 6.0v5


USING THE INTERFACE 127
Viewers

For more information, “Proxy Mode” on page 160.

Full resolution

Figure 3.33: High-res display.

The Foundry Nuke 6.0v5


USING THE INTERFACE 128
Viewers

Proxy

Figure 3.34: Proxy display.

The global proxy resolution and/or scale are determined by


the project settings, which you can open by selecting Edit >

The Foundry Nuke 6.0v5


USING THE INTERFACE 129
Viewers

Project settings (or pressing S).

Figure 3.35: Proxy display resolution defined on the


project settings properties panel.

You can also read in rendered proxies using the Read nodes’
controls. The proxy file does not need to match the proxy
resolution in use. Depending on your settings, either the
full-res or proxy file will be scaled to the required proxy size.
For more information, see “Read Nodes and Proxy Files” on

The Foundry Nuke 6.0v5


USING THE INTERFACE 130
Viewers

page 164.

Figure 3.36: Reading in proxy versions of images.

Lowering the Display Resolution of Individual


Viewers
Viewers also have a pulldown menu that allows you to easily
switch to lower display resolutions, regardless of whether
you have activated proxy mode or not. Using this multiplier
setting, you can, for example, change the display resolution
of an individual Viewer to 50% of the current (be it full-size
or proxy) resolution. This is useful if you want to have Nuke
display your images more quickly without having to touch
the project settings. It also comes in handy if you have just a
few very large plates in your script, as you can choose to use
lower resolutions when viewing just these plates.

To lower the display resolution of individual Viewers:


From the Viewer’s down-rez menu, choose the factor by
which you want to lower the display resolution. Select:
• 1 to display 1/1 of the currently active resolution.
• 2 to display 1/2 of the currently active resolution.
• 4 to display 1/4 of the currently active resolution.

The Foundry Nuke 6.0v5


USING THE INTERFACE 131
Viewers

• 8 to display 1/8 of the currently active resolution.


• 16 to display 1/16 of the currently active resolution.
• 32 to display 1/32 of the currently active resolution.

For example, if you have a 4K plate and are using a proxy


scale of 0.5, your plate will still be 2K even in the proxy
mode. Setting the down-rez factor to 2 in the Viewer will
scale the plate down further to 50% of the proxy resolution,
that is to 1K. This gives you much faster (but less accurate)
feedback.

Pixel Aspect Ratio


The pixel aspect ratio determines whether your images are
displayed using square or rectangular pixels. By default, the
Viewer uses the pixel aspect ratio defined in your project
settings. To see the current setting, select Edit > Project
settings (or press S).

For example, a pixel aspect ratio of 2 accurately displays

The Foundry Nuke 6.0v5


USING THE INTERFACE 132
Viewers

anamorphic footage the way it will be projected, like this:

Figure 3.37: The Viewer uses the pixel aspect ratio


defined for the script.

If you want to ignore the pixel aspect ratio, you can toggle it
by pressing Ctrl/Cmd+Shift+P over the Viewer window.

Figure 3.38: Press Ctrl/Cmd+Shift+P over the Viewer


window to ignore the pixel aspect ratio.

Region of Interest (ROI)


The ROI button lets you enable rendering only through a
region of interest—a portion of the image you explicitly

The Foundry Nuke 6.0v5


USING THE INTERFACE 133
Viewers

select. This is useful for quickly viewing render results in a


process-heavy script.

To define a region of interest:


1. Click on the ROI button in the Viewer controls. The ROI
overlay appears.

2. Drag to resize and move the ROI overlay as necessary.


OR
1. Over the Viewer, press Alt+W once (do not hold the keys
down). The ROI button turns red, but the ROI overlay
does not appear. This allows you to freely draw your own
ROI rather than adjust the default overlay.
2. Drag a marquee to draw the region of interest where you
need it.

To clear a region of interest:


1. After you’ve set a region of interest, you can clear it by
pressing Alt+W over the Viewer. You can then drag a
new marquee to define a new region of interest.
2. To turn off the feature and update the whole Viewer with
the recent changes, click the ROI button again (or press
Shift+W).

The Foundry Nuke 6.0v5


USING THE INTERFACE 134
Viewers

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.
Boost or reduce gamma by entering a gamma level or
dragging the gamma slider.

gain toggle display gain slider

gamma toggle display gamma slider

zebra stripe button


Figure 3.39: Display gain and gamma controls.

The gain and gamma toggle buttons let you switch between
the default values of 1 (no change) and the last gain and
gamma adjustments you made in the Viewer.

The Zebra Stripe button, when pressed, applies stripes to all


pixels outside the range 0.0 to 1.0.

Input Process and Viewer Process Controls


Input Process and Viewer Process operations can be used to
modify the image from the viewed node before it is displayed

The Foundry Nuke 6.0v5


USING THE INTERFACE 135
Viewers

on your monitor. Both only affect the Viewer in which they


are activated and do not affect your rendered output. Input
Process is a legacy system which uses a node instantiated in
the Node Graph to process the image. This is handy for
script-specific, temporary, or experimental use, but can be
error prone due to the node accidentally being deleted or
changed and is limited to a single node. The Viewer Process
system was added in Nuke 5.2 and allows a gizmo (or
compiled node) to be registered from the Python
programming language at start-up. The registered item
appears in a menu in the Viewer and the node is instantiated
internally within the Viewer when the item is selected so
there is no danger of accidental deletion or modification.
This also enables multiple Viewer Processes to be registered
at different points of start-up (as Nuke works through the
NUKE_PATH menu.py files).

The Viewer settings contain an option for the Input Process


to be applied before or after the Viewer Process, so the two
may be used in conjunction, for instance, with the Input
Process applying a projection mask after the Viewer Process
applies a film look profile. While you could combine the two
into a single Viewer Process node, it can be advantageous to
keep operations separated. Having both the Viewer Process
and Input Process available provides a great deal of
flexibility.

You can create an Input Process by creating a node in the


Node Graph and naming it as an Input Process using Nuke’s
Edit menu. Once an Input Process has been named, the IP
button appears in the Viewer controls. When the IP button is
activated, any image you view is passed through the Input
Process.

Unlike Input Processes, Viewer Processes are registered

The Foundry Nuke 6.0v5


USING THE INTERFACE 136
Viewers

using Python. They can be session independent and always


appear in the Viewer’s Viewer Process menu. There are two
predefined Viewer Processes, sRGB and rec709, but you
can also build and add your own. When a Viewer Process is
selected from the Viewer Process menu, any image you view
is passed through that Viewer Process.

Whenever possible, the Input Process and Viewer Process


are executed on the GPU. 1D LUT and 3D LUT (Vectorfield)
have GPU implementations, so the built-in Viewer Processes
will run on the GPU (unless gl buffer depth has been set to
byte in the Viewer settings, in which case all processing is
done on the CPU). To get the GPU'd versions of the nodes for
use in a custom Viewer Process gizmo, press x over the
Node Graph, enter ViewerGain, ViewerGamma, or
ViewerClipTest in the command entry window, and press
Return.

The following table lists the differences between an Input


Process and a Viewer Process.

Input Process Viewer Process


Set by selecting the node in the Registered using Python.
Node Graph and choosing Edit >
Node > Use as Input Process.
Activated using the IP button in the Activated using the Viewer Process
Viewer controls. menu in the Viewer controls.
Requires that the node exists in the Is defined in a text file called
Node Graph. Can quickly and easily menu.py that is run at start-up.
be modified by artists. Can also be Accessible for artists, but not likely
accidentally deleted, disabling the to be accidentally modified or
effect. deleted.

The Foundry Nuke 6.0v5


USING THE INTERFACE 137
Viewers

Input Process Viewer Process


Script dependent. Unless your Input Session independent. The Viewer
Process node is saved in the tem- Processes registered in menu.py will
plate.nk file that is loaded at start- always be available in each new
up, the Input Process is lost when session of Nuke.
you restart Nuke.
There can only be one Input Process There can be an unlimited number
at a time. Setting a new Input Pro- of Viewer Processes available in the
cess overrides any previously used Viewer Process menu. For example,
Input Process. it is possible to register Viewer
Processes in any menu.py file at
start-up, so Viewer Processes can
be added at any directory in your
NUKE_PATH.
Useful for temporary or non-critical Useful for viewing options that you
viewing options that you want in often need or that should not be
the current shot for convenience, or modified by artists on a shot-by-
for testing Viewer Processes before shot basis.
registering them. Can also be used
for other things, such as field
charts or masks that may be
switched on or off and changed
around in the shot.

Note Note that Input Processes and Viewer Processes are part of
a built-in, fixed pipeline of nodes that are applied to images
before they are displayed in the Viewer. This pipeline is
either:
gain > Input Process > Viewer Process > gamma > dither >
channels > cliptest (if viewer input order has been set to
before viewer process in the Viewer settings)
OR

The Foundry Nuke 6.0v5


USING THE INTERFACE 138
Viewers

gain > Viewer Process > Input Process > gamma > dither >
channels > cliptest (if viewer input order has been set to
after viewer process in the Viewer settings).
However, depending on what the Input Process and Viewer
Process are doing, the order in the built-in pipeline may not
be the correct order. Therefore, if your Input Process or
Viewer Process have controls that also exist for the Viewer,
such as float controls named gain, gamma, or cliptest, then
the Viewer will drive them from the corresponding Viewer
controls and not do that image processing itself. This allows
you to implement these controls in your Input Process or
Viewer Process node/gizmo using whatever nodes and order
you want. If your Input Process and Viewer Process do not
have these controls, then the Viewer will apply the effects in
its normal way according to the built-in pipeline.
In the built-in pipeline, dither is applied to diffuse round-off
errors in conversion of floating point data to the actual
display bit depth. Although the cliptest is drawn at the end,
it is computed on the image as input to the Viewer.

Note By default, the predefined Viewer Processes, sRGB and


rec709, affect all channels. However, if you want them to
only affect the red, green, and blue channels, you can
activate apply LUT to color channels only in the individual
Viewer Settings or on the Viewers tab of the preferences.

Input Process Controls


To activate or deactivate the effect of an Input Process, click
the IP button in the Viewer controls. Note that the IP button
only appears if the input process field in the Viewer

The Foundry Nuke 6.0v5


USING THE INTERFACE 139
Viewers

settings is not empty. The button is also only enabled when a


node in the Node Graph is set as an Input Process.

Click here to activate / deactivate the


effect of an Input Process.

Figure 3.40: Toggling the use of the Input Process.

To open the Viewer settings, press S on the Viewer, or select


Viewer Settings from the Viewer’s right-click menu. By
default, input process is set to VIEWER_INPUT. If a node
called VIEWER_INPUT exists in the Node Graph, it will
automatically be used as the input process for the Viewer.
This ensures backwards compatibility with pre-5.2 scripts.

However, the Input Process node does not have to be named


VIEWER_INPUT. You can use any node as an Input Process.
Do the following:
1. Select the node in the Node Graph and choose Edit >
Node > Use as Input Process.
Alternatively, you can press S on the Viewer to open the
Viewer settings and enter the name of the node in the
input process field.
2. In the Viewer settings, you can also define whether the
Input Process will be applied before or after the Viewer
Process currently in use. To do so, set viewer input
order either to before viewer process or after viewer
process.

The Input Process node should not be connected to other


nodes in the Node Graph. If you attempt to connect it, an
error will be displayed on the Viewer. If you delete the Input

The Foundry Nuke 6.0v5


USING THE INTERFACE 140
Viewers

Process node from the Node Graph, the effect of the Input
Process will be disabled.

Viewer Process Controls


To activate a Viewer Process, select it from the Viewer
Process menu in the top right corner of the Viewer. Any
images you now view using this Viewer are passed through
the selected Viewer Process.

Figure 3.41: Selecting the Viewer Process to apply to


images before they are displayed in the Viewer.

Nuke includes the following predefined Viewer Process


gizmos: sRGB and rec709. By default, sRGB is used because
it is a best-guess default for a typical computer monitor.

In addition to using the predefined Viewer Processes, you


can also add your own by registering a node or gizmo as a
Viewer Process. You can register as many Viewer Processes
with custom Viewer LUTs as you like. For more information
on creating and registering custom Viewer Processes, see
“Creating Custom Viewer Processes” on page 881.

All available Viewer Processes (both predefined and custom

The Foundry Nuke 6.0v5


USING THE INTERFACE 141
Viewers

ones) appear in the Viewer Process menu in the Viewer


controls. To disable the use of a Viewer Process, select
None from the Viewer Process menu.

To open the properties panel of the currently active Viewer


Process, select show panel from the Viewer Process menu.

Note that if the control you want to adjust has the same
name as any of the Viewer controls (for example, gain or
gamma), you should adjust the control on the Viewer. This
drives the control in the following:
• the Input Process’ controls if an Input Process is in use
• in the Viewer Process’ controls if no Input Process is in
use.

Tip If you want to render out a file with the Viewer Process
effect baked in, you can select Edit > Node > Copy Viewer
Process to Node Graph to create an instance of the Viewer
Process node in the Node Graph.

Monitor Output Toggle


The monitor output button lets you preview the
current Viewer image on an external broadcast video
monitor. You can select the external device and the
display mode to use in the Viewer settings. To open the
Viewer settings, press S on the Viewer.

Note that this option is only available in 32-bit Windows and


Mac OS X versions of Nuke, and requires additional
hardware, such as a monitor output card or a FireWire port.

For more information, see “Previewing on an External


Broadcast Video Monitor” on page 697.

The Foundry Nuke 6.0v5


USING THE INTERFACE 142
Viewers

2D / 3D Toggle and Camera Controls


The 2D / 3D list lets you toggle between 2D and 3D display
modes in the current Viewer. This list also lets you choose
between different orthographic (non-perspective) views
when working in the 3D mode.

Figure 3.42: The 2D / 3D views and camera controls.

The camera list on the right lets you choose which camera to
look through when multiple cameras exist in your 3D scene.
For more information on these controls, see Chapter 14, "3D
Compositing", on page 562.

Using the Viewer The wipe control provides an option for displaying a split-
Composite Display screen of two images, which can help you compare before
Modes and after versions for color correction, filtering, and other
image manipulation. This control also includes display
compositing options to overlay different images.

To display a comparison wipe:


1. Select a node in your script and press 1 to display its
output in the Viewer.
2. Select the node you want to compare and press 2.

The Foundry Nuke 6.0v5


USING THE INTERFACE 143
Viewers

The 2 keystroke connects the image to the Viewer


(assigning the next available connection, number 2).
3. From the A and B lists on top of the Viewer, select the
images you want to compare. The lists include the last
four nodes connected to the Viewer.
4. From the Viewer composite list in the middle, select
wipe.

The two images are displayed split-screen in the Viewer.

Drag this handle


to cross-dis-
Drag the solve.
crosshair to
position the Drag this han-
split line. dle to rotate the
split.

5. Drag the handles of the crosshair to adjust the wipe:


• Drag the crosshair center to change its position.
• Drag the long handle (on the right) to rotate the wipe.
• Drag the “arc” handle to cross-dissolve the second
image.
6. When finished with the split-screen, select none (-) from
the Viewer composite list.

The Foundry Nuke 6.0v5


USING THE INTERFACE 144
Viewers

Tip If you press Shift while selecting a channel, your selection


only affects the currently active input of the Viewer node.
This way, you can display different channels from the
Viewer’s different inputs. For example, when keying it can be
useful to view the RBG channels from one input and the
alpha channel from another, and toggle between the two.

The display composite options—over, under, and minus—


can also be selected to overlay two images. When the two
images are 2D, this allows you to create a quick comp.

When one image is 2D and the other is a 3D node, you can


use under to line up the wireframe preview with the 2D
reference, and see how the 3D matches prior to a full render.

One example of this is when you want to preview a


wireframe 3D scene with a background plate that you are
trying to match, as shown below.

3D node “under” background

Figure 3.43: Comparing a 3D scene over a 2D image.

The Foundry Nuke 6.0v5


USING THE INTERFACE 145
Using the File Browser

For more information, see Chapter 14, "3D Compositing", on


page 562.

Hiding and Showing To hide or show the top toolbar, press {.


Viewer Toolbars
To hide or show the bottom toolbar, press }.

Locking the Viewer You can choose to lock the Viewer zoom level, so that it
Zoom Level doesn’t change when you switch between inputs of different
sizes. Right-click on the Viewer, and select Prevent Auto
Zoom to toggle between maintaining the same zoom level for
all inputs (on) and changing it according to on-screen image
dimensions (off). Alternatively, you can also press Alt+Z on
Viewer, or toggle prevent auto zoom in the Viewer settings.

Using the File Whenever you load or save files in Nuke, you’ll see a browser
Browser similar to the one shown in Figure 3.44. The directory
navigation buttons let you create or access the directory

The Foundry Nuke 6.0v5


USING THE INTERFACE 146
Using the File Browser

from which you wish to read or write data.

navigation controls

pathname field filter menu

Figure 3.44: Nuke’s file browser.

The navigation controls let you move through the directory


structure, bookmark favorite directories, and create new
directory folders.

To use the navigation controls:


• Click the Create New Directory button to create a
new directory at your current position in the file
hierarchy.
• Click Up one directory to ascend one directory
level closer to the root.
• Click Home to access the directory defined as your
local working directory.
• Click Root to ascend to the very top of your local drive or
server’s file hierarchy.
• Click Work to access the directory you (or your system
administrator) defined as your network working directory.
• Click the + button to add a directory bookmark.

The Foundry Nuke 6.0v5


USING THE INTERFACE 147
Using the File Browser

• Click the edit button to edit the name or pathname to a


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

To limit the file list to specific file types, use the filter
pulldown menu and Sequences checkbox.

To use the filter pulldown menu and Sequences


checkbox:
• Select *.nk to display only Nuke script files.
• Select * to display all files (except hidden files), regardless
of whether they’re associated with Nuke.
• Select .* * to display all files, including hidden files.
• Select */ to display directory names, but not their
contents.
• Check Sequences to display image sequences as single
titles, as in fgelement.####.cin 1-50 rather than
fgelement.0001.cin, fgelement.0002.cin, fgelement.
0003.cin, and so on.

Pathname Field
The pathname field displays the current directory path, lets
you navigate to a new path, and also enter a filename for
scripts and rendered images.

Figure 3.45: Pathname field.

To use the pathname field:


1. To navigate to a directory, type the pathname in the field
and press Tab.

The Foundry Nuke 6.0v5


USING THE INTERFACE 148
Using the File Browser

2. To enter a script name, browse to a directory path and


enter the file name after the displayed path.

To preview files in the file browser:


1. Click the black arrow in the top right corner of the file
browser.

Click here.

The file browser expands to include a small viewer.


2. Select the file you want to preview. Nuke displays the file
in the file browser.

To select multiple files with the file browser:


1. Browse to the folder where you have the files.
2. Ctrl+click on all the files you want to open to select them
(Mac users Cmd+click).
3. Click Open.

The Foundry Nuke 6.0v5


USING THE INTERFACE 149
Undoing and Redoing

Nuke opens all the files you selected.

Undoing and Nuke generally gives you an undo history that extends back
Redoing to the first action of the application’s current session.

To undo an action in the workspace:


Select Edit > Undo (or press Ctrl/Cmd+Z). Repeat as
necessary.

To redo an action in the workspace:


Select Edit > Redo (or press Ctrl/Cmd+Y). Repeat as
necessary.

To undo an change in a properties panel:


Click the Undo arrow button in the properties panel.

To redo an change in a properties panel:


Click the Redo arrow button in the properties panel.

To undo all changes made after the properties


panel was opened:
Click the Revert button.
OR
Right-click on the properties panel and select Revert knobs
from the menu that opens.

To set all controls back to their default values:


Right-click on the properties panel and select Set knobs to
default from the menu that opens.

The Foundry Nuke 6.0v5


USING THE INTERFACE 150
Progress Bars

Progress Bars Nuke displays a progress bar for each active task it
performs. By default, progress bars appear in a pop-
up dialog, but you can also display them in the
Progress panel. To do so, click on a content menu button and
select Progress Bars. This opens a Progress panel. The next
time you get a progress bar, it will appear in the panel. If you
delete the panel, progress bars will appear in a pop-up
dialog again.

Figure 3.46: Progress panel.

If you want to have the Progress panel appear in the same


position in the future, you can save it as part of a layout. For
more information, see “Interface Layouts” on page 150.

Customizing the You may be used to a certain way of working, or simply


Interface disagree with some of Nuke’s default settings. If this is the
case, you’ll be happy to know that you can customize Nuke’s
interface to find just the layouts and settings that work for
you. You can then save your preferred settings, layouts, and
template scripts for future use.

Interface Layouts When your scripts grow, you may not be able to fit all the
different elements on your display at the same time. Luckily,
you can customize the windows and panes, so that accessing
the elements you often need becomes as quick and easy as
possible.

The Foundry Nuke 6.0v5


USING THE INTERFACE 151
Customizing the Interface

Customizing Panes
You can resize and split panes to make more room for
different elements on the screen.

To resize a pane:
Drag the divider line of the pane into a new location.

Figure 3.47: Resizing a pane.

To split a pane:
1. Click on the content menu button in the top left
corner of the pane.
2. Select Split Vertical or Split Horizontal from the menu
that opens.

Moving the Toolbar


You can move the Toolbar into a new position by adding a
new panel for it, hiding the panel name and controls, and
resizing the panel. For more information on how to do this,
see “Adding Tabbed Panels” and “Hiding Tab Names and
Controls” below.

The Foundry Nuke 6.0v5


USING THE INTERFACE 152
Customizing the Interface

Adding Tabbed Panels


When you can’t fit more elements to your display, you can
use tabs to save space. You can also use tabs to move the
Toolbar into a new location.

To add tabs:
1. Click on the content menu button in the top left
corner of the pane.
2. Select the type of tab you want to add, for example,
Node Toolbar, Node Graph, New Viewer, or Script
Editor.
The new tab is added on top of the existing tabs.

To move tabs:
Click on the name of the tab and drag the tab to a new
position inside the same pane or in another pane.

To close tabs:
1. Make sure you are viewing the tab you want to close.
2. Click the “x” button in the top right corner of the current
tab.

Tabs and Floating Windows


You can turn tabs and panes into floating windows and vice
versa.

The Foundry Nuke 6.0v5


USING THE INTERFACE 153
Customizing the Interface

To turn a tab or pane into a floating window:


1. Make sure you are viewing the tab or pane you want to
float.
2. From the content menu, select Float Tab or Float Pane.
Alternatively, in the case of tabs, you can also do one of
the following:
• Click the float button in the top right corner of the cur-
rent tab.

OR
• Ctrl+click on the tab name (Mac users Cmd+click).
OR
• Right-click on the tab name and select Float Tab.

To turn a floating window into a tab or pane:


Click on the tab name or pane in the floating window and
drag it to where you want it to dock.

To close floating windows:


Click the “x” button in the top right corner of the tab or
pane.

Customizing Windows

To make a pane expand to the size of the window:


1. With your cursor in the pane.

The Foundry Nuke 6.0v5


USING THE INTERFACE 154
Customizing the Interface

2. Press spacebar quickly. (Pressing and holding the


spacebar brings up a context sensitive menu for that
pane.)

To make a window fullscreen:


1. Make sure the window you want to make fullscreen is
active. This could be the main application window or a
floating Viewer. Making it fullscreen removes the window
borders.
2. Press Alt+S.

Hiding Tab Names and Controls


You can hide the names and control buttons of tabs, as you
may not need them with all panels, such as the Toolbar
panel.

To hide the names and controls on tabs:


From the content menu, disable Show Tabs.

To show the names and controls on tabs:


1. Move your mouse pointer over the very top of the pane
area until the top edge of the pane brightens up.
2. Right-click to open the content menu.
3. From the content menu, enable Show Tabs.

Saving Layouts
You can save up to six favorite layouts and retrieve them as
necessary. You can also use these features to setup the
Nuke interface for dual monitors.

The Foundry Nuke 6.0v5


USING THE INTERFACE 155
Customizing the Interface

To save a layout:
1. Open and arrange the Nuke panes, panels, and tabs as
desired.
2. Select Layout > Save layout 1 (startup default) (or
press Ctrl/Cmd+F1) to save the default layout. Select Yes
in the confirmation dialog that appears.
This step shows F1 as the keystroke, but it can be any
key between F1 and F6.

To retrieve a layout:
Select Layout > Restore layout 1(startup default) (or
press Shift+F1) to retrieve the default layout.

F1 is used here, but if you saved a layout to a different


function key—any key between F1 and F6—then you can
press Shift followed by the key to retrieve the layout.

To use window layout 1 as the default when loading


scripts:
1. Select Edit > Preferences to open the preferences dia-
log.
2. Go to the Windows tab.
3. Check use window layout 1 when loading scripts. This
is usually checked by default.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 156
Working with Multiple Image Formats

4 MANAGING SCRIPTS

In this chapter, you learn about Nuke’s project files called


scripts. The topics covered include setting up, saving, and
loading scripts. You’ll also learn about managing your node
tree in the Node Graph, using Precomp nodes, and working
with file metadata.

Working with Nuke supports multiple file formats, such as Cineon, TIFF,
Multiple Image OpenEXR, HDRI, and RAW camera data (via the dcraw
command-line program), and allows you to mix them all
Formats within the same composite. By default, Nuke converts all
imported sequences to its native 32-bit linear RGB
colorspace. You can, however, use the Colorspace node to
force one of several color models, including sRGB, Cineon,
rec709, gamma 1.80/2.20, HSV, or HSL. The Log2Lin node
lets you convert between logarithmic and linear colorspace
(and vice-versa).

There are no restrictions on image resolution—you can


freely mix elements of any resolution within the same script.
You can, for example, use a 2k film plate as the background
for video shot in PAL format, and then output the result in
HD1080i. Nuke automatically adjusts its Viewer to
accommodate the image you’re viewing.

8-, 16-, and 32-Bit Some digital compositing systems, especially those geared
Image Processing for video work, are optimized for processing exclusively 8-
bit elements (that is, images with 256 intensity values per
channel). Other systems allow for the mixing of 8, 16, and

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 157
Setting Up Your Script

32-bit elements.

For Nuke, which began as a film effects tool, image quality is


paramount. Thus, it supports the processing of exclusively
32-bit-per channel elements (Elements with lower bit depths
are upconverted to 32 bits per channel upon import.) Thirty-
two bit support allows for a much richer palette of colors
and floating point precision in all script calculations. In
practice, this means that Nuke carries out every operation—
from an increase in gamma to a transform—with much
greater accuracy than a lower-bit-depth system.

You might expect that this boost in image quality would


result in big sacrifice in speed. This is not the case for a
couple of reasons. First, Nuke can process scripts with great
efficiency because they are uniformly in a 32-bit colorspace.
Moreover, hardware manufacturers now routinely design
their CPUs for 32-bit processing, making them a efficient
match for 32-bit-per-channel images.

Setting Up Your When you start working on a script, you should first define
Script the settings for it. This involves assigning the script a name,
frame range, frame rate, and default full and proxy
resolution format.

Name, Timespan, and 1. Select Edit > Project settings, or simply press S over a
Frame Rate blank portion of the workspace. The Project settings
properties panel appears.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 158
Setting Up Your Script

2. On the Root tab, type a name for the script (say,


firstcomp.nk) in the name field. Nuke’s scripts always
have the extension .nk.
3. Type the numbers of the first and last frames in the
frame range fields to define length of time for your
“shot.”
4. In the fps field, enter the rate in frames per second (fps)
at which you want your script’s Viewers to play back
footage. For film-based elements, 24 fps is appropriate.

Full-size Formats When you start a new project in Nuke, you need to set up a
full-size format for the project. The full-size format
determines the size of the "black" image that you get from
any disconnected node inputs. It also sets the default size of
any script-generated elements, such as Constants,

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 159
Setting Up Your Script

Colorbars, Bezier and B-spline shapes.

Note The full-size format does not affect the format of the
elements you read into your script. Nuke is resolution-
independent, which means it will respect and keep the
resolution of your images. It won’t automatically crop or pad
elements to match the project settings.
If you want elements you read in to conform to the project
settings, you can do this manually using the Reformat node.
For more information, see “Reformatting Image Sequences”
on page 183.

The full-size format is also used to calculate proxy scaling if


a proxy format is used. For more information on the proxy
mode and proxy formats, see “Proxy Mode” on page 160.

To set up a full-size format:


1. If it’s not already open, select Edit > Project settings
(or press S) to display the Project settings dialog.
2. From the full size format pulldown menu, select the
resolution for the final output of rendered images. If the
format you want to use is not in the list, select new. The
New format dialog appears.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 160
Setting Up Your Script

In the name field, enter a name for the new format.


In the file size fields, define the width and height of the
format.
If you like, you can also define additional information,
such as offsets and pixel aspect ratio.
Click OK to save the format. It now appears in the pull-
down menu where you can select it.

Proxy Mode When compositing with Nuke, you can work in two different
modes: the full-size mode or proxy mode. In the full-size
mode, images are read in exactly as they are on the disk, and
all positions are in actual pixels in these images. This is the
mode you want to use for accurate feedback and when
rendering the final output.

In the proxy mode, instead, a proxy scale factor is used. All


images and all x/y positions are scaled by this factor. This
will produce the same (or at least very similar) composite at
a different scale. For example, you can use a fraction of the
full output resolution to speed up rendering and display

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 161
Setting Up Your Script

calculation.

In addition to the above, a separate proxy file can also be


read in place of a full-size image, provided you have
specified one in the relevant Read node. This can further
speed up the preview, by using a smaller image that reads
faster and also saves time by not needing to be scaled. For
more information, see “Read Nodes and Proxy Files” on
page 164.

The proxy settings you define in the project settings affect


both the proxies Nuke generates using the proxy scale
factor and proxies read from files. Below, we discuss setting
a proxy format and/or a proxy scale, and defining how Read
nodes use proxy files.

Note Note that proxy versions of images are only used if you have
activated the proxy mode (see “Toggling In and Out of Proxy
Mode” on page 167). When the proxy mode is off, Nuke will
always use the full-res files.

Proxy Format and Proxy Scale


In the Project settings dialog, you have the option of
defining a proxy format and/or a proxy scale that you use in
the proxy mode.

For the proxy format, you can define the image resolution as
well as additional information about offsets and pixel aspect
ratio. When using the proxy format, the scaling is
proportionate to the full-size/proxy format relationship (not
scaled to the proxy format).

For the proxy scale, you only define a simple scale factor by
which your images are scaled down whenever the proxy

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 162
Setting Up Your Script

mode is activated. For example, you can use the scale factor
of 0.5 to scale your images down to half the size.

If you like, you can define both a proxy format and a proxy
scale, and then choose which one to use in proxy mode. A
proxy scale is easier to set up, but a proxy format gives you
more control over the low-res versions of your images.
Below, we first describe how to set up proxy formats and
then how to define a proxy scale.

To set up proxy formats:


1. If it’s not already open, select Edit > Project settings
(or press S) to display the Project settings properties
panel.
2. If you want to use a proxy format (rather than a proxy
scale) whenever the proxy mode is activated, select
format from the pulldown menu on the right.
3. From the proxy format menu, select the resolution to
use while working to speed things up. Notice that your
images are not scaled to this resolution, but the scaling
is proportionate to the full-size/proxy format
relationship. Nuke divides the proxy format width by the
full-size width and uses the result as the scale factor.
If the proxy format you want to use is not in the list,
select new.The New format dialog appears.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 163
Setting Up Your Script

In the name field, enter a name for the new format.


In the file size fields, define the width and height of the
format.

Tip You can type formulas in numeric fields to do quick


calculations. For example, if your full-size format width is
4096 and you want your proxy format width to be 1/2 of
that, you can enter 4096/2 in the New format dialog’s file
size w field and press Enter. Nuke then calculates the new
width for you.

Click OK to save the format. It now appears in the pull-


down menu where you can select it.
4. To activate the proxy mode and use the low-res format
for calculations and display, check proxy mode.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 164
Setting Up Your Script

Alternatively, you can use the proxy toggle in the Viewer


controls, or press Ctrl+P (Cmd+P on a Mac). For more
information, see “Toggling In and Out of Proxy Mode” on
page 167.

To setup a proxy scale:


1. If it’s not already open, select Edit > Project settings
(or press S) to display the Project settings properties
panel.
2. Select scale from the pulldown menu in the Project
settings dialog.
3. Using the proxy scale input field or slider, specify the
factor by which you want to scale the width and height of
your images. For example, if you want to scale them
down by 50%, use the value of 0.5.
4. To activate the proxy mode and use the low-res format
for calculations and display, check proxy mode.

Alternatively, you can use the proxy toggle in the Viewer


controls, or press Ctrl+P (Cmd+P on a Mac). For more
information, see “Toggling In and Out of Proxy Mode” on
page 167.

Read Nodes and Proxy Files


As an alternative to letting Nuke generate proxies on the fly,
proxy files can be specified using a second filename in the
Read nodes (for how to do this, see “Loading Image

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 165
Setting Up Your Script

Sequences” on page 176). If you don’t have a proxy file, you


can create one by activating the proxy mode and rendering
your full-size images using a Write node (see “Rendering
Output” on page 699).

The proxy file does not need to match the proxy resolution
in use. Depending on your project settings, either the full-res
or proxy file will be scaled to the required proxy size (that is,
the size calculated by taking the full-size format and scaling
it by the current proxy settings). However, if your proxy
images match your typical proxy settings, you can save this
time.

To define which file (full-res or proxy) is used in the


proxy mode:
1. If it’s not already open, select Edit > Project settings
(or press S) to display the Project settings properties
panel.
2. From read proxy files, select when to use the proxy file
(rather than the full-res file) in a Read node:
• never - Never use the proxy file in the proxy mode.
Instead, scale the full-size file as necessary.
• if larger - Use the smaller of the two images if it is
larger or equal to the desired size, scaling down as
needed. Otherwise, use the larger one, scaling down or
up as needed. This is the default option.
• if nearest - Use the image that is closest to the
desired size, scaling up or down as needed.
• always - Always use the proxy image in the proxy
mode, scaling it up or down as necessary.
The option you choose affects all Read nodes in your
script, provided that a proxy file is named and the proxy
mode is on.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 166
Setting Up Your Script

Write Nodes and Proxy Files


It is worth mentioning here that when a script is rendered in
proxy mode, processing will be done at the proxy scale and
image output will go to the file name in the Write node’s
proxy field. If you do not specify a proxy file name, the
render will fail with an error. It never resizes the proxy
image, and it will not write the proxy image over the full-size
one.

For more information, see “Rendering Output” on page 699.

Using Proxy Mode to Enlarge a Script


If you find it necessary to render a comp at higher than the
original resolution it was intended for, you can also use the
proxy resolution to scale up from the root full size format.
For example, you could use a 2K composite to produce 4K or
higher images in the proxy mode.

The reason you'd probably want to do this is because the


comp you did needs to be re-run at higher resolution for a
different output target and possibly with some new higher
resolution elements. For example, you may need to re-render
with new CG elements at print resolution rather than for film
out, but you don’t want to go through your script and modify
everything that has an x/y position.

When scaling up the output of a script in the proxy mode,


image generator nodes will render at the larger size, larger
images can be specified in the proxy field, and as with
scaling down, all x/y positions will be scaled to the proxy
output resolution.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 167
Setting Up Your Script

Using Small Proxy Files


If you have previously set up your script to use small proxy
files, you do not have to remove these. Make sure read
proxy files in the project settings is set to anything other
than always, and Nuke will read the larger original files and
scale them up.

Using Large Proxy Files


If you actually have larger proxy files, you should enter them
into the Read nodes’ proxy field, and set read proxy files
to anything other than never. Nuke will then use these
larger files in the proxy mode. For maximum quality, these
should be at exactly the desired proxy size so that no scaling
is done to them. For example, if the required proxy size
(defined by the project settings) is 4K, then the proxy image
should be exactly 4K. Otherwise, Nuke will scale it to match
the project settings, which will reduce the quality.

Rendering the Scaled-Up Output


To render the larger output of a scaled-up script, you need
to activate the proxy mode and enter a file name in the
proxy field of the Write nodes. The larger images will then
be written to these files.

Toggling In and Out of Proxy Mode


It’s usually smart to work in proxy mode because most
operations work quickly and more efficiently under the low-
res display. You can switch between low- and high-
resolution when you need greater precision (for example,
when pulling a key or tracking), or when you’re ready for
final rendering.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 168
Image Caching

To toggle between full resolution and proxy mode:


1. Click on an empty area of the Nuke window.
2. Press Ctrl+P to toggle the display mode (Cmd+P on a
Mac).

Nuke automatically scales script elements—Bezier shapes,


B-spline shapes, paint curves, garbage masks, tracking
curves, and so on—to keep the original placement on the
image.

Image Caching To ensure fast playback, the Nuke Viewer saves a version of
every frame it displays to disk. When you play through
sequences in the Viewer, it reads, where possible, from this
cache of prerendered images. This way, Nuke can quickly
display the results without recalculating the parts of the
script that have not changed. Provided the caching
preferences (see “Defining the Settings for Caching” on
page 169) have been set, Nuke automatically caches any
output displayed in a Viewer. However, you can also use the
DiskCache node (see “Using the DiskCache Node” on
page 170) to cache other parts of the node tree.

The Cache Directory Both the automatic caching and the DiskCache node use the
same cache directory defined using the Preferences dialog.
In the Preferences, you can also set the maximum size you
allow the disk cache to consume. For more information on
the caching preferences, see “Defining the Settings for
Caching” below.

Note that the cached images have unique names reflecting


their point of output location in the

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 169
Image Caching

script. This means that you can cache images from multiple
nodes in the script without overwriting previously cached
images.

Defining the Settings You can define the settings for both the automatic caching
for Caching and the DiskCache node in the Preferences.

To define the settings for caching:


1. Select Edit > Preferences (or press Shift+S).
The Preferences dialog opens.
2. Under disk cache, specify where you want Nuke to
cache out data to disk. Pick a local disk (for example, c:/
temp), preferably with the fastest access time available.
The environment variable NUKE_DISK_CACHE can be used
to override this setting. For more information, see “Envi-
ronment Variables” on page 825.
3. Using the disk cache size control, pick the maximum
size the disk cache can reach. Ensure there is enough
space on the disk for this to be reached. The default
value is 10GB, but a larger value, such as 50GB, can
often be used.
The environment variable NUKE_DISK_CACHE_GB can be
used to override this setting. For more information, see
“Environment Variables” on page 825.
4. Click the Save Prefs button to update preferences and
then restart Nuke.

Once these settings are defined, the automatic caching of


images is enabled. The Viewer will cache each frame it
displays in the directory specified. If you add a DiskCache
node into your script, it will also use the same directory.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 170
Image Caching

The disk cache is preserved when you quit Nuke so it can be


used again later. However, when the cache becomes full, old
items are automatically deleted to make room for newer
items.

Clearing the Disk When the disk cache becomes full, old items are
Cache automatically deleted. If necessary, you can also empty the
disk cache manually. You may want to do this if, for some
reason, wrong images are displayed in the Viewer.

To empty the disk cache:


From the menu bar, select Render > Clear Disk Cache.

Using the DiskCache The DiskCache node caches to disk scanlines from its input
Node as they are requested by its output. This can be useful, for
example, if:
• you are working on a large, complex node tree. Using the
DiskCache node, you can break the node tree into smaller

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 171
Image Caching

sections and cache any branches that you are no longer


working on.
• you are reading in images from a network. If you insert a
DiskCache node after a Read node, the image will be
cached locally and displayed faster.
• you are painting or rotoscoping. If you insert a DiskCache
node before a RotoPaint node, flipping frames becomes
faster.

The cached images are saved in the same directory as the


images the Nuke Viewer caches automatically. You can set
the location and size of this directory in the Preferences. For
more information, see “Defining the Settings for Caching” on
page 169.

Note Even though the DiskCache node and the automatic Viewer
caching use the same cache directory, they do not share the
same cache files. Therefore, using a DiskCache node does
not create cache files for the Viewer and does not
necessarily speed up playback. Instead, if placed at
strategic, expensive parts of a node tree, it can speed up
calculations, as Nuke can reference the cached data rather
than recalculate it.
Unlike the images in the Viewer cache, the images created by
the DiskCache node affect your rendered output and are
always saved as full floating point images.

If you make a change in the nodes upstream, the affected


cached images are discarded and automatically recalculated.

Note When executing a script on the command line, the DiskCache


nodes are NOT automatically executed.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 172
Saving Scripts and Recovering Backups

To cache images upstream:


1. Set the zoom level in the Viewer. By default, only the
lines displayed in the Viewer will be cached.
2. Select Other > DiskCache to insert a DiskCache node
after the last node in the section of the node tree that
you want to cache.
3. From the channels menu, select which channels to
cache.
Nuke caches the selected channels of the current frame
at the current zoom level. From this point on, Nuke refer-
ences the cached data instead of constantly recalculating
the output of the preceding nodes.
As you pan and zoom around, new parts of the image are
cached.
4. If you want to cache more than the current frame and
zoom level, click the Precache button in the DiskCache
properties and enter a frame range in the dialog that
opens.
This forces Nuke to cache all frames specified. All lines
will be cached regardless of what is shown in the Viewer.
Where the required images are partly cached already,
Nuke only calculates what is missing.

Saving Scripts and You know the mantra: save and save often. Nuke provides
Recovering three ways to save your scripts, plus an automatic timed
backup.
Backups

Saving Scripts There are three ways of saving scripts:

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 173
Saving Scripts and Recovering Backups

• To save a new script, select File > Save as (or press


Shift+Ctrl/Cmd+S).
• To update changes to a script already saved, File > Save
(or press Ctrl/Cmd+S).
• To save and upgrade to the next version, File > Save
new version (or press Alt+Shift+S).

To save a script:
1. Select File > Save as.
The Save script as dialog opens.
2. Browse to the directory where you want to store the
script. For instructions on using the file browser, see
“Using the File Browser” on page 145.
3. In the field in the bottom of the dialog, enter a name for
the script after the folder path, for example
firstscript_v01.nk.
4. Click Save.

Tip The _v01 string in the end of a script name allows you to use
the Save new version feature. Selecting File > Save new
version saves the current version of your script and
increments its name (that is, saves the different versions
under different names using _v01, _v02, _v03, and so on, in
the end of file names). This only works when the file name
includes a number that can be incremented.

Automatic Backup of You can define where and how often Nuke makes automatic
Scripts backups your files, or turn off the autosave function.

To define autosave options for a script:


1. Select Edit > Preferences.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 174
Saving Scripts and Recovering Backups

The Preferences dialog opens.

2. Edit the following settings:


• autosave filename to define where and under what
name Nuke saves your automatic backup files. By
default, the files are saved in the same folder as your
project files with the extension .autosave. To change
this, enter a full directory pathname in the autosave
filename field.
• autosave after idle for to define how long (in sec-
onds) Nuke waits before performing an automatic
backup after you have left the system idle.
• force autosave after to define how long (in seconds)
Nuke waits before performing an automatic backup
regardless of whether the system is idle.
3. Click Save.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 175
Saving Scripts and Recovering Backups

Note If you close the Preferences dialog without clicking Save


Prefs, your changes will only affect the current session of
Nuke.

Note For the automatic backup to work, you must save your script
first so that the autosave can reference the file. We’d hate
for you to lose your work, so please do this early on in the
process!

To turn off automatic backup:


1. Select Edit > Preferences.
The Preferences dialog opens.
2. Set the autosave after idle for and force autosave
after fields to 0.

From now on, Nuke will not perform any automatic backups,
and you are more likely to lose your work in the case of a
system or power failure.

Recovering Backups After experiencing a system or power failure, you are likely
to want to recover the backup files created by Nuke’s
autosave function.

To recover backups:
1. Relaunch Nuke.
A dialog opens that asks you if you want to recover the
autosave file.
2. Click OK.

Nuke opens the backup file for your use.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 176
Loading Image Sequences

There may be times when you don’t want to load the


autosave file and rather need to load the last saved version.
For example, consider a situation where you modified a
script, but decided not to commit the changes and so exited
Nuke without saving. In all likelihood Nuke autosaved some
or all of your changes, in which case if you open the
autosaved file you will not be working on the original script,
as intended. If you accidentally open an autosaved script,
then simply close it and reload the last saved version.

Loading Image When you are ready to start compositing, you may want to
Sequences 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.

To import an image sequence:


1. Select Image > Read (or press R over the Nuke window).
A Read node is inserted in the Node Graph.

Browse to the image sequence you want to import.


For instructions on using the file browser, see “Using the
File Browser” on page 145. Select the file you want to

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 177
Loading Image Sequences

open. If you want to open several files at the same time,


Ctrl+click (Mac users Cmd+click) on the files. Click Open.
Nuke imports the image sequence and displays it as a
thumbnail on the Read node. Generally, the Read node
does not reformat or resize the sequence in any way, and
the node’s properties panel is updated to display the
native resolution and the frame range for the sequence.
Note that the format and proxy format fields in the
controls indicate the format of the images, they do not
cause the images read from files to be resized to this
format.

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

Note The maximum image size the Nuke Viewer can display is
2^28 = 268,435,456 pixels. This is the same as 16k x 16k,
32k x 8k, 64k x 4k, or 128k x 2k. If your image is larger than
this, it will be resized and you will get the following warning:
"Viewer image is clipped to <size> x <size>!"
For example, if your image resolution is 60,000 x 4473,
Nuke is able to display the image because the number of
pixels is less than 2^28. However, if the resolution is
60,000 x 4474 (more than 2^28 pixels), the image will be
resized to 59998 x 4474.
In addition to the Viewer, this limit is also applied to the
bounding box of the images being passed between each
node.
2. If you have a proxy version of the image sequence,
click the proxy field’s folder icon and navigate to the

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 178
Loading Image Sequences

proxy version. Select Open. If you don’t have a proxy


version, don’t worry: Nuke will create one on the fly
according to the proxy scale or proxy format settings
you specified in the Project settings.
The proxy file does not need to match the proxy resolu-
tion in use. Depending on your settings, either the full-
res or proxy file will be scaled to the required proxy size.
For more information, see “Read Nodes and Proxy Files”
on page 164.

Note QuickTime .mov files may appear different in Nuke relative to


Apple’s Final Cut Pro, because Final Cut Pro introduces a
gamma compensation based on assumptions about the
content of the files and the viewing environment.

Note QuickTime is only supported by default on 32-bit Windows


and Mac OS X.
To load QuickTime files on Linux, you need to use the prefix
ffmpeg: before the file path and file name, for example,
ffmpeg:/users/john/job/FILM/MG/final_comp_v01.####.mov.
This way, Nuke will use its reader that is based on the
FFmpeg open source library to decode QuickTime files. Note
that we are using this open source library to encode the
output images, so image data may be subject to colorspace
and transform shifts dependant on the codec employed.
On 64-bit Windows, you cannot load QuickTime files. As a
workaround, you can use the 32-bit version of Nuke to load
your files and convert them to another file format.

Note AVI files can be supported by default or only via Nuke’s


reader that is based on the FFmpeg open source library. If
you get an error when using AVI files in Read nodes, you may
need to use the prefix ffmpeg: before the file path and file

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 179
Loading Image Sequences

name, for example, 


ffmpeg:\z:\job\FILM\IMG\final_comp_v01.####.avi.

Note On Linux, the Nuke EXR reader uses a memory-mapping


function to improve performance reading PIZ-compressed
EXR files. However, some customers have experienced
hanging when reading large (frame size and number of
channels) PIZ-compressed EXR files across an NFS network.
If you experience this problem, you can tell Nuke not to use
the mmap function by enabling this option. You can set it on
a case by case basis or use a knobDefault in your init.py to
always have it disabled. For more information on
knobDefault, see “Setting Default Values for Controls” on
page 769.

Loading Images from To load an image, you can also drag and drop the image into
an External File the Node Graph from an external file browser (such as
Browser Windows Explorer or Mac OS X Finder). To load an entire
image sequence this way, drag and drop the directory that
contains the images into the Node Graph.

Naming Conventions The file names of image sequences generally end in a number
before the extension, for example image0001.rgb,
image0002.rgb, image0003.rgb, and so on. When browsing
for files like this, you may notice that the sequence appears
as image####.rgb. Here, #### is Nuke’s way of indicating
that the number is in a 4-digit incremental format. For a 3-
digit format, such as image001.rgb, the frame number
variable would be ###.

Nuke’s File Browser also understands unpadded file names,


such as image1.rgb, image2.rgb, image3.rgb, and so on. They

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 180
Loading Image Sequences

appear as image#.rgb.

Changing the Relation By default, Nuke assumes an exact relation between the
Between the Current current frame processed, and the frame read in. For example,
Frame and the Frame at frame 15, Nuke reads in image.0015.rgb. However, you
Read in can change this behaviour using the frame parameter on the
Read node. For instance, if you have a sequence that runs
from image.0500.rgb to image.1000.rgb, you may want to
read in image.0500.rgb at frame 1. Nuke lets you do this via
expressions, specified start frames, and constant offsets.
Each method is described below.

Using Expressions
1. Select Image > Read to import an image sequence.
2. In the Read node controls, set the frame pulldown menu
to expression. Enter an expression in the field on the
right. The expression changes the relation between the
current frame and the frame read in.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 181
Loading Image Sequences

For example, if your clip begins from image.0500.rgb and


you want to place this first frame at frame 1 rather than
frame 500, you can use the expression frame+499. This
way, 499 frames are added to the current frame to get
the number of the frame that’s read in. At frame 1,
image.0500.rgb is read in; at frame 2, image.0501.rgb is
read in; and so on.
Another example of an expression is frame*2. This
expression multiplies the current frame by two to get the
number of the frame that’s read in. This way, only every
other frame in the clip is used. At frame 1,
image.0002.rgb is read in; at frame 2, image.0004.rgb is
read in; at frame 3, image.0006.rgb is read in; and so on.

Specifying a Start Frame for a Clip


1. Select Image > Read to import an image sequence.
2. In the Read node controls, set the frame pulldown menu
to start at. Enter a start frame number in the field on
the right. This specifies the frame where the first frame
in the sequence is read in. In other words, all frames are
offset so that the clip starts at the specified frame.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 182
Loading Image Sequences

For example, if your sequence begins from


image.0500.rgb and you enter 1 in the field,
image0500.rgb is read in at frame 1. Similarly, if you
enter 100 in the field, image0500.rgb is read in at frame
100.

Offsetting All Frames by a Constant Value


1. Select Image > Read to import an image sequence.
2. In the Read node controls, set the frame pulldown menu
to offset. Enter a constant offset in the field on the
right. This constant value is added to the current frame
to get the number of the frame that’s read in.

For example, if your clip begins from image.0500.rgb and


you want to place this first frame at frame 1 rather than
frame 500, you can use 499 as the constant offset. This
way, 499 is added to the current frame to get the frame
that’s read in. At frame 1, image.0500.rgb is read in; at
frame 2, image.0501 is read in, and so on.
You can also use negative values as the constant offset.
For example, if you use the value -10, Nuke will subtract
ten from the current frame to get the frame that’s read

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 183
Reformatting Image Sequences

in. At frame 20, image.0010.rgb is read in; at frame 21,


image.0011.rgb is read in; and so on.

Reformatting When you import image sequences, Nuke stores their format
Image Sequences settings and makes them available to the Reformat node.
You can then use the Reformat node to resize and reposition
your image sequences to a different format. Reformat nodes
also allow you to use plates of varying image resolution on a
single script without running into issues when combining
them.

To insert a Reformat node:


1. Make sure the Read node you added is currently
selected.
2. Select Transform > Reformat.
The Reformat node is inserted in the script, and its prop-
erties panel opens.

3. From the output format pulldown menu, select the


format to which you want to output the sequence. If the
format does not yet exist, you can select new to create a
new format from scratch. The default setting,
[root.format], resizes the image to the format indicated
on the Project settings dialog box.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 184
Loading Nuke Scripts

4. You can now use the same Reformat node for any other
Read nodes in the script. Simply select the Reformat
node and Edit > Copy. Select another Read node in the
script and Edit > Paste.

Loading Nuke When you have built a script and saved it and want to come
Scripts back to it later, you need to load in an entire script file. You
recognize Nuke’s script files from the extension .nk (for
example firstscript.nk).

To load a script:
1. Select File > Open (or press Ctrl/Cmd+O).
The Script to open dialog appears.
2. Browse to the script you want to open. For instructions
on using the file browser, see “Using the File Browser” on
page 145.
3. Click Open.

Closing Nuke To close a script:


Scripts 1. Select File > Close (or press Ctrl/Cmd+W).
2. If you have made any unsaved changes to the script,
Nuke prompts you to select whether to save them. Click
Yes to save your changes or No to ignore them.
Nuke is quit and relaunched, as though you ran it again.
It does everything it does at start-up, apart from dis-
playing the splash screen. Therefore, you can use Ctrl/
Cmd+W as a quick way to clear memory, reread plug-in
paths, and reload the init.py and menu.py files. (The
init.py and menu.py files are files that Nuke runs at

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 185
Defining Frame Ranges

start-up and can be used for configuring Nuke. You may


want to reload these files if you have made any changes
to them.)

Defining Frame Several dialogs in Nuke, such as the Frames to render and
Ranges Frames to flipbook dialogs, prompt you for a frame range. To
define one, you need to enter a starting frame and an ending
frame, separated by a dash. For example, to restrict an
action to frames 1, 2, 3, 4, and 5, you would use 1-5 as the
frame range.

The following table gives you more examples of frame ranges


you can define.

Frame Range Expands To


3 3
-3 -3
1348 1, 3, 4, 8
1-10 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
-3-4 -3, -2, -1, 0, 1, 2, 3, 4
-8--5 -8, -7, -6, -5
1-10×2 1, 3, 5, 7, 9
(frame range from 1 to 10 in
steps of 2)

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 186
File Name Search and Replace

Frame Range Expands To


1-10×3 1, 4, 7, 10
(frame range from 1 to 10 in
steps of 3)
1-4×1 8-10×1 12-14×1 1, 2, 3, 4, 8, 9, 10, 12, 13, 14
(multiple ranges separated
by spaces)

You can use the above ways of defining a frame range


everywhere in Nuke. In addition to dialogs, they can be used
on the command line (where any frame ranges should be
preceded by the -F switch) and in Python statements. For
more information, see “Command Line Operations” on
page 817 and “Setting Frame Ranges Using Python” on
page 774.

File Name Search With the Search and Replace function, you can quickly
and Replace replace all or part of file names or file paths in any node with
file or proxy controls (for example in Read and Write
nodes).

To search for a file name or file path and replace it:


1. Select the node(s) where you want to replace all or part
of a file name or file path.
2. Select Edit > Node > Filename > Search and Replace.
OR
Press Ctrl+Shift+/ (Mac users press Cmd+Shift+/).
3. In the dialog that opens, enter the string you want to
search for and the string you want to replace it with.
Click OK.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 187
Displaying Script Information

Nuke searches for the string in the selected nodes and


replaces it with the new string.

Note You can also enter expressions into the Search and Replace
dialog. Just remember that the search field in the dialog only
takes regular expressions. Any characters that have specific
meanings in regular expressions, such as [ and ], need to be
preceded by the \ character. For example, [getenv HOME]
would need to be entered as \[getenv HOME\].
You can also pass flags alongside the expression itself to
control how the expression behaves. For example, to
perform case-insensitive searches, you can enter (?i) in the
beginning of the expression or after one or more whitespace
characters.

Displaying Script To display script information, such as the node count,


Information channel count, cache usage, and whether the script is in full-
resolution or proxy mode, do the following:
1. Select File > Script Info (or press Alt+I).
The script information window opens.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 188
Grouping Nodes in the Node Graph

2. If you make changes to your script while the window is


open, click update to update the information.
3. To close the information window, click close.

Grouping Nodes in You can group nodes in the Node Graph using the Backdrop
the Node Graph 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 You can use the Backdrop node to visually group nodes in
the Backdrop Node 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 colors and titles. This makes it easier

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 189
Grouping Nodes in the Node Graph

to find a particular node in a large node tree, for example.

Figure 4.1: Nodes grouped in the Node Graph with Backdrop


nodes.

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.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 190
Grouping Nodes in the Node Graph

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

Drag here to move the box and the


nodes inside it.

Drag here to resize the box.

4. To change the color of the box, open the Backdrop


node’s controls by double-clicking on the title bar, then
click the left color button and pick a new color with the
color picker that appears.

5. To change the title of the box, enter a new name for the
Backdrop node in the node’s controls.

6. If you later want to remove both the box and the nodes
inside it, click on the title bar and press Delete. Ctrl/
Cmd+clicking on the title bar and pressing Delete only
removes the box and leaves the nodes untouched. To
remove the nodes and leave the box untouched, click on

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 191
Grouping Nodes in the Node Graph

the triangle in the lower right corner of the box and


press Delete.

Grouping Nodes with You can use the Group node to nest multiple nodes inside a
the Group Node single node.

To group nodes with a Group node:


1. Select all the nodes you want to nest inside the Group
node.
2. If you want to replace the original nodes with the Group
node, select Edit > Node > Group > Collapse To
Group (or press Ctrl/Cmd+G on the Node Graph).
If you want to keep the original nodes in the layout in
addition to the Group node, select Edit > Node > Group
> Copy Nodes To Group (or press Ctrl/Cmd+Alt+Shift+G
on the Node Graph).

Edit > Node > Edit > Node >


Group > Col- Group > Copy
lapse To Group Nodes To

Ctrl/Cmd+G Ctrl/Cmd+
Alt+Shift+G

The selected nodes are nested into a group. The internal


structure of the Group node is shown on a separate tab that
opens.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 192
Grouping Nodes in the Node Graph

Tip As an alternative to Edit > Node > Group > Collapse to


Group, you can also select Other > Group from the Toolbar
or the Node Graph right-click menu.

To view the nodes nested inside a Group node:


In the Group node’s controls, click the S button (short for
Show) in the top right corner.

A new tab that contains the nested nodes opens.

To ungroup nodes:
1. Select the Group node in the Node Graph.
2. Select Edit > Node > Group > Expand Group (or press
Ctrl/Cmd+Alt+G).
The Group node is replaced with the nodes that were
nested inside it.

OR
1. In the Group node’s controls, click the S button in the top
right corner.

A new tab that contains the nested nodes opens.


2. Copy the nodes from the new tab into your script. If you
want to lock the connections between the grouped nodes

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 193
Adding Notes to the Node Graph

so that they cannot be accidentally disconnected during


the copy-paste operation, check lock all connections in
the Group node’s controls.
3. Delete the unnecessary Group node from your script.

Adding Notes to Using the StickyNote node, you can add notes to the Node
the Node Graph Graph. The notes can be any text or HTML mark-up. Usually,
they are made as annotations to the elements in the node
tree.

To add a note to the Node Graph:


1. Click on the part of the Node Graph where you want to
add a note.
2. Select Other > StickyNote. A note box appears in the
Node Graph.

3. In the StickyNote controls, enter your note in the label


field. If you like, you can use HTML mark-up. For
example,
• to have a note appear in bold, you can use <b>my
note</b>. This would appear as my note.
• to have a note appear in italics, you can use <i>my
note</i>. This would appear as my note.
• to add an icon to your note, you can use <img src="Col-
orwheel.png"/>. This adds the Nuke color wheel icon.
You can also use your own icons in the same way as
long as you save them in your plug-in path directory.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 194
Using the Precomp Node

Most common image formats will work, but we recom-


mend using PNG files.

Using the Precomp The Precomp node is like a Group node, but its content is
Node stored in an independent .nk file. This allows you to save a
subset of the node tree as a separate .nk script, render the
output of this saved script, and read the rendered output
back into the main comp as a single image input.

Precomp nodes can be useful in at least two ways. Firstly,


they can be used to reduce portions of the node tree to pre-
rendered image inputs. This speeds up render time, as Nuke
only has to process the single image input instead of all the
nodes that were used to create it. Because the original
nodes are saved in a separate .nk script, you also maintain
access to them and can adjust them later if necessary.

Secondly, Precomp nodes enable a collaborative workflow.


While one artist works on the main comp, others can work on
the sections that have been exported using the Precomp
node. These sections can be edited, versioned, and managed
independent of the main comp. For example, say you have a
comp that involves a complex, multi-layered CG render. A 3D
artist can produce this as a separate script that the

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 195
Using the Precomp Node

compositor finishing the shot then reads in using a Precomp


node. This way, the 3D artist can modify and re-render the
CG element portion of the comp without having to share the
main comp with the compositor.

Creating Precomp Whether you want to use the Precomp node to speed up
Nodes rendering or to enable a collaborative workflow, the process
of creating the Precomp is the same.

To create a Precomp node:


1. Select the nodes you want to include in the separate pre-
comp script. If you select a Group node, the nodes nested
inside it will be copied into the precomp script.
2. Select Other > Precomp (or press Ctrl/Cmd+Shift+P on
the Node Graph).
The Precomp Nodes dialog opens.

Note If you don't select any nodes when you create a Precomp
node, the Precomp Nodes dialog is not displayed and the
node is left blank. Using the file parameter in the Precomp
controls, you can then browse to an existing script to load
into the Precomp node.
If you have several Write nodes in the existing script and
want to control which of them is used for the output of the

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 196
Using the Precomp Node

Precomp node, you can select Other > Output to insert an


Output node after the Write node you want to use.
If the Precomp node cannot find an Output node in the
script, it looks for a Write node and sets Output node in the
Precomp controls to the name of that node. The Output node
field can also be used later to override what is set as the
Output node in the precomped script. To do so, make sure
you check enable. This check box allows you to toggle
between the output node chosen by default and the output
node you specified in the Output node field.
3. Click the file browser icon next to Precomp script
path, and browse to the directory where you want
to save the precomp .nk script. After the directory path,
enter a name for the precomp script, for example
Precomp1_v01.nk. By default, the precomp script is
saved next to the main script. If the main script has not
been saved, the precomp script is saved in the current
directory.
4. Click the file browser icon next to Precomp render
path, and browse to the directory where you want
to save the rendered output of the precomped nodes.
After the directory path, enter a name for the rendered
image, for example Precomp1_####.exr. If you like, you
can also use version numbers in the name, for example
Precomp1_v01_####.exr.

Important We recommend rendering the image as an exr because that


way Nuke will write the hash value of the incoming node tree
into the rendered file. If the precomp script changes so that
the hashes won’t match, Nuke will then notify you, and you
can update the resulting image. If you use a file format other
than exr, you will not get this notification and the rendered
file is likely to become out of date.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 197
Using the Precomp Node

For more information on hash values, see “What is the hash


value?” on page 711.
5. From the Channels pulldown menu, select the channels
you want to include in the rendered output of the
precomped nodes.
If you later need to adjust this selection, you can do so
by setting the channels on the appropriate Write node
(by default, Write1) in the precomp .nk script.
6. From the Original nodes pulldown menu, select:
• add backdrop to create a backdrop behind the pre-
comped nodes in the Node Graph.
• delete to delete the precomped nodes.
• no change to do nothing to the precomped nodes.
7. Click OK.
Nuke saves the selected nodes in the .nk script specified.
This script will also include input and output nodes, a
Write node, and the current project settings.
In the Node Graph, the selected nodes are replaced with
the Precomp node. Nuke opens the properties of the Pre-
comp node.

Precomp Nodes and Project Settings


When you create a Precomp node, the precomp .nk script
gets its project settings from the main script. The main
script’s project settings are also used whenever the precomp
script is loaded into the main script. Therefore, if you open
the precomp script in a separate instance of Nuke and
change its project settings so that they no longer match the
main script’s settings, your changes do NOT have an effect
when the precomp script is loaded into the main script. If
you want to change the project settings, you should always
do so in the main script rather than the precomp script.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 198
Using the Precomp Node

Using a Precomp Node If you want to use a Precomp node to speed up rendering,
to Speed up Rendering you need have the Precomp node read in the output of the
precomp script.

To render a Precomp node:


1. Create a Precomp node. For more information on how to
do this, see “Creating Precomp Nodes” on page 195.
2. In the Precomp node controls, click Render. Enter a
frame range (for example, 1-100) in the dialog that
opens and click OK.
Nuke renders the output of the precomp script and saves
the resulting image in the Precomp render path direc-
tory you specified when you created the Precomp node.
If you have activated the proxy mode and have specified
a proxy filename in the output node, the rendered image
is a proxy image.
3. If the render finishes successfully, read file for output
is automatically turned on in the Precomp properties.
When this is checked, the Precomp node turns green and
reads in the rendered precomp image rather than
calculates the output of the precomp script. The word
(Read) and the name of the image read in are also
displayed on the Precomp node in the Node Graph to
indicate this.
4. In case there is an error opening the rendered output of
the precomped nodes, select what to do from the
missing frames menu in the Precomp properties:
• error - display an error message on any missing
frames.
• black - replace any missing frames with black.
• checkerboard - replace any missing frames with a
checkerboard image.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 199
Using the Precomp Node

• read input - display the result of the input tree rather


than the rendered file on any missing frames.

When several Precomp nodes are used like this to replace


sections in a large, complex node tree, the render times may
become significantly faster.

Note When rendering the output of the precomp script, Nuke


automatically selects the Write node to use by first looking
for an Output node. If it can't find any Output nodes, it tries
to find a Write node, and sets Output node in the Precomp
node controls to the name of the Write node. If it can't find
any Output or Write nodes, it produces an error.
At any point, the Precomp node properties can be used to
override what is set as the Output node in the precomped
script. To do so, open the Precomp properties and the
advanced controls. In the Output node field, enter the name
of the Write node whose output you’d like to use. Make sure
you also check enable. This check box allows you to toggle
between the output node chosen by default and the output
node you specified in the Output node field.

Tip You can also use Write nodes in a similar manner and have
their output read in from the rendered file rather than
calculated using the nodes upstream. For more information,
see “Using a Write Node to Read in the Rendered Image” on
page 710.

Precomp Revisions The following describes how to open, edit, and reload a
precomp script.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 200
Using the Precomp Node

To view and edit the precomp script:


1. In the Precomp node properties, click Open.
This starts a new Nuke session and loads the precomp
script.
2. Edit the precomp script as necessary.
3. If you are using version numbers in the Write node file
name, select the Write node in the Node Graph and
choose Edit > Node > Filename > Version Up from the
menu bar. This changes the version number in the file
that’s rendered, for example, from
Precomp1_v01_####.exr to Precomp1_v02_####.exr.
4. Render the Write node. Note that if the proxy mode is on
and you have entered a proxy file name for the output
node, Nuke will render a proxy image.
5. Select File > Save New Version (or File > Save As) to
save the script with a new version number, for example,
Precomp1_v02.nk instead of Precomp1_v01.nk.

To reload a revised precomp script:


1. Load the main comp.
2. Make sure the filename in the Precomp node’s file field
matches the current name of the precomp script.
If the precomp script name has been versioned up, you
can simply select the Precomp node and choose Edit >
Node > Filename > Version Up from the menu bar.
This changes the name of the script that is read in, for
example, from Precomp1_v01.nk to Precomp1_v02.nk.
If the precomp script has been saved with a different
name or you want to use a different script as the pre-
comp script, edit the filename in the file field.
3. In the Precomp properties, click Reload.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 201
Using the Precomp Node

Collaborative In this example, a compositor is responsible for the main


Workflow Example comp that will be delivered to the client. A lightingTD is
responsible for providing a multi-layered CG render for use
in the main comp. The following describes how the
compositor and lightingTD could use the Precomp node to
enable a collaborative workflow.

To enable a collaborative workflow:


1. The compositor starts building the main comp.
2. The lightingTD does a render of the CG element and a
comp of the layers, saving the script as cg_v01.nk.

Important Note that we recommend rendering precomp images as exrs.


This way, Nuke will write the hash value of the incoming
node tree into the rendered file. If the precomp script
changes so that the hashes won’t match, Nuke will notify the
user who can then update the resulting image. If you use a
file format other than exr, the user will not get this
notification and the rendered file is likely to become out of
date.
For more information on hash values, see “What is the hash
value?” on page 711.
3. The compositor creates a Precomp node reading from the
file cg_v01.nk, and continues working on the main comp.
4. The lightingTD continues to revise the CG render and the
comp, versioning up the Write node and the precomp
script .nk name. (See “To view and edit the precomp
script:” on page 200.)
When better results are achieved, the lightingTD notifies
the compositor of the new and improved version of the
precomp script.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 202
Working with File Metadata

5. The compositor versions up the Precomp node to the


new, improved version and reloads the precomp script.
(See “To reload a revised precomp script:” on page 200.)

Working with File The nodes in the Metadata menu of the Toolbar let you
Metadata work with information embedded in your images. This
section gives instructions on their usage, teaching you
to view, compare, edit, and render metadata.

Metadata in Nuke Metadata is a set of information about an image embedded


in the image file. This information may include the image’s
original bit depth, width, and height, for example. It can be
attached to the file by the camera used to shoot the images,
and/or edited later.

When Nuke loads an image, it reads in the metadata


embedded in the image. The metadata is then passed down
the node tree so you can view and use it at any point in your
script. For example, you can reference metadata via
expressions. You can also edit or delete existing metadata,
add new metadata to a file, and write the resulting metadata
out to files.

Note Metadata for QuickTime files does not show gamma or bit
depth.

Note When using a Merge node, you can choose which input’s
metadata to pass down the tree. In the Merge controls, set
metadata from to either A or B.

In the MetaData menu of the Toolbar, Nuke features five

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 203
Working with File Metadata

nodes that help you work with file metadata:


• ViewMetaData lets you inspect the metadata passed
down by the input node. See “Viewing Metadata” on
page 203.
• CompareMetaData lets you compare the metadata
between two inputs and view the differences. See
“Comparing Metadata Between Inputs” on page 205.
• ModifyMetaData lets you edit existing metadata in the
input stream, add metadata into the stream, and delete
metadata from the stream. See “Modifying Metadata” on
page 205.
• CopyMetaData lets you copy metadata from one input to
another and filter metadata to exclude some of it. See
“Copying Metadata from One Input to Another and
Filtering Metadata” on page 209.
• AddTimeCode lets you add a timecode to the metadata
passed down by the input node. See “Adding a Timecode
to Metadata” on page 210.

Viewing Metadata To view metadata:


1. Select MetaData > ViewMetaData to insert a View-
MetaData node after the node whose metadata you want
to inspect.
2. In the ViewMetaData properties, you can see a list of the
metadata embedded in the image. This is divided into
keys and their values.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 204
Working with File Metadata

3. To filter the lists of metadata, use the search metadata


for field. For example, if you enter f in the search
metadata for field, only the keys and values that include
the letter f are displayed. By default, the search is done
within both keys and values. If you want to limit to
search to either keys or values only, set within to keys
only or values only. For example, you can view
metadata specific to the input’s file format by entering
the file format (for instance, dpx/) in the search
metadata for field and setting within to keys only.

Note When observing the creation time (input/ctime) of an image,


Windows generally differs from Linux and Mac OS X. This is
due to the different way in which the operating systems deal
with file creation times.

Once you know which keys exist on the input, you can
reference them in expressions. See “Accessing Metadata via
TCL Expressions” on page 212.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 205
Working with File Metadata

Comparing Metadata To compare metadata between two inputs:


Between Inputs 1. From the Toolbar, select MetaData > CompareMeta-
Data to add a CompareMetaData node after the two
nodes whose metadata you want to compare.
2. Connect the nodes you want to compare to the A and B
inputs of the CompareMetaData node.
A list of keys where there is a difference between the
two inputs is shown in the CompareMetaData properties.

Modifying Metadata To add metadata:


1. Select MetaData > ModifyMetaData to insert a Modi-
fyMetaData node after the node whose metadata you
want to add a new key to.
2. In the ModifyMetaData controls, click on the plus (+)
button. A placeholder appears in the metadata box.
3. Double-click on the placeholder under key.

Double-click

The Pick metadata key dialog opens.


4. In the field at the bottom of the dialog, enter a name for
the new key you want to add to the metadata. Click OK.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 206
Working with File Metadata

5. Double-click on the placeholder under data and enter a


value for the new key.
The new key and its value are added to the metadata
being passed through.

To edit metadata:
1. Select MetaData > ModifyMetaData to insert a Modi-
fyMetaData node after the node whose metadata you
want to edit.
2. In the ModifyMetaData controls, click on the plus (+)
button.
A placeholder appears in the metadata box.
3. Double-click on the placeholder under key.
The Pick metadata key dialog opens.
4. Pick the key whose name or value you want to edit and
click OK.
They key is added to the ModifyMetaData properties.
5. In the ModifyMetaData properties, double-click on the
key or its value and edit the information as required.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 207
Working with File Metadata

To remove metadata:
1. Select MetaData > ModifyMetaData to insert a Modi-
fyMetaData node after the node whose metadata you
want to edit.
2. In the ModifyMetaData properties, click on the plus (+)
button. A placeholder is added to the metadata list.
3. Double-click on the placeholder under action and select
remove from the menu that opens.

Double-click
here.

4. Double-click on the placeholder under key.

Double-click here.

The Pick metadata key dialog opens.


5. From the list of existing keys, select the key you want to
remove and click OK.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 208
Working with File Metadata

The node now removes the selected key from the meta-
data, as you can see if you view the metadata in the out-
put.

To edit the list of actions in the ModifyMetaData


properties:
• To perform a new action, click on the plus (+) button.
• To cancel an existing action, select it from the list and
click on the minus (-) button. Note that this only affects
the ModifyMetaData actions, and does NOT delete keys
from the metadata embedded in the input image.
• To move an item up in the list, select it and click on the up
arrow button.
• To move an item down in the list, select it and click on the
down arrow button.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 209
Working with File Metadata

Copying Metadata To copy metadata from one input to another and/


from One Input to or filter metadata:
Another and Filtering 1. Select MetaData > CopyMetaData to insert a
Metadata CopyMetaData node into your script.
2. Connect
• the Image input to the node whose image you want to
pass down the tree.
• the Meta input to the node whose metadata you want
to copy to the output.
3. Set metadata from to one of the following:
• Image+Meta to add the metadata from the Meta input
to the metadata from the Image input. If the inputs
share any common metadata keys, the values taken
from the Meta input override those taken from the
Image input.
• Meta only to only use the metadata from the Meta
input.
• Meta+Image to add the metadata from the Image
input to the metadata from the Meta input. If the
inputs share any common metadata keys, the values
taken from the Image input override those taken from
the Meta input.
• Image only to only use the metadata from the Image
input. This produces the same result as not using a
CopyMetaData at all: both the image and metadata are
taken from the Image input. However, this option can
be useful if you want to filter the metadata to exclude
some of it (see the next step for how to do this).
4. To filter the metadata taken from the inputs, use the
copy only fields under Meta filtering and/or Image
filtering. For example, if you enter f in the copy only
field under Meta filtering, only the keys and values that

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 210
Working with File Metadata

include the letter f are copied from the Meta input. By


default, the search is done within both keys and values. If
you want to limit to search to either keys or values only,
set within to keys only or values only. For example,
you can copy metadata specific to the input’s file format
by entering the file format (for instance, dpx/) in the
copy only field and setting within to keys only.

Adding a Timecode to To add a timecode to metadata:


Metadata 1. Select MetaData > AddTimeCode to insert an
AddTimeCode node into your node tree.
A timecode is added to the metadata being passed
through. By default, the timecode is 01:00:00:00 on the
first frame. It is updated throughout the frame range
according to the input clip’s playback speed, which in
turn is controlled by the fps (frames per second) param-
eter in the project settings. If you change the fps value
in the project settings, the timecode in the metadata is
updated to reflect the change.

2. If you don’t want the timecode on the start frame to be


01:00:00:00, enter a new timecode in the startcode
field.
3. If you want to specify the playback speed manually
rather than get it from the metadata and project

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 211
Working with File Metadata

settings, uncheck get FPS from metadata and enter a


new value in the fps field.
4. If you want to specify a different start frame than the
first frame, check use start frame? and enter a new
value in the start frame field.

If you want to display the timecode on the image, insert a


Text node after the AddTimeCode node and enter [timecode]
in the message field. For more information on referencing
metadata via expressions, see “Accessing Metadata via TCL
Expressions” below.

Rendering Metadata When rendering with the Write node, Nuke lets you write out
metadata into the following file formats: EXR, CIN, DPX, and
JPEG. You cannot write out metadata into any other formats.

When rendering metadata into an EXR file, you can use the
metadata menu in the Write node controls to specify what
to write out:
• no metadata - Do not write out any metadata, except
for metadata that fills required header fields (for
example, filename and bbox).
• default metadata - Write out the timecode, edgecode,
frame rate, and exposure.
• default metadata and exr/* - Write out the timecode,
edgecode, frame rate, exposure, and anything in exr/.
• all metadata except input/* - Write out all metadata,
except anything in input/.
• all metadata - Write out all metadata.

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 212
Working with File Metadata

When rendering any other file format than EXR, Nuke writes
whatever metadata the file format header is known to
support. Therefore, what is written out varies according to
the file format.

Accessing Metadata You can access metadata via TCL expressions in the
via TCL Expressions following ways:
• To get a list of all keys in the incoming metadata, use the
expression [metadata]. For example, if you add a Text
node after an image and enter [metadata] in the
message field, a list of all the keys in the incoming
metadata appears on the image. The values of the keys
are not displayed.
• To get the value of a particular key in the incoming
metadata, use the expression [metadata key]. Replace key
with the name of the key whose value you want to use.
For example, to display the name and location of the
image file on the image, add a Text node after the image
and enter [metadata input/filename] in the message
field.
• To get a filtered list of keys in the incoming metadata,
use the expression [metadata keys filter]. Replace filter
with whatever you want to use to filter the list. You can
use asterisks (*) as wildcards in your filter to substitute
zero or more characters in the key names. For example, to
get a list of all the keys with the letter f in them, use the
expression [metadata keys *f*]. To get a list of all the
keys starting with input/, use the expression [metadata
keys input/*].
By default, the keys are listed on separate lines. To
change this, you can use -s "separator" to have the keys
separated by a separator of your choice. Replace separa-
tor with whatever you want to appear between the differ-

The Foundry Nuke 6.0v5


MANAGING SCRIPTS 213
Working with File Metadata

ent keys. For example, to get a list of all the keys starting
with input/ and separated by spaces, you can use [meta-
data -s " " keys input/*]. To get the same list separated by
commas, use [metadata -s ", " keys input/*].

By default, if you attempt to access metadata that does not


exist in the stream, Nuke returns an empty string. To make
this error instead, use the -e flag before other parameters.

For more information on using expressions, see


“Expressions” on page 713.

Accessing Metadata You can also access metadata using the Python
via Python programming language. For more information, see “Accessing
Node Metadata” on page 781.

The Foundry Nuke 6.0v5


REFERENCE
ach chapter in this section explains in detail a key fea-
E ture of Nuke. You can use the section to familiarize
yourself with the features you are particularly inter-
ested in, or to get answers to specific problems that arise
during compositing.
For information on the features in NukeX, see “NukeX” on
page 891.

Organisation of the These are the topics covered by this section:


Section • Chapter 1, "Reformatting Elements", describes how you
can reformat images through scaling, cropping, and pixel
aspect adjustments. This chapter also covers working
with bounding boxes.
• Chapter 2, "Channels", shows you how to manage image
data using Nuke’s unique 1023-channel workflow.
• Chapter 3, "Merging Images", teaches you how to layer
background and foreground elements together, create
contact sheets, and copy rectangles from one image to
another.
• Chapter 4, "Color Correction and Color Space", explains a
broad sampling of Nuke’s many color correction tools.
• Chapter 5, "Transforming Elements", covers the tools for
changing the size, location, and orientation of an image,
including how to translate, scale, rotate, and skew
elements in 2D and 3D space. This chapter also describes
adding motion blur.
REFERENCE 215
Organisation of the Section

• Chapter 6, "Tracking and Stabilizing", shows how to


generate and edit 2D tracking data for purposes of
removing unwanted motion or applying it to other
elements.
• Chapter 7, "Keying with Primatte", teaches you to use the
blue/greenscreen keyer Primatte in Nuke.
• Chapter 8, "Keying With Keylight", teaches you to use the
keyer tool Keylight in Nuke.
• Chapter 9, "Using RotoPaint", shows how to use Nuke’s
RotoPaint node.
• Chapter 10, "Temporal Operations", explains how to apply
time-based effects like clip retiming and motion blur. This
chapter also explains how to perform editorial tasks, such
as trimming and slipping.
• Chapter 11, "Warping and Morphing Images", teaches you
to use the GridWarp and SplineWarp nodes to warp and
morph images.
• Chapter 12, "Creating Effects", describes how you can
create effects, such as star filter effects, on your images.
• Chapter 13, "Analyzing Frame Sequences", explains how
to use the CurveTool node to analyze and match image
sequences.
• Chapter 14, "3D Compositing", teaches you how to create
and manipulate 3D scenes composed of objects,
materials, lights, and cameras.
• Chapter 15, "Working with Stereoscopic Projects",
describes how to composite stereoscopic material in
Nuke.
• Chapter 16, "Previews and Rendering", teaches you how
to write out image sequences from scripts in order to
preview results or create final elements.
• Chapter 17, "Expressions", explains how to apply
expressions or scripting commands to Nuke parameters.

The Foundry Nuke 6.0v5


REFERENCE 216
Organisation of the Section

• Chapter 18, "Setting Interface Preferences", discusses the


available preference settings that you can use to make
behaviour and display adjustments to the interface.
• Chapter 19, "The Script Editor and Python", teaches you
to use Python in Nuke’s Script Editor to automate long
procedures, for example.
• Chapter 20, "Configuring Nuke", explains how to set up
Nuke for multiple artists working on the same project.

The Foundry Nuke 6.0v5


REFORMATTING ELEMENTS 217
Reformatting Images

1 REFORMATTING ELEMENTS

This chapter teaches you how to reformat images through


scaling, cropping, and pixel aspect adjustments. You will also
learn to adjust bounding boxes to minimize processing and
rendering times.

Reformatting This section discusses scaling operations with specific


Images 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.

Using the Reformat You can use the Reformat node for three different purposes:
Node 1. To generate image sequences that match a desired image
format in terms of both resolution and pixel aspect ratio
(the width to height ratio of the format’s individual pix-
els).
2. To create postage stamps (low resolution frames which
you might post to the web in order to storyboard a
sequence). The node scales the frame until it fits inside a
rectangle whose dimensions you specify. It also sets
pixel aspect ratio to one (square).
3. To scale images. The scale factor will be rounded slightly
so that the output image has an integer number of pixels
in the direction you choose in the Reformat node’s
controls.

The Foundry Nuke 6.0v5


REFORMATTING ELEMENTS 218
Reformatting Images

Converting Images to a Desired Image Format


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.

When creating a new format from scratch, you define the


overall resolution, the cropped resolution (optional) and the
pixel aspect ratio. As you define these parameters, the
Reformat operator graphically displays them for you in the
manner shown below.
full dimensions

pixel dimensions

crop dimensions—only inside


portion will display as image

To create a new output format:


1. Click Transform > Reformat to insert a Reformat node
at appropriate place in your script (generally before a
Write node).
2. Connect a Viewer to the output of the Reformat node so
you can see the effect of your changes.
3. Select new from the output format pulldown menu. The
New format dialog appears.
4. Type a name for the new format in the name field.
5. In the file size fields, type the full output resolution (in
pixels).
6. If you want to crop the full output resolution (for
example, to create a letter box):

The Foundry Nuke 6.0v5


REFORMATTING ELEMENTS 219
Reformatting Images

• Check image area.


• Increment the x field to define the left boundary of the
crop. (The display updates to show you the left bound-
ary of the crop relative to the full-size input.)
• Increment the y field to define the bottom boundary of
the crop.
• Increment the r field to define the right boundary of the
crop.
• Increment the t field to define the top boundary of the
crop.
7. If the destination display device for the image sequence
uses nonsquare pixels, type the appropriate pixel aspect
ratio in the pixel aspect field (for example, if your
destination is a digital video display, type 1.1).

Tip You can also add formats to Nuke via entries to the menu.py
file:
1. Open the menu.py file (located in same directory as your
Nuke executable).
2. Add an entry similar to the following example:
nuke.addFormat ("720 486 0 0 720 486 0.9 NTSC_video")
where the numbers specify, respectively, the format’s full
horizontal resolution, full vertical resolution, left crop
position, bottom crop position, right crop position, top crop
position, and pixel aspect ratio; and where the final text
string designates the format’s name.
3. Save and close the menu.py file. The next time you launch
Nuke the format will be available for selection from the
Project settings dialog, Reformat node properties panel, and
elsewhere.

The Foundry Nuke 6.0v5


REFORMATTING ELEMENTS 220
Reformatting Images

To edit a format:
1. Select the format you wish to edit from the output for-
mat pulldown list, then let the list close.
2. From the same list, select edit. The Edit format dialog
appears.
3. Edit the name, file size, image area, and pixel aspect
fields as necessary.
4. Click OK to save the changes to the format.

To delete a format:
1. Select the format you wish to delete from the output for-
mat pulldown list, then let the list close.
2. From the same list, select delete. The format is removed
from the list.

To apply a format:
1. If necessary, click Transform > Reformat to insert a
Reformat node at appropriate place in your script (gen-
erally before a Write node).
2. Connect a Viewer to the output of the Reformat node so
you can see the effect of your changes.
3. From the type pulldown menu, select to format.
4. Select the format you wish to apply from the output
format pulldown list.
5. From the resize type field to choose the method by which
you preserve or override the original aspect ratio. Select:
• width to scale the original until its width matches the
format’s width. Height is then scaled in such a manner
as to preserve the original aspect ratio.

The Foundry Nuke 6.0v5


REFORMATTING ELEMENTS 221
Reformatting Images

• height to scale the original until its height matches the


format’s height. Width is then scaled in such a manner
as to preserve the original aspect ratio.
• fit to scale the original until its smallest side matches
the format’s smallest side. The original’s longer side is
then scaled in such a manner as to preserve original
aspect ratio.
• fill to scale the original until its longest side matches
the format’s longest side. The input’s shorter side is
then scaled in such a manner as to preserve original
aspect ratio.
• distort to scale the original until all its sides match the
lengths specified by the format. This options does not
preserve the original aspect ratio, so distortions may
occur.
6. When cropping the output, check center to position the
crop area at the center of the frame.
7. Choose the appropriate filtering algorithm from the filter
pulldown list (see “Choosing a Filtering Algorithm” on
page 302).
8. When scaling an image with Key, Simon, and Rifmen
filters, you may see a haloing effect which is caused by
pixel sharpening these filters employ. If necessary, check
clamp to correct this problem.

Creating Postage Stamps


1. Click Transform > Reformat to insert a Reformat node at
appropriate place in your script (generally before a Write
node).
2. Connect a Viewer to the output of the Reformat node so
you can see the effect of your changes.
3. From the type pulldown menu, select to box.

The Foundry Nuke 6.0v5


REFORMATTING ELEMENTS 222
Reformatting Images

4. In the width and height fields, type the output


dimensions. The units are pixels.
5. Use the resize type pulldown menu to choose the
method by which you preserve or override the original
pixel aspect ratio. Select:
• width to scale the original until its width matches the
value in the width field. Height is then scaled in such a
manner as to preserve the original aspect ratio (this
means that the output you specified in height may not
match the result).
• height to scale the original until its height matches the
value in the height field. Width is then scaled in such a
manner as to preserve the original aspect ratio (this
means that the output you specified in width may not
match the result).
• fit to scale the original until its smallest side matches
the corresponding value in width/height. The longer
side is then scaled in such a manner as to preserve
original aspect ratio.
• fill to scale the original until its longest side matches
the corresponding value in width/height. The smallest
side is then scaled in such a manner as to preserve
original aspect ratio.
• distort to scale the original until its sides match the
values in the width/height fields. This option does not
preserve the original aspect ratio, so distortions may
occur.
6. Choose the appropriate filtering algorithm from the filter
pulldown list (see “Choosing a Filtering Algorithm” on
page 302).
7. When scaling an image with Key, Simon, and Rifmen
filters, you may see a haloing effect which is caused by

The Foundry Nuke 6.0v5


REFORMATTING ELEMENTS 223
Reformatting Images

pixel sharpening these filters employ. If necessary, check


clamp to correct this problem.

Scaling Image Sequences


1. Click Transform > Reformat to insert a Reformat node at
appropriate place in your script (generally before a Write
node).
2. Connect a Viewer to the output of the Reformat node so
you can see the effect of your changes.
3. From the type pulldown menu, select scale.
4. In the scale fields, enter scale factors for the width and
the height. To scale both directions together using the
same scale factor, click the 2 button.
5. Use the resize type pulldown menu to choose the
method by which you preserve or override the original
pixel aspect ratio. Select:
• width to scale the original so that it fills the output
width. Height is then scaled in such a manner as to pre-
serve the original aspect ratio.
• height to scale the original so that it fills the output
height. Width is then scaled in such a manner as to pre-
serve the original aspect ratio.
• fit to scale the original so that its smallest side fills the
output width or height. The longest side is then scaled
in such a manner as to preserve the original aspect
ratio.
• fill to scale the original so that its longest side fills the
output width or height. The smallest side is then scaled
in such a manner as to preserve the original aspect
ratio.

The Foundry Nuke 6.0v5


REFORMATTING ELEMENTS 224
Reformatting Images

• distort to scale the original so that both sides fill the


output dimensions. This option does not preserve the
original aspect ratio, so distortions may occur.
6. Choose the appropriate filtering algorithm from the filter
pulldown list (see “Choosing a Filtering Algorithm” on
page 302).
7. When scaling an image with Key, Simon, and Rifmen
filters, you may see a haloing effect which is caused by
pixel sharpening these filters employ. If necessary, check
clamp to correct this problem.

Cropping Elements To crop a frame is to cut out the unwanted portions of the
image area.

To crop elements:
1. Click Transform > Crop to insert a Crop node at appro-
priate place in your script.

The Foundry Nuke 6.0v5


REFORMATTING ELEMENTS 225
Adjusting the Bounding Box

2. Connect a Viewer to the output of the Crop node so you


can see the effect of your changes.
3. Define the crop boundaries:
• In the Viewer, drag on any side of the frame to reposi-
tion it.

• Or, in the Crop properties panel, increment or decre-


ment the box field (x stands for left side, y for bottom
side, r for right side, and t for top side).
4. 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.
5. If you wish to vignette the edges of the cropped portion,
increment the softness field.

Adjusting the The bounding box defines the area of the frame that Nuke
Bounding Box sees as having valid image data. The larger the bounding box
is, the longer it takes Nuke to process and render the

The Foundry Nuke 6.0v5


REFORMATTING ELEMENTS 226
Adjusting the Bounding Box

images. To minimize processing and rendering times, you can


crop the bounding box. Occasionally, the bounding box may
also be too small, in which case you need to expand it.

To adjust the bounding box, you can use the AdjBBox and
CopyBBox nodes. The AdjBBox node lets you both crop and
expand the bounding box edges, whereas with the CopyBBox
node you can copy a bounding box from one input to
another. If needed, you can also add a black outside edge to
the bounding box using the BlackOutside node.

Resizing the Bounding The AdjBBox node lets you expand or crop the edges of the
Box bounding box by a specified number of pixels.

Figure 1.1: Resizing the bounding Figure 1.2: Resizing the bounding
box with the AdjBBox node: An box with the AdjBBox node: A
expanded bounding box. cropped bounding box.

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.
.

The Foundry Nuke 6.0v5


REFORMATTING ELEMENTS 227
Adjusting the Bounding Box

To resize the bounding box:


1. Select Transform > AdjustBBox to insert an AdjBBox
node after the image whose bounding box you want to
resize.
2. Connect a Viewer to the AdjBBox node, so you can see
the effect of your changes.
3. In the AdjBBox 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.

Copying a Bounding Some Nuke operations, such as a merge, can cause an


Box from One Input to expansion of the bounding box area because Nuke does not
Another know that the extra area is going to be black or another
constant color. Often, you can fix this by copying the
bounding box from one of the inputs to the resulting image,
thus cutting off this extra area. For this, you can use the
CopyBBox node.

The Foundry Nuke 6.0v5


REFORMATTING ELEMENTS 228
Adjusting the Bounding Box

Figure 1.3: A bounding box from one input copied on top of


another.

To copy a bounding box:


1. Select Merge > CopyBBox to insert a CopyBBox node
after the node whose bounding box you want to use.
2. Connect the image whose bounding box you want to copy
to the CopyBBox node’s input A, and the image onto
which you want to copy the bounding box to input B.
Nuke copies the bounding box from input A to input B.
Whatever is outside the copied bounding box area in
image B gets replicated towards the edges of the image.

The Foundry Nuke 6.0v5


REFORMATTING ELEMENTS 229
Adjusting the Bounding Box

Adding a Black Outside If you adjust a bounding box with the AdjBBox or CopyBBox
Edge to the Bounding node, you may notice that whatever is outside the bounding
Box box area gets replicated towards the edges of the image. 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.

Figure 1.4: Using the Figure 1.5: Using the


BlackOutside node to add a black BlackOutside node to add a black
edge to the bounding box: A edge to the bounding box: The
cropped bounding box with effect of the BlackOutside node.
replicated edges.

The Foundry Nuke 6.0v5


REFORMATTING ELEMENTS 230
Adjusting the Bounding Box

To add a black outside edge to the bounding box:


1. Select the image whose edges outside the bounding box
you want to fill with black.
2. Choose Transform > BlackOutside to add a
BlackOutside node in an appropriate place in your script.

Nuke fills everything outside the bounding box area with


black.

The Foundry Nuke 6.0v5


CHANNELS 231
Overview

2 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.

Overview Before getting into the actual mechanics of channel


management, it’s important to review some basic concept
about how Nuke processes channels.

Understanding Think of a channel as a container that contains image data.


Channels Once created or read into your composite, the image data
stored in a channel is available downstream in the network
until the value is replaced with something else or the channel
is removed. The channel may even be “empty”—depending on
where you reference it in the compositing network.

Understanding All channels in a script must exist as part of channel set


Channel Sets (Layers) (also called a layer). You’re probably familiar with the default
channel set—rgba—which includes the channels with pixel

The Foundry Nuke 6.0v5


CHANNELS 232
Creating Channels and Channel Sets

values of red, green, and blue, and also the alpha channel for
transparency.

All channels in a composite must belong to at least one


channel set. Some channels, like alpha, may be available in
other sets, too. Channel names always include the channel
set name as a prefix, like this:
set_name.channel_name.

By default, every script has a channel set called rgba. When


you first import an image element, Nuke automatically
assigns its channels to the rgba set—that is, the image
channels are named rgba.red, rgba.blue, rgba.green, and
rgba.alpha.

The rgba set allows for the standard four-channel workflow


of most node-based compositing systems. However, you’re
not limited to these four channels. You can create new
channels and assign them to new channel sets up to the limit
of 1023 channels per script.

Creating Channels It’s important to understand that many types of nodes allow
and Channel Sets 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.

Many nodes feature an output or channels setting, which


lets you direct the output of the current node to a specific
channel set and channel. You can also use the output or
channels list to create new channel sets and channels.

Some nodes do not include an output or channels setting in

The Foundry Nuke 6.0v5


CHANNELS 233
Calling Channels

their parameters. For these, you can connect other nodes,


such as Channel Copy or Shuffle, to create and manage
channel output in the node tree.

To create a new channel set and/or channel:


1. Open the properties panel for the node whose output will
create the new channel.
2. From the output or channels pulldown list, select new.
3. Under Name, enter the name of the channel set, and
under Channels the new channel name.

For example, as shown in the figure above, you would


enter mask and robotvisor to create a new channel
(“robotvisor”) in the channel set named “mask.” If the set
does not already exist, Nuke will create it.
4. Click OK.

Note You can also create new channels with the Shuffle and
ShuffleCopy nodes. These are explained later, under
Swapping Channels.

Calling Channels By default, most nodes in Nuke attempt to process the

The Foundry Nuke 6.0v5


CHANNELS 234
Calling Channels

current channels in the rgba set and put output in those


same channels. However, many nodes also contain an input
list which lets you select the channels you want to process,
and an output list to choose the channel(s) where the results
should be stored.

Some nodes also contain mask controls and a mask input


connector, which let you select a channel for use as a matte
to limit operations such as color corrections. Using these
mechanisms, you can point the output of almost any node in
the script to any available channel.

Input channels

Output channel

The script below attempts to clarify these concepts. Note


the script generates six channels (though it could just as well
generate 1023). The steps below describe how each channel
was created.

The Foundry Nuke 6.0v5


CHANNELS 235
Calling Channels

A B C

Figure 2.1: A six-channel script.

A. The script reads in the foreground, creating three chan-


nels (red, green, and blue), which are by default assigned
to the rgba set.
Channel count: 3
B. A low contrast key (soft) is pulled and assigned to a new
channel set called mattes.
Channel count: 4
C. A high contrast key (hard) is pulled and also assigned to
the mattes set.
Channel count: 5

The Foundry Nuke 6.0v5


CHANNELS 236
Calling Channels

D. The mattes.hard and mattes.soft channels are mixed to


form the final matte (alpha), which is assigned to the rgba
set.
Channel count: 6

Suppose now that you wanted to perform a color correction


using the output of the Soft Matte node as a mask for the
correction. There’s no need to pipe the output from that Soft
Matte node—it already exists in the data stream along with
the other five channels that were created.

You simply attach a color correction node (for example, the


HueCorrect node), then select the appropriate channel from
the mask controls (in this example, mattes.soft). (Again, the
mattes portion of the name indicates the parent channel
set.)

Figure 2.2: Selecting a channel to mask color


correction.

Selecting Input A node’s channels field lets you select one or several
Channels channels for processing.

The Foundry Nuke 6.0v5


CHANNELS 237
Calling Channels

To select a single input channel:


1. Open the properties panel of the node into which you
wish to feed a channel.
2. From the channels field, select none.
3. From the right most channel field—the one which
typically calls the alpha channel—select the single
channel you wish to process.

Single channel

To select multiple input channels:


1. Open the properties panel of the node into which you
wish to feed channels.
2. From the channels field, select the channel set containing
the channels you wish to process.
The set’s channels appear with check boxes.

selected channel set available channels

3. Uncheck those channels which you don’t wish to process.


The node will process all those you leave checked.

Selecting Masks The mask controls in a node’s properties panel let you select
a single channel for use as a matte in a given process
(typically, a color correction). The given process will
thereafter be limited to the non-black areas of the selected
channel.

The Foundry Nuke 6.0v5


CHANNELS 238
Calling Channels

You can use one of the script’s existing channels as the


matte, or attach a mask to the node with a mask input
connector.

You can find mask input connectors on color correction and


filter nodes, such as HueCorrect and Blur. At first, they
appear as triangles on the right side of the nodes, but when
you drag them, they turn into arrows labeled mask You
connect them the same way as any other connectors. If you
cannot see a mask input connector, open the node’s
properties panel and make sure mask is set to none.

Figure 2.3: Using the mask Figure 2.4: Using the mask
input connectors that appear input connectors that appear
on some of the color, filter, on some of the color, filter,
channel, and merge nodes: channel, and merge nodes:
Before dragging the connector. When dragging the connector.

To select a channel for use as a matte from the


mask input:
1. Connect a mask to the node with its mask input connec-
tor.

The Foundry Nuke 6.0v5


CHANNELS 239
Calling Channels

If you cannot see the mask input connector, open the


node’s controls and make sure mask is set to none.

By default, when a mask input is connected, the node


uses the alpha channel from it as a matte.

2. If you don’t want to use the alpha channel as the matte,


select the channel you want to use from the mask
pulldown menu.
3. If you want the mask from the mask input copied into
the predefined mask.a channel, check inject. This way,
you can use the last mask input again downstream. You
can also set a stream of nodes to use mask.a as the
mask, and then change the masking of all of them by
simply connecting a new mask into the mask input
connector of the first node.
4. If necessary, check the invert box to reverse the mask.
5. If the overall effect of the node is too harsh, you can
blend back in some of the input image by adjusting the
mix slider.

To select a channel for use as a matte from the


main input:
1. Make sure nothing is connected to the node’s mask input
connector. If you disconnect a mask input, the mask
input connector disappears, as it is no longer being used.

The Foundry Nuke 6.0v5


CHANNELS 240
Tracing Channels

2. Select the channel you want to use from the mask


pulldown menu.
3. If necessary, check the invert box to reverse the mask.
4. If the overall effect of the node is too harsh, you can
blend back in some of the input image by adjusting the
mix slider.

Tracing Channels You may have noticed that nodes visually indicate the
channels which they are processing (that is, treating in some
way) and passing (that is, conveying without any treatment).
This is done via a system of colored rectangles, which allows
you to trace the flow of channels throughout a script.

Look closer, for example, at the Over node. The wide


rectangles indicate channels which Nuke processes (in this
case, the red, green, blue, and alpha channels). The narrow
rectangles indicate channels that Nuke passes onto the next
node without processing (in this case, the mattes.soft and
mattes.hard).

Figure 2.5: Visual confirmation of extra channels.

Renaming Channels In the course of building your script, you may find it
necessary to replace certain channels in a channel set.

The Foundry Nuke 6.0v5


CHANNELS 241
Removing Channels and Channel Sets

To rename a channel:
1. Open the properties panel for a node which has the
channel selected on the channels, input, or output pull-
down list.
2. Click on the list where the channel is displayed and
choose rename.
The Rename Channel box appears.
3. Enter a new name for the channel and click OK.

Removing Channels When you are done using a channel set or a channel within a
and Channel Sets set, you may wish, for the sake of clarity, to remove it so
that it is no longer passed to downstream nodes. Note that
leaving channels in the stream will not itself cause them to
be computed; only channels required are computed.

To remove a channel set or a channel within a set:


1. Click Channel > Remove to insert a Remove node at the
appropriate point in your script.
2. In the Remove properties panel, select the channel set
you wish to remove from the channels fields.
3. If you don’t wish to remove the entire channel set,
uncheck the boxes corresponding to the channels which
you still wish to be able to call downstream.
4. Click OK to close the properties panel.
The channel set and/or the channels you removed will no
longer be displayed in node parameters downstream from
the Remove node.

Note Removing channel sets and or channels does not free up


space for the creation of new channels and sets. Once you

The Foundry Nuke 6.0v5


CHANNELS 242
Swapping Channels

create a channel it permanently consumes one of the script’s


1023 available channel name slots. You are free, however, to
rename channels and/or assign them new outputs.

Swapping Channels Nuke features two main nodes for channel swapping: Shuffle
and Shuffle Copy. Shuffle lets you rearrange the channels
from a single image (1 input) and then output the result to
the next node in your compositing tree. Shuffle Copy lets you
rearrange channels from two images (2 inputs) and output
the result. Let’s take a look at the ShuffleCopy node first.

Channels from input 1. Channels from input 2.

The channel set the chan-


nels are output to.

Matrix combina-
tion specifies
channels to out-

Figure 2.6: The Shuffle Copy matrix.

Channels from Input 1 The first group of channel boxes are the channels supplied
by input 1 on the node. As shown above, the foreground
element’s default RGBA set is selected.

Channels from Input 2 The second group of channel boxes are the channels
supplied by input 2 on the node.

The Foundry Nuke 6.0v5


CHANNELS 243
Swapping Channels

Channel Outputs The combination of the boxes checked in the channel matrix
create the list of channels that are output to the channel set
selected in the top pulldown menu on the right.

This four channel stream acts as the second set of outputs


from the node. It allows you to output another four channels
from the node, for a total of eight channels of output to
match the possible eight channels of input.

In this case, this second set of outputs has not been utilized.

Tip While not required, it’s good practice to use the first set of
outputs for swapping channels in the current data stream
and the second set of outputs for creating new channels.
This protects the default RGBA set from unintentional
overwriting, and makes it easier for other artists to
understand the workings of your script.

The basic process then for swapping channels is to first


select your incoming channel sets from the 1 in and 2 in (or,
in the case of the Shuffle node, the in 1 and in 2) pulldown
menus. Then, select your outgoing channel sets from the
pulldown menus on the right. Then make the actual channel
swaps by clicking on the resulting matrix.

For example, to take the simplest case, suppose, you wanted


to copy red channel of the RGBA set into its alpha channel.
You would click on the matrix to create the following
configuration.

The Foundry Nuke 6.0v5


CHANNELS 244
Swapping Channels

Figure 2.7: Configuring the channel matrix.

You can see that the matrix makes use of the r channel
(standing for red) twice. It goes out once as the red channel,
and another time as the alpha channel.

Assigning Constants The shuffle nodes also include parameters that let you
assign white (1) or black (0) constants to any incoming
channel. So, for example, to reset the alpha channel to a full-
frame image, you would configure the matrix as follows:

Figure 2.8: Assigning constants to channels.

The Foundry Nuke 6.0v5


CHANNELS 245
Swapping Channels

Creating Swap Channel Finally, note that if the channel set to which you wish to
Sets output channels does not yet exist, you can create it using
the new option on the pulldown menus on the right. Once
you select the new option, you follow the same process for
creating channel sets as is described in the “Creating
Channels and Channel Sets” on page 232.

In Summary The steps below summarize this discussion on swapping


channels.

To swap channels:
1. Click Channel > Shuffle or ShuffleCopy to insert a
Shuffle or Shuffle Copy node. Remember you use Shuffle
when you only want to swap channels in a single
upstream node, and Shuffle copy when you want to swap
channels in two separate nodes, like a foreground and
background branch.
2. Select the incoming channels from the In 1 and In 2
(optional) pull-down lists. You can select up to eight
channels in this manner.
3. Select the channel sets to which you wish to direct the
incoming channels from the pulldown lists on the right.
You can select up to eight channels in this manner.
4. If the outgoing channel set to which you wish to direct
channels does not yet exist, create it using the new
option on the pulldown lists on the right.
5. Click as necessary on the resulting matrix to swap
channels.

Tip If you just need to copy a channel from one data stream into
another, use Channel > Copy, instead of Shuffle Copy. Then,

The Foundry Nuke 6.0v5


CHANNELS 246
Swapping Channels

specify the channel to copy and the destination channel for


output.

The Foundry Nuke 6.0v5


MERGING IMAGES 247
Layering Images Together with the Merge Node

3 MERGING IMAGES

With Nuke, you can merge images in a wide variety of ways.


In this chapter, we teach you how to use the Merge,
ContactSheet, and CopyRectangle nodes. The Merge node is
used for layering multiple images together. The ContactSheet
node lets you create a contact sheet that shows your frame
sequence(s) lined up next to each other in a matrix. The
CopyRectangle node can be used for copying a rectangular
region from one image to another.

Layering Images The Merge node with its compositing algorithms allows you
Together with the to control just how your images are combined.
Merge Node

Note When using most of the available merge algorithms, Nuke


expects premultiplied input images. However, with the matte
operation you should use unpremultiplied images.

To layer images with the Merge node:


1. Select Merge > Merge (or press M on the node graph) to
insert a Merge node after the images you want to layer
together.
2. Connect your images to the Merge node’s A and B inputs.
3. If necessary, you can connect multiple A images to the
Merge node. Once you have got the A and B inputs
connected as instructed in step 2, drag more connectors
from the left side of the Merge node to the images you
want to use as additional A inputs.

The Foundry Nuke 6.0v5


MERGING IMAGES 248
Layering Images Together with the Merge Node

Each input is merged in the order connected, for example


A1, A2, A3, B.
4. Connect a Viewer to the output of the Merge node so
you can see the effect of your merge operation.
5. In the Merge node’s controls, select how you want to
layer the images together from the operation pulldown
menu. The default and the most common operation is
over, which layers input A over input B according to the
alpha of input A. For descriptions of all the available
operations, see “Merge Operations” below.
6. Using the A channels and B channels menus, select
which channels to use from the A and B inputs and which
channels to use as the A and B alpha. If you want to
merge more channels than these and output them into
the same channels, select them from the also merge
pulldown menus and checkboxes.
7. From the output menu, select the channels you want to
write the merge of the A and B channels to. Channels
named in the also merge list are written to the same
output channels.
8. If necessary, you can also adjust the following controls:
• To select which input’s metadata to pass down the tree,
use the metadata from menu. For more information on
file metadata, see “Working with File Metadata” on
page 202.
• To dissolve between the original input B image (at 0)
and the full Merge effect (at 1), adjust the mix slider. A
small light gray square appears on the node in the node
graph to indicate that the full effect is not used.
• If you want to mask the effect of the Merge operation,
select the mask channel from the mask pulldown
menus. To invert the mask, check invert. To blur the
edges of the mask, check fringe.

The Foundry Nuke 6.0v5


MERGING IMAGES 249
Layering Images Together with the Merge Node

Note that you should not use the alpha of the inputs
for the mask. It produces erroneous results (though the
error is often hard to see); you can achieve better
results by turning on alpha masking.
• From the Set BBox to pulldown menu, select how you
want to output the bounding box. The default is union,
which combines the two bounding boxes. You can also
choose intersection to set the bounding box to the
area where the two bounding boxes overlap, A to use
the bounding box from input A, or B to use the bound-
ing box from input B.
• By default, Nuke assumes that images are in linear
color space. However, if you want to convert colors to
the default 8-bit color space defined in the LUT tab of
your project settings (usually, sRGB), check Video col-
orspace. The conversion is done before the images are
composited together, and the results are converted
back to linear afterwards. Any other channels than the
red, green, and blue are merged without conversion.
Checking this option can be useful if you want to dupli-
cate the results you obtained from an application that
uses the standard compositing math but applies it to
non-linear images (for example, Adobe® Photoshop®).
In this case, you typically also need to make sure pre-
multiplied is not checked in your Read node controls.
• By default, the same math is applied to the alpha chan-
nel as the other channels. However, according to the
PDF/SVG specification, many of the merge operations
(for example, overlay and hard-light) should set the
alpha to (a+b - ab). This way, the input images remain
unchanged in the areas where the other image has zero
alpha. If you want to enable this, check alpha masking.

The Foundry Nuke 6.0v5


MERGING IMAGES 250
Layering Images Together with the Merge Node

Merge Operations 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. The
available algorithms are listed in alphabetical order.

Tip With many compositing algorithms available, it may


sometimes be difficult to find what you’re looking for in the
operation menu. Luckily, there’s a quick way of finding a
particular operation. With the menu open, you can type a
letter to jump to the first operator that starts with that
letter. To move to the second operation that starts with the
same letter, press the letter again. For example, to select the
screen operation, open the menu and press S twice.

The following table describes each operation and its


associated compositing algorithm. You may want to spend
some time familiarizing yourself with each algorithm in order
to be able to determine which operation to use in each
situation.

The Foundry Nuke 6.0v5


MERGING IMAGES 251
Layering Images Together with the Merge Node

Operation Algorithm Description Illustration Example Uses


atop Ab+B(1- Shows the shape
a) of image B, with
A covering B
where the images
overlap.

average (A+B)/2 The average of


the two images.
The result is
darker than the
original images.

color- darken B Image B gets


burn towards darker based on
A the luminance of
A.

color- brighten Image B gets


dodge B towards brighter based
A on the luminance
of A.

The Foundry Nuke 6.0v5


MERGING IMAGES 252
Layering Images Together with the Merge Node

Operation Algorithm Description Illustration Example Uses


conjoint- A+B(1-a/ Similar to the
over b), over operation,
A if a>b except that if a
pixel is partially
covered by both
a and b, con-
joint-over
assumes a com-
pletely hides b.
For instance, two
polygons where a
and b share some
edges but a com-
pletely overlaps
b. Normal over
will produce a
slightly transpar-
ent seam here.
copy A Only shows This is useful if
image A. you also set the
mix or mask con-
trols so that
some of B can
still be seen.

difference abs(A-B) How much the Useful for com-


pixels differ. Also paring two very
available from similar images.
Merge > Merges
> Absminus.

The Foundry Nuke 6.0v5


MERGING IMAGES 253
Layering Images Together with the Merge Node

Operation Algorithm Description Illustration Example Uses


disjoint- A+B(1-a)/ Similar to the This can be use-
over b, over operation, ful if you want to
A+B if except that if a merge element a
a+b<1 pixel is partially over element b,
covered by both and element a
a and b, disjoint- has element b
over assumes the already held out.
two objects do For example, you
not overlap. For may have a CG
instance, two character whose
polygons that hair, skin, and
touch and share clothing are ren-
an edge. Normal dered separately
over will pro- so that each
duce a slightly object has the
transparent seam other objects
here. held out of the
render.
In this case,
using the over
operation would
produce dark
lines around the
comped objects.
This is because
over does a hold-
out of the back-
ground image,
meaning the
background will
be held out
twice.

The Foundry Nuke 6.0v5


MERGING IMAGES 254
Layering Images Together with the Merge Node

Operation Algorithm Description Illustration Example Uses


divide A/B, Divides the val- This does not
0 if A<0 ues but stops match any pho-
and B<0 two negative val- tographic opera-
ues from becom- tion, but can be
ing a positive used to undo a
number. multiply.

exclusion A+B-2AB A more photo-


graphic form of
difference.

from B-A Image A is sub-


tracted from B.

geometric 2AB/ Another way of


(A+B) averaging two
images.

hard-light multiply if Image B is lit up


A<0.5, by a very bright
screen if and sharp light in
A>0.5 the shape of
image A.

The Foundry Nuke 6.0v5


MERGING IMAGES 255
Layering Images Together with the Merge Node

Operation Algorithm Description Illustration Example Uses


hypot sqrt Resembles the
(A*A+B*B) plus and screen
operations. The
result is not as
bright as plus,
but brighter than
screen.

Unlike the screen


operation, hypot
does not clip
pixel values to a
maximum of 1.0.
in Ab Only shows the Useful for com-
areas of image A bining mattes.
that overlap with
the alpha of B.
Also available
from Merge >
Merges > In.

mask Ba This is the


reverse of the in
operation. Only
shows the areas
of image B that
overlap with the
alpha of A.

matte Aa+B(1-a) Premultiplied


over. Use unpre-
multiplied images
with this opera-
tion. Also avail-
able from Merge
> Merges >
Matte.

The Foundry Nuke 6.0v5


MERGING IMAGES 256
Layering Images Together with the Merge Node

Operation Algorithm Description Illustration Example Uses


max max (A,B) Takes the maxi-
mum values of
both images.
Also available
from Merge >
Merges > Max.

min min (A,B) Takes the mini-


mum values of
both images.
Also available
from Merge >
Merges > Min.

minus A-B Image B is sub-


tracted from A.

multiply AB, A if Multiplies the Used to compos-


A<0 and values but stops ite darker values
B<0 two negative val- from A with the
ues from becom- image of B - dark
ing a positive gray smoke shot
number. Also against a white
available from background, for
Merge > Merges example.
> Multiply.

The Foundry Nuke 6.0v5


MERGING IMAGES 257
Layering Images Together with the Merge Node

Operation Algorithm Description Illustration Example Uses


out A(1-b) Only shows the Useful for com-
areas of image A bining mattes.
that do not over-
lap with the
alpha of B. Also
available from
Merge > Merges
> Out.
over A+B(1-a) This is the This is the most
default opera- commonly used
tion. Layers operation. Used
image A over B when layering a
according to the foreground ele-
alpha of image A. ment over a
background
plate.
overlay multiply if Image A bright-
B<0.5, ens image B.
screen if
B>0.5

The Foundry Nuke 6.0v5


MERGING IMAGES 258
Layering Images Together with the Merge Node

Operation Algorithm Description Illustration Example Uses


plus A+B The sum of image Useful for com-
A and B. Also positing white
available from smoke or fire
Merge > Merges shot against a
> Plus. Note that dark background.
the plus algo-
rithm may result
in pixel values
higher than 1.0.
If you want to
clip values to a
maximum of 1.0,
use the screen
operation
instead.
screen A+B-AB Like plus, but
clips pixel values
to a maximum of
1.0. Also avail-
able from Merge
> Merges >
Screen.
soft-light Image B gets lit
up. Not as
extreme as the
hard-light opera-
tion.

The Foundry Nuke 6.0v5


MERGING IMAGES 259
Generating Contact Sheets

Operation Algorithm Description Illustration Example Uses


stencil B(1-a) This is the
reverse of the
out operation.
Only shows the
areas of image B
that do not over-
lap with the
alpha of A.
under A(1-b)+B This is the
reverse of the
over operation.
Layers image B
over A according
to the matte of
image B.
xor A(1- Shows both
b)+B(1-a) image A and B
where the images
do not overlap.

Tip If you have used older versions of Nuke, you may have seen
Merge operations called diagonal, nl_over, and nl_under.
Diagonal has been renamed and is now called hypot. To get
the results of nl_over and nl_under, you can check Video
colorspace and use over and under.

Generating Contact In order to demonstrate, document or manage what you are


Sheets doing for a project, it can be useful to generate a contact
sheet that shows your frame sequence(s) lined up next to
each other in a matrix. For this, you can use the

The Foundry Nuke 6.0v5


MERGING IMAGES 260
Generating Contact Sheets

ContactSheet node. It generates a contact sheet from all its


inputs or from the frames of one input.

Figure 3.1: A contact sheet generated from the frames


of one image sequence.

To generate a contact sheet:


1. Select Merge > ContactSheet to insert a ContactSheet
node in your script.
2. Connect the image(s) you want to include in your contact
sheet to the numbered input(s) of the ContactSheet node.
If you want to include several different image sequences
in the contact sheet, use multiple inputs. If you want the
contact sheet to include the frames of just one image
sequence, use only one input.

The Foundry Nuke 6.0v5


MERGING IMAGES 261
Generating Contact Sheets

3. Connect a Viewer to the ContactSheet node so you can


see the effect of your changes.
4. In the ContactSheet properties, define the Resolution
(width and height) of the entire contact sheet in pixels.
5. If you want to create a contact sheet from the frames of
one input, check Use frames instead of inputs. In the
Frame Range field, define the frame range you want to
include in the contact sheet.
6. In the rows/columns field, specify into how many rows
and columns you want to arrange the input images or
frames.
7. To adjust the size of the gaps between the images in the
contact sheet, increment or decrement the gap

The Foundry Nuke 6.0v5


MERGING IMAGES 262
Generating Contact Sheets

value.

The gap value set to 0. The gap value set to 50.

8. From the Row Order and Column Order menus, choose


how you want to order the images or frames in the
contact sheet:

Row Order: Row Order: Row Order:


TopBottom TopBottom TopBottom
Column Order: Column Order: Column Order: Snake
LeftRight RightLeft

Row Order: Row Order: Row Order:


BottomTop BottomTop BottomTop
Column Order: Column Order: Column Order: Snake
LeftRight RightLeft

Tip If you want to add any text, such as the frame number, on
top of the images in the contact sheet, insert a Text node
between the input image(s) and the ContactSheet node.

The Foundry Nuke 6.0v5


MERGING IMAGES 263
Copying a Rectangle from One Image to Another

Copying a With the CopyRectangle node, you can copy a rectangle from
Rectangle from One one input on top of another.
Image to Another

Input A

Input B

The output of
CopyRectangle

Figure 3.2: Using CopyRectangle to copy a rectangular


region from input A onto input B.

The CopyRectangle node can also be used to limit effects,


such as color corrections, to a small region of an image. To
do so, you need to use the same image in both input A and B

The Foundry Nuke 6.0v5


MERGING IMAGES 264
Copying a Rectangle from One Image to Another

and only perform the color correction on one input.

Figure 3.3: A rectangle from input A color corrected


and copied on top of input B.

The Foundry Nuke 6.0v5


MERGING IMAGES 265
Copying a Rectangle from One Image to Another

Figure 3.4: Using Figure 3.5: Using the Figure 3.6: Using
the CopyRectangle CopyRectangle node the CopyRectangle
node to limit a to limit a color node to limit a color
color correction to correction to a correction to a
a rectangular rectangular region: rectangular
region: The original Defining a rectangle region:The color
image. with CopyRectangle. corrected rectangle
on top of the
original image.

To copy a rectangle from one image to another:


1. Select Merge > CopyRectangle to insert a CopyRectan-
gle node after the image that has a region you want to
copy (input A) and the image you want to copy the region
to (input B). Create the following setup:

The Foundry Nuke 6.0v5


MERGING IMAGES 266
Copying a Rectangle from One Image to Another

2. In the CopyRectangle controls, use the channels


pulldown menu to select the channels you want to copy
from input A.
3. To define the rectangle you want to copy, resize and
reposition the CopyRectangle overlay in the Viewer. Drag
the center of the overlay to reposition, and the edges to
resize. If you cannot see the overlay in the Viewer, open
the CopyRectangle properties panel and double-click on
the Viewer node in the Node Graph.

repositioning the rectangle resizing the rectangle

4. To control how soft the edges of the rectangle seem,


adjust the softness slider. The higher the value, the
softer the edges.

low softness value high softness value

5. To dissolve between the full CopyRectangle effect and


input B, adjust the mix slider.

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 267
Making Tonal Adjustments

4 COLOR CORRECTION AND COLOR SPACE

This chapter explains how to use Nuke’s color correction


nodes to adjust the appearance of the images in your
composites. Specifically, you’ll learn how to:
• Make tonal adjustments.
• Make basic contrast, gain, gamma, and offset
adjustments.
• Make hue, saturation, and value adjustments.
• Apply masks to color corrections.
• Convert elements into nonnative color spaces.
• Apply grain.

These topics provide a good overview of Nuke’s color-


correction nodes; however not all options are covered here.
Look to Nuke’s online help for instructions on using the
other nodes found under the Color icon in the toolbar.

Making Tonal Defining tonal range (the blackpoint, whitepoint, and neutral
Adjustments value) is typically the first step in color correcting a clip.
Tonal range adjustments often improve contrast, but more
importantly, they set the stage for subsequent color
corrections by properly dividing the colorspace into shadow,
midtone, and highlight regions.

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 268
Making Tonal Adjustments

Figure 4.1: Before tonal Figure 4.2: After tonal


adjustment. adjustment.

Several of Nuke’s color correction effects offer tonal


adjustment tools. Of these, Grade and Histogram are
probably the most intuitive to operate.

Using Histograms The properties panel for the Histogram node includes a
window that graphs the number of pixels at each brightness
level. This is a useful gauge to see whether an image has a
good distribution of shadows, midtones, and highlights.
Pixel count

Brightness
Figure 4.3: The histogram maps the distribution of
shadows, midtones, and highlights.

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 269
Making Tonal Adjustments

To define tonal range with the Histogram node:


1. Click Color > Histogram to insert a Histogram node at
the appropriate place in your script.
2. Connect a Viewer to the output of the Histogram node so
you can see the effect of your changes.
3. Drag the leftmost input range slider till it roughly lines
up with the initial boundary of the histogram.
4. Drag the rightmost input range slider till it roughly lines
up with the final boundary of the histogram.
5. Drag the middle input range slider to define the midtone,
or neutral, value.

Sampling White and The Grade node lets you define white and black points by
Black points sampling pixels from a Viewer frame.

To define tonal range with Grade:


1. Click Color > Grade to insert a Grade node at the appro-
priate place in your script.
2. Connect a Viewer to the output of the Grade node so you
can see the effect of your changes.
3. In the Grade properties panel, use the channels pulldown
list to select the channels you wish to process.
4. Click the blackpoint parameter’s color swatch.
The eye dropper icon appears.
5. In the Viewer, press Ctrl/Cmd+Shift while clicking on the
pixel you want to define as the blackpoint (typically the
darkest pixel).
6. Click the whitepoint parameter’s color swatch. The eye
dropper icon appears.

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 270
Making Tonal Adjustments

7. In the Viewer, press Ctrl/Cmd+Shift while clicking on the


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

Making Basic Adjustments to contrast, gamma, gain, and offset often


Corrections comprise the bulk of the work in color correction. Some
artists prefer to makes these adjustments via sliders; others
prefer curves (which represent the range of color values in
an image.) Nuke’s ColorCorrect and ColorLookup nodes offer
tools to suit either preference.

Figure 4.4: Original. Figure 4.5: Contrast boost.

Figure 4.6: Original. Figure 4.7: Gain boost.

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 271
Making Tonal Adjustments

Figure 4.8: Original. Figure 4.9: Gamma boost.

Figure 4.10: Original. Figure 4.11: Offset boost.

Using Sliders 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.

To adjust contrast, gain, gamma or offset with the


ColorCorrect node:
1. Click Color > ColorCorrect (or press C) to insert a Col-
orCorrect node at the appropriate place in your script.
2. Connect a Viewer to the output of the ColorCorrect node
so you can see the effect of your changes.
3. In the ColorCorrect properties panel, use the channels
pull-down list to select the channels you wish to process.

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 272
Making Tonal Adjustments

4. 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.

5. Remember too that you can use the color sliders to apply
any of the corrections on a per channel basis.

Using Color Curves If you prefer to work with color curves, you can use the
ColorLookup node to make contrast, gamma, gain, and offset
adjustments (and, in fact, many others). Color curves refer to
line graphs of a given color 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.

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 273
Making Tonal Adjustments

new brightness values whitepoint

blackpoint

original brightness

As Figure 4.12 shows, you can edit the ColorLookup node’s


color 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

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 274
Making Tonal Adjustments

Figure 4.12: Corrections Figure 4.13: Corrections


through the ColorLookup through the ColorLookup
node’s color curves: Contrast node’s color curves: Gain boost
boost

Figure 4.14: Corrections Figure 4.15: Corrections


through the ColorLookup through the ColorLookup
node’s color curves: Gamma node’s color curves: Offset
boost boost

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 275
Making Tonal Adjustments

To make basic corrections with the ColorLookup


node:
1. Click Color > ColorLookup to insert a ColorLookup node
at the appropriate place in your script.
2. Connect a Viewer to the output of the ColorLookup node
so you can see the effect of your changes.
3. In the ColorLookup properties panel, click red, green,
blue, or alpha if you want to limit the subsequent
operations to a particular channel.
You can select multiple curves in order to edit one curve
with reference to another). Otherwise, select the master
curve (which represents all channels).
4. In the Viewer, drag the cursor over the pixels you want
to sample for the correction. In the ColorLookup
properties panel, press Ctrl+Alt (Cmd+Alt on a Mac) while
clicking on the curve to set points at the places where
the red, green, and blue lines intersect with the color
curve.

sampled pixel
values

Figure 4.16: Viewing values from a sampled color.

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 276
Making Hue, Saturation, and Value Adjustments

5. Edit the position of the points and adjust the tangent


handles to adjust the curve shape for the color
correction.
As an alternative to steps 4 and 5, you can use the
source control to pick a source color for adding points.
Then, use target to pick a destination color. Finally, do
one of the following:
• Click Set RGB to add points on the red, green, and blue
curves, mapping source to target.
• Click Set RGBA to add points on the red, green, blue,
and alpha curves, mapping source to target.
• Click Set A to add points on the alpha curve, mapping
source to target.
You can use these controls to match shadow, midtone,
and highlights on two plates, for example. Set source to
shadow rgb in one, target to shadow rgb in the other,
then press Set RGB. Same for midtone and highlight
areas.

Making Hue, For certain color correction tasks like spill suppression, you
Saturation, and ideally want to influence only a very narrow range of color
values. For such tasks, it’s often helpful to use effects that
Value Adjustments employ the Hue, Saturation, and Value (HSV) color model. As
its name indicates, the HSV color model breaks color into
three components:
• Hue, which refers to the color’s location on the traditional
color wheel.
• Saturation, which refers to the extent to which the color
has “soaked up” its hue.

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 277
Making Hue, Saturation, and Value Adjustments

• Value, which refers to the brightness of the color..

Figure 4.17: Original. Figure 4.18: Hue shift.

Figure 4.19: Original. Figure 4.20: Saturation


decrease.

Figure 4.21: Original. Figure 4.22: Value decrease.

Nuke offers effects that allow you to correct the hue,


saturation, and value components individually or collectively.

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 278
Making Hue, Saturation, and Value Adjustments

Correcting HSV Nuke’s HSVTool node lets you simultaneously adjust hue,
saturation, and value components from a single properties
panel. It also features a color replacement tool. The main
strength of this node is the precision it offers in limiting
corrections to a narrow swath of colors.

Figure 4.23: Adjusting color Figure 4.24: Adjusting color


within a specific range of pixel within a specific range of pixel
values. values.

For example, suppose you wanted to add a bit more punch to


the waterfront scene by diversifying the rooftop hues. To do
so, you could limit the correction to the rooftop’s ochre-
colored hues by sampling a few pixels, then shift their
values. Because you limited the color range, the surrounding
image would be generally unaffected by the shift.

To make HSV corrections with the HSVTool node:


1. Click Color > HSVTool to insert an HSVTool node at the
appropriate place in your script.
2. Connect a Viewer to the output of the HSVTool node so
you can see the effect of your changes.
3. Limit, as appropriate, the range of colors you want
subsequent corrections to influence:
• In the HSVTool properties panel, click the srccolor color
swatch. Ctrl/Cmd+click on the Viewer to sample a single

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 279
Making Hue, Saturation, and Value Adjustments

color displayed, or Ctrl/Cmd+Shift+drag to sample a


range of colors. To sample a single color from the
node’s input while viewing its output, Ctrl/
Cmd+Alt+click on the Viewer. To sample a region from
the input, Ctrl/Cmd+Alt+Shift+drag on the Viewer.
• The Range sliders on Hue, Saturation, and Bright-
ness clamp to the sampled range.
• For any color component, drag on the Range sliders to
expand the color range as necessary.
• For any color component, drag on the Range Rolloff
slider to fine tune the color range. Doing so, adjusts
the amount of falloff allowed past the limits defined by
the Range sliders.
4. Make the necessary HSV corrections:
• For hue corrections, drag on the Rotation slider to
input color wheel value between 0 and 360.
• For saturation corrections, drag on the Saturation
Adjustment slider to input values between -1 (com-
pletely desaturated to some shade of gray) and 1 (com-
pletely saturated).
• For value corrections, drag on the Brightness Adjust-
ment slider to input values between -1 (black) and 1
(white).

You can also make color replacements using the srccolor and
dstcolor parameters: First sample the color you wish to
replace with the srccolor color swath, then sample the color
which you wish to use as the replacement with the dstcolor
color swath. The color in dstcolor replaces the color in
srccolor throughout the image.

Also, keep in mind that the HSVTool node makes an excellent


keyer. You can use its Hue, Saturation, and Brightness range

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 280
Making Hue, Saturation, and Value Adjustments

sliders to precisely select a range of colors, then use the


channel output pulldown at the bottom of the dialog to
output this selection as a matte channel. This pulldown lets
you specify which color components (hue, saturation, value,
etc.) are added to the matte.

Correcting Hue Nuke’s HueCorrect node lets 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.

range of hues
influenced
new saturation

original saturation
Figure 4.25: Editing the suppression curve.

By choosing which curve you edit and how much of that


curve you alter, you can precisely limit the influence of the
effect.

Suppressing Spill
For the compositor, HueCorrect is obviously of greatest use
in diminishing green, blue, or redscreen spill.

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 281
Making Hue, Saturation, and Value Adjustments

To suppress spill with the HueCorrect node:


1. Click Color > HueCorrect to insert a node at the appro-
priate place in your script.
2. Connect a Viewer to the output of the HueCorrect node
so you can see the effect of your changes.
3. In the HueCorrect properties panel, choose the channels
you want to influence:
• Click sat to influence all channels (red, green, blue, and
alpha) equally.
• Click lum to influence all channels, but with luminance
weighting in effect (meaning that the red channel
receives approximately 30% of the effect; the green,
60%; and the blue, 10%).
• Click red to apply the curve as a lookup on the red
channel only, looking up the pixel's hue on the curve
and then multiplying the red value in the pixel by the
lookup result.
• Click green to apply the curve as a lookup on the green
channel only, looking up the pixel's hue on the curve
and then multiplying the green value in the pixel by the
lookup result.
• Click blue to apply the curve as a lookup on the blue
channel only, looking up the pixel's hue on the curve
and then multiplying the blue value in the pixel by the
lookup result.
• Click r_sup to apply a suppression function to reduce
the level of the red channel. While the red curve is used
to directly multiply the red channel by the curve value,
the r_sup curve is used to control the amount that the
red channel is suppressed.
• Click g_sup to apply a suppression function to reduce
the level of the green channel. While the green curve is

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 282
Making Hue, Saturation, and Value Adjustments

used to directly multiply the green channel by the curve


value, the g_sup curve is used to control the amount
that the green channel is suppressed.
• Click b_sup apply a suppression function to reduce the
level of the blue channel. While the blue curve is used
to directly multiply the blue channel by the curve value,
the b_sup curve is used to control the amount that the
blue channel is suppressed.
Note that you can select multiple curves in order to edit
one curve with reference to another.
4. If necessary, drag the cursor over the Viewer to sample
the image pixels that are representative of the part of
the image you want to correct. Then, in the HueCorrect
properties panel, press Ctrl+Alt (Cmd+Alt on a Mac) while
clicking on the curve to plot a particular pixel’s value on
the curve. This lets you see what portion of the curve
you want to edit.
5. Edit the curve as necessary—typically this means
dragging down on control points in the hue region that
you wish to suppress.

Correcting Saturation For the times when you just want to correct the saturation
component and don’t require limiting the correction to any
particular channel, you can use Nuke’s Saturation node. Its
controls are bare bones—basically, just a saturation slider.

To make saturation corrections with the


Saturation node:
1. Click Color > Saturation to insert a Saturation node at
the appropriate place in your script.
2. Connect a Viewer to the output of the Saturation node
so you can see the effect of your changes.

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 283
Masking Color Corrections

3. Drag the saturation slider to make the necessary


corrections.

Masking Color Virtually all the color-correction effects in Nuke include


Corrections mask parameters that lets you limit the correction to the
non-black pixel values of a matte image. For example,
suppose you want to add a blue cast to the following scene
without affecting the buildings.

Original image Color-corrected image


without mask

Color-corrected image
Mask image
limited by mask

Figure 4.26: Masking color-correction operations.

You could create a garbage mask that covers the river, then
boost the red channel’s gamma in the area of the frame that
underlies the mask.

Typically, mask controls are located toward the bottom of


the properties panel. However, in the case of multi-purpose

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 284
Applying Grain

effects like HSVTool, there may be multiple mask controls, so


that you can limit each type of correction with a different
mask.

Figure 4.27: Selecting a mask channel.

To mask a color correction:


1. Open the node’s properties panel and locate the mask
controls.
2. Select the channel you wish to use as the mask from the
pulldown list.
3. If you check inject in the mask controls, the mask from
the mask input is copied into the predefined mask.a
channel. This way, you can use the last mask input again
downstream. You can also set a stream of nodes to use
mask.a as the mask, and then change the masking of all
of them by simply connecting a new mask into the mask
input connector of the first node.
4. If necessary, check the invert box to reverse the mask.
5. To blur the edges of the mask, check fringe.
6. If the overall effect of the node is too harsh, you can
blend back in some of the input image by dragging on the
mix slider.
7. If you want to output only the portion of the frame
underlying the mask, check the (un)premult by box.

Applying Grain Grain matching—ensuring that all of the elements in a

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 285
Applying Grain

composite, including those which were digitally generated,


look like they were shot on the same film stock—is often one
of the final steps in achieving a convincing integration of all
of a composite’s elements. Nuke offers effects for
synthetically creating grain and for reading in practically-
created grain (grain derived from actual film stock).

Figure 4.28: An example of Figure 4.29: An example of


applying grain to an image: applying grain to an image:
Grainless image Grained image

Using Synthetic Grain Nuke offers several nodes for creating synthetic grain:
Dither, Grain, and ScannedGrain. Of these, Dither is the
crudest—it basically just lets you specify the amount of
noise per channel.

Grain includes presets for matching film stock and a means


for controlling the mix between the generated grain and the
backplate. ScannedGrain offers film stock presets, plus
synthetic grain controls for applying practical grain.

To add synthetic grain with the Grain node:


1. Click Draw > Grain to insert a Grain node at the appro-
priate place in your script.

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 286
Applying Grain

2. Connect a Viewer to the output of the Grain node so you


can see the effect of your changes.

3. From the presets pulldown menu, choose one of the film


stock you want to match.
4. Adjust the Size sliders for the red, green, and blue
channels to shrink or enlarge the granules.
5. Adjust the Irregularity sliders to increase or decrease the
random quality of the grain, according to the different
channels.
6. Adjust the Intensity sliders to increase or decrease the
contrast of the grain against the original image.

Using Practical Grain Although Nuke’s ScannedGrain node offers controls for
creating synthetic grain (ones comparable to those just
discussed), it’s main use is for reading in and applying
scanned grain—that is, grain derived from actual film stock.
If your facility has such sequences available, you can read

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 287
Applying Grain

them in and apply them using the ScannedGrain node. You


can also download grain files from our website for this
purpose. Both creating and downloading grain files are
described below, as well as using the resulting grain files
with the ScannedGrain node.

To create film stock sequences:


1. Film a gray card. Only about 50 frames are needed.
2. Scan the film in.
3. Select Image > Read to load the scanned image into
Nuke.
4. Add a Blur node (Filter > Blur) after the image to blur
the image until you cannot see any grain. Then, blur the
image a bit more.
5. Select Merge > Merge to insert a Merge node in your
script. Connect the A input of the Merge node into the
original image, and the B input into the Blur node. Then,
open the Merge controls and select minus from the
operation pulldown menu. The blurred image is
subtracted from the original image.
The purpose of this and the previous step is to subtract
any overall gray level from the grain so that only the
grain is left.
6. Select Color > Math > Add to insert an Add node after
the minus node. In the Add node controls, enter 0.5 in
the value field. This adds a value of 0.5 to all channels.
This step is necessary, because the ScannedGrain node
subtracts 0.5 from the channels when it reads the grain
file (the subtraction is needed to store negative numbers
in most file formats).
7. Select Image > Write to insert a Write node after the
Add node. Render the output. Any file format will do (for

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 288
Applying Grain

example, we have used the .rgb extension in the grain


files on our website).

To download film stock sequences:


1. Select Help > Tutorials.
2. Click on a grain sample to download it. The downloads
are in compressed tar format (tgz). The grain samples are
.rgb files.

To add scanned grain with the ScannedGrain node:


1. Click Draw > ScannedGrain to insert a ScannedGrain
node at the appropriate place in your script.

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 289
Applying Grain

2. Connect a Viewer to the output of the ScannedGrain


node so you can see the effect of your changes.

3. Click the folder icon of the grain field and navigate to


the appropriate film stock sequence. Select Open.
4. If necessary, check the resize box to scale the grain
sequence up or down to match your working resolution.
5. In the min. width field, define a minimum width (in
pixels) that images have to have in order to receive grain.
6. Enter values into the red, green, and blue amount fields
to increase or decrease on a per-channel basis the

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 290
Applying Mathematical Operations to Channels

density of granules. (This is accomplished, crudely


speaking, by boosting or reducing the gain of the grain
sequence.)

Now you’re ready to fine-tune the blending between the


grain and backplate.

To mix the grain and backplate:


1. Drag on the saturation slider to increase or decrease
the intensity of the grain’s hue across all channels.
2. If necessary, you can also use the supplied curve editor
to edit the grain sequence’s color curves. In this manner,
you can alter gain, gamma, contrast, etc. on a per
channel basis. (These curves function in the same manner
as those describe in “Using Color Curves” on page 272).
3. To set a low threshold, based on the input image, below
which the grain will not be subtracted, adjust the
low_clip slider.

Applying Nuke’s Color icon in the toolbar houses a number of nodes


Mathematical which are designed to apply common mathematical
operations to channels. These operations include clamps,
Operations to offsets, inversions, multiplications, and expressions.
Channels

Clamping Channel To clamp a channel’s values is to ensure that its blackest


Values blacks and whitest whites will be visible on an intended
display device. Nuke’s Clamp node lets you assign “legal”
values to colors that are either too light or dark for the

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 291
Applying Mathematical Operations to Channels

intended display device.

Figure 4.30: Clamping black Figure 4.31: Clamping black


and white pixels to “legal” and white pixels to “legal”
values. values.

For this effect, you use Nuke’s Clamp node.

To clamp channel values:


1. Click Color > Clamp to insert a Clamp node at the
appropriate point in your script.
2. Connect a Viewer to the output of the Clamp node so you
can see the effect of your changes.
3. In the Clamp properties panel, use the channels field to
select the channel you wish to clamp.
4. Drag the minimum slider to the legal value. (This has the
effect of causing black values to go gray.)
5. Drag the maximum slider to the legal value. (This has the
effect of causing white values to go gray.)

Offsetting Channel To offset a channel’s values is to add a fixed value to them,


Values which, in effect lightens the whole channel. You can also add
a negative value to a channel, in which case the channel gets

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 292
Applying Mathematical Operations to Channels

darker.

Figure 4.32: Offsetting Figure 4.33: Offsetting


channel values. channel values.

For this effect, you use Nuke’s Add node.

To offset channel values:


1. Click Color > Math > Add to insert a Add node at the
appropriate point in your script.
2. Connect a Viewer to the output of the Add node so you
can see the effect of your changes.
3. In the Add properties panel, use the channels field to
select the channel you wish to offset.
4. Use the value slider to input the value you wish to add to
the channel’s values.
5. If you are using premultiplied input images, you may
want to check (un)premult by and select rgba.alpha
from the pulldown menu. This will simulate doing the
addition before the premultiplication was done.

Inverting Channel To invert a channel is to subtract its values from one, which
Values causes its blacks to become white and its whites to become
black. In the course of building a script, you’ll have frequent

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 293
Applying Mathematical Operations to Channels

need to invert mattes in particular.

Figure 4.34: Inverting channel Figure 4.35: Inverting channel


values. values.

To invert channels you use Nuke’s Invert node.

To invert channel values:


1. Click Color > Invert to insert an Invert node at the
appropriate point in your script.
2. Connect a Viewer to the output of the Invert node so you
can see the effect of your changes.
3. In the Invert properties panel, use the channels field to
select the channel you wish to invert.

Multiplying Channel To multiply a channel’s values is to times them by a given


Values factor, which has the effect of lightening the channel while
preserving the blackpoint. (This operation is also knows as

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 294
Applying Mathematical Operations to Channels

gain.)

Figure 4.36: Multiplying Figure 4.37: Multiplying


channel values. channel values.

For this effect, you use Nuke’s Multiply node.

To multiply channel values:


1. Click Color > Math > Multiply to insert a Multiply node
at the appropriate point in your script.
2. Connect a Viewer to the output of the Multiply node so
you can see the effect of your changes.
3. In the Multiply properties panel, use the channels field to
select the channel whose values you wish to multiply.
4. Use the value slider to input the factor by which to you
want to times the channel’s values.

Applying Expressions Up till now, the discussion has focused on how to apply
to Channel Values simple mathematical formulae—additions, subtractions,
multiplications, etc.—to a channel’s values. Nuke’s
Expression node, however allows you to apply complex
formulae to a channel’s values. The actual syntax for
expressions is rather complex, and thus must be deferred to
Chapter 17, Expressions, on page 713. For now, you can
read about the basics of how to operate the Expression

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 295
Applying Mathematical Operations to Channels

node.

To apply expressions to channel values:


1. Click Color > Math > Expression to insert an Expres-
sion node at the appropriate point in your script.
2. Connect a Viewer to the output of the Expression node
so you can see the effect of your changes.
3. In the Expression properties panel, use the channel
menus and buttons to select the channel to which you
wish to apply an expression.
4. Type the actual expression in the = field next to the
channel.
For example, to assign noise to the red channel, then
boost the gain of that result by 20 you would type (ran-
dom*r)*20.
5. If necessary, you can apply different expressions to
different sets of channels by repeating the above steps
for the other channel menus and buttons.
6. If you need to use a long expression in several fields, you
can use the fields on top of the properties panel for
assigning the expression temporarily to a variable. Enter
your variable on the left side of the = sign, and the
expression on the right. You can then use the variable to

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 296
Transforming the Color Space

represent the expression in the = fields next to the


channels.

Figure 4.38: A checkerboard modified using an


Expression node.

Transforming the Whenever you read a clip into a script, it is automatically


Color Space converted to Nuke’s native color space, which is 32-bit per
channel RGB, a linear format. This conversion takes place
even if the clip you read in is in the Kodak Cineon format,
which is a logarithmic format.

The reverse of this conversion, called a lin-to-log


conversion, also automatically takes place when you write
the processed element back out of the script—that is, Nuke
automatically converts it back into a Cineon element.

Overriding the Default Nuke uses the Kodak-recommended settings when making
Cineon Conversion Cineon conversions in either direction. It’s rare that you
would want to override these settings, but if it becomes

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 297
Transforming the Color Space

necessary you can use Nuke’s log2lin node.

To override the default Cineon conversions:


1. Double-click on the Read node of the Cineon element
whose conversion you wish to override.
2. In the Read properties panel, set the colorspace
pulldown list to linear. This halts the automatic log-to-lin
conversion.
3. Click Color > Log2Lin to insert a log2lin node directly
after the Read node.
4. In the log2lin properties panel, set the operation
pulldown to log2lin.
5. Set black, white, and gamma to the appropriate values.
6. Copy the log2lin node and insert it just before the
element’s Write node.
7. Open up the properties panel of the second log2lin node
and set the operation pulldown list to lin2log. This gives
you the reverse of the conversion you created above.
8. Double click on the element’s Write node.
9. In the Write properties panel, set the colorspace
pulldown list to linear. This halts the automatic lin-to-log
conversion and lets the one you create above have
priority.

Making Other Color You can also convert elements from Nuke’s native color
Space Conversions space to other color spaces more appropriate to a given
process or intended display device. For conversions such as
this, use Nuke’s Colorspace node, which supports RGB, HSV,
YUV, CIE, and CMS formats (and various subformats).

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 298
Transforming the Color Space

To convert an element in Nuke’s native color space


into another color space:
1. Click Color > Colorspace to insert a Colorspace node
into the appropriate place in your script.
2. In the Colorspace properties panel, set the rightmost
pulldown menu in the out controls to the appropriate
standard.
3. Set the pulldown menu in the middle of the out controls
to the appropriate standard.
4. Set the leftmost pulldown menu in the out controls to the
color space of your choice.
5. If you wish to reverse this conversion later in the script:
• Copy the Colorspace node and insert it at the appropri-
ate point in your script.
• Set the out controls to sRGB, D55, and RGB.
• Set the in controls to match the values you entered in
steps 2, 3, and 4 above.
6. If you wish write out the element in the new color space:
• Double click on the element’s Write node.
• In the Write properties panel, set the colorspace pull-
down list to linear. This halts the automatic conversion
and lets the one you create above have priority.

Changing the Viewer By default, a script’s Viewers display images in Nuke’s native
Color Space color space. You can, however, set a script’s Viewers to
display images in non-native color spaces. Changing the
display color space in no way affects your rendered output.
You are applying a display-only lookup table.

The Foundry Nuke 6.0v5


COLOR CORRECTION AND COLOR SPACE 299
Transforming the Color Space

To change the displayed color space for individual


Viewers:
Select the desired color space from the Viewer’s Viewer
process menu on the top right corner. For more information
on this menu, see “Input Process and Viewer Process
Controls” on page 134.

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 300
Transforming in 2D

5 TRANSFORMING ELEMENTS

This chapter explains how to perform a range of 2D and


2.5D spatial transformations. You learn how to apply
geometric transformations (including translations, rotations,
scales, and skews) to elements, and how to add motion blur
using the nodes in the Transform menu.

Note that this chapter discusses how to manually apply


transformations. Chapter 6, "Tracking and Stabilizing"
discusses how to use Nuke’s tracker to automatically
generate and apply transformations.

Transforming in 2D This section describes how to apply 2D transformations


including translations, rotations, scales, and skews to
elements using a number of Nuke nodes.

Using the 2D Several of the nodes discussed in this section display a


Transformation Viewer overlay for executing spatial transformations. This
Overlay overlay is often a faster alternative to the properties panel.
The figure below shows you how to use Nuke 2D

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 301
Transforming in 2D

transformation overlay.

A
B
E
D
C

Figure 5.1: Transformation Overlay.

A. Drag to skew the frame (see “Skewing Elements” on


page 313).
B. Drag to scale the frame uniformly—simultaneously on x
and y (see “Scaling Elements” on page 319).
C. Drag to translate the frame (see “Translating Elements”
on page 317).
Shift+drag to constrain the translation to x or y.
Ctrl/Cmd+drag to reposition the pivot point (the point
that acts as the center to transformation operations).
D. Drag to scale the frame on x.
E. Drag to rotate the frame around the pivot point (see
“Rotating Elements” on page 317). The transform overlay
snaps to typical values. To prevent the snapping, press
Shift while dragging.

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 302
Transforming in 2D

F. Drag to scale the frame on y.

Choosing a Filtering Spatial transformations involve remapping pixels from their


Algorithm original positions to new positions. The question arises as to
what values to assign remapped pixels. In the simplest case,
they retain their original values, but this can create problems
with image quality, particularly in high contrast areas of the
frame. For example, the figure below 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 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
neighbouring pixels.

For example, applying Nuke’s cubic algorithm to the above


rotation, results in a softer, less jagged edge:

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 303
Transforming in 2D

When executing spatial transformations, Nuke lets you


choose from the filtering algorithms described in the table
below.

Note that the curves shown in the table plot the manner by
which each algorithm samples from neighbouring pixels. The
center of each curve represents the value of the remapped
pixel itself, and the rising and falling portions of each curve
represent the amount of sampling that occurs across a five

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 304
Transforming in 2D

pixel radius.

Filter Description Sampling Curve and Output


Impulse Remapped pixels carry
original values.

Cubic Remapped pixels


(default) receive some smooth-
ing.

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 305
Transforming in 2D

Filter Description Sampling Curve and Output


Keys Remapped pixels
receive some smooth-
ing, plus minor sharpen-
ing (as shown by the
negative -y portions of
the curve).

Simon Remapped pixels


receive some smooth-
ing, plus medium sharp-
ening (as shown by the
negative -y portions of
the curve).

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 306
Transforming in 2D

Filter Description Sampling Curve and Output


Rifmen Remapped pixels
receive some smooth-
ing, plus significant
sharpening (as shown
by the negative -y por-
tions of the curve).

Mitchell Remapped pixels


receive some smooth-
ing, plus blurring to hide
pixelation.

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 307
Transforming in 2D

Filter Description Sampling Curve and Output


Parzen Remapped pixels
receive the greatest
smoothing of all filters.

Notch Remapped pixels


receive flat smoothing
(which tends to hide
moire patterns).

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 308
Transforming in 2D

Translating Elements To translate an element is to slide it on x or y.

You can use the Transform, TransformMasked, or Position


nodes to translate elements.

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. For the sake of brevity, this
chapter only discusses the use of Transform, but keep in
mind you can use TransformMasked any time you need to

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 309
Transforming in 2D

process a transformation through a mask. Its mask controls


work in the same fashion as those described in “Masking
Color Corrections” on page 283.

To translate an element using the Transform node:


1. Click Transform > Transform to insert a Transform
node at appropriate place in your script.
2. Connect a Viewer to the output of the Transform node so
you can see the effect of your changes.
3. In the Transform properties panel, increment or
decrement the translate x and y fields to slide the
element along either axis.
Or drag on the center of the transformation overlay.

Using the Position Node


The Position node gives you just bare-bones parameters for
translating an element.

To translate an element using the Position node:


1. Click Transform > Position to insert a Position node at
appropriate place in your script.
2. Connect a Viewer to the output of the Position node so
you can see the effect of your changes.
3. In the Position properties panel, increment or decrement
the translate x and y fields to slide the element along
either axis.

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 310
Transforming in 2D

Rotating Elements To rotate an element is to spin it around the pivot point.

Use the Transform node to rotate elements.

To rotate an element using the Transform node:


1. Click Transform > Transform to insert a Transform
node at appropriate place in your script.
2. Connect a Viewer to the output of the Transform node so
you can see the effect of your changes.
3. In the Transform properties panel, choose the
appropriate filtering algorithm from the filter pulldown
list (see “Choosing a Filtering Algorithm” on page 302).
4. Position the pivot point as necessary:

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 311
Transforming in 2D

• Increment or decrement the center x and y fields to


move the axis in either direction.
• Or press Ctrl (Cmd on a Mac) while dragging on the cen-
ter of the transformation overlay.
5. Increment or decrement the rotate field.
Or drag on the horizontal bar of the transformation
overlay.

Scaling Elements To scale an element is to resize it by adding (upsampling) or


removing (downsampling) pixels.

Nuke offers several nodes for scaling elements. Transform,


whose scaling functions are described below, is designed

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 312
Transforming in 2D

primarily for scaling up or down the background plate in a


composite.

Reformat is designed for writing out elements with specific


resolutions and pixel aspect ratios. “Adding Motion Blur” on
page 319 describes the use of this node.

To scale an element using the Transform node:


1. Click Transform > Transform to insert a Transform
node at appropriate place in your script.
2. Connect a Viewer to the output of the Transform node so
you can see the effect of your changes.
3. In the Transform properties panel, choose the
appropriate filtering algorithm from the filter pulldown
list (see “Choosing a Filtering Algorithm” on page 302).
4. Position the pivot point as necessary:
• Increment or decrement the center x and y fields to
move the axis in either direction.
• Or press Ctrl (Cmd on a Mac) while dragging on the cen-
ter of the transformation overlay.
5. To scale the frame uniformly (on both x and y):
• Increment or decrement the Transform node’s scale
field.
• Or drag the circle-portion of the of the transformation
overlay.
6. To scale the frame asymmetrically (on x or y):
• Click scale parameter’s channel chooser to reveal
the x and y fields, then increment or decrement
each individually.

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 313
Transforming in 2D

• Or drag any of the four points on the circle-portion of


the transformation overlay. The top and bottom points
scale on y; the left and right points, on x.

Skewing Elements To skew an element is to rotate its pixel columns around the
pivot point.

Use the Transform node to skew elements.

To skew an element using the Transform node:


1. Click Transform > Transform to insert a Transform
node at appropriate place in your script.

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 314
Applying Core Transformations in 2.5D

2. Connect a Viewer to the output of the Transform node so


you can see the effect of your changes.
3. In the Transform properties panel, choose the
appropriate filtering algorithm from the filter pulldown
list (see “Choosing a Filtering Algorithm” on page 302).
4. Position the pivot point as necessary:
• Increment or decrement the center x and y fields to
move the axis in either direction.
• Or Ctrl+drag (Cmd+drag on a Mac) on the center of the
transformation overlay.
5. Increment or decrement the skew field to rotate the
pixel columns around the pivot point.
Or drag the vertical bar of the transformation overlay.

Applying Core Nuke’s Card3D node lets you apply the same geometric
Transformations in transformations possible with the Transform node, but gives
you an additional axis of operation, z.
2.5D
Just to be clear, the Card3D node’s transformations are not
truly 3D, but rather what is sometimes called “2.5D”—
meaning that you can move an element back on the z axis,
but doing so does not convey the sense that it is behind or
in front of another element. 2.5D transformations are useful
for tasks like “cheating” the perspective of an element or
“faking” a camera zoom.

Remember, however, that Nuke doesn’t limit you to 2.5


dimensions. If you need true 3D capabilities, you can
construct a 3D scene. See Chapter 14, 3D Compositing, on
page 562.

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 315
Applying Core Transformations in 2.5D

Adding a Card3D Node To add a Card3D node:


1. Click Transform > Card3D to insert a Card3D node at
appropriate place in your script.
2. Connect a Viewer to the output of the Card3D node so
you can see the effect of your changes.

Specifying the Order The order by which Nuke executes operations can affect the
of Operations outcome. The Card3D node lets you choose the order by
which Nuke executes scales, rotations, and translations, as
well as the order by which it executes rotation on individual
axes.

To choose the operation order for scales,


rotations, and translations:
In the Card3D properties panel, select an option from the
transform order pulldown list, which displays all possible
combinations (S signifies scale, R, rotation; and T,
translation).

To choose the operation order for rotations:


Select an option from the rotation order pulldown list, which
displays all possible axial combinations.

Choosing a Filtering Filtering algorithms let you specify the degree of smoothing
Algorithm and sharpening that remapped pixels receive during
transformation. The Card3D node offers the same filter
algorithms as the Transform node. See “Choosing a Filtering
Algorithm” on page 302 for more information.

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 316
Applying Core Transformations in 2.5D

To choose a filter algorithm:


Select the desired algorithm from the filter pulldown list.

Using the 3D You’ll note when viewing the output of a Card3D node that it
Transformation displays an overlay for executing spatial transformations.
Handles This overlay is often a faster alternative to the properties
panel. The figure below shows you how to use it.

A. Drag to translate the frame on the y axis (see “Translat-


ing Elements” on page 308).
Press Ctrl/Cmd while dragging to rotate the frame on any
axis (see “Rotating Elements” on page 310).
B. Drag to translate the frame on the z axis.
Press Ctrl/Cmd while dragging to rotate the frame on any
axis.
C. Drag to translate the frame on the x axis.
Press Shift while dragging to constrain the translation to
x.
Press Ctrl/Cmd while dragging to rotate the frame on any
axis.

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 317
Applying Core Transformations in 2.5D

Translating Elements When using the Card3D node, you can translate elements on
z in addition to the other axes.

To translate an element using the Card3D node:

In the Card3D properties panel, increment or decrement the


translate x, y, and z fields to slide the element along any
axis.

Alternatively, you can drag on any axis on transformation


overlay.

Rotating Elements When using the Card3D node, you can rotate elements
around the x and y axes, in addition to the z. This is useful

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 318
Applying Core Transformations in 2.5D

for cheating the perspective.

To rotate elements using the Card3D node:


1. Position the pivot point as necessary by incrementing or
decrementing the pivot x, y, and z fields to move the axis
in any direction.
Alternatively, you can position the pivot point by press-
ing Ctrl/Cmd+Alt while dragging.
2. Increment or decrement the rotate x, y, and z fields to
spin the element around the pivot point.
Alternatively, you can press Ctrl/Cmd while dragging on
any axis on the transformation overlay.

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 319
Adding Motion Blur

Scaling Elements To scale an element using the Card3D node:


1. Position the pivot point as necessary by incrementing or
decrementing the pivot x, y, and z fields to move the axis
in any direction.
Alternatively, you can position the pivot point by press-
ing Ctrl/Cmd+Alt while dragging.
2. To scale the frame simultaneously on x, y, and z,
increment or decrement the uniform scale field.
3. To scale the frame asymmetrically, increment or
decrement the scale x, y, and z fields.

Skewing Elements Whereas the Transform node lets you rotate pixel columns
only around the z axis, Card3D permits you to so around all
three axes.

To skew an element using the Card3D node:


1. Position the pivot point as necessary by incrementing or
decrementing the pivot x, y, and z fields to move the axis
in any direction.
Alternatively, you can position the pivot point by press-
ing Ctrl/Cmd+Alt while dragging.
2. Increment or decrement the skew x, y, and z fields to
rotate the pixel columns around the corresponding axes.

Adding Motion Blur The following nodes under the Transform menu have their
own controls for adding motion blur to transformations:
• Transform
• TransformMasked
• Card (3D)

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 320
Adding Motion Blur

• CornerPin2D
• Reconcile3D
• Tracker
• Stabilize2D.

These controls allow you to create motion blur without


adding a separate node for it. The output is similar to a
TimeBlur node (see “Applying the TimeBlur Filter” on
page 500), but 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..

Figure 5.2: Before rotation Figure 5.3: After rotation and


and motion blur. motion blur.

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.

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 321
Adding Motion Blur

To add motion blur:


1. Open the transform node’s controls.
2. Create a transform and animate it. For instructions on
how to do this, see “Animating Parameters” on page 94.
3. 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.
4. 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.
5. From the shutteroffset pulldown menu, select when the
shutter opens and closes in relation to the current frame
value:
• to center the shutter around the current frame, select
centerd. For example, if you set the shutter value to 1
and your current frame is 30, the shutter will stay open
from frame 29,5 to 30,5.
• to open the shutter at the current frame, select start.
For example, if you set the shutter value to 1 and your
current frame is 30, the shutter will stay open from
frame 30 to 31.
• to close the shutter at the current frame, select end.
For example, if you set the shutter value to 1 and your
current frame is 30, the shutter will stay open from
frame 29 to 30.
• to open the shutter at the time you specify, select cus-
tom. In the field next to the pulldown menu, enter a
value (in frames) you want to add to the current frame.

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 322
Replicating the Input Image Across the Output

To open the shutter before the current frame, enter a


negative value. For example, a value of -0.5 would open
the shutter half a frame before the current frame.

Replicating the The Tile node produces an output image that contains
Input Image Across scaled-down, tiled copies of the input image. The output
image is the same format as the input.
the Output

Figure 5.4: Before the Tile Figure 5.5: After the Tile
node. node.

To use the Tile node:


1. Select the image you want to replicate and choose
Transform > Tile.
A Tile node is inserted in the Node Graph.
2. Attach a Viewer to the Tile node.
3. In the Tile node properties, use the rows field to define
how many times the image is replicated vertically. Note
that the value can be fractional.

The Foundry Nuke 6.0v5


TRANSFORMING ELEMENTS 323
Replicating the Input Image Across the Output

The original input image. The output of the Tile node


with rows set to 4 and columns
to 5.

If you want to flip adjacent tiles vertically to form mirror


images, check mirror.

The output of the Tile node The output of the Tile node
without mirroring. with vertical mirroring.

4. In the columns field, enter the number of times you want


to replicate the image horizontally. Note that the value
can be fractional.
If you want to flip adjacent tiles horizontally to form mir-
ror images, check mirror.

The output of the Tile node The output of the Tile node
without mirroring. with horizontal mirroring.

5. From the filter menu, choose an appropriate filtering


algorithm. For more information, see “Choosing a
Filtering Algorithm” on page 302.

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 324
Tracking an Image

6 TRACKING AND STABILIZING

Nuke features a 2D tracker that allows you to extract


animation data from the position, size, and rotation of an
image. Using expressions, you can apply the data directly to
transform and matchmove another element. Or you can
invert the values of the data and apply it to the original
element—again through expressions—to stabilize the image.

This is the general process for tracking an image:


1. Connect a Tracker node to the image you want to track.
2. Place tracking anchors over features in the image.
3. Calculate the tracking data.
4. Choose the tracking operation you want to perform:
stabilize or matchmove.

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 color-correct the


image to boost the visibility of features before you attempt
to track them. Because of the procedural nature of Nuke, you
can disable these extra nodes after you get a successful
track, or simply reconnect the Tracker node at the
appropriate place to apply the transform.

Tracking an Image The Tracker can analyze the movement of up to four


different features in a single image. Nuke generates one
animation curve or track for each feature.

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 325
Tracking an Image

A single track is usually sufficient to record a feature’s


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

To track position only (a single feature):


1. Select the node that outputs the image you want to
track.
2. Choose Transform > Tracker to connect a new Tracker
node.

3. Click the Tracker tab. In the Viewer, you will see the
anchor for the first track.

4. Drag the anchor over the feature in the image you want
to track.

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 326
Tracking an Image

When you move the anchor in the Viewer, the track1, x


and y values change to reflect the center of the anchor.
5. In the properties panel, under Tracker Controls, press
the track forward button to generate the tracking data
from the current frame forward.
6. Inside the Tracker’s properties panel, click the
Transform tab.
7. From the transform list, choose an operation:
To match another element to the current image, choose
match-move.
To eliminate movement (i.e., camera shake) from the cur-
rent image, choose stabilize.

To track position, rotation, and scaling (multiple


features):
1. Select the node that outputs the image you want to
track.
2. Choose Transform > Tracker to connect a new Tracker
node.
3. Click the Tracker tab and check the enable box for each
of the tracks you want to activate—one for each feature
you want to track in the image.
For example, suppose you want to track the four corners
of a billboard so you can matchmove a new image to it—
a cornerpin track. you’ll need four tracks activated.
4. Drag the anchors over the features in the image you
want to track.
5. Press the track forward button in the Tracker properties
panel to generate the animation data for all enabled
tracks.

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 327
Tracking an Image

6. Inside the Tracker’s properties panel, click the


Transform tab.
7. Choose an operation from the transform list: match-
move or stabilize.

Activating Track You can select up to four track anchors. The number you
Anchors choose depends on which transformational components you
wish to track and the degree of accuracy you require.

To activate the tracks:


1. Click the Tracker tab in the properties panel.
2. Check each of the boxes for the tracks you want to
enable.

Note After you calculate a track, you can uncheck its enable box
to lock it. This protects the tracked points from being
recalculated or repositioned.

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 328
Tracking an Image

Positioning Track A pattern and search area accompany each track anchor. The
Anchors pattern area encompasses the grid of pixels that the system
attempts to follow across multiple frames. This pattern
should be as distinct as possible from the surrounding
frame, 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.

Figure 6.1: 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.

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

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 329
Tracking an Image

fine tune the position and size of each. In the end, the search
area must be larger than the pattern area.

To move both the search and pattern boundaries:


1. Drag on the frame to select both boundaries with the
marquee.
2. 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 position of either the search or


pattern boundaries.
1. Click to the line-portion of either boundary to select it.
2. Drag to reposition the boundary.
Or, if you’re repositioning the pattern boundary, increment or
decrement the track’s x and y fields.

To adjust the size of the search or pattern


boundaries.
1. Click on any point on either boundary.
2. Drag to reposition the associated side.

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. Tracking backwards
often allows you to get accurate tracks when a feature
exhibits a lot of scaling—when the distance between the
feature and the camera changes.

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 330
Tracking an Image

To toggle the tracking overlay:


If necessary, turn on the Tracker overlay in the Viewer. Click
the right mouse button and choose Overlay, or just press O,
over the Viewer.

Pressing O three times toggles between the three overlay


states: overlay off, overlay on, and overlay on, no
animation path.

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 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.
3. If a particular track anchor doesn’t stick, experiment with
a different position.
4. Once all track anchors stick, click the
Tracker’s track forward or track backward
buttons to analyze 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’s you experiment with
better placement for the wayward tracks.

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.

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 331
Retracking Part of a Track

To reset the size of an anchor’s search and pattern


boxes:
1. Check the enable box for only the track anchor whose
size you wish to reset.
2. Click the reset button. The track anchor’s pattern and
search areas are recentered to their default sizes.

To clear a track’s animation data:


1. Check the enable box for only the track anchor whose
track you wish to remove.
2. Under Animation Controls, click the clear all button. The
selected track is removed—that is, all it’s
transformational data is wiped.
To only clear animation forward or backward of the cur-
rent frame, click clear fwd or clear bkwd.

Retracking Part of A tracking pattern may become unusable when it moves out
a Track of frame, is hidden by another image feature, or because of
motion blur. When this happens, you can retrack 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 retrack part of a track with a new search area:


1. Check the enable box for only the track that requires
retracking.
2. Cue the Viewer to the last frame where the existing
tracking is usable.
3. Ctrl+drag (Command+drag on Mac OS X) the track anchor
to reposition the search and pattern areas without

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 332
Editing Tracks

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, the new track values
continue smoothly from the existing ones.

Editing Tracks You can edit tracks via their Viewer overlays or their
underlying animation curves.

Manipulating the The Tracker plots existing tracks as Viewer overlays. These
Track Overlays overlays offer an intuitive means of editing a track. If for
example, you have a track in which the Tracker loses sight of
its pattern for one or two frames, you can use the overlay to
manually reposition the wayward track points. (This is often
a faster approach than going into the associated animation
curves.)

To move track points with the overlay:


1. Cue the Viewer to the frame corresponding to the track
point you wish to move. The search and pattern boxes
move over the point.
2. Drag the track point to the desired location. The search
and pattern boxes follow.

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 333
Editing Tracks

Manipulating Track A track is essentially just an animated transformation


Curves and Smoothing matrix. Thus each track has animation curves which you can
Tracks edit in order to refine a track. You can also smooth tracks
using the Tracker controls.

Moving Track Points with Curves

To move 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.).

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 334
Editing Tracks

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.

Smoothing Tracks
Once applied to an element, some tracks may exhibit too
much jitter, which is 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.

To smooth tracks:
1. In the Tracker controls, go to the 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.

OR
1. In the Tracker properties panel, click the anima-
tion 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 Crtl+A
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 neighbouring
points.

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 335
Editing Tracks

4. Enter the number of times to apply the smoothing filter


in the dialog that appears. Click OK.
5. Reapply the smoothing filter as many times as is
necessary.

Figure 6.2: A track curve Figure 6.3: A track curve after


before smoothing. smoothing.

Tracking and If you need to use tracking data in a multiview or


Multiview Projects stereoscopic project, you may want to apply your edits to
one view only (for example, the left view but not the right),
or create a track in one view and have it automatically
generated for the other, in the correct position.

Splitting Views Off


Splitting a view off allows you to edit the tracking data in
that view only, without affecting any other views that exist
in your project settings.

To split a view off:


1. Display the view you want to split off in the Viewer.
2. In the Tracker controls, display the Tracker tab. Usually,
it is better to split off controls on this tab rather than
the Transform tab. The controls on the Transform tab
will compute differently per view as long as the tracks on
the Tracker tab are different per view.

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 336
Editing Tracks

3. Click the view button next to the track you want to


edit and select Split off [view name]. For example,
to edit tracking data in a view called left, select
Split off left. Any changes you now make to the track in
question are only applied to the view you chose to split
off and are displaying in the Viewer.

Correlating One View from Another


You can use a Tracker to track something in one view, and
have the track’s x and y position automatically generated for
the other view.

To correlate one view from the other:


1. Track a feature in one view.
2. In the Viewer, display the view you want to generate the
corresponding track for.
3. In the Tracker controls, click the view button next
to the track, and select Correlate [view name]
from [view name] using disparity. For example, if
you created a track for the left view and want to have
the corresponding track generated for the right view,
select Correlate right from left using disparity. This
generates the corresponding track for the view you are
displaying.

Tip If you have got The Foundry’s Ocula plug-ins installed, you
can also do the correlation using Ocula (select Correlate
[view name] from [view name] with Ocula). This way, extra
refinements are done when generating the track, and the
results may be more accurate.

For more information on working with multiview projects,


see Chapter 15: "Working with Stereoscopic Projects" on

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 337
Applying Tracking Data

page 655.

Applying Tracking You apply tracking data to the input image or other Nuke
Data nodes using either the Tracker node’s controls or linking
expressions.

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

Stabilizing Elements
The Tracker node’s controls let you remove motion, such as
unwanted camera shake, from the node’s input clip.

To stabilize the input footage:


1. Create the track you want to use for stabilizing the foot-
age. A single track is usually enough to stabilize a fea-
ture’s horizontal and vertical motion across the 2D
plane. Two tracks can be used to do the same but also
remove rotation in the image.
2. In the Tracker properties panel, go to the Settings tab.
From the warp type pulldown menu, select the
transformations that you want Nuke to take into account
when stabilizing the image, for example Translate/
Rotate/Scale.
3. Go to the Transform tab. Under transform, select
stabilize.

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 338
Applying Tracking Data

Nuke stabilizes the footage, locking its elements to the same


position within the composite.

Matchmoving Elements
You can use the Tracker node’s controls to apply the tracked
motion to another image, that is, to matchmove an image.

To matchmove footage:
1. Use a Tracker node to create the track you want to apply
to an image.
2. Copy the Tracker node and paste it after the footage you
want to matchmove.
3. In the second Tracker node’s controls, go to the
Transform tab.
4. From the transform pulldown menu, choose match-
move.

Nuke applies the tracked movement to the footage you want


to matchmove.

Applying Tracking Nuke’s CornerPin2D and Stabilize2D nodes are specifically


Data Via Linking designed to receive tracking data via linking expressions, but
Expressions you can apply tracking data in this manner to virtually any
Nuke node. For example, you might animate a Bezier or a B-
spline shape with tracking data by entering linking
expressions into the RotoPaint node’s transformation
parameters. You can also apply tracking data to individual
points.

This section explains the basic procedure for applying


tracking data to any node via linking expressions, then

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 339
Applying Tracking Data

discusses how to apply such data to the CornerPin2D and


Stabilize2D nodes in particular.

Creating Linking Expressions


The Tracker node’s Tracker panel displays data related to
the position of each track anchor over time (tracks’ x and y
fields). These are the data which you most typically apply to
other nodes.

To drag and drop tracking data:


1. Display both the tracker parameters (the source parame-
ters, in this case) and the parameters to which you wish
to apply the tracking data (the destination parameters—
for example, a RotoPaint node’s translate parameter).
2. Ctrl+drag (Cmd+drag on a Mac) from the source
parameters animation button to the destination
parameters animation button.

When you release, the destination parameters will turn blue,


indicating an expression has been applied. In this case, the
drag and drop action has created a linking expression
resembling the following example:
Tracker1.tracker1.x

Tip You can also apply tracking (or other transform) data to
individual RotoPaint, SplineWarp, or GridWarp points (this is
sometimes called per vertex tracking). To do so, Ctrl/
Cmd+drag and drop the track’s animation button on a
RotoPaint, SplineWarp or GridWarp point in the Viewer.

You can add other components to this linking expression as


necessary. For example, you might add a spatial offset to the
linking expression by subtracting out the initial frame’s

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 340
Applying Tracking Data

tracking values, in which case the final expression would


resemble the following:
Tracker1.tracker1.x-Tracker1.tracker1.x(1)

See Chapter 17: "Expressions" on page 713 for more


information. Once you enter the linking expression, the
destination parameter turns blue.

Using the CornerPin Node


The CornerPin2D node is designed to map the four corners
of an image sequence to positions derived from tracking
data. In practice, this node lets you replace any four-
cornered feature with another image sequence. For example,
suppose you needed to replace the monitor image in the
fast-panning shot shown below.

Feature to
replace

Figure 6.4: Fast-panning shot requires four corner


tracking.

You would first use the Tracker to calculate four separate

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 341
Applying Tracking Data

tracks, one for each corner of the feature.

Figure 6.5: Generating the four tracks.

Next, you would attach a CornerPin2D node to the image


sequence you want to use as the replacement for the
feature, and apply to it the tracking data. This would remap
the image sequence’s corners to the correct positions over
time.

Figure 6.6: Applying the tracked corner data to the


replacement image.
.

The final step would be to layer this result over the original

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 342
Applying Tracking Data

element.

Figure 6.7: The composited image.

The steps below summarize the use of the CornerPin2D


node.

To use the CornerPin2D node:


1. Use the Tracker node to generate four tracks, one per
corner, on the feature requiring replacement.
2. Click Transform > CornerPin to add a CornerPin2D
node to the script.
3. Attach the CornerPin2D node to the image sequence that
will replace the feature tracked above.
Note that the CornerPin2D node should NOT be con-
nected to the Tracker node or the Tracker node’s input
image.
4. In the CornerPin2D properties panel, add linking
expressions (see “Creating Linking Expressions” on
page 339) to the positional data for the four tracks
generated above.
When linking a particular track to a particular corner,
keep in mind that to1 refers to the bottom left corner of
the image sequence; to2, to the bottom right corner;

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 343
Applying Tracking Data

to3, to the top right corner, and to4, to the top left cor-
ner.
5. If necessary, choose a different filtering algorithm from
the filter pulldown menu. (See “Choosing a Filtering
Algorithm” on page 302).
6. When filtering with Key, Simon, or Rifmen filters, you
may see a haloing effect caused by pixel sharpening
these filters employ. If necessary, check clamp to correct
this problem.
7. In most cases, you will keep black outside checked. This
renders as black pixels outside the image boundary,
making it easier to layer the element over another. (If you
uncheck this parameter, the outside area is filled with
the outermost pixels of the image sequence.)

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 if
you only need to stabilize movement; it requires data from
two tracks if you need to stabilize 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.

To use the Stabilize2D node:


1. Use the Tracker node to generate the appropriate num-
ber of tracks on the element requiring stabilisation.
Remember, you’ll need at least two tracks if you need to

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 344
Applying Tracking Data

stabilize for more than just movement. (You can, of


course, generate more tracks and average the results for
better accuracy.)
2. Select the Tracker node used above, then click
Transform > Stabilize to add a Stabilize2D node to the
Tracker node.
3. From the type pulldown menu in the Stabilize2D
properties panel, select:
• 1 Point to stabilize only for movement.
• 2 Point to stabilize for rotation and/or scaling.
4. Check all transformation types which you wish to cancel
out.
5. In the both the track1 x and y fields, type 1- (to invert
the data), followed by a linking expression to the
relevant tracking data in the Tracker node used above.
(You can use either the positional data for Tracker 1, or
some multiple track average from the Outputs panel.)
Your entries should resemble the following examples: 1-
Tracker1.tracker1.x and 1-Tracker1.tracker1.y.
6. Repeat the above for the track2 x and y fields.
7. As you apply the tracking data, the current frame
displayed in the Viewer is likely to move out of view. This
is because the node applies the inverted tracking data to
the bottom left corner of the image sequence. Enter
values in the offset XY x and y fields to restore the
image to the center of frame. (You may have to animate
these values over time to keep the image centered.)
8. If necessary, choose a different filtering algorithm from
the filter pulldown. (See “Choosing a Filtering Algorithm”
on page 302).
9. When filtering with Key, Simon, or Rifmen filters, you
may see a haloing effect caused by pixel sharpening

The Foundry Nuke 6.0v5


TRACKING AND STABILIZING 345
Applying Tracking Data

these filters employ. If necessary, check clamp to correct


this problem.
10. In most cases, you will keep black outside checked. This
renders as black pixels outside the image boundary. (If
you uncheck this parameter, the outside area is filled
with the outermost pixels of the image area.)

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 346
Accessing Primatte from Nuke

7 KEYING WITH PRIMATTE

This section explains how to use the blue/green screen


keyer, Primatte, in Nuke.

Accessing Primatte Start up Nuke, create a Primatte node and connect a


from Nuke foreground and a background image to it. Add a Nuke Viewer
node so you can see the result.

Figure 7.1: Nuke flowgraph.

When you select the Primatte node, you should be presented


with the Primatte properties panel as shown below.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 347
Primatte Basic Operation Tutorial

Figure 7.2: Primatte properties panel.

Primatte Basic This describes the operation of the Primatte node in Nuke. A
Operation Tutorial more detailed explanation of how the Primatte algorithm
actually works can be found under “The Primatte Algorithm”
on page 384.

Auto-Compute This version of Primatte has a new feature that may


eliminate the first three steps of using earlier versions of

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 348
Primatte Basic Operation Tutorial

Primatte. It is called the Auto-Compute button and may


make your keying operation much easier. You can click on
this button as a first step and it may automatically sense the
backing screen color, eliminate it and even get rid of some of
the foreground and background noise that would normally be
cleaned up in Step 2 (Clean BG Noise) and Step 3 (Clean FG
Noise) of the Primatte operation. If you get good results
then jump ahead to the spill removal tools.

The Auto-Compute button has two sliders that modify its


behaviour; the auto BG factor and the auto FG factor sliders.
These may be moved to get better results with the Auto-
Compute button. This is useful when doing a set of clips that
have similar backgrounds and lighting. Once the sliders are
configured for a particular lighting set-up, all the clips will
key quickly using just the Auto-Compute button.

If you don't get the results you wanted from Auto-Compute,


please continue from this point on to get the basic Primatte
operation procedures.

The basic functionality for the Primatte interface is centered


around the Actions or operation pulldown menu and the
Viewer window.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 349
Primatte Basic Operation Tutorial

Figure 7.3: Primatte operation menu.

There are four main steps to using the Primatte and Select
BG Color is the first step.

Select BG Color Ensure that the Select BG Color action is selected (it should
be at this time as it is the default Action mode when you
start Primatte).

Position the cursor in the bluescreen area (or whatever


background color you are using), usually somewhere near the
foreground object. Hold the Ctrl/Cmd key down and sample
the targeted background color. Release the mouse button
and Primatte will start the compositing process. If the
foreground shot was done under ideal shooting conditions,
Primatte will have done 90-95% of the keying in this one
step and your image might look like this.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 350
Primatte Basic Operation Tutorial

Figure 7.4: Basic key.

Note Primatte will work equally well with any color backing screen.
It does not have to be a specific shade of green or blue.

Tip If you dragged the cursor in the blue area, Primatte averages
the multi-pixel sample to get a single color to adjust to.
Sometimes Primatte works best when only a single pixel is
sampled instead of a range of pixels. The color selected at
this point in the Primatte operation is critical to the
operation of the node from this point forward. Should you
have difficulties further along in the tutorial after selecting a
range of blue shades, try the Select BG Color operation again
with a single dark blue pixel or single light blue pixel. You
can also switch to the alpha channel view and click around in
the bluescreen area and see the different results you get
when the initial sample is made in different areas.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 351
Primatte Basic Operation Tutorial

Tip If you would rather make a rectangular selection and not use
the default 'snail trail' sampling method, you can do a
Ctrl+Shift+drag sample.

Tip If the foreground image has a shadow in it that you want to


keep it in the composite, do not select any of the dark blue
pixels in the shadow and the shadow will come along with
the rest of the foreground image.

The second and third steps in using Primatte require viewing


the Matte or Alpha view in the Viewer window. Press the ‘A’
key on the keyboard to change to the Alpha view. The image
displayed will change to a black and white ‘matte’ view of the
image that looks like this.

Figure 7.5: Matte.

Clean BG Noise Change the Actions Operation from Select BG Color to Clean

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 352
Primatte Basic Operation Tutorial

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.
Sample through these whitish noise regions and when you let
up on the pen or mouse button, Primatte will process the
data and eliminate the noise. Repeat this procedure as often
as necessary to clear all the noise from the background
areas. Sometimes increasing the brightness of your monitor
or the screen gamma allows you to see noise that would
otherwise be invisible.

Note You do not need to remove every single white pixel to get
good results. Most pixels displayed as a dark color close to
black in a key image will become transparent and virtually
allow the background to be the final output in that area.
Consequently, there is no need to eliminate all noise in the
bluescreen portions of the image. In particular, if an attempt
is made to meticulously remove noise around the foreground
object, a smooth composite image is often difficult to
generate.

Tip When clearing noise from around loose, flying hair or any
background/foreground transitional area, be careful not to
select any of areas near the edge of the hair. Leave a little
noise around the hair as this can be cleaned up later using
the Fine Tuning Sliders tool.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 353
Primatte Basic Operation Tutorial

Figure 7.6: Before background Figure 7.7: After background


noise removal. noise removal.

Clean FG Noise 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 Actions operation 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.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 354
Primatte Basic Operation Tutorial

Figure 7.8: Before foreground Figure 7.9: After foreground


noise removal. noise removal.

These were the steps necessary to create a clean 'matte' or


'key' view of the image. With this key, the foreground can be
composited onto any background image. However, if there is
`spill' on the foreground object from light that was reflected
off the background, a final operation is necessary to remove
that background spill get a more natural looking composite.

For the fourth step in the Primatte operation, return the RGB
view to the monitor window by clicking again on the ‘A’
keyboard key. This will turn off the alpha channel viewing
mode and the Viewer window will again display the RGB view
with the background image (if you connected one to the
Primatte node).

The sample image below has gone through the first three
steps and has examples of spill. Notice the blue fringe to her
hair and a blue tint on her right cheek, arm and chest.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 355
Primatte Basic Operation Tutorial

Figure 7.10: Blue spill visible.

Spill Removal - Method There are three ways in Primatte to remove the spill color.
#1 The quickest method is to select the Spill Sponge button
from the Actions operation area and then sample the spill
areas away. By just positioning the cursor over a bluish pixel
and sampling it, the blue will disappear from the selected
color region and be replaced by a more natural color.
Additional spill removal should be done using the Fine Tuning
tools or by using the Spill(-) feature. Both are explained
further on in this manual.

Note All spill removal/replacement operations in Primatte can be


modified using the Spill Process ‘replacement with’ tools.
Spill can be replaced with either the complement of the

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 356
Primatte Basic Operation Tutorial

background color, a solid color selected by the user or by


colors brought from a defocused background. Depending on
the spill conditions, one of these options should provide the
results you are looking for. See the information in “Spill
Replacement Options” on page 361 for more details.

Note Primatte's spill removal tools work on 'color regions'. In the


image above, samples should be made on the light flesh
tones, the dark flesh tones, the light blonde hair, the dark
blonde hair and the red blouse color regions. One sample in
each color region will remove spill from all similar colors in
the foreground image.

If the spilled color was not been totally removed using the
Spill Sponge or the result of the Spill Sponge resulted in
artifacts or false coloring, a fine-tuning operation Spill(-)
tool should be used instead for a more subtle and
sophisticated removal of the spilled background color. This is
discussed in “Spill (-)” on page 378.

Spill Removal - Method 1. Select the Fine Tuning Sliders Actions operation. This will
#2 activate these tools.

2. Using the zoom and pan capabilities of the Nuke


application, zoom into an area that has some blue edges
or spill.
3. Using the cursor, sample a color region that has some
spill in it. When you let up on the pen or mouse button,
Primatte will register the color selected (or an average of
multiple pixels) in the current color area. For most

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 357
Primatte Basic Operation Tutorial

images, the L-poly (spill) slider is all that is required to


remove any remaining blue spill. The more to the right
the slider moves, the more spill color will be removed
from the sampled pixels. The more to the left the slider
moves, the more the selected pixels will move toward the
color in the original foreground image.
Note: When using the L-poly (spill) slider, spill color
replacement will be replaced based on the setting of the
Spill Process ‘replacement with’ settings. For more infor-
mation on these tools, see the section of this manual on
Spill Replacement in Chapter 6. Primatte Tools and But-
tons.

Tip It is better to make several small adjustments to the blue


spill areas than a single major one.
4. You can use the other two sliders in the same way for
different key adjustments. The S-poly (detail) slider
controls the matte softness for the color which is closest
to the background color. For example, you can recover
lost rarefied smoke in the foreground by selecting the
Fine Tuning Sliders action, sampling the area of the
image where the smoke just starts to disappear and
moving the S-poly (detail) slider to the left. The M-poly
(trans) slider controls the matte softness for the color
which is closest to the foreground color. For example, if
you have thick and opaque smoke in the foreground, you
can make it semi-transparent by moving the
Transparency slider to the right after selecting the pixels
in the Fine Tuning Sliders mode.

Tip If the foreground image changed color dramatically during the fine tuning
process, you can recover the original color by selecting an area of the off-
color foreground image and moving the L-poly (spill) slider slightly to the
left. This may introduce spill back into that color region. Again, use the

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 358
Repeatable Sampling Tools

Fine Tuning Sliders option to suppress the spill, but make smaller
adjustments this time.

Spill Removal - Method 1. This method uses a more recent Primatte tool that is
#3 covered in detail in Repeatable Sampling Tools below.

Note If these final 'spill suppression' operations have changed the


final compositing results, you may have to return to earlier
operations to clean up the matte. If the composite view
looks good, it is a good idea to go back and take a final look
at the alpha channel view. Sometimes in the Primatte
operation, a 100% foreground area (all white) will become
slightly transparent (gray). You can clean those transparent
areas up by using the Matte Sponge tool. After selecting the
Matte Sponge tool, just click on the transparent pixels and
they will become 100% foreground. All of the spill-
suppression information will remain intact. Alternatively, you
can go to the alpha channel view and then using the Fine
Tuning Sliders option, select those transparent areas and
move the Transparency slider slightly to the left. This will
move that color region from 0-99% foreground with spill
suppression to 100% foreground with spill suppression and
should solve the problem. The Matte(+) tool will also work to
solve this problem.

Repeatable Most of the Primatte operations are done using a 'mouse or


Sampling Tools pen sampling' operation. The only exceptions are the Fine
Tuning Sliders Actions mode and its sliders. The Fine Tuning
Sliders action mode gives a continuous valuator for fine-
tuning but some of the sliders are not often used because
results are often unpredictable or not subtle enough.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 359
Repeatable Sampling Tools

Another weak point in previous versions of Primatte is the


lack of functionality to attenuate and thicken the existing
matte density. This version of Primatte offers a more
intuitive, easy-to-use and powerful user interface called
Repeatable Sampling.

In addition to the conventional Primatte operation modes


previously mentioned, six other tools are added:

The Spill Sampling Using the Spill(+) and Spill(-) modes, you can gradually
Tools remove or recover the spill intensity on the foreground
object by sampling the referenced color region repeatedly.
The conventional Spill Sponge tool removes the spill
component in a single action at one level and did not allow
sampling the same pixel a second time. Even though just a
small amount of spill needed to be removed, the spill sponge
removed a preset amount without allowing any finer
adjustment.

Figure 7.11: The effect of Spill (+/-) repeatable


sampling.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 360
Repeatable Sampling Tools

Using the zoom and pan capabilities of the Nuke application,


zoom into an area that has some blue edges and click on a
pixel with some spill on it. Repeated clicking will
incrementally remove the spill. Continue this operation until
the desired result is achieved.

The Matte Sampling The Matte(+) and Matte(-) modes are used to thicken or
Tools attenuate the matte information. If you want a thinner
shadow on a foreground object, you can use the Matte(-)
mode as many times as you like to make it more transparent.
On the other hand, you can use the Matte(+) mode to make
the matte thicker in that color region.

Figure 7.12: Effect of Matte (+/-) Repeatable


Sampling.

The Detail Sampling The Detail(+) and Detail(-) modes are a refined version of
Tools Clean BG Noise and Restore Detail (discussed later in this
document). For example, when you see some dilute noise in
the backing area but don't want to remove it completely
because it affects some fine detail in a different area, try
using Detail(-). It will attenuate the noise gradually as
multiple samples are made on the pixel. You should stop the
sampling when important fine details start to disappear.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 361
Spill Replacement Options

Figure 7.13: Effect of Detail (+/-) Repeatable Sampling.

Spill Replacement The proper processing of spill on foreground objects is one


Options of the many useful features of Primatte. You can move
between these four modes to see how they affect the image
clip you are working with. The four methods are as follows:

1. No Suppression (no suppression)


2. Complemental Spill Replacement (complement)
3. Solid Color Spill Replacement (solid color)
4. Defocus Spill Replacement (defocused background)

No Suppression (no In this mode, no suppression is applied.


suppression)

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 362
Spill Replacement Options

Complemental This is the default spill replacement mode. This mode will
Replacement Mode maintain fine foreground detail and deliver the best quality
(complement) results. If foreground spill is not a major problem, this mode
is the one that should be used.

Figure 7.14: Complemental Replacement mode


maintains fine detail.

The Complemental Replacement mode is sensitive to


foreground spill. If the spill intensity on the foreground
image is rather significant, this mode may often introduce
serious noise in the resultant composite.

Figure 7.15: Serious noise in the composite.

Solid Color In the Solid Color Replacement mode, the spill component
Replacement Mode will be replaced by a 'user defined' palette color. While the
(solid color) Complemental Replacement mode uses only the backing color
complement to remove small amounts of spill in the original
foreground, the Solid Color Replacement mode tries to
assuage the noise using the 'user defined' palette color.
Changing the palette color for the solid replacement, the
user can apply good spill replacement that matches the
composite background. Its strength is that it works fine with

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 363
Spill Replacement Options

even serious blue spill conditions.

Figure 7.16: Smooth spill processing with solid color


replacement.

On the negative side, when using the Solid Color


Replacement mode, fine detail on the foreground edge tends
to be lost. The single palette color sometimes cannot make a
good color tone if the background image has some high
contrast color areas.

Defocus Spill The Defocus Replacement mode uses a defocused copy of


Replacement the background image to determine the spill replacement
(defocused colors instead of a solid palette color or just the complement
background) color. This mode can result in good color tone on the
foreground object even with a high contrast background. As
in the example below, spill can even be removed from frosted
glass using this feature and still retain the translucency.

On the negative side, the Defocus Replacement mode


sometimes results in the fine edge detail of the foreground
objects getting lost. Another problem could occur if the user
wanted to later change the size of the foreground image
against the background. Since the background/foreground
alignment would change, the applied color tone from the
defocused image might not match the new alignment.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 364
Spill Replacement Options

Figure 7.17: Blue suppression of a frosted glass


object.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 365
Primatte Tools and Buttons

Primatte Tools and


Buttons

Figure 7.18: Primatte node controls.

Initialize Section

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 366
Primatte Tools and Buttons

Primatte Algorithm Menu

Primatte Algorithm
The Primatte algorithm mode delivers the best results and
supports both the Solid Color and the Complement Color spill
suppression methods. It is the algorithm that uses three
multi-faceted polyhedrons (as described further down in the
this document) 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.

Primatte RT+ algorithm


Primatte RT+ is in between the above two options. It uses a
six planar surface color separation algorithm (as described
further down in the this document) and will deliver results in
between the other two in both quality and performance.
Other disadvantages of the Primatte RT+ algorithm is that it
does not work well with less saturated backing screen colors
and it does not support the Complement Color spill
suppression method.

Primatte RT Algorithm
Primatte RT is the simplest algorithm and therefore, the
fastest. It uses only a single planar surface to separate the
3D RGB colorspace (as described further down in the this
document) and, as a result, does not have the ability to
separate out the foreground from the backing screen as
carefully as the above Primatte algorithm. Other
disadvantages of the Primatte RT algorithm is that it does
not work well with less saturated backing screen colors and
it does not support the Complement Color spill suppression
method.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 367
Primatte Tools and Buttons

Reset
Resets all of the Primatte key control data back to a blue or
greenscreen.

Auto-Compute
The Auto-Compute button can be used as the first step in
the Primatte operation. It's 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 color, 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
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.

3D Viewer
This selector opens a window in the Viewer that displays a
graphical representation of the Primatte algorithms and
allows the user to see what is happening as the various
Primatte tools are used. It is a passive feature that has no

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 368
Primatte Tools and Buttons

adjustment capabilities, it may prove useful in evaluating an


image as you operate on it.

When you select it, you are presented with a window that
may look similar to one of these images (depending on which
Primatte algorithm you have selected).

Figure 7.19: Primatte algorithm.

Figure 7.20: Primatte RT+ Figure 7.21: Primatte RT


algorithm algorithm

The different algorithms are described in more detail in a


later section of this manual. Here is a description of the
tools and features of the 3D Viewer:

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 369
Primatte Tools and Buttons

3D Viewer Tools
At the top of the 3D Viewer window are three areas that can
be clicked on:
1. Clicking and dragging on the blue center area allows the
user to move the window around on the screen.
2. Clicking and dragging on the triangular white region in
the upper right corner allows the user to scale the 3D
Viewer window.
3. Clicking on the square white region in the upper left of
the window displays a pop-up menu that looks like this:

Note A ‘selected feature has a solid yellow square next to it. An


‘unselected’ feature has a hollow yellow square next to it.

Minimize
This feature, when selected, makes the 3D Viewer window
disappear. Only the blue title bar at the top of the window
remains.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 370
Primatte Tools and Buttons

Large Surface
This feature, when selected, displays the large Primatte
polyhedron in the Viewer window.

Middle Surface
This feature, when selected, displays the medium Primatte
polyhedron in the Viewer window.

Small Surface
This feature, when selected, displays the small Primatte
polyhedron in the Viewer window.

Opaque
This feature, when selected, makes the selected polyhedrons
opaque. De-selecting it makes them semi-transparent.

Samples
This feature, when selected, allows the user to sample color
regions on the image window using the 3D Sample Actions
mode and see where those regions are in relation to the
polyhedron and the algorithm. The colors will be displayed as
a spray of pixels in the color selected. This button only
allows the user to see or hide the sampled colors.

Note The 3D Sample Actions mode must be selected in the Actions


area for this feature to operate.

Clear BG
This feature changes the background color of the 3D Viewer
window from black (when unselected) to transparent (when
selected).

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 371
Primatte Tools and Buttons

Sliced
This feature, when selected, slices open the large and
medium polyhedrons so that the inner polygons can be seen.
When unselected, the largest polyhedron selected becomes a
completely closed polyhedron and you might not be able see
the inner polyhedrons (unless the Opaque feature is
deselected).

Wireframe
This feature, when selected, changes the polyhedrons from
shaded-surface objects to wireframe objects.

Degrain Section Degrain Tools


The Degrain tools are used when a foreground image is
highly compromised by film grain. 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 amount of film grain induced pixel 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. A short tutorial
explaining when and how to use these tools is at the end of
this section.

none

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 372
Primatte Tools and Buttons

When none is selected, the user gets the color of the exact
pixel sampled. This is the default mode.

small
When small is selected, the user gets the average color of a
small region of the area around the sampled pixel. This
should be used when the grain is very dense.

medium
When medium is selected, the user gets the average color of
a medium-sized region of the area around the sampled pixel.
This should be used when the grain is less dense.

large
When large is selected, the user gets the average color of a
larger region of the area around the sampled pixel. This
should be used when the grain is very loose.

Tolerance Slider
Adjusting the tolerance slider this should increase the effect
of the Clean BG Noise tool without changing the edge of the
foreground object.

Degrain Tools Tutorial


If you have a noisy image as in the example below...

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 373
Primatte Tools and Buttons

...you will find that the matte is also noisy:

Currently you can use the Clean BG Noise operation to


remove the noisy pixels, but this can also modify the edge of
the foreground object in a negative manner.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 374
Primatte Tools and Buttons

Using the Degrain Tools in the following way may help you
clean up the image and still get a good edge on the matte:
1. Use the Clean BG Noise operation just a small amount to
remove some of the white noise in the Alpha channel
view but do use it so much that you affect the edge of
the foreground object.
2. Then select the Grain Size tool and select small as a first
step to reduce the grain:

With the degrain tolerance slider set at 0, move it around


some. This should increase the affect of the Clean BG
Noise tool without changing the edge of the foreground
object.

Sometimes this may not be enough to totally remove the


grain so by adjusting the degrain tolerance slider, you
can tell the Primatte algorithm what brightness of pixels
you think represents grain. You should try not to use too
high of a value otherwise it will affect the overall matte.
For an example of an 'over adjusted' image see below.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 375
Primatte Tools and Buttons

The Primatte degrain algorithm uses a 'Defocused Fore-


ground' image to compute the noise.

Note The small, medium and large settings for the degrain tools all
produce defocused foregrounds that have larger or smaller
blurs respectively.

Note It is important to make sure that the crop settings are


correctly applied otherwise when the defocus image is
generated, if there is 'garbage' on the edges of the images,
then that garbage will be blurred into the defocus
foreground.

As a review:
1. Select the Select BG Color Actions mode and click on a
backing screen color.
2. Select the Clean BG Noise Actions mode and use it
sparingly so that it has minimum affect to the edge of
the foreground object.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 376
Primatte Tools and Buttons

3. If there is still grain in the backing screen area, then use


the degrain type functionality starting at the small
setting to reduce the grain
4. If the grain is still present, then try increasing the
tolerance slider a little - not too much.
5. If grain is still a problem, then try changing the type to
medium or large and also changing the grain tolerance
until the desired effect is achieved.

Note The grain functionality does not always remove grain


perfectly but is sometimes useful to minimize its effects.

Actions Section Actions operation Tools/Modes

Select Background Color


When this operational mode is selected, the Primatte
operation will be initially computed by having the user
sample the target background color within the image
window. For keying operations, this is the first step and
should be followed by the steps described immediately
below.

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.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 377
Primatte Tools and Buttons

Clean Foreground Noise


When this operational mode is selected, the user samples
pixels on the image window known to be 100% foreground.
The color of the sampled pixels will be registered by Primatte
to be the same color 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.

Spill Sponge
When this operational mode is selected, the background
color component in the sampled pixels (or spill) within the
image window is keyed out and removed for the color region
selected. This operation can only be used once on a
particular color 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.

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

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 378
Primatte Tools and Buttons

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 and the like. It shrinks the small
polyhedron slightly.

Make Foreground Transparent


When this mode is selected, the opaque foreground color
region sampled in the image window becomes slightly
translucent. This operation is useful for the subtle tuning of
foreground objects which are otherwise 100 percent covered
with smoke or clouds. It can only be used one time on a
particular color. For a more flexible way to thin out a color
region and be able to make multiple samples, you should use
the Matte (-) tool. It expands the medium polyhedron
slightly.

Spill (+)
When this operational mode is selected, color spill will be
returned to the sampled pixel color (and all colors like it) in
the amount of one Primatte increment. This tool can be used
to move the sampled color more in the direction of the color
in the original foreground image. It can be used to nullify a
Spill (-) step. This tool dents the Primatte large polyhedron
in the color region sampled.

Spill (-)
When this operational mode is selected, color spill will be
removed from the sampled pixel color (and all colors like it)
in the amount of one Primatte increment. If spill color
remains, another click using this operational mode tool will
remove more of the color spill. Continue using this tool until

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 379
Primatte Tools and Buttons

all color spill has been removed from the sampled color
region. This tool expands the Primatte large polyhedron in
the color region sampled.

Matte (+)
When this operational mode is selected, the matte will be
made more opaque for the sampled pixel color (and all colors
like it) in the amount of one Primatte increment. If the matte
is still too translucent or thin, another click using this
operational mode tool will make the sampled color region
even more opaque. This can be used to thicken smoke or
make a shadow darker to match shadows in the background
imagery. It can only make these adjustments to the density
of the color region on the original foreground image. It can
be used to nullify a Matte (-) step. This tool dents the
Primatte medium polyhedron in the color region sampled.

Matte (-)
When this operational mode is selected, the matte will be
made more translucent for the sampled pixel color (and all
colors like it) in the amount of one Primatte increment. If the
matte is still too opaque, another click using this operational
mode tool will make the sampled color region even more
translucent. This can be used to thin out smoke or make a
shadow thinner to match shadows in the background
imagery. This tool expands the Primatte medium polyhedron
in the color region sampled.

Detail (+)
When this operational mode is selected, foreground detail
will become less visible for the sampled pixel color (and all
colors like it) in the amount of one Primatte increment. If
there is still too much detail, another click using this

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 380
Primatte Tools and Buttons

operational mode tool will make more of it disappear. This


can be used to remove smoke or wisps of hair from the
composite. Sample where is visible and it will disappear. This
is for moving color regions into the 100% background
region. It can be used to nullify a Detail (-) step. This tool
expands the Primatte small polyhedron in the color region
sampled.

Detail (-)
When this operational mode is selected, foreground detail
will become more visible for the sampled pixel color (and all
colors like it) in the amount of one Primatte increment. If
detail is still missing, another click using this operational
mode tool will make detail more visible. This can be used to
restore lost smoke or wisps of hair. Sample where the smoke
or hair just disappears and it will return to visibility. This is
for restoring color regions that were moved into the 100%
background region. It may start to bring in background noise
if shooting conditions were not ideal on the foreground
image. This tool dents the Primatte small polyhedron in the
color region sampled.

Current Color Chip


This shows the current color selected (or registered) by the
Fine Tuning operational mode.

Fine Tuning Section Fine Tuning Sliders


When this operational mode is selected, the color of the
sampled pixel within the Viewer window is registered as a
reference color for fine tuning. It is displayed in the Current
Color Chip in the Actions section. To perform the tuning
operation, sample a color region on the image, select a Fine

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 381
Primatte Tools and Buttons

Tuning slider and move the slider to achieve the desired


effect. See the Fine Tuning Sliders tool descriptions further
on in this section for more details on slider selection.

Spill or L-poly Slider (Spill Removal)


When in the Fine Tuning Actions mode, this Spill slider can
be used to remove spill from the registered color region.
After choosing the Fine Tuning Actions mode and registering
a color region, this slider can be moved to remove spill from
the registered color region. The more to the right the slider
moves, the more spill will be removed. The more to the left
the slider moves, the closer the color component of the
selected region will be to the color in the original foreground
image. If moving the slider all the way to the right does not
remove all the spill, re-sample the color region and again
move the slider to the right. These slider operations are
additive. This result achieved by moving the slider to the
right can also be achieved by clicking on the color region
using the Spill(-) operational mode. This slider bulges the
Primatte large polyhedron near the registered color region.

Transparency or M-poly Slider (Adjust Transparency)


When in the Fine Tuning Actions mode, this Transparency
slider can be used to make the matte more translucent in the
registered color region. After choosing the Fine Tuning
Actions mode and selected a color region, moving this slider
to the right makes the registered color region more
transparent. Moving the slider to the left makes the matte
more opaque. If moving the slider all the way to the right
does not make the color region translucent enough, re-
sample the color region and again move the slider to the
right. These slider operations are additive. This result
achieved by moving the slider to the right can also be
achieved by clicking on the color region using the Matte(-)

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 382
Primatte Tools and Buttons

operational mode. This slider bulges the Primatte medium


polyhedron near the registered color region.

Detail or S-poly Slider (Add/Restore Lost Detail)


When in the Fine Tuning Actions mode, this Detail slider can
be used to restore lost detail. After choosing the Fine Tuning
Actions mode and selected a color region, moving this slider
to the left makes the registered color region more visible.
Moving the slider to the left makes the color region less
visible. If moving the slider all the way to the left does not
make the color region visible enough, re-sample the color
region and again move the slider to the left. These slider
operations are additive. This result achieved by moving the
slider to the left can also be achieved by clicking on the color
region using the Detail(-) operational mode. This shrinks the
small polyhedron (which contains all the blue or green
background colors) and releases pixels that were close to
the background color. The S-poly slider in the Fine Tuning
mode is useful for restoring pixels that were lost because
they were so similar to the background color. This slider
dents the Primatte small polyhedron near the registered
color region.

Spill Process Section Complement/Solid/Defocus Spill Replacement


Allows the user to choose between the three methods of
color spill replacement as covered in detail in Section 5. Spill
Replacement Options and below.

no suppression
Replaces the spill color with the complement of the backing
screen color.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 383
Primatte Tools and Buttons

complement
Replaces the spill color with the complement of the backing
screen color.

solid color
Replaces the spill color with colors from a defocused version
of the background image.

defocused background
Replaces the spill color with a 'user selected' solid color.

Replace color Slider


When solid color is selected, this area allows the user to
select a solid color to use to replace the spill. For all other
spill replacement selections, this area is ‘grayed out’ and not
activated.

Defocus Slider
When defocused background is selected, this area allows the
user to adjust the amount of defocus applied to the
background buffer image. For all other spill replacement
selections, this area is ‘grayed out’ and not activated.

Output Section Output Mode Selector


These are the three formats for the output of the node.

composite
outputs the composite result of the Primatte node.

premultiplied
outputs the premultiplied result of the Primatte node.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 384
The Primatte Algorithm

unpremultiplied
outputs the unpremultiplied result of the Primatte node.

The Primatte There are three Primatte algorithms. Here is a chart that
Algorithm shows the main differences between them.

For a description of the Primatte algorithm, see “Explanation


of how Primatte works” below.

For a description of the Primatte RT+ algorithm, go to


“Explanation of how Primatte RT+ works” on page 396.

For a description of the Primatte RT algorithm see


“Explanation of how Primatte RT works” on page 397.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 385
The Primatte Algorithm

Explanation of how The Primatte chromakey algorithm is a sophisticated method


Primatte works of color space segmentation that can be easily explained to
help a user achieve maximum effectiveness with the tool.
Basically Primatte segments all the colors 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 works in 3D RGB color space. Here is a visual


representation of the Primatte algorithm after an image has
been processed.

By operating the Primatte interface, the user essentially


creates three concentric, multi-faceted polyhedrons. These
can be pictured as three globes (or polyhedrons or polys),
one within the other, which share a common center point.
The creation of these polyhedrons separates all possible
foreground colors into one of four regions; inside the small
polyhedron (1), between the small and medium polyhedrons
(2), between the medium and the large polyhedrons (3) and
outside the large polyhedron (4).

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 386
The Primatte Algorithm

The four regions created are described as follows:

Region 1 (inside the small polyhedron) - This region contains


all of the foreground image colors that are considered 100%
background. These are the green or blue or whatever colors
that were used as the backing color of the foreground image.

Region 2 (between the small and medium polyhedrons) - This


region contains all the foreground colors that are at the
edges of the foreground object(s), in glass, glass reflections,
shadows, sheets of water and other transparent and semi-
transparent color regions. These color regions also have spill
suppression applied to them to remove color spill from the
backing screen.

Region 3 (between the medium and large polyhedrons) - This

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 387
The Primatte Algorithm

region contains all the foreground image colors that are


100% foreground but have spill suppression applied to them
to remove color spill from the backing screen. Otherwise
they are 100% solid foreground colors.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 388
The Primatte Algorithm

Region 4 (outside the large polyhedron) - This region


contains all the 100% foreground image colors that are not
modified from the original foreground image. There is no spill
suppression applied to these colors.

In the first step in using Primatte (Select Background Color),


the user is asked to indicate the backing color on the original
foreground image. The sample should usually be taken from
a 'medium shaded' area near the foreground object. By
'medium shaded' area, it is meant that if green is the backing
color and the green area of the foreground image has many
shades of green ranging from very pale green to almost
black, a shade of green in-between these extreme ranges
should be chosen. If good results are not obtained using this
sample, Primatte should be reset and another sample taken
using a slightly darker or lighter shade of green. The first
sample of Primatte often determines the final result as the
center point of all three polyhedrons is created based on this
first sample.

A single pixel may be selected or a range of pixels (snail trail


or rectangular sample). If a range of pixels is taken, the
sample will be averaged to get a single color sample. This
single pixel or averaged color sample then becomes the
center of the small polyhedron. A few other shades around
that color are included in the original small polyhedron.

Note It is recommended that a single pixel be selected as the first


sample as you then have some idea where the center point
of the polyhedrons is located. If a box sample or a long snail
trail sample is made. You can only guess at the average color
that ends up being the center point. You can get an idea how
this sample affects the algorithm by resetting the Primatte
plug-in, going to the Matte View and clicking around on the

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 389
The Primatte Algorithm

green or blue screen area while in the Select Background


Color Operation Mode. You can immediately see the results
of the initial settings of the polyhedrons in this way.

After making a sample of the backing screen color in the first


step, the result is a small golf ball-shaped poly as shown in
the following image.

The second step in using Primatte is to clean up the backing


color area by adding additional shades of green or blue to
the small poly. This second step (Clean Background Noise) is
usually executed while viewing the black and white Matte

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 390
The Primatte Algorithm

View.

Figure 7.22: Before Figure 7.23: After background


background noise removal. noise removal.

While in the Clean Bg Noise sampling mode, the user samples


the white milky regions as shown in the left-hand image
above. As the user samples these regions, they turn to black
as shown in the right-hand image above.

What is happening in the Primatte algorithm is that these


new shades of green (the white milky areas) are added to the
small poly where all the shades of green or blue are moved.
The next two images show the new pixels sampled (white
dots) in relation to the small poly and the image next to it
shows how the small poly extends outward to encompass

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 391
The Primatte Algorithm

the newly sampled colors into the small poly.

The advantage of this technique is that the polyhedron


distorts to enclose only the shades of green that are in the
backing screen. Other shades of green around these colors
are left undisturbed in the foreground. Other chromakeyers
expand from a golf ball-sized shape to a baseball to a
basketball to a beach ball. Since it expands in all directions,
many shades of green are relegated to 100% background
making it hard to get good edges around the foreground
objects.

Now that the user has created a small polyhedron, he must


shape the medium and large polys. A default medium and
large poly are both automatically created and are then
modified based on the next couple of Primatte operations.
The third Primatte step (Clean Foreground Noise) is to
sample and eliminate gray areas in the 100% foreground
area of the image.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 392
The Primatte Algorithm

Figure 7.24: Before and after Figure 7.25: Before and after
foreground noise removal. foreground noise removal.

Again, the user makes several samples on the dark, grayish


areas on the foreground object until it is solid white in color.
Primatte is shaping the large polyhedron with each color
region that is sampled. Care should be taken in both this and
the previous steps to not sample too close to the edges of
the foreground object. Getting too close to the foreground
object's edges will result in hard edges around the
foreground object. Primatte uses these samples to modify
and shape the medium and large polys to the desired shape.
At this point, the matte or key has been created and would
allow the foreground objects to be composited into a new
background image.

If the user changes the display mode from the black and
white Matte View to the color Composite View, there is
usually 'color spill' on the edges (and sometimes the center)
of the foreground objects. When on the edges of the
foreground object, this spill comes from where the edges of
the foreground object blended into the backing color. If it is

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 393
The Primatte Algorithm

on the center of the foreground object, it usually results


from reflected color from the backing screen. The next
Primatte step, either Spill Sponge, Fine Tuning or Spill(-), can
now be used to eliminate this spill color.

Let's take a look at what is happening in the Primatte


algorithm while this next step is performed. Here is what the
various tools in Primatte do to the Polyhedrons when they
are used:

As you can see above, the Spill Sponge bulges the large
polyhedron in the color region specified. A color region is
specified by clicking on the image in a particular area with
spill present. For example, if the user clicks on some spill on
the cheek of a foreground person, Primatte goes to the
section of the large polyhedron closest to that particular

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 394
The Primatte Algorithm

flesh tone and bulges the polyhedron there. As a result, the


flesh tones move from outside the large poly to in-between
the medium and large polys. This is Region 3 and, if you
remember, is 100% foreground with spill suppression. As a
result of the suppression, the spill is removed from that
cheek color and all other shades of that color on the
foreground. The user would then continue to sample areas of
the image where spill exists and each sample would remove
spill from another color region.

When all spill has been removed, the user should have a final
composite. As a last step, he should go back to the Matte
View and make sure that gray, transparent areas have not
appeared in the foreground area. If there are any, the Matte
Sponge Operation Mode should be selected and those gray
pixels are sampled until they have all turned white again.

The Matte Sponge and Spill Sponge tools bulge or dent the
polyhedrons a pre-selected amount. If the desired results
are not achieved or the results are too extreme for the
image, a manual method can be applied. The user should
choose the Fine Tuning sliders, select a color region of
interest and then move the appropriate slider to get the
desired results.

For example, to remove spill, select a region of the


composite image with spill on it. Move the spill or large poly
slider to the right a little bit, the large poly will bulge and the
spill should disappear. Move it a little more, if necessary.
Moving this slider to the right removes spill (moves the
colors from outside the large poly to between the medium
and large polyhedrons) and moving it to the left, dents the
large poly and moves that color region to outside the large
poly.

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 395
The Primatte Algorithm

If the user samples a foreground object shadow and then


moves the Matte or medium poly slider to the right, the
shadow will become more transparent. This is useful for
matching composited shadows to shadows on the plate
photography. It can also be used to make clouds or smoke
more transparent.

If some foreground detail disappears during the composite,


the user can select where the detail should be and then move
the detail or small poly slider to the left. This dents the small
poly in that color region and releases the detail pixels from
the small poly into the visible region between the small and
medium polyhedrons.

The Spill Sponge and Matte Sponge tools are 'shortcut tools'
that automatically move the sliders a pre-selected amount
as a timesaving step for the user. Other 'shortcut tools'
include the Make Foreground Trans. tool and the Restore

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 396
The Primatte Algorithm

Detail tool.

These 'shortcut tools' are one-step operations where the


user clicks on a color region of interest and Primatte
performs a pre-calculated operation. Hopefully, most
operations using Primatte would only require these tools,
but the manual operation of the sliders is always an option.

The Spill(-) tool bulges the large poly a small amount


incrementally in the color region that is clicked on and the
Spill(+) tool dents it a small amount with each click. The
Matte(-) and Matte(+) tools do the same to the medium poly
and the Detail(-) and Detail(+) do it to the small poly.

Explanation of how The Primatte RT+ algorithm differs from the Primatte
Primatte RT+ works algorithm in that it has a six surface color separator instead

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 397
The Primatte Algorithm

of the 127-faceted polyhedrons. This makes the Primatte


RT+ algorithm much simpler and, therefore, faster to
calculate. The results and performance of Primatte RT+ falls
in between the Primatte and Primatte RT options. Where the
Primatte RT+ algorithm might not work well is with less
saturated backing screen colors and it also does not support
the Complement Color spill suppression method (which is the
spill suppression method that delivers the best detail). For a
well-lit and photographed image or clip, this algorithm will
produce good results and render quickly.

Here is what a visual representation of the Primatte RT


algorithm looks like after an image has been processed:

Explanation of how Primatte RT is the simplest algorithm and, therefore, the


Primatte RT works fastest. It uses only a single planar surface to separate the
3D RGB colorspace and, as a result, does not have the ability
to separate out the foreground from the backing screen as
carefully as the above Primatte algorithm. Like the Primatte
RT+ algorithm, Primatte RT might not work well with less
saturated backing screen colors and it too does not support

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 398
Contact Details

the Complement Color spill suppression method (which is the


spill suppression method that delivers the best detail). For a
well-lit and photographed image or clip, this algorithm will
produce good results and render very quickly.

Here is what a visual representation of the Primatte RT


algorithm looks like after an image has been processed:

Contact Details

Main office IMAGICA Corp. of America, 1840 Century Park East, #750,
Los Angeles, CA, USA 90067

Primatte office IMAGICA Corp. of America, 3113 Woodleigh Lane, Cameron


Park, CA 95682. Phone: 1-530-677-9980, FAX: 1-530-
677-9981, Cell: 1-530-613-3212, E-mail:
[email protected], Website: http://primatte.com

The Foundry Nuke 6.0v5


KEYING WITH PRIMATTE 399
Proprietary Notices

Proprietary Primatte is distributed and licensed by IMAGICA Corp. of


Notices America, Los Angeles, CA, USA. Primatte was developed by
IMAGICA Corp., Tokyo, Japan. Primatte is a trademark of
IMAGICA Corp., Tokyo, Japan.

The Foundry Nuke 6.0v5


KEYING WITH KEYLIGHT 400
Quick Key

8 KEYING WITH KEYLIGHT

This section explains how to use the blue/green screen


keyer, Keylight, in Nuke.

Quick Key Consider this shot from The Saint, pictures courtesy of CFC
and Paramount British Pictures Ltd.

Figure 8.1: Blue Screen.

Figure 8.1 is the blue screen foreground that should be


composited over the background shown in Figure 8.2.

Figure 8.2: Background.

1. Start Nuke and read in both images. From the Keyer


menu, apply Keylight and attach a Viewer.

The Foundry Nuke 6.0v4


KEYING WITH KEYLIGHT 401
Quick Key

2. Click the color swatch next to Screen Color to activate


the eye dropper. In the Viewer, Ctrl+Shift+Alt+click (Mac
users Cmd+Shift+Alt+click) and drag a rectangular area
over the blue pixels as shown in Figure 8.3.

Figure 8.3: Pick the Screen Color.

Picking the screen color also sets the Screen Balance.


3. That’s it. In many cases, this is all you will need to do to
perform a key, since selecting the screen color creates a
screen matte and despills the foreground.
4. Switch output from Final Result to Composite to see the
foreground keyed over the background. The final
composite is shown in Figure 8.4.

Figure 8.4: Final composite.

The Foundry Nuke 6.0v4


KEYING WITH KEYLIGHT 402
Basic Keying

Picking the screen color may be enough for a lot of keys, but
there are many more tools within Nuke that can be used to
tackle more complicated shots. These are described later in
this chapter.

Basic Keying The following section describes the parameters you need to
do basic keying. This will give you enough to tackle most
simple keys. A discussion of advanced parameters to fine
tune keys and tackle complex keys can be found on
page 405.

Picking the Screen The screen color is probably the most important parameter
Color and you should always pick the screen color before doing
anything else. It should be set to the color of the green or
blue curtain behind the foreground object. Pick the screen
color directly from the image by Ctrl+Shift+Alt dragging
(Cmd+Shift+Alt+dragging on a Mac) a rectangle over the blue
pixels. The average value of the pixels selected is used.

Tip If you press Alt when sampling a color, Nuke always samples
the source image regardless of what you’re looking at. This
means that you can pick the blue screen color even if you are
viewing the matte, status or composite.

Tip Picking different shades of blue from the screen color can
give quite different results. It’s worth picking from different
parts of the screen to get the best result.

Picking the Screen Color creates the screen matte used to


composite the foreground over the background. It also sets
the Screen Balance (if this has not already been set

The Foundry Nuke 6.0v4


KEYING WITH KEYLIGHT 403
Basic Keying

manually) and despills the foreground.

Screen Matte Setting the screen color will pull a key, or in other words,
create a matte - the Screen Matte. Setting the screen color
will also despill the foreground, although you can also use
the Despill Bias to remove more spill. In some cases this is
enough to get a decent key. For more information on Screen
Color see page 402.

Figure 8.5 shows a well-lit blue screen behind an actor.

Figure 8.5: Blue Screen.

You should note that repeatedly picking colors does not add
to previous selections and key more of the image with each
click. To key more of the image, try picking different shades
of blue then use the screen strength parameter. See “Keying
More” on page 405.

Viewing the Key After picking the screen color, you have created a matte (the
screen matte) and despilled the foreground. The result can
be displayed in a number of different ways using the View
control. You can output the final composite of the
foreground over the background as an rgba, or you can

The Foundry Nuke 6.0v4


KEYING WITH KEYLIGHT 404
Basic Keying

output the premultiplied or unpremultiplied foreground for


compositing elsewhere in the tree. The screen matte and the
status view are the other two options which are useful in
fine tuning the key rather than as an output image in their
own right.

The Status is one of the options in the View menu and shows
an exaggerated view of the key so that you can make a more
informed decision when tuning the key. Figure 8.7 shows the
Status display after the screen color has been picked from
the image shown in Figure 8.6.

Figure 8.6: Green Screen. Figure 8.7: Status.

Three colors are displayed:


• Black pixels show areas that will be pure background in
the final composite.
• White pixels show areas that will be pure foreground.
• Gray pixels will be a blend of foreground and background
pixels in the final composite. You need gray pixels around
the edge of the foreground to get a good key at the
foreground edge. Pixels that are a blend between the
foreground and background are shown in just one shade
of gray. This is done to highlight potential problems with
the key. These gray pixels may represent a foreground/

The Foundry Nuke 6.0v4


KEYING WITH KEYLIGHT 405
Advanced Keying

background blend of 50/50 or 99/1. No distinction is


made as to this ratio.

You may occasionally see other colors in the Status view and
these are covered under “Status” on page 406.

Keying More To improve the key by firming up the foreground so the


background doesn’t show through, you should adjust the Clip
White parameter. To key more of the foreground so that the
background is clearer, you should use the Clip Black
parameter. Look at the Screen Matte and the Composite
while you’re doing this. Don’t overdo either of these or the
edges between foreground and background will become hard.

Advanced Keying The following section describes how Keylight works under
the hood as well as the parameters you need to fine tune
keys and get the most out of Keylight. Basic parameters
covered in the previous chapter may also be covered here in
more detail.

Under The Hood Keylight is a ’color difference keyer’, which means that for it
to figure out a key, it compares every pixel in the image
against a single color, known here as the Screen Color.

View The View parameter allows Keylight to render the final


composite of the foreground over the background, or the
foreground RGBA for compositing further down the tree.
Two options, Screen Matte and Status, are for viewing the
key rather than an output. The options are:

The Foundry Nuke 6.0v4


KEYING WITH KEYLIGHT 406
Advanced Keying

• Source - shows the blue/green screen foreground.


• Source Alpha - shows the alpha channel on the
foreground input.
• Screen Matte - this is the matte created from picking the
Screen Color. It does not include any inside or outside
masks.
• Inside Mask - shows the inside input. This is used to firm
up the foreground matte to stop print through.
• Outside Mask - shows the outside input. The outside
mask is used as a garbage mask to reveal the background.
• Combined Matte - the screen matte, inside mask, and
outside masks added together.
• Status - this renders an exaggerated view of the key so
that minor problems are shown clearly. See “Status” on
page 406.
• Intermediate Result - use this option on shots that can
only be keyed using several different keys on different
parts of the image (multipass keying). This renders the
original source image with the Screen Matte generated in
this Keylight node. In Keylight nodes down the tree, you
should set the Source Alpha in the Inside Mask folder to
Add To Inside Mask.
• Final Result - this creates a premultiplied RGBA
foreground that can be composited later. There’s an
Unpremultiply Result toggle you can use if you wish.
• Composite - this renders the foreground composited over
the background using all mattes, spill and color
corrections.

Status
Status is one of the options in the View menu and shows an
exaggerated view of the key so that you can make a more
informed decision when fine tuning the composite.

The Foundry Nuke 6.0v4


KEYING WITH KEYLIGHT 407
Advanced Keying

Figure 8.7 shows the Status after the screen color has been
picked from the image shown in Figure 8.6 on page 404.

Figure 8.8: Green Screen. Figure 8.9: Status.

Three colors are displayed:


• Black pixels represent pure background in the final
composite.
• White pixels are pure foreground.
• Gray pixels are a blend of the foreground and background
pixels. The gray is just one color to highlight any areas
that are not pure foreground or background. Gray pixels
do not mean the key is poor - the final composite may be
fine.

You may occasionally see other colors in the Status view.

The Foundry Nuke 6.0v4


KEYING WITH KEYLIGHT 408
Advanced Keying

Figure 8.10 shows black, white, gray, and green pixels.

Figure 8.10: Status showing Figure 8.11: Composite


processing of the alpha showing Screen Replace Color.
channel.

• Green pixels are a warning. They show you the parts of


the alpha that have changed through processing the
alpha channel (clipped, softened, or eroded). These areas
have had the correct amount of spill removed, but the
alpha has subsequently changed and the composite may
no longer look right. This can be corrected using the
Screen Replace Color to put back color in these areas.
Figure 8.11 is an extreme example to illustrate the point.
The Screen Replace Color has been set to pure red and
you can see that this mirrors the green pixels in the
Status view.

The Foundry Nuke 6.0v4


KEYING WITH KEYLIGHT 409
Advanced Keying

Similarly, you may see blue pixels in the Status.

Figure 8.12: Status showing Figure 8.13: Composite


how the inside matte will showing the inside replace
affect the foreground. color.

• Blue pixels represent processed pixels in the Inside Mask


that affect the despill of the foreground. The Inside
Replace Color will be used to modify these pixels. Another
extreme example is shown in Figure 8.13. The Inside
Replace Color is set to pure yellow and the Inside Replace
is Hard Color.

You may also see dark red pixels in the Status.


• Red pixels indicate areas where an outside mask has been
used to reduce the transparency of the image.

Screen Color The screen color represents the color of the pure blue (or
green) screen. The first thing you should do when pulling a
key is pick the Screen Color.

Note If you press Alt when sampling a color, Nuke always samples
the source image regardless of what you’re looking at. This
means that you can pick the blue screen color even if you are
viewing the matte, status or composite.

The Foundry Nuke 6.0v4


KEYING WITH KEYLIGHT 410
Advanced Keying

Picking the Screen Color creates the screen matte used to


composite the foreground over the background. It also sets
the Screen Balance and despills the foreground.

The Screen Color is a single color. It has a primary


component, blue or green, and that has a saturation. Once
the screen color has been picked, Keylight analyzes all the
pixels in the image and compares the saturation of the
primary component in each of these pixels with the
corresponding saturation of the screen color. Keylight uses
this comparison to do two things.
1. It calculates the transparency of that pixel and puts it in
the alpha channel.
2. It removes the screen color from the pixel, a process
known as despilling.

Tip It’s worth sampling a selection of screen (blue or green)


colors and viewing the result. Picking different colors will
give different results.

Background Pixel
If the saturation of the pixel in the image is as strong or
greater than the screen color, then it’ll be a pixel from the

The Foundry Nuke 6.0v4


KEYING WITH KEYLIGHT 411
Advanced Keying

blue screen background, and that pixel will be set to


completely transparent and black. See Figure 8.14.

Figure 8.14: Blue screen pixel set alpha to zero.

Edge Pixel
If the saturation of the pixel is less than the screen color,
then it’ll be the edge of the foreground object, and we
subtract some of the screen color from the pixel (despilling)
and set the image to semi-opaque. See Figure 8.15.

Figure 8.15: Edge pixel gives partial alpha.

The Foundry Nuke 6.0v4


KEYING WITH KEYLIGHT 412
Advanced Keying

Foreground Pixel
If the primary component in the pixel is not the same as the
primary component of the screen color, we have a
foreground pixel, and the alpha is set to completely opaque.
The pixel color is not modified. See Figure 8.16.

Figure 8.16: Foreground pixel gives full alpha.

Note You should note that the Screen Color is a single color. You
are not picking lots of colors that are keyed out.

Biasing
What’s biasing all about? Biasing in Keylight was originally
developed for a shot in the motion picture "Executive
Decision". The foreground consisted of reddish browns, but a

The Foundry Nuke 6.0v4


KEYING WITH KEYLIGHT 413
Advanced Keying

combination of factors led to the 'green screen' being lit so


that its primary component was actually slightly red.

Figure 8.17: Is this the worst green screen you’ve ever


seen?

So what happens when we pick the screen color? Well


because the screen was 'red', as is the foreground, our pilot
ends up being keyed out as shown in Figure 8.18.

Figure 8.18: Default key showing the transparency in


the foreground as a result of picking the "red" screen
color.

Not a great result, I’m sure you’ll agree, and much pressure
was applied to the lowly programmers to get around the

The Foundry