Situation
I have artists submitting from machines using one platform to a renderfarm using another and I need to translate the paths.
Question
How can I have the QubeGUI automatically convert entered paths (scenefile name, etc) when it submits the job?
Solution
The QubeGUI 5.4 version uses the standardized SimpleCmd/SimpleSubmit framework for all of the submission dialogs. These submission dialogs are editable and located in the simplecmds/ directory (see "File->Open SimpleCmds Directory..."). A postDialog callback can be added to convert all path parameters to what the renderfarm machines expect.
Here is an example of modification to the "Nuke (cmdline)" submission interface that will convert the paths from OSX to Windows UNC paths.
def create():
cmdjob = SimpleCmd('Nuke (cmdline)', hasRange=True, canChunk=True, help='Nuke render jobtype', postDialog=postDialog)
...
def postDialog(cmd, jobProps):
# Get a list of properties that use paths
fileProps = set([k for k,v in cmd.options.iteritems() if v.get('type', '') in ['dir', 'file']])
# For path properties, substitute the string values
for k,v in jobProps.setdefault('package', {}).iteritems():
if k in fileProps:
jobProps['package'][k] = v.replace('/Volumes/myserver/', '//myserver/')
logging.info('Adjusted path for property "%s" to "%s"'%(k,jobProps['package'][k]))