Undocumented environment variables #2


set XSI_EDITORS_WHITE_BG=1

XSI_EDITORS_WHITE_BG

This undocumented env var was mentioned on the XSI mailing list back in 2008 (ice tree background), but I found out about it another, more brute force, way.

* undocumented env var #1 was XSI_DISABLE_NEW_PICK (see also here, where XSI_DISABLE_NEW_PICK is a workaround for failed component selection in a virtual environment like Parallels)

Checking the environment of a running program


Sometimes when you’re troubleshooting, it’s a good idea to check the environment in which Softimage is running.
You can check specific environment variables in the script editor like this:

import os
print os.getenv( "XSI_USERHOME" )
print os.getenv( "TEMP" )

or like this:

print XSIUtils.Environment("XSI_BINDIR")

But I would typically use Process Explorer to see the full environment:
ProcessExplorer_Environment
or Process Monitor (in Process Monitor, you just have to find the Process Start operation for XSI.exe and double-click it).
ProcessMonitor_Environment

Crosswalk, Common Files, and the PATH environment variable


Anytime you have problems with Crosswalk not showing up in Softimage or Crosswalk missing or dotXSI liberaries missing, it’s probably because the Common Files location is missing from your PATH environment variable.

Now, setenv.bat does add the Common Files location to the PATH:

rem Adding folder(s) to the Path
set SOFTIMAGE_COMMONFILES=C:\Program Files\Common Files\Softimage
if not "%XSI_SetenvDone%"=="" goto Done_Path
set Path=%XSI_BINDIR%\%XSI_CPU%%_CPU_REVISION%;%XSI_BINDIR%;%SOFTIMAGE_COMMONFILES%;%Path%
:Done_Path

but strangely, this doesn’t [always] help.

  • If you start Softimage from the Start menu, this Softimage still can’t find the common file Crosswalk_2013.0.64.dll (which is installed in C:\Program Files\Common Files\Softimage).
  • But if you start Softimage from a command prompt with XSI.bat, Softimage does find Crosswalk_2013.0.64.dll.

I stumbled on this when I wrote a little script to check whether or not Common Files was in the PATH. Because setenv.bat prepends the Common Files location to PATH, I need to check whether there is more than one occurrence in the PATH. If there’s just one, then that’s a problem because Crosswalk won’t be found when you start Softimage from the Start menu.

from siutils import si

if Application.Version().split('.')[0]>= "11":
	si = si()					# win32com.client.Dispatch('XSI.Application')
	
from siutils import log		# LogMessage
from siutils import disp	# win32com.client.Dispatch
from siutils import C		# win32com.client.constants


path = XSIUtils.Environment( 'PATH' )
cf = "".join( [XSIUtils.Environment( 'CommonProgramFiles' ), '\Softimage'] )
#cfx86 = "".join( [XSIUtils.Environment( 'CommonProgramFiles(x86)' ), '\Softimage'] )

# Check Common Files

# Log number of times Common Files is found in PATH
# log( path.split(';').count(cf) )

if path.split(';').count(cf) > 1:
	log( "'%s' is in PATH" % cf )
else:
	log( "'%s' is missing from PATH" % cf, C.siError )

Disabling Customer Error Reporting (CER)


In general, we’d prefer you didn’t disable the CER reports. But if you’re in the middle of debugging a plugin that constantly crashes, for example, you might want to temporarily disable the CERs.

To disable CER reporting, edit the Softimage setenv.bat file and add this:

SI_DISABLE_CER=1

Maya, and presumbably 3ds Max, work the same way.

MAYA_DISABLE_CER=1