Q100272: Creating a Katana launcher script for Linux

Follow

SUMMARY 

To start 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 and example script below that covers all the various renderer plugins, and is ready for usage. It is well commented and you only need delete the references to the renderer plugins you don't require using in your workflow.

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. 

If you are yet to install and license Katana on Linux, please see this article: Q100271: Installing Katana on Linux

 

 

MORE INFORMATION

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

  1. Copy and paste the contents of the script below (Example launcher shell script) into a text editor, for example gedit. An example file is also attached, so alternatively download the attached script and open it with gedit. 
  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 Katana2.5v5Launcher and close it (it should have no file extension).
  5. Now execute the file in the terminal by navigating to the folder where it is saved and entering ./Katana2.5v5Launcher 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 shorter command to launch Katana, you can add this in the following way:
  • Locate your .bashrc file, this is usually in your home folder, and open it in a text editor like gedit.
  • Add a line like the following to the bottom, associating a so-called alias with the path to the executable script you created:

    alias k2.5v5='~/Documents/Katana2.5v5Launcher'

    Now entering k2.5v5 in a Terminal should run the script and launch Katana with all the environment variables set.

 

KATANA LAUNCHER SCRIPT



Key KATANA environment variables

KATANA_ROOT should point to your Katana installation directory.  
PATH is a Windows system variable specifying directories where executable programs are located.
KATANA_RESOURCES provides a list of paths under which to look for plug-ins and other customisations, for example shaders. For more information, please see the Katana Online Help.

 

Some script commands explained

marks a comment; Lines beginning with this command will be ignored when the script is run.
export is the command to set an environment variable. Multiple paths can be separated by a colon(:).

The final line (/opt/Foundry/Katana2.5v5/katana) runs the Katana executable. Make sure the path matches the one to the Katana executable in your Katana installation directory.

 

Example launcher shell script


#!/bin/bash
# start here
# ---------------------------------------------
# -------- How to use this script ------------
# ---------------------------------------------


# --The KATANA Specific section shows some examples for how you can use the KATANA_RESOURCES environment variable--
# -- KATANA_RESOURCES drives what gets loaded at start-up for KATANA. This is how you load tools and plug-ins, both custom and non-custom ones like commercial renderer plug-ins--
# --Delete the settings for the renderers that you do not have installed or do not want to use at the same time.--

# --DEFAULT_RENDERER is the environment variable that drives which renderer plug-in is expected by default in a RenderSettings node.--

# --The different renderer plug-ins' requirements for environment variables may change. Please refer to the installation instructions for each particular render plug-in for the most up to date information--


# --------------------------------------
# -------- KATANA Specific ------------
# --------------------------------------


# --This line is a simple example of how custom shelf scripts can be sourced--
# http://help.thefoundry.co.uk/katana/current/#tg/shelf_item_scripts/shelf_item_scripts.html
export KATANA_RESOURCES=$KATANA_RESOURCES:/home/Users/Lizzy/Dropbox/katana_shelves
export KATANA_RESOURCES=$KATANA_RESOURCES:/home/Users/Lizzy/Dropbox/katana_tools

# -This is how you export the default renderer when more than one are used at once (arnold, prman, vray, dl)
# - Change this to match the renderer you want to use by default.
export DEFAULT_RENDERER=arnold
# !!--------------------------------!!

 

 

# !!!!!!!!!!!!! Delete the tools you do not use from the section below !!!!!!!!!!!!!


# ----------------------------------------
# -------- 3Delight Specific ------------
# ----------------------------------------
# -- Source the .3delight_bash or .3delight_csh file from the location where the main 3Delight package is installed--
# -- Please note that 3Delight requires gcc 4.8.3 or higher to run --
source /usr/local/3delight-12.0.137/.3delight_bash

# !!--------------------------------!!


# --------------------------------------
# -------- Arnold Specific ------------
# --------------------------------------
# --Where you have installed the KtoA plug-in--
export ARNOLD_INSTALL_PATH=/opt/Foundry/Arnold/KtoA-1.1-kat2.5-linux

# --Without these KtoA will not function--
export ARNOLD_PLUGIN_PATH=$ARNOLD_INSTALL_PATH/Plugins

# --This is how to load the KtoA plug-in--
export KATANA_RESOURCES=$KATANA_RESOURCES:$ARNOLD_INSTALL_PATH
# !!--------------------------------!!

 


# --------------------------------------------
# -------- RenderMan 20 Specific ------------
# --------------------------------------------
# -- You can only load one version of the RfK plug-in at a time so make sure you delete the commands for the version you do not want to use --
# --This is the location of the PRman plugin for KATANA--
export RFKTREE=/opt/pixar/RenderManForKatana-20.9-katana2.5
# --This is the location of the RenderMan Pro Server installation--
export RMANTREE=/opt/pixar/RenderManProServer-20.10


# --These make sure that the programs can be found, shaders loaded, and all components used--
# --This is different for PRman 21 so do not try to use the same for both versions.--
export PATH=$PATH:$RMANTREE/lib:$RMANTREE/bin
export RISDIR=$RMANTREE/lib/RIS
export RMAN_RIXPLUGINPATH=$RISDIR/bxdf:$RISDIR/pattern:$RISDIR/integrator:$RISDIR/projection:$RISDIR/light
export RMAN_SHADERPATH=$RMAN_SHADERPATH:$RFKTREE/Resources/PRMan20/Shaders:$RMANTREE/lib/shaders:$RMANTREE/lib/rsl/shaders


# --This is what is required to load the RfK plugin--
export KATANA_RESOURCES=$KATANA_RESOURCES:$RFKTREE/Resources/PRMan20
# !!--------------------------------!!

 


# --------------------------------------------
# -------- RenderMan 21 Specific ------------
# --------------------------------------------
# -- You can only load one version of the RfK plug-in at a time so make sure you delete the commands for the version you do not want to use --
# --This is the location of the PRman plugin for KATANA --
export RFKTREE=/opt/pixar/RenderManForKatana-21.2-katana2.5/plugins
# --This is the location of the RenderMan Pro Server installation--
export RMANTREE=/opt/pixar/RenderManProServer-21.2

# --These make sure that the programs can be found, shaders loaded, and all components used--
# --This is different for PRman 20 so do not try to use the same for both versions--
export PATH=$PATH:$RMANTREE/lib:$RMANTREE/bin

# --This is what is required to load the RfK plugin--
export KATANA_RESOURCES=$KATANA_RESOURCES:$RFKTREE/Resources/PRMan21
# !!--------------------------------!!


# -------------------------------------
# -------- V-Ray Specific ------------
# -------------------------------------
# --Location of the V-Ray for KATANA install directory.--
export VRAY_INSTALL_PATH=/opt/Foundry/VRay
# --This is how the V-Ray plugin gets loaded--
export KATANA_RESOURCES=$KATANA_RESOURCES:$VRAY_INSTALL_PATH

# --Specific location to call out the plug-in to itsef--
export VRAY_FOR_KATANA_PLUGINS_x64=$VRAY_INSTALL_PATH/vrayplugins
# !!--------------------------------!!

 


# !!!!!!!!!!!!! Stop deleting parts of the script. Leave the rest of this script alone !!!!!!!!!!!!!

 


# -------- Start KATANA ------------
/opt/Foundry/Katana2.5v5/katana 

Was this article helpful?
0 out of 0 found this helpful