Compositing in Nuke can be really fun, especially if you have your workflow dialed in so you are able to focus on the creative aspects of your shot.
But even then, there are things that can drive you crazy and reduce your speed a lot, like bugs, weird behavior, and slow computation.
Today we are looking at those specifics to make your life in Nuke easier and faster.
Let's start by talking about different bugs and behaviors that will mess with your comp workflow:
1. The "Roto Bug":
Chances are, you encountered the "Roto Bug" before, without realizing it.
What is the "Roto Bug":
You will know that you are encountering the Roto Bug if the following happens:
- Disabling nodes does not work.
--> You have to click somewhere to get a node into the "disabled" state.
- The viewer does not update anymore.
--> No matter if you create new nodes or disable existing ones.
1. Create a new Roto node
2. Draw a Roto shape with at least 3 vertices and close the shape
3. Nuke will behave normal again
Sometimes when using the Roto or Rotopaint node, Nuke will get stuck in the state of "Drawing a roto shape".
--> You can get stuck in this state even though you finished drawing your shapes.
--> You can exit the state by closing a new shape.
2. Locked connections:
Sometimes you might not be able to unplug node-connections.
There are 2 causes for that:
1. The "lock all connections" checkbox is ticked. (either in the project settings or in group properties)
2. You encountered a bug.
How to fix the bug:
Select the problematic node and create a dot
Disconnect the dot from the node that caused the issue
Delete the "Dot" node
You should now be able to connect & disconnect the node normally again
If a node gets into a locked state, you can pass this state to a new node, by for example creating a dot.
--> By disconnecting and deleting it you get rid of this state and everything should behave normally again.
3. Navigating Node Loops:
There is also the opposite case, of not being able to connect two nodes.
There are again, 2 different causes:
1. The nodes are not from the same type
--> 2D, 3D, Deep and Particle nodes etc.
2. You created a node loop
--> The output of a node would be part of its input when you connect it.
How to handle node loops:
- The best way to prevent this is comping in a structured way
--> One main B pipe with all layers merged on top from the left
- Analyse the way the information flows through your comp
--> When selecting a node, the orange pipes show the path to its input
4. The Frame Range Lock:
Did you ever wonder why Nuke keeps changing the Frame Range in your project settings automatically?
This happens when you import a 2D sequence (add a Read node) into your comp, which does not match your project frame range. Nuke will set the project range to the new range automatically.
You have to check this checkbox in the project settings.
(I can´t be the only one who found this checkbox way too late, can I? )
5. Updating Plugins twice
I sometimes encounter the problem that pressing the "update" button in the "all plugins" menu does not reload all my tools properly.
Solution: In that case, hitting the button a second time makes it possible to access all Gizmos, etc. again.
If you don´t want to load your tools this way every time you open Nuke, add this code to your menu.py file, to automatically reload your tools on startup.
Optimizing Nuke: Working Smarter, Not Harder
With all of those quirks out of the way, Nuke can still get really slow from time to time.
If you keep the following things in mind, I can guarantee that you will finish your work faster.
1. Restart Nuke often:
Even without any bugs, Nuke's computation speed will go down the more you comp in one active session.
This is especially true because the RAM fills up really quickly when working with huge comps.
Even though there is the option to clear all the memory Nuke uses, by clicking:
"Cache -> Clear All"
In reality, this does not clear it completely.
--> The only way to get Nuke to feel like a new clean session is, well to open a new clean session.
2. Stop using Projections:
This might be a hot take because, for the most part, projections in Nuke are a miracle!
But, I want to talk about projecting images, masks, etc. on flat surfaces/cards,
which is the case most of the time:
Instead of projecting something on a card, it is way faster to convert the card into a CornerPin.
--> Especially if you want to reuse that specific projection over and over again. Let me show you my workflow:
--> I use this Gizmo from Jed Smith: https://gist.github.com/jedypod/98dc18acd8008e7e5cbe#file-planarprojection-nk
Now you can use these Cornerpins everywhere in your comp without the need to copy the 3D setup around.
(make sure to disable the PointCloud or Geo after creating the CornerPin - we will get to that later)
3. Always Crop after a CornerPin:
One of the easiest ways to mess up your BoundingBox is, by not double-checking how your CornerPin nodes affect it.
Without you knowing it, the BoundingBox can shoot up to 10.000.000 x 10.000.000 pixels, only because your shot camera makes a sudden turn. Which in turn, makes your comp super slow.
Solution: Always add a Crop node after each CornerPin you create!
(Especially since we learned to replace most projections with CornerPins)
I would go as far as suggesting, to use a script that automatically places a Crop after each of the CornerPins in your script. (I haven´t implemented that myself tho.)
4. Track in a separate Nuke file:
While talking about CornerPinning, it is worth noting that doing all your tracking operations in a separate Nuke file will speed up the processing time massively.
- 2D point Tracks
- Planar Tracking
- 3D Tracking
- Reconciling 3D positions to 2D
Most of the time I create a second Nuke file without taking the time to name it properly, copy my plate, geometry over, etc. and track away.
--> Just make sure to copy the tracker, reconcile, etc. over into your main file before closing, so as to not lose your tracking sources. (or save the tracking Nuke file properly)
5. Prerender before Frame iterations
Do you know the feeling when your render or prerender suddenly takes ages even though it rendered in a couple of seconds per frame, just a few hours ago?
--> I often experience that, adding a node that iterates over multiple frames like a "Frameblend", is the cause of such a big slowdown.
The best way to handle those scenarios is to prerender your comp right before these nodes (and after the nodes too) to avoid it being recalculated over and over again when rendering on a render farm.
6. Disable Heavy Nodes:
While talking about slowdowns in Nuke, we can not dismiss the importance of disabling heavy nodes.
This is especially true for certain types of nodes, which will keep making your file slower, even though they are not actively being calculated.
- Heavy geometries
- All particle nodes
- All PointCloud Generators
- Read nodes (with Postage Stamp on)
Just having them somewhere in your Nuke file will make it really slow and laggy, so make sure to always prerender the part they are used in and turn them off afterwards. --> I tend to add a little sticky note next to them, to inform the next artist who opens the script that these need to be turned on, before rerendering that part.
1. Bake Formats when sharing Setups:
In compositing, like in all parts of VFX, it is really common to share setups between artists and shows.
One problem that arises is that all notes from the "draw" menu use the "root format" from the project settings, which will vary in different Nuke files.
To make sure a Nuke setup looks the same for another comper, you can bake the format into nodes that use the "root.format" by default.
--> This includes Roto, Noise, Ramp, etc.
There are 2 ways to bake a format into nodes:
2. Add a Reformat or Constant with the desired format before the node
This way you will also keep the sanity of everyone who uses your setups.
2. Update Python Scripts with Chat GPT
When Nuke 13 was released, a lot of tools, scripts, and pipelines broke because, from that version onwards, Python 3.7 is used instead of 2.7. Until today there are many scripts that are written in Python 2.7.
A lot of studios finally made the transition to Nuke 13+ in the last 12 months, so it is time to update your scripts, etc.
One of the ways to do so is using Chat GPT:
You can use the following prompt to get a starting point for fixing your code:
I want to run a python script in the compositing software Nuke. The python script was written in Python 2.7 but since i am using Nuke version 14 which runs with python 3.7 i can not run the script anymore. Please rewrite the following code so i can run it in Nuke 14 on Python 3.7: ""Add your Python 2.7 code here""
(During my tests, the syntax was adjusted correctly. The only problem was that some other parts of the code got changed too. But since Chat GPT, can also show you which parts it adjusted, it is easy to get to a working code for Python 3.7)
Learning Compositing is a never-ending journey and all the small tips and tricks we have discussed in this article are another step towards getting better every day. All advice in this article is based on what I have learned and experienced in my professional journey. Not everything might apply to your situation or even the version of Nuke you are using. I would be happy to hear about your experience with the aforementioned particularities in Nuke or any other similar advice on "How to keep your sanity in Nuke".
Reach out to me on LinkedIn: --> https://www.linkedin.com/in/marcelpichert/