You can use command-line options to render scenes without opening the Softimage user interface. This is known as batch rendering or command line rendering. In addition, you can export render archives as well as create and run batch or script files from the command line.
To render in batch mode you use the xsi or xsibatch command with the -render or -export switch followed by any of the supported batch rendering options you wish to specify. For example, you can do any of the following:
xsi -render bob.scn -pass specular -frames 1,3,60 xsi -export bob.scn xsi -script foo.vbs xsi -render bob.scn -script foo.vbs
xsi and xsibatch support the same options. The difference is that xsibatch is the remote-friendly version of the xsi command compiled specifically for Windows. This allows you to render in batch mode remotely using Telnet for example, or perform other tasks such as automatically close the command window when you want to run several scripts one after another from a single batch file. For more information about batch scripting, see Issues in Batch Scripting [SDK Guide].
To render in batch mode, you must set the environment and then enter rendering commands and options on a command line.
Here are the batch rendering options you can use on a command line with the -render or -export switch. These batch rendering options are general scene and pass-level rendering options that are controlled by Softimage. If you want to modify options that are specific to the renderer, you can use the -script option to specify a script as described in Using Scripts to Set Renderer Specific Options.
xsi|xsibatch <-render|-export> <path to scene> [-pass <pass1,pass2,...,passN>] [-frames <start,end[,step]>|<frame set>] [-output_dir <dir>] [-mb <on|off>] [-skip <on|off>]
If you want to modify other options than those provided with the -render and -export switches, you can use the -script option to specify a script. The script runs after the scene has been loaded and modifications performed on the passes and scene render options according to the specified command line options. The render or export starts after the script has finished.
To turn final gathering on or off, create a script called RenderScript.vbs containing this procedure:
Sub RenderScript( fg_enable ) SetValue "Passes.List.*.mentalray.FGEnable", CBool( fg_enable ) End Sub |
This can be used on the command line as follows:
xsi -render <.scn file> -script RenderScript.vbs -main RenderScript -args -fg_enable True |
There are two methods for batch rendering using scripts:
xsi -render bob.scn -script foo.vbs
When using -script together with -render, you do not need to include any render commands in the script itself. The -render option will take care of rendering the scene file after the script has finished.
xsi -script foo.vbs
When using -script without -render, you can use the RenderPass command to render the specified pass, or the current pass if none is specified, with its current rendering options. You can also use the RenderAllPasses and RenderPassesFrameSet commands. Use GetValue and SetValue to work with renderer options.
A good example of a script that includes rendering commands is Rendering.vbs in the DSScripts subdirectory. You can open this file in the script editor to see how it works.
Remember that you must provide an argument to specify which scene file to render, because scripts run from the command line cannot require any interactivity such as selecting a scene. Before running a script in batch mode, you may need to prepare it first.
For information about scripting, batch scripting, and the script editor in general, see Issues in Batch Scripting [SDK Guide].
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License