# Why Get a Comp from Nuke?

It’s important for artists to be able to assess that Katana scenes are accurate for the next stages in the pipeline. However, as the work progresses down the pipeline and iterations are applied, elements of the scene such as lighting or materials may need to be changed to make them fit more accurately with the results of the composited image.

This process is usually done by producing offline/disk renders from Katana and passing them on to the next stage of the pipeline. Only once these renders were imported and set up in Nuke, would Artists be able to review the results. In some cases, this is a lengthy and manual process, adding time to the overall production process.

Katana’s Nuke Bridge is a game-changing feature that lets you stream a render to Nuke for compositing, and then streams the comped pixels back to Katana for review or refinement. You see the results of the comp within Katana’s render window, eliminating the need for viewing offline and waiting for renders.

In the Nuke Bridge a Katana render is streamed to Nuke, composited using a Nuke script, and the result streamed back to Katana as a new render.

# What Do I Need to Use Nuke Bridge?

To get Nuke Bridge up and running you’ll need the following:

• Katana 4.5 or later.
• Nuke 13.0 or later.
• A nuke_i (interactive) and nuke_r (render) license to run all three comping modes, though a nuke_i license can support all three with additional configuration. See below for details on license compatibility.
• A custom Nuke launcher script with a variable set to load the Katana Nuke plug-ins.
• A Nuke script containing KatanaReader and KatanaWriter nodes.
• A Katana launcher script with a variable set to your version of Nuke.

Full instructions for creating the scripts are given in the following sections.

You can download a Nuke test script and a simple Katana project to try the Nuke Bridge from here.

## Which Nuke Licenses do I Need to Use Nuke Bridge?

The table below shows you which comping modes are available depending on your Nuke license, nuke_i (interactive GUI) or nuke_r (render only).

nuke_i and nuke_r nuke_i nuke_r
Preview Comp Yes Yes (with extra configuration*) Yes
Live Comp Yes Yes (with extra configuration*) Yes
Interactive Comp Yes Yes (with extra configuration*) No

Note:  *If you only own a nuke_i license, you need to create a custom launcher script for Nuke and customize the Katana launcher script to reference this additional Nuke launcher script. Instructions on how to write a launcher script for a nuke_i license are outlined in Additional Steps for Setting up the Nuke Bridge With Only a nuke_i License, however you should still follow all preceding set-up instructions given in the following sections.

• To check which licenses you have, user the Foundry Licensing Utility, available here.

# Choose How to Work With Nuke Using Three Comp Modes

Nuke Bridge offers three modes of operation depending on how you want to work with your render and the comp.

## Preview Mode

Preview mode allows you to send preview renders from Katana, to a headless version of Nuke and then view a composited version of the preview render within Katana, allowing for a quick snapshot of how your final image may look. Whenever a new preview render is created, preview mode will need to be manually re-triggered so that the updated render is comped.

This mode runs Nuke as a background process, meaning you cannot interact with Nuke once the Preview Comp process has been triggered.

The version of Nuke launched by Preview Comp can be installed on a local machine or on a network.

## Live Mode

Live mode allows you to send a live render from Katana to a headless version of Nuke, so a comped version of your live render can be viewed in Katana, while still being able to edit your lights and materials. Any edits to your live render are automatically streamed into Nuke and the comped render will update in real time.

This allows you to be able to edit your scene in the context of a Nuke script and make sure that your lighting setup is compatible with a final grade or composite that your project may be using.

As with preview comp, Nuke is run as a background process and cannot be interacted with.

The version of Nuke launched by Live Mode can be installed on a local machine or on a network.

Note:  For information on the differences between Live and Preview renders in Katana, see Rendering Types

## Interactive Mode

Interactive mode can be used with Live or Preview renders, and when triggered the Nuke application opens. The most flexible of the three modes, Interactive allows you to continue to edit your Katana scene, whilst also being able to adjust your Nuke script within Nuke.

When working with live renders, edits made in Katana are automatically streamed to Nuke, while edits to your Nuke script are automatically streamed back into Katana. When working with preview renders, any edits made to your scene need to be re-rendered and interactive mode needs to be re-triggered for the new render to be seen in Nuke. However, any changes to your Nuke script are reflected automatically in Katana, regardless of the type of render that is being streamed to nuke.

The version of Nuke launched by Interactive Mode must be installed locally and is not able to be used with versions of Nuke installed across a network

# Set Up Nuke Bridge for Katana

This section assumes you’re setting up Nuke Bridge on a single machine to work in any of the three comp modes. To set up Nuke Bridge across a network or render farm, each machine in your network will need to point to the same file path destinations set in the scripts and environment variables.

There are three main stages to the setup:

1. Configure a custom launcher script for Nuke to launch standalone so that you can create a compatible Nuke Script with the Katana plug-ins.
2. In Nuke, create a script including at least one KatanaReader and KatanaWriter node, which allows Nuke Bridge to stream renders to and from Katana.
3. Configure a custom launcher script to launch Katana with the correct settings.

## Configuring a Nuke Launcher Script for the Katana Nuke Plug-in

For Nuke Bridge to work, you must create, or have access to, a Nuke Script that includes at least one KatanaReader and KatanaWriter node. To create these nodes in a standalone Nuke session, a custom launcher script should be created with a variable to define the location of the Katana Nuke plug-in. You can then use this script to run Nuke and add the Katana nodes.

The script performs the following actions:

