Two output files?

Hi guys,

I am writing a script to submit jobs to backburner queue.
What I want is for the script, to submit it and then have 2 output files.

I got the submitting part working but still got no idea of how to do 2 output files. Is it even possible?

Thanks for helping me out.

Here is my code:

fn netRenderSub=
m = netrender.getmanager() --connect
m.connect #manual "" port:3234 --connect to this ip
JobNum = m.numJobs as integer
job = m.newjob() --scene folder and filename = (Scenename+"_"+"v"+((jobNum +=1) as string)+rtype)
job.includeMaps = true --include maps
job.outputWidth = 960 as integer
job.outputHeight = 540 as integer
job.renderCamera = (CameraDList.selected)
job.fromFrame = fromFrame.value as integer
job.toFrame = toFrame.value as integer
job.renderFields = false
job.renderDisplacements = false
job.force2Sided = true
job.frameOutputName = --output file
if doesFileExist (dir+Scenename+"_"+"v"+(baseNo as string)+rtype) == true then
dir+Scenename+"_"+"v"+((filesInFolder += 1)as string)+rtype
dir+Scenename+"_"+"v"+(baseNo as string)+rtype


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
DanGrover's picture

I don't think you'll be able

I don't think you'll be able to get the max file to do this natively, even with a script.

What you can probably do, however, is have a post render script to run at the end of every task which loads the rendered image file using loadBitMap and then save out that same bitmap in whatever format you want with the same name (using filepath). Effectively that'll just open up the file and save it back out again, it won't give you two outputs. But it might achieve the result you're after?

Anubis's picture

that will not work

Backburner have some problems with post render scripts, but most important anyway is that this will not work and in local render, because post render scripts are executed too early, ie before the last rendered image to be saved on the hard disk, so you cannot access that file.

There is a lot of variants to accomplish this, but most of them come with additional complications and that make them non applicable for production.

But why this task should be done within the render process? It can be done without any issue as separate task, and this is what I'll suggest.


my recent MAXScripts RSS (archive here)

Saij's picture

thanks for replying:D yeah i

thanks for replying:D

yeah i figured my hopes was not high. however i can't get a post render script to work with backburner.

do you have any ideas?


DanGrover's picture

I just saw your post, and I'm

I just saw your post, and I'm afraid I don't - I'm actually not familiar with using Post Render Scripts with Backburner! I do it another way....

I send CMDJob's to backburner and have them do things, instead. It's not exactly smart, because a) it requires a licensed copy of Max to be on the render node performing the action and b) it's often a high-time cost way of doing simple things, because it needs to open up a copy of max to do whatever it has to do.

But... what you could do in this instance is use CMDJob to open a copy of max and then run a script. That script could basically be the post render script that isn't working - the one that checks for the frame and opens and saves it back out again? Only, instead of working on just a single image (the one that has just been rendered, in the case of the post render script) it could loop through every frame in the folder.

Now, the reason I use cmdjob's rather than post render scripts is that they can use dependencies (something that normal net-render jobs cannot do from Maxscript, for some bizarre reason). So in this case, the process would be something like this...

Script_1 - This is the one you'd run in max. It is the code you posted in the first post. However, appended to the end of it is the sumission of a second job, using cmdjob. This job is basically just opening max and running Script_2. This cmdjob is dependent on the first job finishing. THIS IS IMPORTANT! Otherwise the frames won't have finished rendering yet.

Script_2 - This is the one that is run on the render node via the cmdjob, so this will only render once the job is done. It needs to be saved somewhere on the network where the render nodes can access it. What this script can do is connect to backburner, look at its own job properties and see what it is dependent on. It can then look at the information for THIS job, and look for its output path. Then it can run some code looping through the folder contents, opening and saving alternatives.

HOWEVER I'm an idiot and I think I've just come up with a much simpler way - if you're using either Mental Ray or VRay, they both have Render Elements which are basically the normal RGBA. You could add as many of these as you want, with as many different file types.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.