handiklap
10-11-2006, 01:06 PM
I've recently written a couple utilities that aid in netrendering multiple passes that are later composited within max. Previously, the script was a singular solution for one machine, rendering four passes and then compositing those passes. Now I have the passes distributed between a few machines, and then later, after all of them are finished (that is to say, when I can be assured that each of the 4 components of a comp are finished), I then put the output directory through another script which handles the compositing. I'm trying to script a way to tell when the 4 jobs of each image are completed. Right now, each of the jobs uses the same maxscript variable, but of course is submitted with a unique name (a file prefix and a unique suffix for each of the four passes). I've tried using the callbacks for both #message and #update, using the maxscript help examples as models, without success. Here's the code I'm using:
netMgr = netrender.getManager()
netMgr.connect #automatic "255.255.255.0"
if (netMgr.querycontrol #wait) do netMgr.getcontrol()
netMgr.wantControl = true
--[standard pass]
netJob = netMgr.newJob()
netJob.name = ((getFilenameFile rendOutputFilename) + "_std")
netJob.frameOutputName = (rendName + "_std" + ".tif")
netJob.includeMaps = true
netJob.suspended = false
netJob.fromFrame = 0
netJob.toFrame = 0
netJob.notifications = true
netJob.notifycompletion = true
netJob.submit()
holdMaxFile()
--[scene changes here]
--[ambient pass]
netJob = netMgr.newJob()
netJob.name = ((getFilenameFile rendOutputFilename) + "_amb")
netJob.frameOutputName = (rendName + "_amb" + ".tif")
netJob.includeMaps = true
netJob.suspended = false
netJob.fromFrame = 0
netJob.toFrame = 0
netJob.submit()
--[scene changes here]
--[specular pass]
netJob = netMgr.newJob()
netJob.name = ((getFilenameFile rendOutputFilename) + "_spc")
netJob.frameOutputName = (rendName + "_spc" + ".tif")
netJob.includeMaps = true
netJob.suspended = false
netJob.fromFrame = 0
netJob.toFrame = 0
netJob.submit()
--[scene changes here]
--[occlusion pass]
netJob = netMgr.newJob()
netJob.name = ((getFilenameFile rendOutputFilename) + "_occ")
netJob.frameOutputName = (rendName + "_occ" + ".tif")
netJob.includeMaps = true
netJob.suspended = false
netJob.fromFrame = 0
netJob.toFrame = 0
netJob.submit()
fetchMaxFile quiet:true
Looking at it now, I realize I should write a fn with the suffix argument for making unique names for the passes.:rolleyes:
If I could get returns of job name completions, or even have all of the manager output through callbacks to weed out the "Job" prefixes, I could easily tell if the four passes for a particular scene have completed.
Thanks for any pointers.
edit: And a bonus question: What setting am I overlooking that turns off trailing zeros on my netrender output? Everything I render with the above code tacks "0000" to the end of the filename.
netMgr = netrender.getManager()
netMgr.connect #automatic "255.255.255.0"
if (netMgr.querycontrol #wait) do netMgr.getcontrol()
netMgr.wantControl = true
--[standard pass]
netJob = netMgr.newJob()
netJob.name = ((getFilenameFile rendOutputFilename) + "_std")
netJob.frameOutputName = (rendName + "_std" + ".tif")
netJob.includeMaps = true
netJob.suspended = false
netJob.fromFrame = 0
netJob.toFrame = 0
netJob.notifications = true
netJob.notifycompletion = true
netJob.submit()
holdMaxFile()
--[scene changes here]
--[ambient pass]
netJob = netMgr.newJob()
netJob.name = ((getFilenameFile rendOutputFilename) + "_amb")
netJob.frameOutputName = (rendName + "_amb" + ".tif")
netJob.includeMaps = true
netJob.suspended = false
netJob.fromFrame = 0
netJob.toFrame = 0
netJob.submit()
--[scene changes here]
--[specular pass]
netJob = netMgr.newJob()
netJob.name = ((getFilenameFile rendOutputFilename) + "_spc")
netJob.frameOutputName = (rendName + "_spc" + ".tif")
netJob.includeMaps = true
netJob.suspended = false
netJob.fromFrame = 0
netJob.toFrame = 0
netJob.submit()
--[scene changes here]
--[occlusion pass]
netJob = netMgr.newJob()
netJob.name = ((getFilenameFile rendOutputFilename) + "_occ")
netJob.frameOutputName = (rendName + "_occ" + ".tif")
netJob.includeMaps = true
netJob.suspended = false
netJob.fromFrame = 0
netJob.toFrame = 0
netJob.submit()
fetchMaxFile quiet:true
Looking at it now, I realize I should write a fn with the suffix argument for making unique names for the passes.:rolleyes:
If I could get returns of job name completions, or even have all of the manager output through callbacks to weed out the "Job" prefixes, I could easily tell if the four passes for a particular scene have completed.
Thanks for any pointers.
edit: And a bonus question: What setting am I overlooking that turns off trailing zeros on my netrender output? Everything I render with the above code tacks "0000" to the end of the filename.
