Difference between revisions of "App Class"

From TouchDesigner Documentation
Jump to: navigation, search
(App Class Auto Create)
(App Class Auto Create)
Line 9: Line 9:
 
     |class=App
 
     |class=App
 
     |name=architecture
 
     |name=architecture
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=The architecture of the compile.  Generally 32 or 64 bit.
 
     |text=The architecture of the compile.  Generally 32 or 64 bit.
Line 16: Line 16:
 
     |class=App
 
     |class=App
 
     |name=binFolder
 
     |name=binFolder
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Installation folder containing the binaries.
 
     |text=Installation folder containing the binaries.
Line 23: Line 23:
 
     |class=App
 
     |class=App
 
     |name=build
 
     |name=build
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Application build number.
 
     |text=Application build number.
Line 30: Line 30:
 
     |class=App
 
     |class=App
 
     |name=compileDate
 
     |name=compileDate
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=The date the application was compiled, expressed as a tuple (year, month, day).
 
     |text=The date the application was compiled, expressed as a tuple (year, month, day).
Line 37: Line 37:
 
     |class=App
 
     |class=App
 
     |name=configFolder
 
     |name=configFolder
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Installation folder containing configuration files.
 
     |text=Installation folder containing configuration files.
Line 44: Line 44:
 
     |class=App
 
     |class=App
 
     |name=enableOptimizedExprs
 
     |name=enableOptimizedExprs
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set if Python expression optimization is enabled. Defaults to True every time TouchDesigner starts.
 
     |text=Get or set if Python expression optimization is enabled. Defaults to True every time TouchDesigner starts.
Line 51: Line 51:
 
     |class=App
 
     |class=App
 
     |name=installFolder
 
     |name=installFolder
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Main installation folder.
 
     |text=Main installation folder.
Line 58: Line 58:
 
     |class=App
 
     |class=App
 
     |name=launchTime
 
     |name=launchTime
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Total time required to launch and begin playing the toe file, measured in seconds.
 
     |text=Total time required to launch and begin playing the toe file, measured in seconds.
Line 65: Line 65:
 
     |class=App
 
     |class=App
 
     |name=osName
 
     |name=osName
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=The operating system name.
 
     |text=The operating system name.
Line 72: Line 72:
 
     |class=App
 
     |class=App
 
     |name=osVersion
 
     |name=osVersion
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=The operating system version.
 
     |text=The operating system version.
Line 79: Line 79:
 
     |class=App
 
     |class=App
 
     |name=power
 
     |name=power
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=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.
 
     |text=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.
Line 89: Line 89:
 
     |class=App
 
     |class=App
 
     |name=preferencesFolder
 
     |name=preferencesFolder
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Folder where the preferences file is located.
 
     |text=Folder where the preferences file is located.
Line 96: Line 96:
 
     |class=App
 
     |class=App
 
     |name=product
 
     |name=product
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Application name. For example, 'TouchDesigner', 'TouchPlayer'. See also licences.type in Licences Class.
 
     |text=Application name. For example, 'TouchDesigner', 'TouchPlayer'. See also licences.type in Licences Class.
Line 103: Line 103:
 
     |class=App
 
     |class=App
 
     |name=recentFiles
 
     |name=recentFiles
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Get or set the list of most recently saved or loaded files.
 
     |text=Get or set the list of most recently saved or loaded files.
Line 110: Line 110:
 
     |class=App
 
     |class=App
 
     |name=samplesFolder
 
     |name=samplesFolder
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Installation folder containing configuration files.
 
     |text=Installation folder containing configuration files.
Line 117: Line 117:
 
     |class=App
 
     |class=App
 
     |name=userPaletteFolder
 
     |name=userPaletteFolder
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Folder where custom user palettes are located.
 
     |text=Folder where custom user palettes are located.
Line 124: Line 124:
 
     |class=App
 
     |class=App
 
     |name=version
 
     |name=version
     |returns=
