top of page

Updated: Sep 9, 2022

Rendering via command line is a handy way to render Nuke scripts in the background or remotely in the absence of a render farm/manager such as Deadline. This method also allows you to leverage your gpu(s) for rendering which is not currently supported when rendering with Frame Server.


Here's a few tips, examples and references to get started along with some bonus flags to debug the Frame Server as well.


* This guide was performed in Windows and there are slight differences for the system environment variables if you are using MacOS/Linux shell documented in the Nuke user guide.

  • Open a command line/terminal shell prompt and change directory to Nuke.exe path

cd C:\Program Files\Nuke13.2v3\
  • I recommend adding the Nuke.exe path to your system environment variables to avoid having to type/cd into that path each time.


  • Alternatively, you can set a doskey to point to Nuke and then you can launch Nuke from any directory:

doskey nuke="C:\Program Files\Nuke13.2v2\Nuke13.2.exe"
  • If you want to doskey NukeX, enter:

doskey NukeX="C:\Program Files\Nuke13.2v2\Nuke13.2.exe" --nukex
  • If you want to doskey Nuke Studio, enter:

doskey nukes="C:\Program Files\Nuke13.2v2\Nuke13.2.exe" --studio


Nuke Command Line render flags:


# Launch Nuke Studio

--studio

# Launch NukeX

--nukex

# Launch in safe mode

--safe

# Enable Interactive License

-i

# Enable GPU Rendering

-gpu

# Display version info

--version

# Verbose mode low/med/high: (0/1/2)

-V 1

# Pause viewers

--pause

# Measure Performance

-P

# Open script(s) at proxy resolution

-p

# Measure your nodes performance metrics and write them to an XML file at render

time. See Using Script Profiling for more information.

-Pf <filename>

# Set render range frame '1-100'

-F 1-100

# Open Nuke script at full resolution

-f

# Continue on errors

--cont

# Background mode

-b

# Anamorphic format

-a

# Open script without Postage stamp nodes

-n

# Nuke priority specifiy: (low/medium/high)

--priority p

# Quite mode

-q

# Limit the cache memory usage, where size equals a number in bytes. You can specify a

different unit by appending k (kilobytes), M (megabytes), or G (gigabytes) after size.

-c size (k, M, or G)



Examples:

  • Run NukeX in interactive mode (-i) and render 'Write_EXR' node with frame range '1-240' with gpu acceleration and verbose level 2

Nuke13.2.exe --nukex -i -F 1-240 -gpu -V 2 -X Write_EXR --pause S:\PROJECTS\path_to_my_nuke_script_v01.nk
  • You can also have multiple terminal/shell instances running without the overhead of the Nuke gui saving you precious memory and VRAM.


  • Using a StickyNote or Backdrop node you can grab the Nuke script path easily and append it to a command line render with this TCL snippet:

Nuke13.2.exe --nukex -i -F 1-240 -gpu -V 2 -X Write_EXR --pause [join [lrange [split [file dirname [knob root.name]] "/"] 0 end-1] "/"]/[lindex [split [value root.name] /] end]


Frame Server debugging commands (useful for troubleshooting Frame Server issues):


# Frame Server Debug Log

--frameserver-loglevel DEBUG

# Manually launch Frame Server with 3 workers and 6 threads each, 48gb max memory

python.exe pythonextensions\site-packages\foundry\frameserver\nuke\runframeserver.py --numworkers=3 --nukeworkerthreads=6 --nukeworkermemory=48192 --workerconnecturl tcp://hostip:5560 --nukepath=Nuke13.2.exe --useInteractiveLicense

# Check Frame Server connection (Nuke/NukeX)

from hiero.ui.nuke_bridge.FnNsFrameServer import frameServer
print([worker.address for worker in frameServer.getStatus(1).workerStatus])

# Check Frame Server connection (Nuke Studio)

from hiero.ui.nuke_bridge.nukestudio import frameServer
print([worker.address for worker in frameServer.getStatus(1).workerStatus])

# Disable Frame Server Nuke

"C:\Program Files\Nuke13.1v1\Nuke13.1.exe" --disable-nuke-frameserver

# Disable Frame Server Nuke Studio

"C:\Program Files\Nuke13.1v1\Nuke13.1.exe" --studio --disable-nuke-frameserver

# Disable Frame Server Hiero

"C:\Program Files\Nuke13.1v1\Nuke13.1.exe" --hiero --disable-nuke-frameserver

References:

How to Render Using the GPU in Nuke (macOS): https://cristianogiardina.com/general/nuke-render-gpu-macos/

406 views0 comments

Updated: Jun 3, 2018


Well thought out node graphs designed with proper color coded backdrops are not only a pleasure to pick up and work with but also a sight to admire when you step back and appreciate all the hard work you've put into your comp.


I highly encourage all junior artists to establish this good habit early on as it will save you loads of time in the long term just from being able to quickly glance through and diagnose your scripts.


Also, who doesn't like node graph porn?


111 views0 comments

Here are some handy TCL quick label expression commands that I've expanded on over the past couple years. They're great for quick glance referencing meta-data from the file location, format, resolution, localization policy, color space and frame range of a Read or Postage Stamp node's connected input.



Read (nodes):


location: [value this.file]
format: [value this.format]
range: [value this.first] - [value this.last]
localization: [value this.localizationPolicy]
colorspace: [value this.colorspace]

Postage Stamp (nodes):


location: [value this.input.file]
format: [value this.input.format]
range: [value this.input.first] - [value this.input.last]
localization: [value this.input.localizationPolicy]
colorspace: [value this.input.colorspace]

Simply copy and paste these TCL script commands into your Read/Postage Stamp 'Node -> label' tab and refresh if necessary.



1,254 views0 comments
bottom of page