Ok Ryan, here you are. Working, tested and confirmed over four separate jobs.
This replaces the full postrendertasks section
def PostRenderTasks( self ):
if self.MergeJob and self.GetBooleanPluginInfoEntryWithDefault( "DeleteFiles", False ):
outputFile = self.GetPluginInfoEntryWithDefault( "OutputFile", "" ).strip()
outputFile = RepositoryUtils.CheckPathMapping( outputFile )
outputFile = self.FixPathSeparators( outputFile )
coopJobs = self.GetIntegerPluginInfoEntryWithDefault( "CoopJobs", 0 )
if self.GetBooleanPluginInfoEntry( "SingleFile" ):
self.LogInfo( "Deleting intermediate files" )
for seedFile in self.MxiSeedFiles:
self.LogInfo( " Deleting " + seedFile )
File.Delete( seedFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_material_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_object_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_alpha_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_fresnel_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_normals_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_position_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_roughness_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_zbuffer_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_motion_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_shadow_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
else:
frame = self.GetStartFrame()
filenamePadding = StringUtils.ToZeroPaddedString( frame, 4, False )
self.LogInfo( "Deleting intermediate files for frame " + str(frame) )
for seedFile in self.MxiSeedFiles:
self.LogInfo( " Deleting " + seedFile )
File.Delete( seedFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s" + padding + "_." + filenamePadding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_material_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_object_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_alpha_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_fresnel_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_normals_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_position_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_roughness_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_zbuffer_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_motion_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
if len( outputFile ) > 0:
for seed in range( 1, coopJobs + 1 ):
padding = StringUtils.ToZeroPaddedString( seed, 4, False )
directory = Path.GetDirectoryName( outputFile )
filename = Path.GetFileNameWithoutExtension( outputFile )
extension = Path.GetExtension( outputFile )
seedOutputFile = Path.Combine( directory, filename + "_s_shadow_" + padding + extension )
self.LogInfo( " Deleting " + seedOutputFile )
File.Delete( seedOutputFile )
I’ve tried to keep it as clean as possible, but perhaps you know of a better way than this.
Tim.