Hey all,
I have multiple writes in a script…exr, jpg, half res jpg, etc.
However, when publishing, I only want to publish the exr files. How do I pick what path gets published to shotgun?
I am using the Create Shotgun Version in the deadline gui.
thanks,
rob
Hey Rob,
Unfortunately, in its current state, the script currently just uses the first OutputFile from the job (as you may have noticed). In Nuke’s case, this likely ends up being a semi-random write node, since we’re not processing them in any particular order during submission. We’d really have to get a selection box when there’s multiple possible paths. Until we have something like that in place, there isn’t really an easy way to pick which one gets chosen, unfortunately.
If you’re versed in Python, and are willing to make/maintain changes in the script yourself, I could point you to where to make changes, though.
Cheers,
More than happy to make a stab at this!
So the script you’d want to look at is is “scripts/Jobs/JobCreateShotgunVersion/JobCreateShotgunVersion.py”, for the right-click job script. If you’re using the regular submitters too, you’ll also need to make similar changes in “events/Shotgun/Shotgun.py”
There are a couple places in here that uses the first output location. The first is at line ~105:
if len( job.JobOutputDirectories ) > 0 and len( job.JobOutputFileNames ) > 0:
fname = job.JobOutputFileNames[0]
outputPath = os.path.join( job.JobOutputDirectories[0], fname )
outputPath = RepositoryUtils.CheckPathMapping( outputPath, False )
outputPath = PathUtils.ToPlatformIndependentPath( outputPath )
This is for the “Path to Frames” field in Shotgun.
The second is for the Thumbnail, and is located at line ~177:
# Get the output path for the frame.
outputPath = os.path.join(job.JobOutputDirectories[0], job.JobOutputFileNames[0]).replace("//","/")
outputPath = RepositoryUtils.CheckPathMapping( outputPath, False )
outputPath = PathUtils.ToPlatformIndependentPath( outputPath )
Basically, insted of just grabbing the first value of job.JobOutputDirectories and job.JobOutputFileNames, you’ll have to add some logic to figure out which one to use.
IMPORTANT NOTE: If you make custom changes to the script (and this goes for any of our scripts or plugins), you have to be aware that your changes can be clobbered when updating the Deadline Repository. It’d be up to you to maintain these changes across upgrades.
Cheers,