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:
Continue reading

Motion blur on non-simulated ICE trees


In a recent case, a customer was using an ICE tree in the Modeling stack to create a fixed number of particles. Then, he used an animated scalar value in the ICE tree to drive changes in the particle positions. Basically, it was a bunch of “spokes” rotating in a circle.

The problem was that there was no motion blur when he rendered with mental ray (but there was motion blur with 3Delight).

To get motion blur in this type of scene, you have to set the PointVelocity attribute to a value that indicates the direction and distance/second of travel.

Unlike 3Delight, mental ray only takes the motion from the velocity attribute. There’s no delta comparison done.

Creating a desktop shortcut for batch rendering


You can use scriptXSI.bat in %XSI_HOME%\Application\bin to create a desktop shortcut for batch rendering. When you drag and drop a scene file on that batch file, that starts a batch render.

To create a desktop shortcut, right-click scriptXSI.bat and click Send To > Desktop (create shortcut).

If you want to drag and drop multiple scenes:

  1. Copy scriptXSI.bat to your desktop.
  2. Edit the batch file and change it to this:
    @echo off
    call "C:\Program Files\Autodesk\Softimage 2011 Subscription Advantage Pack\Application\bin\setenv.bat"
    :next
    if "%1"=="" goto end
    set SCN=%1
    "C:\Program Files\Autodesk\Softimage 2011 Subscription Advantage Pack\Application\bin\XSIBatch.exe" -render %SCN%
    shift
    goto next
    :end
    

ERROR : FATAL: DB 1.0 fatal 041500: interrupted by exception code 0xc0000005 (access violation)


‘ ERROR : FATAL: DB 1.0 fatal 041500: interrupted by exception code 0xc0000005 (access violation)

The exception code 0xc0000005 (access violation) indicates this is probably a memory access error. The software is trying to access a region of memory that it shouldn’t be accessing. In general, this could be a problem in the code (for example, a NULL pointer), faulty RAM, or even a bad device driver.

If you get this error with any scene (for example, with one of the sample scenes that ships with Softimage), then that may indicate the problem is specific to your computers. Or if you get the error only with a certain computer, that would indicate a possible problem with that one computer.

If you get this with just some scenes, then that points to a problem in the software (or perhaps the scene). It could be that something about the scene triggers certain conditions in the software, and the software then causes the error. In general, I would try breaking down the scene to try and isolate the root cause. It could be the overall complexity of the scene, or a specific element of the scene.

In one case I had recently, the user got this 0xc0000005 (access violation) error and then an endless series of bad message…0xbad0bad errors. We traced the access violation error back the number of different animated objects that were being instanced through ICE using assemblies.

Assemblies are used when an ICE trees use one of these compounds:

  • Set Instance Geometry
  • Set Particle Instance Animation Time
  • Control Instance Animation
  • Control Displacement Instance Animation

Using assemblies can be memory-intensive, so it appears that when you’ve got a lot of particles and a lot of animated instances of many objects, satellite rendering may fail with a memory access error (actually, the frame was rendered, but XSI was hung up after because of the errors).

Ref: Access Violation? How dare you …

ERROR : 2004 – Invalid pointer – [line 2]


When you render with xsibatch, you get this error even though the frame does render successfully.

ERROR : 2004 – Invalid pointer – [line 2]

For example:

COMMAND: -render "C:\Users\blairs\Documents\Support\Project\Scenes\Sphere.scn" -
frames 2-4
>Loading: C:\Users\blairs\Documents\Support\Project\Scenes\Sphere.scn...
' ERROR : 2004 - Invalid pointer - [line 2]
' INFO : 4034 - Loaded scene was created with build number: 9.5.184.0 - compatibility version: 900
' ERROR : 2004 - Invalid pointer - [line 2]
OpenScene "C:\Users\blairs\Documents\Support\Project\Scenes\Sphere.scn", False,True
' INFO : Rendering all passes: Passes.Default_Pass
' INFO : Rendering frames '2-4'
' INFO : Rendering pass 'Default_Pass'...
' INFO : Rendering frame 2 (0.0% done)
' INFO : Rendering frame 3 (33.3% done)
RenderPasses "Passes.Default_Pass", , , , siRenderVerbosityDefault

If you running xsibatch from a render manager, this error may cause the render manager to quit the render job.

You can workaround this by renaming the ICEFlow plugin (Application\Plugins\ICEFlow.dll). This plugin manages the transfer of data between Softimage and Maya (the one-click ICE workflow).

Getting Softimage to render on all cores


I see this question pop up from time to time: why doesn’t Softimage use all my CPUs/cores when I render?

mental ray is going to use all the cores it can (or should I say “all the cores it needs”?). There’s no flag to set or switch to activate. In fact, the only related option is the -threads command line flag, which will restrict the number of threads.

Here’s a screenshot of a render region of the ICE_Candle example scene. I didn’t have to do anything for Softimage to use all cores:

If Softimage doesn’t seem to be using all your cores/CPUs, I guess the first thing I would check is the task priority and affinity in the Task Manager.

Satellite rendering works in 2011 SP1


I’ve had a couple of customers ask if satellite really does work, and I can confirm that it does. I set up a couple of Windows 7 machines for satellite, and the mental ray diagnostics show the satellite machine being used (I’ve changed the computer names for demo purposes):

// INFO : JOB  0.n  progr:    89.8%    rendered on MTL-SATELLITE:7020.6
// INFO : JOB  0.13 progr:    90.9%    rendered on MTL-MASTER.13
// INFO : JOB  0.6  progr:    91.9%    rendered on MTL-MASTER.6
// INFO : JOB  0.n  progr:    92.9%    rendered on MTL-SATELLITE:7020.7
// INFO : JOB  0.12 progr:    93.9%    rendered on MTL-MASTER.12
// INFO : JOB  0.n  progr:    94.9%    rendered on MTL-SATELLITE:7020.2
// INFO : JOB  0.n  progr:    95.9%    rendered on MTL-SATELLITE:7020.4
// INFO : JOB  0.10 progr:    96.9%    rendered on MTL-MASTER.10
// INFO : JOB  0.n  progr:    97.9%    rendered on MTL-SATELLITE:7020.0
// INFO : JOB  0.n  progr:    98.9%    rendered on MTL-SATELLITE:7020.5

MTL-SATELLITE is the satellite computer, 7020 is the port used by the Satellite service, and the number after the period is the thread number.

One gotcha: satellite didn’t work if I used a different port on each computer. For example, if I changed the port to 7004 on the Master, then satellite didn’t work.

Fatal 041052: accessing unknown tag


In a recent support case, a customer reported he was getting an error that looked like this:

' INFO : Rendering frame 123 (62.5% done)
' FATAL : DB   0.14 fatal  041052: accessing unknown tag 0x41d
' FATAL : mental ray has encountered a fatal error condition.
' It has been disabled for the rest of this XSI session.
' Please save your work and and contact Softimage support (support@softimage.com).

Sometimes “accessing unknown tag” errors can happen when you run out of memory. Other times, “accessing unknown tag” errors can indicate that something is missing in the scene database created by mental ray. Everything in the scene database has a tag, including shaders and light profiles. Shaders use the tags to reference objects, so if some input to a shader is missing, you would get the “unknown tag” error.

In this particular case, the customer was able to resolve the problem by removing all unused materials and image clips from the scene.