I’m pretty confident with expressions in Nuke, but once I start adding expression within text fields in Nuke (in node labels or Text nodes) I quickly get confused with the syntax. Today I wanted to round the value from a knob before displaying it and I had to ask around before I got it right so I thought I’d make a note of it.
[expression (rint([value knob]))]
Or if you wanted to simply multiply a value by 2 before displaying it you would use:
[expression ([value knob]*2)]
]]>In this video I show you four preferences I change as soon as I sit down at a new Nuke installation, whether that is at a new studio, a new computer, or a fresh installation.
Here are the four preferences:
I will usually customize my Nuke workspace. I don’t deviate too far from the default, but if I’m on a setup with two monitors I will definitely have the viewer in a floating window on the primary monitor and move my node graph and properties pane to the other display. Once I have saved my workspace I will set my new workspace to be the default layout every time I launch Nuke with:
Preferences > Startup > startup workspace
By default Nuke will keep up to 10 properties panels open in the properties pane until it closes one when you open another. That is way too many panels to have open at once and is never useful.
Not only is it not useful but it can lead to a clutter of onscreen controls, which could lead to you changing properties in the wrong node. Personally I think having two panels open at once is as many as you usually need so I set that as the default number:
Preferences > Control Panels > max nodes in properties bin
There is an option to add colours to the pipes in your node graph that dynamically change based on the direction your data is flowing. I always set it so that pipes that are flowing upwards start to turn red as soon as they pass horizontal. That way I can see if the script is heading in the wrong direction.
You can pick any colours you want, and can add different colours for up, down, left and right. To set the colours go to:
Preferences > Node Graph > Arrow
Nuke has it’s on default controls for navigating the 3D space. I couldn’t even tell you what they are, but I know they are confusing because they don’t match other 3D packages. I always set the 3D controls to match Maya with:
Preferences > Viewer Handles > 3D navigation > Maya
Beauty and the Beast was already in production at Digital Domain when I started there to work on Deadpool, and it was still going after I finished working on Independence Day: Resurgence. And it went on for about another 6 months after that.
DD was responsible for two main parts of the project, The Beast and he’s castle.
The Beast was a complicated CG asset with lots of hair and cloth sims. The renders required a lot of work in comp, as well as lots of complicated integration work when he interacted with live action actors.
The castle was also CG but had a lot of matte painting enhancements.
As well as those two main elements there was also a lot of magic FX, and some CG wolves.


