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 at present is to use a launcher shell 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.
NOTE: If your paths are different for the various components used in this script, then you will have to update those paths to the correct location on your system.
If you are yet to install and license Katana on Linux, please view the Installing on Linux 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./opt/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 shell commands used in the following launcher scripts along with their explanations for your convenience.
Command | Function |
# | Marks the current line as a comment. Lines beginning with this command will be ignored when the script is executed. |
export | Sets a given environment variable to a specified value or path. Multiple values or paths can be separated by a semicolon(;). |
#!/bin/bash | Ensures that the script using the Bash shell. |
$KATANA_ROOT/katana | 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:
- Copy and paste the contents of one of the scripts below (Example launcher shell script) into a text editor, for example gedit. An example file is also attached. You can download the attached script and open it with your favorite text editor.
- Carefully read through the script, checking if the specified paths are the same on your machine. If not, update them so that they point to the correct locations.
- Delete the sections specific to tools you do not use, such as renderers or custom scripts.
- Save the file as Katana6.0v4Launcher.sh and close it.
- Now execute the file in the terminal by navigating to the folder where it is saved. Entering
./Katana6.0v4Launcher.sh
should run the commands and launch Katana with all the necessary environment variables set.
You can check if they have been set correctly, by running these commands in the Python tab of Katana:
import os
print (os.environ['KATANA_RESOURCES'])
This should print the paths you have added to KATANA_RESOURCES in the launcher script. - If you would like a shorter command to launch Katana, you can add this in the following way:
- Locate your .bashrc file, typically located in your home directory, and open it in a text editor like gedit.
- Add a line to the bottom, associating an alias with the path to the executable script you created:
alias k604='~/Documents/Katana6.0v4Launcher.sh'
Now enteringk604
in a Terminal should run the script and launch Katana with all the environment variables set.
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.
#!/bin/bash # -- Define the install location for KATANA -- export KATANA_ROOT=/opt/Katana6.0v4 # -- select which renderer Katana expects by default when rendering -- export DEFAULT_RENDERER=prman # -- Location of the RenderMan Pro Server installation -- export RMANTREE=/opt/Pixar/RenderManProServer-25.0 # -- Location of the PRman plugin for KATANA -- export RFKTREE=/opt/Pixar/RenderManForKatana-25.0/plugins/katana6.0 # -- This is what is required to load the RfK plugin -- export KATANA_RESOURCES=$KATANA_RESOURCES;$RFKTREE # -- These are required for the hdPrman Render Delegate export FNPXR_PLUGINPATH=/opt/pixar/RenderManForKatana-25.0/plugins/katana6.0/usd export RMAN_SHADERPATH=$RMAN_SHADERPATH:/opt/pixar/RenderManForKatana-25.0/plugins/katana6.0/usd/resources/shaders export RMAN_RIXPLUGINPATH=$RMAN_RIXPLUGINPATH:/opt/pixar/RenderManForKatana-25.0/plugins/katana6.0/usd # -- Start Katana -- $KATANA_ROOT/katana
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.
#!/bin/bash # -- Define the install location for KATANA -- export KATANA_ROOT=/opt/Katana6.0v4 # -- select which renderer Katana expects by default when rendering -- export DEFAULT_RENDERER=arnold # -- Where you have installed the KtoA plug-in -- export KTOA_HOME=/opt/ktoa/ktoa-4.2.2.5-kat6.0-linux # -- The KtoA bin folder is needed in PATH -- export PATH=$PATH;$KTOA_HOME/bin # -- This is how to load the KtoA plug-in -- export KATANA_RESOURCES=$KATANA_RESOURCES;$KTOA_HOME # -- Start Katana -- $KATANA_ROOT/katana
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.
#!/bin/bash # -- Define the install location for KATANA -- export KATANA_ROOT=/opt/Katana6.0v4 # -- select which renderer Katana expects by default when rendering -- export DEFAULT_RENDERER=dl # -- Location of where the main 3Delight package is installed -- export DELIGHT=/opt/3Delight # -- The 3Delight bin folder is needed in PATH -- export PATH=$PATH;$DELIGHT/bin # -- Location of the 3Delight for KATANA plug-in -- export KATANA_RESOURCES=$KATANA_RESOURCES;$DELIGHT/3DelightForKatana # -- Start Katana -- $KATANA_ROOT/katana
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.
#!/bin/bash # -- Define the install location for KATANA -- export KATANA_ROOT=/opt/Katana6.0v4 # -- select which renderer Katana expects by default when rendering -- export DEFAULT_RENDERER=redshift # -- Location of the RedShift bin folder -- export REDSHIFT_HOME=/opt/Redshift/bin # -- Location of the RedShift plugin for KATANA -- export REDSHIFT4KATANA_HOME=/opt/Redshift/Plugins/Katana/6.0v4 # -- This is what is required to load the RedshiftForKatana plugin -- export PATH=$PATH;$REDSHIFT_HOME export KATANA_RESOURCES=$KATANA_RESOURCES;$REDSHIFT4KATANA_HOME # -- Start Katana -- $KATANA_ROOT/katana
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 with a dollar ($) sign prefix. This will replace that name with the value you previously set in your script.
#!/bin/bash # ** OPTIONS ** export KAT_VER=6.0v4 export REN_VER=25.2 export KAT_LINE=6.0 # -- Define the install location for KATANA -- export KATANA_ROOT=/opt/Katana$KAT_VER export DEFAULT_RENDERER=prman # -- Location of the RenderMan Pro Server installation -- export RMANTREE=/opt/Pixar/RenderManProServer-$REN_VER # -- Location of the PRman plugin for KATANA -- export RFKTREE=/opt/Pixar/RenderManForKatana-$REN_VER/plugins/katana$KAT_LINE # -- This is what is required to load the RfK plugin -- export KATANA_RESOURCES=$KATANA_RESOURCES;$RFKTREE $KATANA_ROOT/katana
FURTHER READING
For further reading on launching Katana and the different launch modes available, please refer to the Launching on Linux section of the Katana documentation.
ATTACHMENTS
We're sorry to hear that
Please tell us why