What’’s the difference between the xsi and xsibatch executable

November 25th, 2005 by Luc-Eric - Viewed 5483 times - Popularity: 11%




I created XSIBatch what seems to be a hundred years ago, and it was created only for the purpose of address a specific Windows problem. On IRIX, xsibatch used to be a simple link to ”xsi”, they were completely identical.

The problem addressed was that under windows, an application must specify whether it’’s a console or a graphical (GUI) application at link time with the /subsystem switch.

A Win32 console application can create windows and do graphical things just the same. The difference is that a console app will inherit the console from the command-line prompt that launched the application, whereas a GUI app doesn”t.

If a console application is launched from the desktop, Windows will create a new console for it.

A GUI win32 app’’s stdout, stderr all get attached to a null handle and all the output is lost. A GUI app can create new console, but it will not be attached to the command-line prompt that launched the application.

So we needed to create xsibatch to have a version of xsi.exe that had the /Subsystem:console switch, which allowed launching XSI through telnet for a render, and getting back the output of XSI through telnet (or to a batch file),

Under UNIX, all applications inherit the parent’’s console, if any, so this is not necessary. However, through the years we have modified xsibatch to make sure that it sets an internal flag to not start any graphical elements - such as a dialog box - that would require starting XWindows, because that will cause telnet or a batch files to hang. So it’’s no longer identical to xsi.exe today, but it’’s got only a few bytes of difference.

Softimage|3D was compiled always as a console application, which is why when you start it from explorer there is a “black window” behind, i.e. a console that was created. Early on, we decided we didn”t want XSI to do that , because a well- behaved Windows application shouldn”t create a dead console on your desktop in addition to its main window.

How can you use this knowledge?

Well, basically, ”xsibatch” and ”xsi” are the same, take the same command line arguments and do the same thing. So if you have instructions to run a batch script or a render that uses ”xsibatch”, you could as well run that command with ”xsi” and get the same result. As well, if you mean to do run a script that needs the user interface, for example run a batch script that does a viewport capture and then exit, you will need to use xsi.exe instead of xsibatch.exe, because xsibatch will never allow opening a window. Same is true for Linux.

Leave a Reply