# mtor initialization/configuration file
# $Revision: #3 $

LoadExtension tcl [file join [RATGetDir etc] mtorCompat.tcl]

# clipping values used during mapgen when near==0 and/or far==0
SetPref DefaultNearClipping .001
SetPref DefaultFarClipping 10000.0

# a means to disable the server resources feature. When enabled,
# if you are using NetRender in frame chunking mode, MTOR writes
# RIB files that cause temporary maps to be placed on the server.
# This is currently broken in prman 3.9.
LockPref ServerResources 0

# old behavior for STMatrix calls was to ignore
# the frame coverage, rotation and offset for
# place2dTexture nodes.  Set this to 1 to guarantee
# backward compatibility with old scene files.
# This would only come about if you had non-default
# values in the frame coverage, etc. parameters.
SetPref STMatrixIgnoreFrame 0

# when running without Glimpse, MTOR stores all its state
# in simple string attributes within a Maya file.  This eliminates
# the "requires mtor.so" that used to appear in all IRIX
# Maya files that had MTOR information embedded.  Strictly
# speaking, MTOR is not required in order for Maya to
# read the file. Conversely MTOR *must* be loaded at the time
# a file is opened otherwise it will not be properly synchronized
# with the file contents.  You can address this problem in
# a variety of ways:
#   #1 always autoload MTOR when starting Maya.
#   #2 leave MTOR unloaded but load it before opening a file
#      whose MTOR or Slim contents you wish to edit.  After
#      loading the MTOR plugin, re-open any open files to ensure
#      that MTOR is properly synchronized.
#   #3 set theis ForceMTORRequires preference to 1. This causes
#      the "requires mtor" to appear in all Maya files saved
#      while MTOR is loaded.  Now when opening files with "requires mtor"
#      Maya will automatically ensure the MTOR is loaded before reading
#      the rest of your scene.  You can still force MTOR to remain inactive
#      by setting the MTOR_PLUGIN_NOLOAD environment variable.
SetPref ForceMTORRequires 0

# MTOR 3.0 introduced the ability to match Maya NURB paramerization
# This is done by reorganizing the CVs and this modifies the default
# parameterization of the NURBS.  You can cause all NURBS to be
# represented with the Maya parameterization ordering by setting
# mtorNURBSStyle to maya.  Remember this will probably break old
# scenes.  MTOR also supports a per-nurbs string attribute of the same name
# to allow you to tag individual NURBS with the parameterization style.
SetPref mtorNURBSStyle legacy

# MTOR 4.0 introduced the ability to represent Maya Meshes using
# PRMan 3.10's facevarying primitive variable class.  This class
# better represents Maya's multiple normals/uvs per vertex design and
# allows MTOR to more accurately and concisely translate Maya
# meshes.  Generally, the new method is better but this new method
# could cause old scenes to render differently.  If you have an
# old scene that exibits this problem, you'll need to set mtorMeshStyle
# to legacy.
SetPref mtorMeshStyle facevarying

# MTOR 4.5 introduced the ability to disable the mesh parameterization
# conversion required to match renderman.  Generally this pref
# should be set to renderman, however, to defeat this conversion
# set this value to maya.
SetPref mtorMeshParameterization renderman

# MTOR 4.0 introduced the ability to cause all polygon objects
# to be represented as subdivs. If you want polygon meshes to
# be rendered as Subdivision surfaces, set this pref to "subdiv".
# To preserve polygon rendering, set this pref to "mesh".
SetPref mtorMeshRep mesh

# nodes upstream from an object that indicate that an object
# is dynamic.  The empty string indicates that the built-in
# list should be used.  Generally you shouldn't need to change
# this.
SetPref mtorIndicatesDynamic {}

# MTOR 4.5 introduced the ability to disregard object instancing
# when applying shaders.  When the preference "mtorUniquelyShadeInstances" 
# is disabled, assigning a shader to any instance of an object is 
# equivalent to assigning the shader to all instances.  When enabled,
# MTOR maintains the shading information on a per-instance basis. 
SetPref mtorUniquelyShadeInstances	1

