Other two simple scripts help please

First of all THANK you br0t and
THANK you Anubis for your help.

Because with State Sets with 3ds Max 2012
you can do every batch job you want especially
with modifiers, I need to insert into them
some batch render essential jobs.

So can somebody please tell with maxscript how to:

Switch to a specific cameraview

Render output to a tiff file in specific resolution

thank you again


Comment viewing options

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

Hi Petros

MaxScript give many choices on how to render - for example, you can set camera to view, but you can also render concrete camera without this. Also you can set/modify renderer settings and then render, or using render() function with needed optional parameters. Here is 3 examples that did exact the same result:

-- var #1 (modifying renderer settings):
viewport.setCamera $Camera01 -- set Camera01 to active view
renderWidth = 320 -- set render width
renderHeight = 240 -- set render height
renderPixelAspect = 1.0 -- 1.0 is a default value anyway
rendSaveFile = true -- activate "Save File" option
rendOutputFilename = "C:\\test.tif" -- set output file path
-- var #2 (render with "to:bitmap"):
theBmp = bitmap 320 240 -- create "virtual" bitmap
render to:theBmp vfb:off camera:$Camera01 -- render to bitmap
theBmp.fileName = "C:\\test.tif" -- set fileName of the bitmap
save theBmp -- save those bitmap
free theBmp -- close and free it from memory
-- var #3 (render with optional "outputfile"):
render camera:$Camera01 outputSize:[320,240] \
pixelaspect:1.0 outputfile:"C:\\test.tif"

I think that the 1st method is fine for State Sets, but just in case, i mention others too.

So, 1st method set camera to view and modify renderer settings; 2nd acquire output size from the bitmap; also using optional param "camera", no need to set it as active view; that's true and for the 3rd method, where render is directly to file (outputfile) and size is supplied with "outputSize".

I hope this is good enough to get started ;)

Ah, just in case, a note about "\" sign used at the end of 3rd method. It's a programming "line-break" (good for too large lines) whos tell to the compiler that the command continue on the next line. Without it, above 2 lines will be interpreted as 2 separate commands.

my recent MAXScripts RSS (archive here)

pproestos's picture


Thank you again, you are genius man.

Many thanks.
I wish one day to learn well maxscript, because
now I understand how important tool is for 3dsmax...

thanks again.

Comment viewing options

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