Create a ticket
关注

Q100272: 为Linux系统创建Katana启动程序脚本

概述

要启动KATANA,并运用各种渲染器插件,您需要确保正确设置了环境变量。在目前,管理这些环境
变量的最简单方法是利用启动程序shell脚本来启动Katana。


本文后续部分提供的示例脚本,已经涵盖了各种不同的渲染器插件。脚本注释清晰,您只需要删除
在您的工作流程中不需要使用的渲染器插件的引用代码即可使用。

注意:如果此脚本中使用的各种组件的路径与您的安装路径不同,则您必须将这些路径更新为您系
统上的正确位置。


如果您尚未在Linux系统上安装并授权了Katana,请参阅此文章:Q100271:在Linux系统上安装
Katana

 

更多信息

修改和使用此脚本的具体方法,请按照下列步骤操作:

  1. 将以下脚本的内容(启动程序shell脚本示例)复制并粘贴到文本编辑器,例如gedit之中。文末也 附带了一个示例文件。因此,您也可以下载附带的脚本,并使用gedit打开它。
  2. 仔细通读脚本,检查计算机上的路径是否与脚本相同。如果不同,请更新脚本中的路径,使其指 向正确的位置。
  3. 删除您不使用的工具的特定部分,例如渲染器或自定义脚本等。
  4. 将文件保存为Katana2.5v5Launcher,并关闭(此文件没有文件扩展名)。
  5. 导航至文件的保存位置,并在终端里输入./Katana2.5v5Launcher,这样就会运行命令,并在设 定了所有必要的环境变量的同时启动Katana。


您也可以通过在Python标签页中运行此命令,来检查它们是否已正确设置:

import os
print os.environ['KATANA_RESOURCES']


此命令会打印出您在启动程序脚本中添加上的KATANA_RESOURCES路径。

  • 如果您想用一个较短的命令来启动Katana,那可以通过以下方式添加:
  • 首先找到.bashrc文件(通常位于您的主文件夹中),然后用文本编辑器(如gedit)打开。
  • 在底部添加如下所示的命令行,将“alisas(化名)”与创建的可执行脚本的路径相关联:

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

    现在终端中输入k2.5v5,就会运行脚本,设置好所有的环境变量,然后启动Katana了。.

 

Katana启动程序脚本



Key KATANA environment variables

KATANA_ROOT should point to your Katana installation directory.  
PATH is a 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 comes bundled with Katana 3.0 and can be set up to run without
# -- a specific launcher script at install time --
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 

这篇文章有帮助吗?
/

We're sorry to hear that!

Please tell us why.
1 人中有 1 人觉得有帮助

评论