+
     |type=
 
     |set=0
 
     |set=0
 
     |text=Application version number.
 
     |text=Application version number.
Line 132: Line 132:
 
|items=
 
|items=
 
 
 +
{{ClassMethod
 +
    |class=App
 +
    |name=removeNonCommercialLimit
 +
    |call=removeNonCommercialLimit(password)
 +
    |returns=
 +
    |text=: -> bool
 +
Removes the restriction previously added. Returns True if successful.
 +
password - (Keyword) Password previously used when restriction added.
 +
app.removeNonCommercialLimit('secret123')
 +
}}
 
{{ClassMethod
 
{{ClassMethod
 
     |class=App
 
     |class=App
Line 145: Line 155:
 
{{ClassMethod
 
{{ClassMethod
 
     |class=App
 
     |class=App
     |name=removeNonCommercialLimit
+
     |name=removeResolutionLimit
     |call=removeNonCommercialLimit(password)
+
     |call=removeResolutionLimit(password)
 
     |returns=
 
     |returns=
 
     |text=: -> bool
 
     |text=: -> bool
 
Removes the restriction previously added. Returns True if successful.
 
Removes the restriction previously added. Returns True if successful.
 
  password - (Keyword) Password previously used when restriction added.
 
  password - (Keyword) Password previously used when restriction added.
app.removeNonCommercialLimit('secret123')
+
app.removeResolutionLimit('secret123')
 
}}
 
}}
 
{{ClassMethod
 
{{ClassMethod
Line 165: Line 175:
 
app.addResolutionLimit(600, 480, 'secret123')  #undoable with password
 
app.addResolutionLimit(600, 480, 'secret123')  #undoable with password
 
app.addResolutionLimit()  #permanent during length of session.
 
app.addResolutionLimit()  #permanent during length of session.
}}
 
{{ClassMethod
 
    |class=App
 
    |name=removeResolutionLimit
 
    |call=removeResolutionLimit(password)
 
    |returns=
 
    |text=: -> bool
 
Removes the restriction previously added. Returns True if successful.
 
password - (Keyword) Password previously used when restriction added.
 
app.removeResolutionLimit('secret123')
 
 
}}}}
 
}}}}
 
<section end=HELPBODY />
 
<section end=HELPBODY />
 
{{History}}
 
{{History}}
 
{{#invoke:Category|list|Python Reference}}
 
{{#invoke:Category|list|Python Reference}}

Revision as of 15:11, 15 September 2017

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[edit]

architecture(Read Only):

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

binFolder(Read Only):

Installation folder containing the binaries.

build(Read Only):

Application build number.

compileDate(Read Only):

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

configFolder(Read Only):

Installation folder containing configuration files.

enableOptimizedExprs(Read Only):

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

installFolder(Read Only):

Main installation folder.

launchTime(Read Only):

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

osName(Read Only):

The operating system name.

osVersion(Read Only):

The operating system version.

power(Read Only):

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.

Example:

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

preferencesFolder(Read Only):

Folder where the preferences file is located.

product(Read Only):

Application name. For example, 'TouchDesigner', 'TouchPlayer'. See also licences.type in Licences Class.

recentFiles(Read Only):

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

samplesFolder(Read Only):

Installation folder containing configuration files.

userPaletteFolder(Read Only):

Folder where custom user palettes are located.

version(Read Only):

Application version number.

Methods[edit]

removeNonCommercialLimit(password):

: -> bool

Removes the restriction previously added. Returns True if successful. password - (Keyword) Password previously used when restriction added.

app.removeNonCommercialLimit('secret123')

addNonCommercialLimit(password):

:

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. password - (Keyword, Optional) Password to later remove the restriction. app.addNonCommercialLimit('secret123') #undoable with password

app.addNonCommercialLimit() #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')

addResolutionLimit(x,y password):

:

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.

TouchDesigner Build:

The operating system's holder of files and other folders (directories). It does not refer to operators within TouchDesigner. See Network Path.