Q100242: How to Launch Katana With Third-party Renderer Plugins Using a Launcher Script For Windows

Follow

SUMMARY

To launch Katana and work with the various renderer plugins available, you need to make sure that a few environment variables are set up correctly. The easiest way to manage these environment variables is to create a launcher batch script to start Katana.

This article provides a few example scripts that will cover various renderer plug-ins. These scripts are ready to be used and are configured using the default installation paths for said render plug-ins.

If you have yet to install and license Katana on Windows, please view the Installing on Windows User Guide.

 

KATANA LAUNCHER SCRIPT TERMINOLOGY

Every launcher script will require the following environment variables in order to successfully launch Katana. Below are the variables along with their primary function for your convenience.

Environment Variable

Function

KATANA_ROOT The location of the root installation of Katana.C:\Program Files\Katana7.0v3 is the default location.
PATH An operating system variable that specifies directories to search for various modules to be used as commands.
KATANA_RESOURCES A list of paths used to find plug-ins and other customizations. For example, shaders, macros, SuperTools, etc. For more information, please refer to the Katana Resources page of the Katana Docs.

Below are a few common batch commands used in the following launcher batch scripts along with their explanations for your convenience.

Command Function
rem Marks the current line as a comment. Lines beginning with this command will be ignored when the script is executed.
@echo off Disables the display of the executed commands in a command prompt window.
set Sets a given environment variable to a specified value or path. Multiple values or paths can be separated by a semicolon(;).
"%KATANA_ROOT%\bin\katanaBin.exe" Runs the specified Katana executable. Once the batch file has reached this line, a command prompt will appear echoing the commands executed by Katana.

 

CONFIGURING THE LAUNCHER SCRIPT

For instructions on how to modify and use this script, please follow these steps:

  1. Copy and paste the contents of one of the scripts below (Example launcher batch script) into a text editor, for example Notepad.
    Example files are also attached, so alternatively download an attached batch script. To edit the .bat file, right-click on the file and choose 'Edit'. 
  2. Carefully read through the script, checking if the paths specified are the same on your machine. If not, update them so that they point to the right locations.
  3. Delete the sections specific to tools that you do not use, for example renderers or custom scripts.
  4. Save the file as Katana6.0v4.bat and close it.
  5. Now double-clicking the .bat file or right-click > Open should run the commands and launch Katana with all the necessary environment variables set.

    You can check if they have been set correctly, for example, by running these commands in the Python tab:

    import os
    print(os.environ['KATANA_RESOURCES'])

    This should print the paths you have added to KATANA_RESOURCES in the launcher script. 
  6. If you would like a desktop icon to click and launch Katana from, you can add this in the following way:
  • Right-click on the .bat file > Create shortcut. 
  • Place the shortcut that is created on your Desktop.
  • Right-click the shortcut > Properties > Shortcut tab > Change Icon…
  • You may now see a warning saying the .bat file contains no icons. Click okay and you will get the option to choose an icon from a different location.
  • Click Browse… and browse to your Katana installation directory (KATANA_ROOT). Select the file WindowsIcon.ico and click Open. Click OK to close the Change Icon dialog and OK to close the Properties window.

    You should now have the Katana launcher script shortcut showing the Katana icon available on your Desktop.

 

EXAMPLE SCRIPTS

The following drop down sections will showcase example scripts for each of the most commonly used render plug-ins. These scripts are ready to be used and are configured using the default installation paths for said render plug-ins. You may also download the examples found under the Attachments section at the bottom of this article.

RenderMan

Below is an example launcher batch script for the RenderMan for Katana renderer Plug-in. For more information regarding RenderMan specific environment variables, please refer to their documentation page Environment Variables in Katana.

@echo off
rem -- Define the install location for KATANA --
set "KATANA_ROOT=C:\Program Files\Katana6.0v4"

rem -- select which renderer Katana expects by default when rendering --
set "DEFAULT_RENDERER=prman"

rem -- Location of the RenderMan Pro Server installation --
set "RMANTREE=C:\Program Files\Pixar\RenderManProServer-25.2"

rem -- Location of the PRman plugin for KATANA --
set "RFKTREE=C:\Program Files\Pixar\RenderManForKatana-25.2\plugins\katana6.0"

rem -- This is what is required to load the RfK plugin --
set "KATANA_RESOURCES=%KATANA_RESOURCES%;%RFKTREE%"

rem -- These are required for the hdPrman Render Delegate
set "FNPXR_PLUGINPATH=%RFKTREE%\usd"
set "RMAN_SHADERPATH=%RMAN_SHADERPATH%;%RFKTREE%\usd\resources\shaders"
set "RMAN_RIXPLUGINPATH=%RMAN_RIXPLUGINPATH%;%RFKTREE%\usd"
rem -- Start Katana -- "%KATANA_ROOT%\bin\katanaBin.exe"

NOTE: If your paths are different for the various components used in this script, then you have to update those paths to the correct location on your system.

Arnold

