[Closed] Setting Render Element filename on pre-render script?
I’m trying to fix the problem of render elements not working with strip rendering.
I’ve written a script which assembles an image from all the strips, which works fine (mainly because the 2nd passes in backburner keep failing on our network)
Now i’m trying to write a pre/post render script which will save out the elements.
For those who don’t know… when using strip rendering the strip renders and the element and saves the strip as STP000xfilename.tga but saves the element as filename_renderelement.tga with no STP000x prefex, so on every strip render it overwrites the renderelement.
So I wrote a pre-render script which (just for now) makes a random file name for the render element and sets it before the render. But this just stops the render element from being saved on a single render, and does nothing using strip rendering.
a = maxOps.GetCurRenderElementMgr()
setsilentmode true
b = a.getrenderelement 0
rendEPath = a.getrenderelementfilename 0
r = random 1 20
newpath = (substring rendEPath 1 (rendEpath.count - 4)) + r as string + ".tga"
a.setrenderelementfilename 0 newpath
So now I guess I have to try it as a post-render script. How can i acess the gbuffer information?
I’ve thought about writing a script that copies and renames the rendered element so it doesn’t get overwritten but that leaves me with another problem.
Is it possible for a post-render script to determin which strip it is currently rendering?
I don’t think the problem is the name, I think the problem is how BB saves the name. So to fix that you will need to bypass the strip rendering and submit wach strip yourself.
I would suggest submitting a crop render that goes through the needed strips (ie send separate jobs per strip). This would ensure that all strips and elements would have unique names. Then you could stitch them together as you currently are.
-Eric
Problem is with that is we use strip rendering on a large scale. Often rendering a 12,000×8000 pixel image in 200 strips to make the most of using the render farm. It would take far too long to submit each strip as a single job and would really slow down the manager and be very difficult to work with if we were kicking off say 30 renders one night…
I guess you want to fix this problem via code, but can I strongly suggest you consider investing in a cutting-edge renderfarm management tool which would handle strip rendering for you automatically and is production proven?
http://www.franticfilms.com/software/products/deadline/download/
Free for the first 2 slaves and includes all maxscript code on how their strip rendering works
Mike
Yeah been asking for Deadline for a while but not getting it for the moment
Thinking I might write my own strip renderer for now using the cmd renderer and crop render.
I have been looking at exactly the same problem, and my conclusion was that BB overwrites each strips with the same name.
My conclusion was to use the callback on postrender, and then rename the current stip (proof of concept was with vray alpha)
callbacks.addScript #postRender filename:"postRename.ms" id:#super persistent:true
-- postRename.ms
re = maxOps.GetCurRenderElementMgr()
renderOutput_filepath = getFilenamePath rendoutputfilename
renderOutput_filename = getFilenameFile rendoutputfilename
renderOutput_fileExtension = getFilenameType rendoutputfilename
new_element_PathAndFilename_string = renderOutput_filepath + renderOutput_filename + "_vrayalpha_" + "0000" + renderOutput_fileExtension
new_element_Filename_string = renderOutput_filename + "_vrayalpha_" + "0000"
element_filepath = getFilenamePath (re.GetRenderElementFilename 0)
element_filename = getFilenameFile (re.GetRenderElementFilename 0)
element_fileExtension = getFilenameType (re.GetRenderElementFilename 0)
element_PathAndFileName = element_filepath + element_filename + "0000"
element_CompleteName = element_PathAndFileName + element_fileExtension
renameFile element_CompleteName new_element_PathAndFilename_string
Is works, now I just need to work some more on the assemble part of the script...
I wonder if AD understands the number of hour spent trying to get BB to work in a production enviroment?? But I’m sure glad to have that new steering wheel…
I’ve spent a few days chasing this one too… same ideas meantioned but no rock solid solution…
Problem is Backburner is for Max and Combustion.
That’s just not good enough for most people’s farms. I think backburner should be abandoned and if they want to offer free Max render management work out some sort of limited ‘lite’ version of deadline.
Don’t forget Toxik and Burn also. They are run off of Backburner as well.
-Eric