# MTOR 4.5 introduced the ability to automatically attach a
# primitive variable to instanced objects.  This primitive variable
# would be declare thus: "constant float __objinstanceid". It will only
# be present on primitives that have been instanced and only if this
# pref is enabled.  The primitive variable can be used in a shader to 
# distinguish between object instances.   
SetPref mtorDecorateObjectInstances	0

# mtorParticleBlurStyle:
#   controls the interpretation of particle velocity for
#   the purposes of motion blur.  Prior to RAT 6, MTOR
#   only supported shutter "closeOnFrame" behavior.
#   Now you can choose one of:
#	globals:  "use the blur style indicated by RenderMan Globals"
#	openOnFrame:
#	centerOnFrame:
#	closeOnFrame:
SetPref mtorParticleBlurStyle  globals

# mtorLocatorsAsCoordinateSystems:
#  MTOR 6.0 translated locators as mtor coordinate systems, which 
#  was generally undesirable, and is no longer being done.  
#  Enable this pref if you depend on the previous behavior.
SetPref mtorLocatorsAsCoordinateSystems 0

# mtorFurStyle:
#  MTOR 6.5 translates maya fur automatically.  Users who wish
#  to use the mtorUltraFur rib generator plugin for fur
#  should set the mtorFurStyle pref to "legacy"
#SetPref mtorFurStyle legacy

# the JobPreflightSlimCmd is executed during job preflight....
# by default we force the building of all dirty shaders
# when slim is launched in batch (mtor batch) mode.
SetPref JobPreflightSlimCmd "slim BuildShaders -dirty -batch"

# alfred scripting support:
#   commands, services and tags

# this is the command that MTOR executes when launching alfred
SetPref	mtorAlfredScriptHandler alfred

SetPref TxMakeCmd	txmake
SetPref TxMakeSvc	{}
SetPref TxMakeTag	{}
SetPref TxMakeMetrics	{}

SetPref RIBGenSvc	pixarmtor
SetPref RIBGenTag	{}
SetPref RIBGenMetrics	{}

SetPref NetRenderCmd	netrender
SetPref NetRenderSvc	pixarNrm
SetPref NetRenderTag	prman
SetPref NetRenderMetrics {}

SetPref PRManCmd	{prman -p:%n -Progress}
SetPref PRManSvc	pixarRender
# Set PRManLocalSvc & PRmanRemoteSvc if you don't want the
# PRManSvc to be used for both local and remote prman renders.
SetPref PRManLocalSvc   {}
SetPref PRManRemoteSvc  {}
SetPref PRManTag	prman
SetPref PRManMetrics	{}

SetPref IrmaCmd		irma
SetPref IrmaSvc		pixarIrma
SetPref IrmaTag		prman
SetPref IrmaMetrics	{}

SetPref ShoCmd		sho
SetPref ShoSvc		{}
SetPref ShoTag		{}
SetPref ShoMetrics	{}

SetPref BrickMakeCmd	brickmake
SetPref BrickMakeSvc	pixarRender
SetPref BrickMakeTag	{intensive}
SetPref BrickMakeMetrics {}

SetPref PtRenderCmd	ptrender
SetPref PtRenderSvc	pixarRender
SetPref PtRenderTag	{intensive}
SetPref PtRenderMetrics {}

SetPref PtFilterCmd	ptfilter
SetPref PtFilterSvc	pixarRender
SetPref PtFilterTag	{intensive}
SetPref PtFilterMetrics {}

array set pf [GetPlatform]
if [string equal $pf(platform) Darwin] {
    set mgr active
} else {
    set mgr passive

SetPref mtorSlimWindowMgmt $mgr
SetPref mtorGetWorkForShadingGroups 1
#  mtorVersionAlfserverEnvironmentKey
#   facilitates distributed RIB gen to servers with multiple RAT/maya/RPS 
#   versions installed.
#   set to {} or 0 to disable
SetPref mtorVersionAlfserverEnvironmentKey [file tail [RATGetDir rattree]]