Automatic VRAY Denoise Job after Render Job finishes

Hi mepp!

I am completely new to phyton. I can do a couple of tricks with Maxscript but I am not a coder. My question is: Are python skills required to do an automatic post job of vray denoise? I simply can’t continue from your starting point.
I’ve tried to modify the code of this thread and all I can achieve is execute the script without errors… and without denoising xD
I would like to run VRAY Denoise after the drafting job of a tiled rendering. Is there any template, sample or tutorial which I can follow?

Thank you very much for your help :smiley:

In case it helps, here is the code (you can have a good laugh :wink: no problem)

####### START CODE ######
def main( *args ):

def __init__(self):
	self.OnJobFinishedCallback += self.OnJobFinished

def Cleanup(self):
	del self.OnJobFinishedCallback
	
def OnJobFinished( self, job ):
	# TODO: Connect to pipeline site to notify it that the job for a particular
	# shot or task is complete.

	jobInfoFilename = Path.Combine( ClientUtils.GetDeadlineTempPath(), "automVRAYDenoise_jobInfo.job" )
	writer = StreamWriter( jobInfoFilename, False, Encoding.Unicode )
	writer.WriteLine( "Plugin=VDenoise" )
	writer.WriteLine( "Name=%s - Automatic VRAY Denoise" % job.JobName )
	
	
	outputDirectory = job.OutputDirectories[0]
	outputFilename = job.OutputFileNames[0]
	outputFilename = outputFilename.replace("#","")
	outputFilename = outputFilename[:-4]
	vrayDenoisePath = "%s\%s.????.exr" % (outputDirectory,outputFilename)
	self.LogInfo( vrayDenoisePath )
	
	
	writer.WriteLine( "Frames=%s" % job.JobFrames )


	writer.Close()
	
	# Create plugin info file.
	pluginInfoFilename = Path.Combine( ClientUtils.GetDeadlineTempPath(), "automVRAYDenoise_pluginInfo.job" )
	writer = StreamWriter( pluginInfoFilename, False, Encoding.Unicode )

	writer.WriteLine( "InputPath=%s" % vrayDenoisePath )        
	writer.WriteLine( "DenoiseMode=Default" )
	writer.WriteLine( "SkipExisting=True" )
	writer.WriteLine( "DenoiseElements=False" )
	writer.WriteLine( "UseGPU=True" )

	
	writer.Close()

	ClientUtils.ExecuteCommand( (jobInfoFilename,pluginInfoFilename) )


	self.LogInfo("Event Plugin: Complete")

####### END CODE ########