GENERATE/PREV.gifGENERATE/NEXT.gif

Running Scripts from DOS

You can launch MAX from a DOS command line and have it run a specified script, which is useful for tasks such as unattended batch-rendering. This capability uses the existing -U command line switch that names a utility to be run when MAX is started. The -U switch allows an optional string argument which, in the case of MAXScript, is taken to be the name of a launch script to run.

Example:

c:\3dsmax\3dsmax -U MAXScript rendercams.ms

This example command line would launch the MAX executable in c:\3dsmax, start MAXScript and then have it run the script rendercams.ms.

The following example launch script loads two scenes and renders frames from each of the cameras in them, and then quits MAX:

loadMaxFile "foo.max"

for c in cameras do render camera:c outputfile:("foo_"+c.name+".bmp")

loadMaxFile "baz.max"

for c in cameras do render camera:c outputfile:("baz_"+c.name+".bmp")

quitMax #noPrompt

This example makes use of the new quitMax() function. Launch scripts need not be 'batch' scripts as in this example, but may be used, for example, to condition Max for interactive use, say by loading a scene file and setting some UI options.

The normal startup script, startup.ms, is run before the launch script.