Documentation for nk2dl (aka Nuke to Deadline).
nk2dl
can be downloaded from source or from a point release.
From the shell:
git clone https://github.com/artandmath/nk2dl.git
cd nk2dl
nk2dl
can be installed from a release.From the shell:
cd /path/to/nk2dl-0.1.x-alpha
Create the virtual environment will also install the dependencies:
python setup_environment.py
The setup script will ask for a Nuke location. The Nuke location contains the python interpreter that will be used in the virtual environment.
Nuke installation path not set.
Default path: C:\Program Files\Nuke15.2v1
Enter Nuke installation path (press Enter to use default):
The setup script may ask for the Deadline repository location if it cannot automatically find the repository. The script will copy the Deadline API from the repository to the virtual environment.
Deadline repository root not found automatically.
Default path: C:\DeadlineRepository10
Enter Deadline repository root path (press Enter to use default):
Set the virtual environment (only powershell tested thus far).
# Windows
./.venv/Scripts/Activate-nk2dl.ps1
# Linux/MacOSX
source ./.venv/Scripts/activate
A success message will output to the terminal:
Activating NK2DL development environment...
Setting up NK2DL environment variables...
Environment activated and ready!
Open a python interpreter from the terminal. The python interpreter should indicate that the Foundry’s Nuke version of python is in use.
> python
Python 3.10.10 (remotes/origin/foundry/v3.10.10:693bcebd65, Feb 7 2024, 11:52:25) [MSC v.1935 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
If the python interpreter is not the version by the Foundry, launch Nuke in terminal mode, which is essentially the same as launching the Nuke python interpreter.
# Windows:
& 'C:\Program Files\Nuke15.1v1\Nuke15.1.exe' --t
Import the nk2dl
module. A copyright message for nk2dl
will display and Nuke will load.
>>> import nk2dl
Nuke to Deadline (nk2dl) v0.1.0
Copyright (c) 2025 Daniel Harkness. All Rights Reserved.
If nk2dl
will be used in the Nuke application, then Nuke will need to be able find nk2dl
and its dependencies during the application launch process.
nk2dl
from src
into the user’s .nuke
folder.yaml
and Deadline
from .venv/Lib/site-packages
into the user’s .nuke
folder.nuke
folder will contain the following structure~/.nuke/
├─ Deadline/
├─ nk2dl/
├─ yaml/
├─ init.py
├─ menu.py
│
etc
nk2dl
folder to a location available to all users.# Use nuke.pluginAddPath()
nuke.pluginAddPath('/path/to/parent/folder/containing/nk2dl')
# Or append/insert to sys.path
import sys
sys.path.insert(0, '/path/to/parent/folder/containing/nk2dl')
yaml
and Deadline
must be available in nk2dl.yaml
and Deadline
from .venv/Lib/site-packages
to a location that is available to sys.path
./path/to/your/deadline/repository/plugins/nuke
./path/to/your/deadline/repository/plugins/Nuke
with the contents of /path/to/nk2dl/src/deadline_plugins/Nuke
.For best performance, an instance of a Deadline Web Service is recommended. Instructions on setting up a Deadline Web Service can be found via the Deadline documentation:
After setting up an instance of Deadline Web Service, configure and test the connection to the Deadline Web Service.
[!IMPORTANT] Configuration is recommended, but not required.
nk2dl uses a YAML configuration system with multiple levels of precedence (~/.nk2dl/config.yaml
has the highest precedence):
config.yaml
in the nk2dl
module.$NK2DL_CONFIG
.$NK2DL_*
)~/.nuke/nk2dl/config.yaml
)In the case of a single user install in the user’s .nuke
folder, level 2 and level 5 may be the same file. If using $NK2DL_*
environment variables or the NK2DL_CONFIG
that points to a config, file remove the config.yaml
from the nk2dl
folder in the .nuke
firectory to avoid this file taking precedence over the environemnt variables.
config.yaml
from the nk2dl
module to a location available to all users.NK2DL_CONFIG
and point it to the location of your_config_name.yaml
Alternatively:
config.yaml
file in the nk2dl
module directoryconfig.yaml
in the nk2dl
cannot be renamed, otherwise the configuration will not be read by the nk2dl
pyhton module.Example configuration:
deadline:
use_web_service: True
host: deadline-web-server
port: 8081
ssl: False
commandline_on_fail: True
logging:
level: DEBUG
file: null
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
submission:
pool: nuke
group: none
priority: 50
chunk_size: 10
department: comp
batch_name_template: "{scriptname}"
job_name_template: "{batch} / {write} / {file}"
extra_info_templates:
- "Write: {write}"
- "Order: {render_order}"
- "Frames: {range}"
- "Output: {file}"
# - "GSVs: {gsvs}"
nk2dl
has a feature that will create a backup copy(s) of the submitted script. nk2dl
will resolve the project root on the copy(s) before submission and can submit the resolved copy.copy_script_path
parameter directly in the function call (full path with directory and filename)submit_nuke_script(
"/path/to/script.nk",
copy_script=True,
copy_script_path="{outdir}/farm/{nkstem}_{YYYY}-{MM}-{DD}.nk"
)
# For multiple copies, provide lists:
submit_nuke_script(
"/path/to/script.nk",
copy_script=True,
copy_script_path=[
"{outdir}/.farm/{scriptname}",
"{nkdir}/archive/{nkstem}_{YYYY}-{MM}-{DD}.nk"
]
)
submission:
# Full path template including directory and filename
# Available tokens: {nkdir}, {nkstem}, {output}, {YYYY}, etc.
script_copy_path: '{outdir}/.farm/{nkstem}.nk'
{nkdir}
, {scriptdir}
, {nukescriptdir}
{nkstem}
, {scriptstem}
, {nukescriptstem}
{nk}
, {script}
, {scriptname}
, {nukescript}
{outdir}
, {outputdir}
{filestem}
, {filenamestem}
, {outstem}
, {outputstem}
{output}
{YYYY}
(year), {YY}
(2-digit year), {MM}
(month), {DD}
(day), {hh}
(hour), {mm}
(minute), {ss}
(second){tmp}
, {temp}
, {tmpdir}
, {tempdir}
{uuid}
submission:
script_copy0_path: '{outdir}/.farm/{nukescript}'
script_copy1_path: '{nkdir}/archive/{basename}_{YYYY}-{MM}-{DD}_{hh}-{mm}-{ss}.nk'
#script_copy2_path: etc
tests/nukescripts
folder contains 2 simple nukescripts.
tests
folder to a location on the network that is available to the deadline workers.tests/test_nk2dl.py
python script to submit the example nukescripts to Deadline.cd /path/to/downloaded/nk2dl-repository/
./.venv/Scripts/Activate-nk2dl.ps1
python /path/to/tests/test_nk2dl.py
tests/test_nk2dl.py
.