User guide
41
2. Navigate to the directory where you installed Katana.
3. Enter:
./katana --shell
Querying Launch Mode
To query the current Katana launch mode, call QtGui.qApp.type() while in Script or Interactive mode. This returns
an int, with value 1 if running in UI mode, and 0 if running in a headless mode.
The following script queries type() and prints the current launch mode:
from Katana import QtGui
if QtGui.qApp.type() == 1:
print( "Running in UI mode" )
elif QtGui.qApp.type() == 0:
print( "Running in headless mode" )
else:
print( "Error" )
While in Batch mode, the KATANA_BATCH_MODE environment variable is set. To retrieve this from AttributeScripts,
use the getEnv() syntax.
6 KATANA LAUNCH MODES |