App Class

From Derivative
Jump to navigation Jump to search

This class contains specific application details, such as its version and installation folders. It can be accessed with the app object, found in the automatically imported td module.

NOTE: See also Variables and Dialogs -> Variables where more built-in paths and strings are available via expressions in the form var('DESKTOP'), var('MYDOCUMENTS') and var('TOENAME').


Members

architecturestr (Read Only):

The architecture of the compile. Generally 32 or 64 bit.

binFolderstr (Read Only):

Installation folder containing the binaries.

buildstr (Read Only):

Application build number.

compileDatetuple(year, month, day) (Read Only):

The date the application was compiled, expressed as a tuple (year, month, day).

configFolderstr (Read Only):

Installation folder containing configuration files.

desktopFolderstr (Read Only):

Current user's desktop folder.

enableOptimizedExprsbool :

Get or set if Python expression optimization is enabled. Defaults to True every time TouchDesigner starts.

experimentalbool (Read Only):

Returns true if the App is an experimental build, false otherwise.

installFolderstr (Read Only):

Main installation folder.

launchTimefloat (Read Only):

Total time required to launch and begin playing the toe file, measured in seconds.

logExtensionCompilesbool :

Get or set if extra messages for starting and ending compiling extensions is sent to the textport. Additional error stack will be printed if compilation fails. Defaults to False every time TouchDesigner starts.

osNamestr (Read Only):

The operating system name.

osVersionstr (Read Only):

The operating system version.

powerbool :

Get or set the overall processing state of the process. When True, processing is enabled. When False processing is halted. This is identical to pressing the power button on the main interface. This has a greater effect than simply pausing or stopping the playbar.

app.power = False #turn off the power button.

preferencesFolderstr (Read Only):

Folder where the preferences file is located.

processIdint (Read Only):

The ID of the current running process.

productstr (Read Only):

Type of executable the project is running under. Values are 'TouchDesigner', 'TouchPlayer' or 'TouchEngine'.

pythonExecutablestr (Read Only):

Path to TouchDesigner's Python executable. This executable is not used directly by TouchDesigner but can be used to test pure Python code in an environment with all the packages and modules included with TouchDesigner. The executable can also be used to run external Python scripts without installing a separate Python installation.

recentFileslist :

Get or set the list of most recently saved or loaded files.

samplesFolderstr (Read Only):

Installation folder containing configuration files.

paletteFolderstr (Read Only):

Installation folder containing palette files.

userPaletteFolderstr (Read Only):

Folder where custom user palettes are located.

versionstr (Read Only):

Application version number.

windowColorBitsint (Read Only):

The number of color bits per color channel the TouchDesigner window is running at. By default this will be 8-bits per channel, but can be increased to 10-bits by settings env var TOUCH_10_BIT_COLOR=1. Only works on displays that support 10-bit color.

systemFolderstr (Read Only):

Installation folder containing system files.

tempFolderstr (Read Only):

Folder used for temporary files.

Methods

addNonCommercialLimit(password)None:

Limits the application to operate at non-commercial license level. Multiple calls can be made, but each can be undone with a matching removeNonCommercialLimit(password). If the password is blank the operation cannot be undone. (See also licenses.disablePro) member.

  • password - (Keyword, Optional) Password to later remove the restriction.
app.addNonCommercialLimit('secret123')  #undoable with password
app.addNonCommercialLimit()  #permanent during length of session.

removeNonCommercialLimit(password)bool:

Removes the restriction previously added. Returns True if successful.

  • password - (Keyword) Password previously used when restriction added.
app.removeNonCommercialLimit('secret123')

addResolutionLimit(x, y, password)None:

Limits all textures to the specified amount. Multiple calls can be made, but each can be undone with a matching removeResolutionLimit(password). The final resolution limit will be the minimum of all calls. If the password is blank the operation cannot be undone.

  • x - Width of maximum texture resolution, measured in pixels.
  • y - Height of maximum texture resolution, measured in pixels.
  • password - (Keyword, Optional) Password to later remove the restriction.
app.addResolutionLimit(600, 480, 'secret123')  #undoable with password
app.addResolutionLimit()  #permanent during length of session.

removeResolutionLimit(password)bool:

Removes the restriction previously added. Returns True if successful.

  • password - (Keyword) Password previously used when restriction added.
app.removeResolutionLimit('secret123')

TouchDesigner Build: