I would like to know if there is a batch render script that will render several different files using DR overnight while I get a little sleep for a change.
If I can’t use DR I would still like to know if it can be done with vray. As you can tell scripting is not my cup of tea.
Here is a sample script; you can modify it as necessary:
-- batchRender
-- scenesDir: the folder with all the scenes
-- outputDir: the folder with the final images
-- all images are saved as .png files
fn batchRender scenesDir outputDir = (
-- Create the output bitmap
bm = Bitmap 640 480
-- Set up the .png output (we need to save alpha)
pngio.setAlpha true
pngio.setType #true24
-- Get all .max files in the folder
filelist = getFiles (scenesDir+"*.max")
-- Cycle through all the scenes
for f in filelist do (
-- Load the next file
loadres = loadMAXFile f quiet:true useFileUnits:true
-- If not loaded, print an error and move on to the next one
if not loadres then (
print "Error loading file "+f+"
"
continue
)
-- Set some renderer parameters
renderers.current.system_frameStamp_on = true
renderers.current.system_frameStamp_string = "%vrayversion | %filename | %frame | %rendertime | %computername | %cpu %mhz %ram"
-- Render out the image
render outputWidth: 640 outputHeight: 480 outputFile: (outputDir+""+getFilenameFile(f)+".png") to: bm
)
)
When you run this script, you can go to the MaxScript listener and type, for example: batchRender "d:/scenes/batchScenes" "d:/images/batchImages"
We could really use this batch DR script. I have tried it with Max 6 and Max 7 both with Vray 1.46.10.
I run the script as is in Vlado’s post then type the command batchRender “c:scenesatchScenes” “c:imagesatchImages” in MXS listner and I get and OK response from MXS. But nothing ever happens; no scenes load and no images get saved.
I tried the scenes with DR enabled and disabled.
We can use 3dsmaxcmd to batch render on single machines. 3dsmaxcmd does not work with DR enabled.
I’ve had good luck with a script called “batcher utility” available at scriptspot.com. You run it from within Max and it will run a list of scripts on a folder full of files. All you need is a very simple script to render and save the file. You can also use it to generate IR maps on a series of files. Just set your render parameters up in each file before running it. It works for Max 4, don’t know about higher versions. I notice there is another one called “batcher” that looks similar and is good for Max 6.
Tony,
You can create a simple script by turning on listener and execute a render. Copy the text from the listener to a script and save it. You can test it by running it and seeing if it renders. Once you have the script working you can use the batcher do the hard part which is running the render script on a series of files. Just set your render parameters up in the files before running the script. I’ve used this a lot for unattended batch rendering to generate IR files. I haven’t used DR with it but it might work. The beauty of it is that you don’t have to do extensive scripting to get it to work.