Quick start to command-line rendering with xsibatch


I like to use a batch file to build my xsibatch command lines.
For example:

set SCN=\\EXAMPLE\Support\Project\Scenes\Scene.scn
set PASSES=Default_Pass,Depth
set XSI_BINDIR=C:\Program Files\Autodesk\Softimage 2011 Subscription Advantage Pack\Application\bin

"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%"

Note that I call xsibatch.bat, not xsibatch.exe. That is because xsibatch.bat calls setenv.bat, which sets all the environment variables used by xsi.exe and xsibatch.exe. For example, setenv.bat sets the environment variable that specifies the location of the license server.

This xsibatch command line renders all frames and all passes of the specified scene:

"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%"

Note that I need to provide the full path to the scene file, and I enclose it in quotation marks (just in case the path name includes spaces).

-frames allows me to render specific frames. For example, this renders a frameset (frames 1 throught 10):

"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%" -frames 1-10

This renders frames 1,3,5,7,…,99 using the syntax -frames start,end,step:

"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%" -frames 1,100,2

-pass specifies a comma-separated list of passes to render:

"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%" -frames 1-100 -pass "%PASSES%"

-skip tells xsibatch not to re-render frames that have already been rendered (for example, by another render node):

"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%" -frames 1-100 -pass "%PASSES%" -skip on

-verbose turns on verbose logging during the render. xsibatch will log the renderer diagnostics (Render Manager > mental ray > Diagnostics)

"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%" -frames 1-100 -pass "%PASSES%" -skip on -verbose on

-output_dir allows you to override the output folder specified in the scene file:

"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%" -frames 1-10,22 -output_dir %TEMP%

-mb allows you to enable motion blur from the command line:

"%XSI_BINDIR%\xsibatch.bat" -render "%SCN%" -frames 1-10,22 -mb on

If you need to set other mental ray options for a render job, you can use -script with -render. -script allows you to run a script on the scene before it sent to the renderer.

If you run xsibatch -h in a command prompt, you’ll get the usage:

Batch Render Options With -render or -export
============================================
    -render <.scn file>
        Load the given scene and render out to disk.
    -export <.scn file>
        Load the given scene and export to disk as render archives. These archives can then be rendered using a standalone version of the  rendering engine that processes them.
    -pass <pass1,pass2,...,passN>
        Restrict rendering/exporting to the passes given. If no passes are given,   then all the passes in the scene are rendered.
    -frames <start,end[,step]>|<frame set>
        Set the render to render only a specific frame range or a frame set for all the passes. If a list of two or three numbers is given, then it is assumed that the request is for a frame range, otherwise a frame set is assumed. A frame set is also assumed if the frame setting contains  a dash ('-') character, or if the string is surrounded by single quotes.

    -output_dir <directory>
        Override the scene's output directory with the given directory.
    -mb <on|off>
        Force motion blur on or off in all passes.
    -skip <on|off>
        Force skipping of existing frames in all passes. This is useful when rendering from multiple machines.
    -verbose <on|off>
        Force verbose output on or off.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s