Batch Manager Output Error

I've been working on an automation script and I seem to have hit a small wall on one of the steps I'm working on.

In this example I have a scene with an object and some basic cameras, "Front", "Back", "Left", "Right". I started working on this neat little script script that at first seemed to work well.

batchRenderMgr.netRender = true
Front = batchRenderMgr.CreateView $Front
Front.overridePreset = on
Front.outputFilename = "\\\\Server\outputs\teapot_frontview.tif" = "Front"

Repeat for Back, left and right Cameras.

The above works great in that it will create a view in the batch manger based on the named camera, call forth the settings I want and even give me a file output name. However the issues is that unless I manually click on the "save" button in the Render Output file and hit "ok" in the TIF Image Control, it will Not render when submitted to the Farm.. The Farm servers have the error "3dsmax adapter error : 3dsmax.exe process no response." Im still learning Maxscript so I'm hoping that this is just a learning curve that I am overlooking something simple here and not a bug in Maxscript.

The reason I need this to work without me having to go into it manually is that it is part of a larger automation process I'm working on. Thank you in advanced for all your help and knowledge.


Comment viewing options

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

Beautiful Script! Thank you so much!

First Not only does this improve what I had but adds to it. Currently I was just pulling a studio with pre made cameras. This goes far beyond and will allow me to build my cameras procedurally to match the object being rendered, I had not learned how to do that yet..Thank you... This is prefect! I've been playing with this script all morning breaking it apart so I can better learn how each step works.

I started having the batch error again when I ran the script from a brand new scene. I was wrong about it being a permissions error. It seems to be a setting I have on one of my saved studios... anyway if I clear out an old studio and run your script it works. I'm still investigating exactly what it is that causes that to happen and I have a feeling that it is something very simple that I am just over looking and I will post when I figure it out.

Thank you so much again, I absolutely love it!

zahidhasan's picture

Hi, did you solve the max


did you solve the max crash? please tell us about it.
We made a script to work with Batchmanger. the problem was file format as we think.
if we open the image output name once after the script and ok the filename, then the max dont crash. otherwise it crashes after saving empty files(zero size).


barigazy's picture


My pleasure, Libby.
If you have any question about my code, or some extended feature that you want to add to speedup your workflow you can ask anytime.
Also you can see theses tools which works with VRayPhisicalCamera but for earlier version of max


Libby's picture


We had a major crash with our farm computers yesterday and when they got back up and running the script now works. I'm glad it works now, however I don't like not knowing why it suddenly works... Was it a permission issue with the farm computers?

barigazy's picture


See this example. Run this code on empty scene.

-- batchRender setup
fn batchRender camArr path: imagename: ext: =
	local batch = batchRenderMgr, appendPath = pathConfig.appendPath
	batch.netRender = on
	for c in camArr do
		imagename = imagename + "_" + + "view" + ext
		view = batch.CreateView c
		view.overridePreset = on
		view.outputFilename = appendPath path imagename =
--create four cameras
fn createFourOrthoCameras camType:#target origin:[0,0,0] distanceFromOrigin:100 height:0 =
	local camNames = #("Front", "Back", "Left", "Right"), camWire = #(red,green,blue,yellow)
	local camTM = #(
		(matrix3 x_axis z_axis (-y_axis) [origin.x, (origin.y - distanceFromOrigin), height]), \ -- front
		(matrix3 (-x_axis) z_axis y_axis [origin.x, (origin.y + distanceFromOrigin), height]), \ -- back
		(matrix3 (-y_axis) z_axis (-x_axis) [(origin.x - distanceFromOrigin), origin.y, height]), \ -- left
		(matrix3 y_axis z_axis x_axis [(origin.x + distanceFromOrigin), origin.y, height]) -- right
	for i = 1 to camNames.count do
		camera = Freecamera name:camNames[i] wirecolor:camWire[i] transform:camTM[i] orthoProjection:on
		if camType == #target do 
			camera.type = camType = [origin.x,origin.y,height] = camWire[i]
tea = Teapot radius:50
createFourOrthoCameras camType:#free origin:tea.pos distanceFromOrigin:300 height:50
batchRender #($Front, $Back, $Left, $Right) path:@"\\Server\outputs" imagename:"teapot" ext:".tif"


Comment viewing options

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