The case of Softimage stuck in layout editing mode after a crash


In this case, a customer couldn’t start Softimage again after he crashed while editing a layout.
When he started Softimage, it went into the layout editing mode and stopped responding.

In the past, we’ve fixed problems like this by asking customers to rename the User folder, or to delete any bogus .xsily files (for example, zero-length files) from the Application\layouts folder in their User location.

However, I learned from Luc-Eric that there’s a specific preference that specifies whether Softimage is in the layout editing mode. So, to stop Softimage from starting up in the Layout Editor, we had to edit %XSI_USERHOME%\Data\Preferences\default.xsipref and change this

	xsiprivate.UI_LAYOUT_DEFAULT	= Layout Editor

to this:

	xsiprivate.UI_LAYOUT_DEFAULT	= Default

Passing arguments to xsibatch scripts


You can use xsibatch to execute a script:

	xsibatch -processing -script %TEMP%\test.js 

The -processing flag tells xsibatch to run without a license (you can do this for anything that does not involve rendering).
The -script flag specifies the full path the script file.

If the script file contains functions, you can specify the name of the function to execute with the -main flag. For example, if the .js file contained a function named “test”:

	xsibatch -processing -script %TEMP%\test1.js -main test 

If the main function takes arguments, you can specify them with the -args flag. For example, if the function is defined like this (in JScript)

	function test( sPath, sList, nValue )
	{
		// [body]
	}

then you would specify the arguments like this on the xsibatch command line:

	-args -sPath "%TEMP%" -sList "X,Y,Z" -nValue 22

Putting it all together, the xsibatch command line would look like this:

	xsibatch -processing -script %TEMP%\test1.js -main test -args -sPath "%TEMP%" -sList "X,Y,Z" -nValue 22

Argument values are passed in as strings, and any quotation marks are stripped off.

Here’s a simple example of a test.js:

function test( sPath, sList, nValue )
{
	LogMessage( sPath );
	LogMessage( sList );
	LogMessage( nValue );
	LogMessage( typeof(nValue) );
}

The xsibatch command:

xsibatch -processing -script %TEMP%\test1.js -main test -args -sPath "%TEMP%" -sList "X,Y,Z" -nValue 22

And the output:

=======================================================
 Autodesk Softimage 9.5.184.0
=======================================================

License information: using [Processing]
COMMAND: -processing -script C:\Users\blairs\AppData\Local\Temp\test.js -main test -args -sPath "C:\Users\blairs\AppData\Local\Temp" -sList "X,Y,Z" -nValue 22
// INFO : C:\Users\blairs\AppData\Local\Temp
// INFO : X,Y,Z
// INFO : 22
// INFO : string