I was supposed to be working on Beauty and The Beast at Digital Domain after Deadpool but they picked up some last minute work for Independence Day: Resurgence and they had to put together a small team of us to quickly turn around a single, but pretty complicated sequence. The sequence we worked on was the initial attack on the alien mothership, which turned into a huge dog fight with hundreds of alien aircraft. There was a mix of simple cockpit interior blue screen shots, and then huge full CG shots, with hundreds of CG elements.
The movie wasn’t great, and we did some overtime, but it was kind of fun to be part of a smaller team and turn something around quite quickly.
]]>The .nuke folder is created automatically when you install Nuke and it is important to know about when you want to start customizing how Nuke works. It’s where you can install plug-ins and python scripts. It is also where you can find the init.py and menu.py files. These two python files are vital when you want to start doing things like adding your own keyboard shortcuts, changing default values on node, or creating your own menus.
But the .nuke folder is hidden by default so this video shows you where how to find it. I show you several ways to see hidden files on a Mac, including how to use the Terminal, and how to show hidden files in Finder.
To move up one directory from where you are currently: ⌘+↑
To open up Go To Folder dialogue: SHIFT+⌘+G
To toggle hidden visability of folders and files: SHIFT+⌘+.
To move to another directory use cd for change directory and then the directory name eg. cd .nuke
To move up one directory from where you are currently: cd ..
To return to your home directory from anywhere use the ~ shortcut: cd ~
To list the files and folders in the current directory: ls
To list all of the files and folders, including hidden ones: ls -a
In this video I show you a few simple keyboard shortcuts for connecting nodes and moving nodes in your Nuke script. Knowing some of these simple shortcuts can really speed up your compositing in Nuke
In summery:
With two nodes selected, pressing Y will connect the input of which ever node was selected first, to the other node. Shift+Y will connect the input of the second node selected to the first.
CTR+SHIFT+X (⌘+SHIFT+X on a Mac) will disconnect any selected nodes from the rest of your script.
CTR/⌘ + ↑ or CTR/⌘ + ↓ will move the selected node up or down the branch, leapfrogging other nodes above or below it.
Holding shift while you create a new node will automatically put the new node on a new branch of your script.
Pressing Shift+X will swap the inputs of the selected node, eg switch A and B.
]]>Dealing with animation values with Python in Nuke is way more confusing than dealing with other values in Nuke. There are a few useful pages out there with lots of information, like the Foundry developers guide, or this guide from Nathan Rusch on Nukepedia. But when a friend asked me if I knew how to get a list of frames that had keyframes on for a particular knob I couldn’t figure out the answer from either of those, so I did a little more searching and found this old forum post from way back in 2011. In this post Pete O’Connell had already figured out the code I needed to get a list of keyframes from a knob. I simplified it a little and changed to work with Multiply node with an animated ‘value’ slider.
n = nuke.selectedNode()
keyframes = []
k = n['value'].animations()[0]
for i in range (len(k.keys())):
keyframes.append(k.keys()[i].x)
print (keyframes)In this tutorial I build on the custom stabilize and match move nodes that I built with expressions in my previous video to add a control that allows us to adjust the scale of the match move or stabilize effect and allows us to animate the effect over time.
Here are the expressions that I used in the stabilize node:
((Tracker1.tracks.1.track_x(ref_frame) - Tracker1.tracks.1.track_x))*amount
((Tracker1.tracks.1.track_y(ref_frame) - Tracker1.tracks.1.track_y))*amount
And these are the match move expressions:
(Tracker4.tracks.1.track_x - Tracker4.tracks.1.track_x(ref_frame))*amount
(Tracker4.tracks.1.track_y - Tracker4.tracks.1.track_y(ref_frame))*amount
Remember that amount is the name of the slider that I added to the node and represents the scale of the final result. A value of 1 will give you the original result and a value of 0 will mean that the expression will have a result of 0 so will have no effect on the image.
I have saved a simplified version of the two nodes, without the clips, here for you to download yourself. Rather than saving as a .nk file, which some of you might not be able to download at your studio, I’ve saved the script as plain text so you can simply copy and paste this int a Nuke script.
]]>When you are working on anything but a very simply python script it is usually better to write it in a dedicated IDE rather than try to work exclusively in the Nuke script editor. But it can be a bit of a pain to test your code in Nuke if you are writing it in a different program. It usually involves copying and pasting code from the editor to Nuke, then running it, and if you make and changes in the Nuke script editor, copying them back to the IDE.
I have been using Atom for my IDE which has a Nuke extension that allow you to run code directly from Atom in an open Nuke session, you can read more about that here.
You can also save your script, setup your menu.py file to import it, and then launch Nuke and it will import your script read to run. The problem with this approach is that you have to quit Nuke and relaunch it whenever you make changes to your script. Or so I thought until I learned about the reload function.
Before Nuke 13 Nuke used Python 2.7. In this version of Python you could simply use reload() to reload modules that Nuke had already loaded, but that had changed since. So in the Nuke script editor you could simply run the following line after you saved a change to your external .py file:
reload(myModule)But when I tried this in Nuke 13 the other night it didn’t work. Nuke 13 has moved from Python 2.7 to Python 3.7.7 After a quick search I discovered that in Python 3 the reload function is now part of the importlib library that has to be imported separately. So to reload a module in Nuke 13 you need:
import importlib
importlib.reload(myModule)Just keep that in you Nuke script editor and run it every time you save the .py file you are working on and the changes will be updated inside Nuke.
]]>Back in February this year I was asked to be part of the “Meet The Masters” – Compositing Panel as part of the 2021 Spark FX conference. The panel was hosted by Chris Van Dyke and he invited four compositors, myself, Ben McEwan, Aleksandra Sienkiewicz, and Fenner Rockliffe to join him. Between us we came up with he title of “V01 To Done” for our collection of presentations, and we tried to cover a little bit of all the skills a compositor might need to get a shot through the whole production.
Ben talked about some of the basic mathematics that compositors should know to understand how Nuke does some of the operations we use regularly. His section of the presentation is available on his website. Aleks talks about how she works with CG renders and shared some tips on how to add that little extra something special to your full CG shots. And Fenner talked about adding some creative stylization to finish your shots.
I decided that I should bookend those Nuke focused talks with two presentations that focus more on the softer skills of compositing that aren’t talked about as much as Nuke tips.
My first presentation, Steps To Success, talked about the order in which you should approach all the tasks in your shot. I talked about time management, the fact that other departments might require things from us at different stages of the project, and how we should make sure we have a version of the shot that can be put in the final movie before we get hung up on tiny details.
In this video I discus how visual effects requires you to think both creatively and technically, and how some people are better at one than the other. I talk about how these two approaches can sometimes conflict with each other, and how some projects require one more than the other. And how changing your personal goals for a project can help you feel content with whatever kind of your you have to do.