1. Set the location of the Katana Nuke Plug-in
2. Launch Nuke
3. Allow users to create KatanaReader and KatanaWriter nodes in a Nuke script

### Configure a Nuke Launcher Script for Windows

You can copy and edit the template from the code below:

Copy

Nuke Launcher script for Nuke Bridge

@echo off set "NUKE_PATH=%NUKE_PATH%;C:\<PathToKatana>\<KatanaVersion>\plugins\Resources\Nuke\<NukeVersion>""C:\<PathToNuke>\<NukeVersion>\<NukeApplication>.exe"            

To use KatanaReader and KatanaWriter nodes in Nuke standalone sessions, Nuke must be launched using a script that specifies the NUKE_PATH.

Tip:  A quick way to get file paths is to navigate to the directory using your file explorer and copy the path from the explorer bar.

1. Edit the Katana installation location to include the versions of Katana and Nuke being used:

set "NUKE_PATH=%NUKE_PATH%;C:\<PathToKatana>\<KatanaVersion>\plugins\Resources\Nuke\<NukeVersion>"
2. For example:

set "NUKE_PATH=%NUKE_PATH%;C:\Program Files\Katana5.0v1\plugins\Resources\Nuke\13.1"

3. Edit the launcher variable With the version of Nuke and Nuke application you’re using:
4. "C:\<PathToNuke>\<NukeVersion>\<NukeApplication>.exe"

This should match the version added to previous variable. For example:

C:\Program Files\Katana5.0v1\plugins\Resources\Nuke\13.1

5. Save the file with a .bat extension.
6. For example, KatanaNuke.bat would be an appropriate filename for a launcher script.

### Configure a Nuke Launcher Script for Linux

You can copy the example below to create a template:

Copy

Nuke Launcher script for Nuke Bridge

#!/bin/bashexport NUKE_PATH="/<katana installation directory>/plugins/Resources/Nuke/<nuke version>""/<path to nuke installation directory>/<version of nuke>/<nuke application>"             

Set an environment variable on Linux in the terminal, or in your own custom launcher script for Katana:

export NUKE_PATH="/<katana installation directory>/plugins/Resources/Nuke/<nuke version>"

For example, if you’re running Katana 5.0v1 and Nuke 13.1:

export NUKE_PATH="/opt/Foundry/Katana5.0v1/plugins/Resources/Nuke/13.1"

If you're using a script, also edit the path to the Nuke application.

Warning:  If you set the environment variable using the terminal, Nuke must launch from the same terminal.

## Configure a Katana Launcher Script for Nuke Bridge

To use Nuke Bridge you need to launch Katana with a launcher script that sets the file path of the custom Nuke launcher. The script performs the following actions:

1. Sets the location of the Nuke executable for Nuke Bridge to use.
2. Launches Katana.

Windows and Linux sample launcher scripts for Katana containing the Nuke Bridge environment variable are available for download here.

### To Configure a Katana Launcher Script for Windows:

You can use the template given below:

Copy
@echo off rem -------------------------------------- rem -------- KATANA Specific ------------ rem -------------------------------------- set "KATANA_ROOT=C:\<KatanaInstallationDirectory>\Katana<version>"set "PATH=%PATH%;%KATANA_ROOT%\bin"rem --------------------------------------rem ----------- NUKE BRIDGE --------------rem --------------------------------------set KATANA_NUKE_EXECUTABLE=C:\<NukeFolderLocation>\<NukeVersion>\<NukeApplication>.exerem -------- Start KATANA ------------ "%KATANA_ROOT%\bin\katanaBin.exe"       
1. Edit the Katana installation location to include the version of Katana:
set "KATANA_ROOT=C:\<KatanaInstallationDirectory>\Katana<version>"

For example:
2. set "KATANA_ROOT=C:\Program Files\Katana5.0v1”

3. Set and/or edit the Nuke executable location to include the file path of the custom Nuke launcher script:
set KATANA_NUKE_EXECUTABLE=C:\<NukeFolderLocation>\<NukeVersion>\<NukeApplication>.exe

For example:

set KATANA_NUKE_EXECUTABLE=C:\Program Files\Nuke13.1v1\Nuke13.1.exe

4. Tip:  If you are already using your own custom Katana launcher script, you can simply add this variable to your script and set the variable to the correct location.

### To Configure a Katana Launcher Script for Linux

If you're using a script, you can copy and edit the template:

Copy
#!/bin/bashexport KATANA_NUKE_EXECUTABLE="/<nuke installation directory>/<version of nuke>/<nuke application>""/<katana installation directory>/<version of katana>/<katana application>"

You can set this variable in the terminal, or in your custom launcher script for Katana.

export KATANA_NUKE_EXECUTABLE="/<nuke installation directory>/<version of nuke>/<nuke application>"

Add the file path of the Nuke executable file.

For example:

export KATANA_NUKE_EXECUTABLE="/opt/Foundry/Nuke13.1v1/Nuke13.1"

Note:  If the KATANA_NUKE_EXECUTABLE variable in your Katana launcher script has been incorrectly set, a warning message at the top of the window will appear with a diagnostic.

If you're using a script, edit the path to the Katana executable.

## Additional Steps for Setting up the Nuke Bridge With Only a nuke_i License

If you only have a nuke_i license, you can use all the feature of Nuke Bridge, with the following additional steps:

1. Create a custom launcher script for Nuke, in addition to the one that has been set up for standalone sessions.
2. Customize your Katana launcher script to reference this additional Nuke launcher script.