Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Contents

Directory Mapping is a Tractor feature that allows you to specify file system paths on one system that correspond to the same asset paths on a different operating system. For example, if a job script is created on a Windows system with UNC file paths, and you want the job to run on a Linux or OSX system where files are accessed through NFS, then you can specify a directory mapping which will alter the UNC paths to NFS paths. Directory maps can also be useful to replace a drive letter in Windows paths with a fully qualified UNC path.

To specify a directory map, you can add the Job parameter -dirmaps in this form:

Job -dirmaps { maps }

where maps is a list of directory maps in this format:

{ { source } { destination } zone }

In this format, source will be replaced by destination in a file path if the job is being run on a computer in the specified zone.

For example, here are some valid directory maps in a job script:

 Job -title {A Simple Job}
     -dirmaps {
         {{mayabatch} {maya} NFS}
         {{X:/} {//fileserver/projects/} UNC}
         {{X:/} {/fileserver/projects/} NFS}
     }
     -subtasks {
         Task -title {render a.rib} -cmds {
             RemoteCmd {%D(mayabatch) -batch -file {%D(X:/proj1/scenes/test.ma)} -proj {%D(X:/proj1)}} -service {RfMRender}
     }
 }

There are three different maps specified in this -dirmap option. The first one specifies that mayabatch should be replaced by maya when the job is run on a computer in the NFS zone. The second one specifies that X:/ should be replaced by //fileserver/projects/ when the job is run on a computer in the UNC zone. Directory maps are only applied to the text within the %D() areas of the command. So, if this job was run on a Windows computer in the UNC zone, then the command would be run as:

mayabatch -batch -file //fileserver/projects/proj1/scenes/test.ma -proj //fileserver/projects/proj1

If the job was run on a Linux or OSX computer in the NFS zone, then it would be run as:

maya -batch -file /fileserver/projects/proj1/scenes/test.ma -proj /fileserver/projects/proj1

By default, Tractor Blades running on Windows will use the UNC zone, while Linux and OSX blades will use the NFS zone. The zone name can instead be set explicitly for given hosts by specifying the "DirMapZone" value in the matching blade profile.

Also, note that directory maps are only applied if the text within the %D() that begins with the source text from the directory map. So, if a directory map was listed as { {x} {y} UNC }, then the text in %D(zzzx) would not change, but the text in %D(xzzz) would change to yzzz. 

Setting Up Directory Mapping for RenderMan Studio

RenderMan Studio generates job script files for external renders, so if you would like to change the directory mapping that gets added to these job script files, you will need to set the WSDirMaps pref in your RMSWorkspace.ini file. Note that the default RMSWorkspace.ini file is in your $RMSTREE/etc directory, but we strongly encourage you to create a duplicate RMSWorkspace.ini file containing your site-specific overrides and place it in a separate directory that is referenced with the RMS_SCRIPT_PATHS environment variable.

In your $RMS_SCRIPT_PATHS/RMSWorkspace.ini file, you can set the WSDirMaps pref in this format:

SetPref WSDirMaps { { source destination zone } }

For example, this would set X:/ to be replaced by /fileserver/projects in the NFS zone:

SetPref WSDirMaps { {X:/ /fileserver/projects NFS} }

You can specify more than one directory map, often giving the complementary mapping for the alternate platform, or doing drive-letter to UNC maps in the case of Windows machines on the farm.

SetPref WSDirMaps [list {X:/ //fileserver/projects/ UNC} {X:/ /fileserver/projects/ NFS}]

Windows Service Considerations

Windows services run without access to mapped drives. So, if your Maya project is set to a mapped drive location such as X:\projects\proj1, then you will need to set up directory mapping so that your Tractor Blades running as a Windows service can access that location. If your X:drive is mapped to \\fileserver\projects, then you will want to set up a directory mapping for the UNC zone like this:

SetPref WSDirMaps { {X:/ //fileserver/projects/ UNC } }

Note: Windows will sometimes cache SMB mount credentials, or sometimes it will clear its cache of previously authenticated credentials. Particularly on recent Windows editions (8.1+) when the blade is running as a service, the credential for the UNC name will need to have its Persistence set to "enterprise". This is not what it will be set to if you simply browse to the share in the File Explorer and type the password in there. To set the persistence:

  • Open Control Panel->User Accounts and Family Safety->Manage Windows Credentials
  • Delete any old credentials for the given share, IF the persistence is not already "enterprise"
  • Click "add a Windows credential"
  • Enter the appropriate \\server\share, account name and password.

Remember to configure the tractor-blade service to run as the same user. * Go into the Control Panel->...->Services and set blade service's "Run As Account" to your selected account. * Restart the service