Below is an example launcher batch script for the Arnold for Katana renderer Plug-in. For more information regarding Arnold specific environment variables and installation, please refer to their documentation page Installation - Arnold for Katana.

@echo off
rem -- Define the install location for KATANA --
set "KATANA_ROOT=C:\Program Files\Katana6.0v4"

rem -- select which renderer Katana expects by default when rendering --
set "DEFAULT_RENDERER=arnold"

rem -- Where you have installed the KtoA plug-in --
set "KTOA_HOME=C:\Program Files\ktoa\ktoa-4.2.2.5-kat6.0-windows"

rem -- The KtoA bin folder is needed in PATH --
set "PATH=%PATH%;%KTOA_HOME%\bin"

rem -- This is how to load the KtoA plug-in --
set "KATANA_RESOURCES=%KATANA_RESOURCES%;%KTOA_HOME%"

rem -- Start Katana --
"%KATANA_ROOT%\bin\katanaBin.exe"

NOTE: If your paths are different for the various components used in this script, then you have to update those paths to the correct location on your system.

3Delight

3Delight is the renderer that Katana is installed and configured with and can be accessed by using the default executable file found in your Katana installation folder. If you have moved your 3Delight installation or would like to use another version, the following example launcher batch script will showcase the required environment variables needed. For more information, please refer to their documentation page 3Delight for Katana Installation.

@echo off
rem -- Define the install location for KATANA --
set "KATANA_ROOT=C:\Program Files\Katana6.0v4"

rem -- select which renderer Katana expects by default when rendering --
set "DEFAULT_RENDERER=dl"

rem -- Location of where the main 3Delight package is installed --
set "DELIGHT=C:\Program Files\3Delight"

rem -- The 3Delight bin folder is needed in PATH  --
set "PATH=%PATH%;%DELIGHT%\bin"

rem -- Location of the 3Delight for KATANA plug-in --
set "KATANA_RESOURCES=%KATANA_RESOURCES%;%DELIGHT%\3DelightForKatana"

"%KATANA_ROOT%\bin\katanaBin.exe"

NOTE: If your paths are different for the various components used in this script, then you have to update those paths to the correct location on your system.

Redshift

Below is an example launcher batch script for the Redshift for Katana renderer Plug-in. For more information regarding Redshift specific environment variables, please refer to their documentation page Katana Plugin Configuration.

@echo off
rem -- Define the install location for KATANA --
set "KATANA_ROOT=C:\Program Files\Katana6.0v4"

rem -- select which renderer Katana expects by default when rendering --
set "DEFAULT_RENDERER=redshift"

rem -- Location of the RedShift bin folder --
set "REDSHIFT_HOME=C:\ProgramData\Redshift\bin"

rem -- Location of the RedShift plugin for KATANA --
set "REDSHIFT4KATANA_HOME=C:\ProgramData\Redshift\Plugins\Katana\6.0v1"

rem -- This is what is required to load the RedshiftForKatana plugin --
set "PATH=%PATH%;%REDSHIFT_HOME%"
set "KATANA_RESOURCES=%KATANA_RESOURCES%;%REDSHIFT4KATANA_HOME%"

"%KATANA_ROOT%\bin\katanaBin.exe"

NOTE: If your paths are different for the various components used in this script, then you have to update those paths to the correct location on your system.

 

ADVANCED TIPS & TRICKS

Multiple Renderer Plug-ins

It is possible to launch Katana with multiple renderer plug-ins at the same time. Combine all of the necessary environment variables for each of the plug-ins into one batch file and you will be able to access both in Katana. However, only one renderer may be specified for the DEFAULT_RENDERER variable.

 

Custom Environment Variables

It is possible to create your own custom environment variables as well. This can be very useful if you would like to quickly switch between multiple versions of Katana or a certain renderer plug-in. Below is an example RenderMan script with three custom variables created under a OPTIONS header. You will notice that parts of the paths have been replaced by the environment variable names surrounded by percent signs. This will replace that name with the value you previously set in your script.

@echo off
rem **  OPTIONS  **
set "KAT_VER=6.0v4"
set "REN_VER=25.2"
set "KAT_LINE=6.0"

rem -- Define the install location for KATANA --
set "KATANA_ROOT=C:\Program Files\Katana%KAT_VER%"

set "DEFAULT_RENDERER=prman"

rem -- Location of the RenderMan Pro Server installation --
set "RMANTREE=C:\Program Files\Pixar\RenderManProServer-%REN_VER%"

rem -- Location of the PRman plugin for KATANA --
set "RFKTREE=C:\Program Files\Pixar\RenderManForKatana-%REN_VER%\plugins\katana%KAT_LINE%"

rem -- This is what is required to load the RfK plugin --
set "KATANA_RESOURCES=%KATANA_RESOURCES%;%RFKTREE%"

"%KATANA_ROOT%\bin\katanaBin.exe"

 

FURTHER READING

For further reading on launching Katana and the different launch modes available, please refer to the Launching on Windows section of the Katana documentation.

 

ATTACHMENTS

We're sorry to hear that

Please tell us why