User Tools

Site Tools


DzApp

The main application object.

More...

Inherits :

Enumerations

Properties

Static Methods

Methods

DAZ Script
NumberbitArchitecture ()
StringbitArchitectureString ()
StringbyteSizeToString ( Number bytes )
BooleancanShowSceneBuilder ( Object definition=undefined )
voidclearDelayedDeleteStack ( Boolean doProgress )
voidclearPixmapCache ()
StringcreateDigest ( ByteArray data )
StringcreateDigest ( Array tokens )
StringcreateUuid ()
voiddebug ( String message )
voiddelayedExit ( Number exitCode=0 )
voidenableMultiThreading ( Boolean onOff )
voiderror ( String message )
voidfatal ( String message )
BooleanflushLogBuffer ()
StringgetAbsoluteScriptPath ( String scriptName )
StringgetAppDataInstancePath ()
StringgetAppDataPath ()
StringgetApplicationBaseName ()
StringgetApplicationDataName ()
DzAssetIOMgrgetAssetIOMgr ()
DzAssetMgrgetAssetMgr ()
DzAuthenticationMgrgetAuthenticationMgr ()
DzCallBackMgrgetCallBackMgr ()
StringgetCloudLogFilename ()
StringgetCommonUserDocumentPath ()
DzContentMgrgetContentMgr ()
DzAuthorgetCurrentAuthor ()
StringgetDataFolderName ()
StringgetDataFolderPath ()
StringgetDataFolderPathBase ()
StringgetDAZDataPath ()
DzDeviceMgrgetDeviceMgr ()
QWidgetgetDialogParent ()
StringgetDocumentationPath ()
StringgetDocumentsPath ()
DzExportMgrgetExportMgr ()
DzFileIOPresetMgrgetFileIOPresetMgr ()
StringgetGeneratedScriptsPath ()
StringgetGeneratedShadersPath ()
GraphicsModegetGraphicsMode ()
DzHelpMgrgetHelpMgr ()
StringgetHomePath ()
DzImageMgrgetImageMgr ()
DzImportMgrgetImportMgr ()
DzMainWindowgetInterface ()
StringgetLoadSavePath ()
StringgetLogFilename ()
DzMultiMediaMgrgetMultiMediaMgr ()
DzPluginMgrgetPluginMgr ()
StringgetPluginsPath ()
StringgetProgramDataAppInstancePath ()
StringgetProgramDataAppPath ()
StringgetProgramDataPath ()
DzRenderMgrgetRenderMgr ()
StringgetResourcesPath ()
StringgetScriptsPath ()
StringgetShadersPath ()
DzSimulationMgrgetSimulationMgr ()
DzStylegetStyle ()
StringgetStyleDefinition ()
ArraygetStyleDefinitionList ()
StringgetTempFilename ()
StringgetTempPath ()
StringgetTempRenderFilename ()
StringgetTempShadersPath ()
StringgetUtilitiesPath ()
StringinstanceName ()
StringinstanceNameSuffix ()
BooleanisClosing ()
BooleanisEmittingLogMessages ()
BooleanisKeyDown ( Number key=-1 )
BooleanisKeySequenceDown ( String sequence=“Any” )
BooleanisMultiThreadingEnabled ()
BooleanisRegistered ()
BooleanisRunning ()
BooleanisSlave ()
BooleanisStarting ()
BooleanisValidGuid ( String data )
voidlog ( String message )
voidlogMessageBox ( String category, String title, String text, Array buttonTexts, Boolean immediate )
voidlogPathInfo ( String label, String path )
NumbermodifierKeyState ()
OperatingSystemoperatingSystem ()
StringoperatingSystemString ()
Platformplatform ()
voidpostScriptEvent ( Boolean evaluate, String script, Array args=[] )
ReleaseCyclereleaseCycle ()
StringreleaseCycleInstanceString ()
StringreleaseCycleInstanceSuffix ()
StringreleaseCycleInstanceSuffixStripped ()
StringreleaseCycleString ()
StringreleaseCycleSuffix ()
StringreleaseCycleSuffixStripped ()
ReleaseEditionreleaseEdition ()
StringreleaseEditionString ()
voidrestoreDefaultTempPath ()
voidsetLoadSavePath ( String path )
BooleansetStyleDefinition ( String name )
BooleansetTempPath ( String tempPath )
BooleanshowInNativeBrowser ( String absFilePath )
BooleanshowPrompts ()
ArrayshowSceneBuilder ( Object definition=undefined, Boolean asEvent=false )
voidshowURL ( String url )
voidstatusLine ( String message, Boolean addToLog=true )
BooleanusingInterface ()
voidverbose ( String message )
voidwarning ( String message )
BooleanwriteConfigScript ( String configScriptFilename=“” )
voidwriteToLog ( MessageSeverity severity, String message, Boolean immediate )
voidwriteToLog ( String message, Boolean immediate )
voidwriteToLog ( String message )
voidwriteToLog ( MessageSeverity severity, String category, String message, Boolean immediate )
Deprecated
DzSaveFilterMgr (deprecated)getSaveFilterMgr ()
DzAppSettingsMgrgetAppSettingsMgr ()

Signals

voidclosing ()
voiddebugMessage ( String message, String category )
voiderrorMessage ( String message, String category )
voideventLoopStarted ()
voidfatalMessage ( String message, String category )
voidinfoMessage ( String message, String category )
voidmouseEvent ()
voidmultiThreadingChanged ( Boolean onOff )
voidsceneBuilderAccepted ( Array selections )
voidsceneBuilderRejected ()
voidstarting ()
voidstyleAboutToChange ()
voidstyleChanged ( DzStyle newStyle )
voidverboseMessage ( String message, String category )
voidwarningMessage ( String message, String category )
Deprecated
voiddebugMsg ( String message )
voidwarningMsg ( String message )

Detailed Description

Derived from QApplication, this class embodies the main event loop, and owns application-wide settings and objects not directly related to the user interface.

Can be directly accessed using the Global::App variable.

Enumerations


: GraphicsMode

The current graphical systems available in the application.

  • NoInterface - No interface or graphical subsystem is initialized.
  • NoInterfaceWithOpenGL - The OpenGL subsystem is initialized without a user interface.
  • FullInterface - The user interface and all graphical subsystems are initialized.

—–

: MessageSeverity

The severity of a message sent to the application log.

Since:

  • 4.16.1.26
  • MessageFatal - A fatal error message.
  • MessageError - An error message.
  • MessageWarning - A warning message.
  • MessageNormal - A normal operation message.
  • MessageVerbose - A more verbose message.
  • MessageDebug - A debugging message.
  • MessageRaw - A message with no leading qualifier.

—–

: OperatingSystem

Enumerated values representing the Operating System under which the application is currently running.

  • OS_Unknown - An unknown operating system. Since: 4.11.0.235
  • Windows_Unknown - An unknown version of the Windows operating system. Since: 4.11.0.235
  • Windows_95 - The “Windows 95” (Windows 4.0) operating system. Since: 4.11.0.235
  • Windows_98 - The “Windows 98” (Windows 4.1) operating system. Since: 4.11.0.235
  • Windows_Me - The “Windows Millennium Edition” aka “ME” (Windows 4.9) operating system. Since: 4.11.0.235
  • Windows_2000 - The “Windows 2000” (Windows NT 5.0) operating system. Since: 4.11.0.235
  • Windows_XP - The “Windows XP” (Windows NT 5.1) operating system. Since: 4.11.0.235
  • Windows_2003 - The “Windows 2003” (Windows NT 5.2) operating system. Since: 4.11.0.235
  • Windows_Vista - The “Windows Vista” (Windows NT 6.0) operating system. Since: 4.11.0.235
  • Windows_7 - The “Windows 7” (Windows NT 6.1) operating system. Since: 4.11.0.235
  • Windows_8 - The “Windows 8” (Windows NT 6.2) operating system. Since: 4.11.0.235
  • Windows_8_1 - The “Windows 8.1” (Windows NT 6.3) operating system. Since: 4.11.0.235
  • Windows_10 - The “Windows 10” (Windows NT 10) operating system. Since: 4.11.0.235
  • Windows_11 - The “Windows 11” (Windows NT 11) operating system. Since: 4.15.0.22
  • Mac_Unknown - An unknown version of the Mac OS X/OS X/macOS operating system. Since: 4.11.0.235
  • Mac_10_0 - The “Mac OS X 10.0” (aka “Cheetah”) operating system. Since: 4.11.0.235
  • Mac_10_1 - The “Mac OS X 10.1” (aka “Puma”) operating system. Since: 4.11.0.235
  • Mac_10_2 - The “Mac OS X 10.2” (aka “Jaguar”) operating system. Since: 4.11.0.235
  • Mac_10_3 - The “Mac OS X Panther” (version 10.3) operating system. Since: 4.11.0.235
  • Mac_10_4 - The “Mac OS X Tiger” (version 10.4) operating system. Since: 4.11.0.235
  • Mac_10_5 - The “Mac OS X Leopard” (version 10.5) operating system. Since: 4.11.0.235
  • Mac_10_6 - The “Mac OS X Snow Leopard” (version 10.6) operating system. Since: 4.11.0.235
  • Mac_10_7 - The “Mac OS X Lion” (version 10.7) operating system. Since: 4.11.0.235
  • Mac_10_8 - The “OS X Mountain Lion” (version 10.8) operating system. Since: 4.11.0.235
  • Mac_10_9 - The “OS X Mavericks” (version 10.9) operating system. Since: 4.11.0.235
  • Mac_10_10 - The “OS X Yosemite” (version 10.10) operating system. Since: 4.11.0.235
  • Mac_10_11 - The “OS X El Capitan” (version 10.11) operating system. Since: 4.11.0.235
  • Mac_10_12 - The “macOS Sierra” (version 10.12) operating system. Since: 4.11.0.235
  • Mac_10_13 - The “macOS High Sierra” (version 10.13) operating system. Since: 4.11.0.235
  • Mac_10_14 - The “macOS Mojave” (version 10.14) operating system. Since: 4.11.0.235
  • Mac_10_15 - The “macOS Catalina” (version 10.15) operating system. Since: 4.12.1.16
  • Mac_11_0 - The “macOS Big Sur” (version 11.0) operating system. Since: 4.15.0.22
  • Mac_12_0 - The “macOS Monterey” (version 12.0) operating system. Since: 4.15.0.22

—–

: Platform

Enumerated values representing the hardware/software environment on which the application is currently running.

  • Windows - The Windows hardware/software environment.
  • MacOSX - The Mac OS X|OS X|macOS hardware/software environment.

—–

: ReleaseCycle

Enumerated values representing the release cycles (channels) for the application.

  • GeneralRelease - A build of the application that is considered stable, and has been made available to the general public.
  • PublicBuild - A build of the application that is not considered stable yet, but has been made available to the general public for testing.
  • PublishingBuild - A build of the application that is not considered ready for the general public, but is considered stable enough to introduce into a production environment by early adopters; typically only made available to our Published Artists.
  • PrivateBuild - A build of the application that is not considered stable yet, but has been made available to a select group of individuals that serve as the “front line” or the “canary in a coal mine” for a time before the build is promoted to a channel that is less restricted.
  • DevBuild - A build that is used by developers of the application during the development process.

—–

: ReleaseEdition

Enumerated values representing a set of features in the application.

  • Free - An edition of the application that provides the “Free” set of features.
  • Standard - An edition of the application that provides the “Standard” set of features.
  • Advanced - An edition of the application that provides the “Advanced” set of features.
  • Pro - An edition of the application that provides the “Professional” set of features.
  • Alpha - An edition of the application that provides the “Alpha” set of features.
  • Beta - An edition of the application that provides the “Beta” set of features.

Properties


String : appName

Holds the name of the application; i.e., “DAZ Studio”. (Read Only)


String : cloudName

Holds the name of the cloud service; i.e., “Daz Connect”. (Read Only)

Since:

  • 4.9.0.26

Number : exitCode

Holds the exit code returned by the application. (Read Only)

Since:

  • 4.9.3.51

Number : logSize

Holds the size, in bytes, of the log file.

Attention:

  • The “-logSize #” option can used on the command line to specify the log size.

Since:

  • 4.9.4.70

String : longVersionString

Holds a string representation of the full product version number; i.e., major.minor.revision.build. (Read Only)


String : orgName

Holds the name of the organization; i.e., “DAZ 3D”. (Read Only)

Since:

  • 4.6.4.30

Array : scriptArgs

Holds the arguments passed to the application on launch. (Read Only)

Attention:

  • The “-scriptArg value” option can used on the command line to pass in a script argument.

Since:

  • 4.9.3.39

Number : version

Holds the full product version number as an encoded 32-bit integer. (Read Only) Deprecated

Use version64 instead.


Number : version64

Holds the full product version number as an encoded 64-bit integer. (Read Only)


String : versionString

Holds a string representation of the product version number; i.e., major.minor. (Read Only)

Static Methods


DzVersion : getPlatformVersion()

Return Value:

  • The current version of the Operating System for the platform.

Since:

  • 4.15.0.22

DzVersion : getVersion()

Return Value:

  • The current version of the application.

Since:

  • 4.11.0.230

Boolean : hasActiveModalWidget()

Return Value:

  • true if a modal widget (i.e., dialog) is currently displayed, otherwise false.

Example

(function(){
 
	print( App.hasActiveModalWidget() );
 
	var wDlg = new DzBasicDialog();
	App.postScriptEvent( true, "print( \"Testing:\", App.hasActiveModalWidget() );" );
	wDlg.exec();
 
})();

Since:

  • 4.12.1.116

Methods


Number : bitArchitecture()

Return Value:

  • A numeric representation of the bit architecture the application was compiled for.

String : bitArchitectureString()

Return Value:

  • A user-friendly string representation of the bit architecture the application was compiled for.

String : byteSizeToString( Number bytes )

Parameter(s):

  • bytes - The numeric value to convert into a string.

Return Value:

  • A string representation of the byte size.

Example:

// The message will be written to the log
print( App.byteSizeToString( 1073741824 ) ); //1.0 GB

Boolean : canShowSceneBuilder( Object definition=undefined )

Parameter(s):

  • definition - If empty, the default SceneBuilder.json file (if any) in getResourcesPath() will be checked. If a string, the full path of a Scene Builder configuration file to check is expected. If an object, a map of Scene Builder configuration data is expected. (since 4.6.4.62)

Return Value:

  • true if the Scene Builder dialog would be displayed, otherwise false.

Since:

  • 4.6.2.69

void : clearDelayedDeleteStack( Boolean doProgress )

Forces a deletion of all objects currently waiting to be deleted to free up more memory. If you are using this to clear memory you will generally want to clear the Undo Stack first.

See Also:

Parameter(s):

  • doProgress - If true, a progress dialog will be shown to the user while the operation is taking place.

void : clearPixmapCache()

Clears application wide cache of pixmaps.

Since:

  • 4.11.0.34

String : createDigest( ByteArray data )

Parameter(s):

  • data - The byte array to create a digest of.

Return Value:

  • A string representing a message digest. The string is formatted as 36 characters, in which 32 are hexadecimal and distributed across five groups of 8-4-4-4-12 separated by a hyphen ('-', i.e. “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx” where each 'x' is a hexadecimal digit).

String : createDigest( Array tokens )

Parameter(s):

  • tokens - The list of strings to create a digest of.

Return Value:

  • A string representing a message digest. The string is formatted as 36 characters, in which 32 are hexadecimal and distributed across five groups of 8-4-4-4-12 separated by a hyphen ('-', i.e. “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx” where each 'x' is a hexadecimal digit).

String : createUuid()

Return Value:

  • A string representing a randomly generated Universally Unique Identifier (UUID). The string is formatted as 38 characters, in which 32 are hexadecimal and distributed across five groups of 8-4-4-4-12 separated by a hyphen ('-') and enclosed by a pair of curly braces (i.e. “{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}” where each 'x' is a hexadecimal digit).

void : debug( String message )

Writes a debug message to the application log.

Parameter(s):

  • message - The message to write.

See Also:


void : delayedExit( Number exitCode=0 )

Posts an event that causes the application to exit.

Parameter(s):

  • exitCode - The exit code to set. (since 4.9.3.51)

Since:

  • 4.6.2.55

void : enableMultiThreading( Boolean onOff )

Parameter(s):

  • onOff - If true, multi-threaded features are enabled, otherwise multi-threaded features are disabled.

void : error( String message )

Writes an error message to the application log.

Parameter(s):

  • message - The message to write.

See Also:

Since:

  • 4.16.1.26

void : fatal( String message )

Writes a fatal error message to the application log.

Parameter(s):

  • message - The message to write.

See Also:

Since:

  • 4.16.1.26

Boolean : flushLogBuffer()

Writes any currently buffered log messages to the log file. This is automatically called whenever the log buffer has more than 512 characters of data, but can be called at any time to force all messages to be written out.

Return Value:

  • true if the log buffer was successfully flushed, otherwise false.

String : getAbsoluteScriptPath( String scriptName )

Searches in default locations for a script file of the given name.

Parameter(s):

  • scriptName - The name/path of a script file to find. This can be a file name, a relative file path, or an absolute file path.

Return Value:

  • The absolute path of the found script file (if any), otherwise an empty string.

See Also:


String : getAppDataInstancePath()

Return Value:

  • The absolute path of the application data directory for the current machine user, the current major version, the current release cycle and the current instance of the application.

Attention:

  • This path is dynamically constructed using calls to the underlying operating system. If the call to the OS fails, getHomePath() is used as a fallback.

See Also:

Since:

  • 4.12.1.23

String : getAppDataPath()

Return Value:

  • The absolute path of the application data directory for the current machine user, the current major version and the current release cycle of the application.

Attention:

  • This path is dynamically constructed using calls to the underlying operating system. If the call to the OS fails, getHomePath() is used as a fallback.

See Also:


String : getApplicationBaseName()

Return Value:

  • The base name of the application; e.g., “Studio”.

Since:

  • 4.9.2.33

String : getApplicationDataName()

Return Value:

  • The name of the application settings; e.g., “Studio4 Public Build [1]”.

Since:

  • 4.12.1.26

DzAssetIOMgr : getAssetIOMgr()

Return Value:


DzAssetMgr : getAssetMgr()

Return Value:

  • The application-wide Asset Manager.

DzAuthenticationMgr : getAuthenticationMgr()

Return Value:

  • The application-wide Authentication Manager - responsible for tracking user authentication.

DzCallBackMgr : getCallBackMgr()

Return Value:

  • The application-wide Call Back Manager - responsible for tracking call back objects.

String : getCloudLogFilename()

Return Value:

  • The filename for the file that logs messages from the application that pertains to the cloud service.

Since:

  • 4.12.1.26

String : getCommonUserDocumentPath()

Return Value:

  • The absolute path of the public/shared user documents folder.

Attention:

  • This path is dynamically constructed using calls to the underlying operating system. If the call to the OS fails, getHomePath() is used as a fallback.

DzContentMgr : getContentMgr()

Return Value:

  • The application-wide Content Manager.

DzAuthor : getCurrentAuthor()

Return Value:

  • The current author (user that is currently running the app).

String : getDataFolderName()

Return Value:

  • The name of the data folder under the content directory.

String : getDataFolderPath()

Return Value:

  • The full path for the location where data is stored.

String : getDataFolderPathBase()

Return Value:

  • The base path for the location where data is stored.

String : getDAZDataPath()

Return Value:

  • The absolute path of the data directory for the organization.

Attention:

  • This path is dynamically constructed using calls to the underlying operating system. If the call to the OS fails, getHomePath() is used as a fallback.

See Also:


DzDeviceMgr : getDeviceMgr()

Return Value:

  • The application-wide Device Manager - responsible for devices supported by the application.

QWidget : getDialogParent()

Return Value:

  • The active modal widget or the application main window if one exists.

String : getDocumentationPath()

Return Value:

  • The absolute path of the directory where application documentation files are stored.

See Also:


String : getDocumentsPath()

Return Value:

  • The absolute path of the user documents folder for the application.

Attention:

  • This path is dynamically constructed using calls to the underlying operating system. If the call to the OS fails, getHomePath() is used as a fallback.

DzExportMgr : getExportMgr()

Return Value:

  • The application-wide Export Manager in charge of file exporters.

DzFileIOPresetMgr : getFileIOPresetMgr()

Return Value:

  • The application-wide File I/O Preset Manager.

String : getGeneratedScriptsPath()

Return Value:

  • The absolute path of the directory where support script files that are automatically generated are stored.

See Also:


String : getGeneratedShadersPath()

Return Value:

  • The absolute path of the application data directory for automatically generated shaders.

See Also:


GraphicsMode : getGraphicsMode()

Return Value:

  • An enumerated value representing the current graphics mode.

DzHelpMgr : getHelpMgr()

Return Value:

  • The application-wide Help Manager.

String : getHomePath()

Return Value:

  • The absolute path of the directory that contains the application executable.

DzImageMgr : getImageMgr()

Return Value:

  • The application-wide Image Manager - responsible for image I/O and tracking of currently loaded images.

DzImportMgr : getImportMgr()

Return Value:

  • The application-wide Import Manager in charge of file importers.

DzMainWindow : getInterface()

Return Value:

  • The main interface widget if the application is running with an interface, otherwise NULL.

See Also:


String : getLoadSavePath()

Last directory that files were loaded or saved to/from.

See Also:


String : getLogFilename()

Return Value:

  • The filename for the file that logs messages from the application that pertains to the core application and any plugins.

See Also:

Since:

  • 4.12.1.26

DzMultiMediaMgr : getMultiMediaMgr()

Return Value:

  • The application-wide Video and Audio Manager - responsible for video and audio I/O.

DzPluginMgr : getPluginMgr()

Return Value:

  • The application-wide Plug-in Manager - responsible for tracking plug-ins.

String : getPluginsPath()

Return Value:

  • The absolute path of the base directory where plug-ins are loaded from.

See Also:


String : getProgramDataAppInstancePath()

Return Value:

  • The absolute path of the machine's global program data directory for the organization, the current major version, the current release cycle, and the current instance of the application.

Attention:

  • This path is dynamically constructed using calls to the underlying operating system. If the call to the OS fails, getHomePath() is used as a fallback.

See Also:

Since:

  • 4.12.1.23

String : getProgramDataAppPath()

Return Value:

  • The absolute path of the machine's global program data directory for the organization, the current major version, and the current release cycle of the application.

Attention:

  • This path is dynamically constructed using calls to the underlying operating system. If the call to the OS fails, getHomePath() is used as a fallback.

See Also:


String : getProgramDataPath()

Return Value:

  • The absolute path of the machine's global program data directory for the organization.

Attention:

  • This path is dynamically constructed using calls to the underlying operating system. If the call to the OS fails, getHomePath() is used as a fallback.

See Also:


DzRenderMgr : getRenderMgr()

Return Value:

  • The application-wide Render Manager.

String : getResourcesPath()

Return Value:

  • The absolute path of the directory where application resource files are stored.

See Also:


String : getScriptsPath()

Return Value:

  • The absolute path of the directory where support script files are stored.

See Also:


String : getShadersPath()

Return Value:

  • The absolute path of the base directory for all shaders.

See Also:


DzSimulationMgr : getSimulationMgr()

Return Value:

  • The application-wide Simulation Manager.

Since:

  • 4.9.3.140

DzStyle : getStyle()

Return Value:

  • The application-wide style object; subject to becoming invalid if the application style changes.

String : getStyleDefinition()

Return Value:

  • The name of the style definition currently in use.

Array : getStyleDefinitionList()

Return Value:

  • A list of the available style definitions.

String : getTempFilename()

Get a filename for temporary storage.

Return Value:

  • A unique filename (with no extension) whose path will be in the current temporary working folder.

Attention:

  • All files in this folder will be deleted when shutdown() is called.

String : getTempPath()

Return Value:

  • The absolute path of the directory where temporary files are stored.

See Also:


String : getTempRenderFilename()

Get a filename for temporary storage of rendered images.

Return Value:

  • A filename (with no extension) whose path will be in the current temporary working folder.

Attention:

  • All files in this folder will be deleted when shutdown() is called.

String : getTempShadersPath()

Return Value:

  • The absolute path of the temporary directory for automatically generated shaders.

See Also:


String : getUtilitiesPath()

Return Value:

  • The absolute path of the base directory for all binary utilities.

See Also:


String : instanceName()

Return Value:

  • A user-friendly string indicating the name of the application instance (of the release cycle).

Attention:

  • The “-instanceName name” option can used on the command line to specify the name of the application instance. Valid characters for name include any uppercase or lowercase ASCII character in the A-Z range, as well as any number (integer), hyphen, underscore, in any sequence. Any characters that are not supported (e.g., a space - if the value is quoted, special characters, non-ASCII characters) will be automatically stripped. The name supports gap-filling automatic incrementation (Windows only - automatic incrementation does not currently occur on macOS). A name containing the “#” (number sign, hash, pound) character will automatically have occurrences of the “#” character replaced by the 'next' available incremental integer value (e.g., if instances 1, 2, and 3 are running, instance 2 is closed and a new instance is launched, the new instance will be assigned 2 and the next would be assigned 4 - unless 1, 2 or 3 were closed before it launched).

Since:

  • 4.12.1.19

String : instanceNameSuffix()

Return Value:

  • A string indicating the name of the application instance (of the release cycle).

Since:

  • 4.12.1.23

Boolean : isClosing()

Return Value:

  • true if the application is in the process of shutting down, otherwise false.

Boolean : isEmittingLogMessages()

Return Value:

  • true if the application should emit log messages, otherwise false.

Attention:

Since:

  • 4.16.1.26

Boolean : isKeyDown( Number key=-1 )

Parameter(s):

  • key - The Qt::Key value for the key to check. Since 4.11.0.263, any value < 0 (default) is interpreted as “any key” rather than a specific key.

Return Value:

  • true if key is currently pressed, otherwise false.

Boolean : isKeySequenceDown( String sequence=“Any” )

Parameter(s):

  • sequence - A string consistent with QKeySequence::fromString(), in the PortableText format. Since 4.11.0.263, “any” is interpreted as “any key” rather than a specific key sequence.

Return Value:

  • true if sequence is currently pressed, otherwise false.

Boolean : isMultiThreadingEnabled()

Return Value:

  • true if the user has chosen to enable multi-threaded features, otherwise false.

Boolean : isRegistered()

Return Value:

  • true if a valid serial number has been provided, otherwise false.

Boolean : isRunning()

Return Value:

  • true if the main event loop is running and events that are posted can be expected to be delivered, otherwise false.

Boolean : isSlave()

Return Value:

  • true if the application is running as a slave to another application, otherwise false.

Boolean : isStarting()

Return Value:

  • true if the application is in the process of starting up, otherwise false.

Boolean : isValidGuid( String data )

Parameter(s):

  • data - The string to test whether or not it is a valid GUID.

Return Value:

  • true if data consists of 32 hexadecimal characters (i.e. “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx” where 'x' represents a hexadecimal value in the range [0-9a-f]), or 36 characters in which 32 are hexadecimal values distributed across five groups of 8-4-4-4-12 separated by a hyphen ('-', i.e. “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”), or 38 characters where the previous description is enclosed by curly braces (i.e. “{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}”), otherwise false.

Since:

  • 4.12.1.63

void : log( String message )

Writes a normal operational message to the application log.

Parameter(s):

  • message - The message to write.

See Also:


void : logMessageBox( String category, String title, String text, Array buttonTexts, Boolean immediate )

Writes a message containing information about a message box to the application log.

Parameter(s):

  • category - The category (if any) of the message to write.
  • title - The title if the message box.
  • text - The text of the message box.
  • buttonTexts - A list of the button texts for the message box.
  • immediate - If true, the message (and any others in the log buffer) will be immediately written to the log file. If false, the message will be written to the log buffer - the log buffer will be automatically flushed (written to file) if it exceeds the maximum defined buffer size.

See Also:

Since:

  • 4.16.1.26

void : logPathInfo( String label, String path )

Writes a message containing information about the specified path to the application log.

Parameter(s):

  • label - The label identifying the path.
  • path - The path to log information about.

Since:

  • 4.15.0.30

Number : modifierKeyState()

Shift		   = 0x02000000
Control		 = 0x04000000 (Ctrl keys on a Windows keyboard, Command keys on a Macintosh keyboard)
Alt			 = 0x08000000
Meta			= 0x10000000 (Windows key on a Windows keyboard, Control keys on a Macintosh keyboard)
Keypad		  = 0x20000000

Return Value:

  • The current modifier key state; this value is a bitwise OR of the Qt::KeyboardModifier flags for the active keys (if any).

Example:

var bIsOSX = App.platform == DzApp.MacOSX;
var nModifiers = App.modifierKeyState();
var sStateValue = "0x" + nModifiers.toString( 16 ).toUpperCase();
var aKeys = [];
 
if( nModifiers & 0x02000000 ){
	aKeys.push( "Shift" );
}
 
if( nModifiers & 0x04000000 ){
	aKeys.push( bIsOSX ? "Command" : "Ctrl" );
}
 
if( nModifiers & 0x08000000 ){
	aKeys.push( "Alt" );
}
 
if( nModifiers & 0x10000000 ){
	aKeys.push( bIsOSX ? "Control" : "Windows" );
}
 
if( nModifiers & 0x20000000 ){
	aKeys.push( "Keypad" );
}
 
print( aKeys.join( " + " ), "=", sStateValue );

OperatingSystem : operatingSystem()

Return Value:

  • The enumerated value associated with the OperatingSystem that the application is running under.

String : operatingSystemString()

Return Value:

  • A user-readable string that describes the current Operating System.

Platform : platform()

The application is intended to be as platform independent as possible, but there are cases where something needs to be done differently on one platform or another. This function provides a simple way to check which platform the application is running under.

Return Value:

  • The enumerated value associated with the Platform that the application is running under.

Example:

var nPlatform = App.platform();
if( nPlatform == App.Windows ){
	//doWinSomething();
} else if( nPlatform == App.MacOSX ){
	//doMacSomething();
}

void : postScriptEvent( Boolean evaluate, String script, Array args=[] )

Posts an event that causes execution of a script as it is encountered in the event stack.

Parameter(s):

  • evaluate - If script is actual code, set this to true, otherwise set this to false.
  • script - This can be a file name, a relative file path, an absolute file path or code. If passed a file name or path, getAbsoluteScriptPath() is used to resolve it. If passed actual code, evaluate must also be set to true.
  • args - The list of arguments to pass to the script.

Since:

  • 4.10.0.101

ReleaseCycle : releaseCycle()

Return Value:

  • The enumerated value associated with the ReleaseCycle of the application.

String : releaseCycleInstanceString()

Return Value:

  • A user-friendly string describing the release cycle (and optionally, the instance) of the application.

Since:

  • 4.12.1.19

String : releaseCycleInstanceSuffix()

Return Value:

  • A user-friendly string describing the release cycle (and optionally, the instance) of the application.

Since:

  • 4.12.1.19

String : releaseCycleInstanceSuffixStripped()

Return Value:

  • A string describing the release cycle (and optionally, the instance) of the application, without any space characters.

Since:

  • 4.12.1.19

String : releaseCycleString()

Return Value:

  • A user-friendly string describing the release cycle of the application.

String : releaseCycleSuffix()

Return Value:

  • A user-friendly string describing the release cycle of the application.

String : releaseCycleSuffixStripped()

Return Value:

  • A string describing the release cycle of the application, without any space characters.

ReleaseEdition : releaseEdition()

Return Value:

  • The enumerated value associated with the ReleaseEdition of the application.

String : releaseEditionString()

Return Value:

  • A user-friendly string describing the release edition of the application.

void : restoreDefaultTempPath()

Restores the temporary files directory to the default location.

See Also:


void : setLoadSavePath( String path )

Sets the default directory for loading or saving files.

Parameter(s):

  • path - The absolute path of the (default) directory to load/save files from/to.

Example:

//Set the load/save path to our favorite folder
App.setLoadSavePath( "c:/MyScenes" );

See Also:


Boolean : setStyleDefinition( String name )

Sets the current style for the application.

Parameter(s):

  • name - The name of the style definition to use.

Return Value:

  • true if the application switched to the given style, otherwise false.

Boolean : setTempPath( String tempPath )

Sets the directory path where temporary files are stored. The path provided needs to be an absolute path. A directory will be created at the new location if it does not already exist.

Parameter(s):

  • tempPath - The path of the new temporary files directory.

Return Value:

  • true if the path provided is valid and changing the temporary path succeeded. false if any errors occurred.

See Also:


Boolean : showInNativeBrowser( String absFilePath )

A convenience method for opening a showing a file/directory in the OS file browser.

Parameter(s):

  • absFilePath - The absolute file path to a file or folder to show.

Return Value:

  • true if the file exists and the OS file browser could be launched, otherwise false.

Boolean : showPrompts()

Return Value:

  • true if the application should prompt the user for input, otherwise false.

Attention:

  • The “-noPrompt” option can used on the command line to disable display of popup messages/dialogs - this feature is not strictly enforced and may not be fully implemented or necessarily respected by 3rd party plugins/scripts.

See Also:

Since:

  • 4.9.3.46

Array : showSceneBuilder( Object definition=undefined, Boolean asEvent=false )

Displays the Scene Builder dialog.

Parameter(s):

  • definition - If empty, the default SceneBuilder.json file (if any) in getResourcesPath() will be used. If a string, the full path of a Scene Builder configuration file to check is expected. If an object, a map of Scene Builder configuration data is expected. (since 4.6.4.62)
  • asEvent - If false (default), the Scene Builder configuration data is processed immediately. If false, the Scene Builder configuration data is posted to an event and processed as it is encountered in the event stack. (since 4.6.4.62)

Return Value:

  • If asEvent is false, a list of the selections made by the user in the Scene Builder dialog, otherwise an empty list. (since 4.6.4.62)

See Also:

Since:

  • 4.6.2.69

void : showURL( String url )

A convenience method for browsing to a given URL.

Parameter(s):

  • url - The url to open in the system's default browser. Be sure to specify the scheme of the url (e.g., 'http:' or 'file:').

Example:


void : statusLine( String message, Boolean addToLog=true )

Display a message in the current status interface.

Parameter(s):

  • message - The string to be displayed.
  • addToLog - If true (default), the message will also be added to the application log.

Example:

//The message will be displayed in status bar and written to the log file
App.statusLine( "Hello World!" );

See Also:


Boolean : usingInterface()

Return Value:

  • true if the application is using a user interface, otherwise false.

void : verbose( String message )

Writes a more verbose message to the application log.

Parameter(s):

  • message - The message to write.

See Also:

Since:

  • 4.16.1.26

void : warning( String message )

Writes a warning message to the application log.

Parameter(s):

  • message - The message to write.

See Also:


Boolean : writeConfigScript( String configScriptFilename=“” )

Saves out a user configuration script to the given filename. If no filename is given, the script is saved to the same file read from in startup(). The run() function calls this at the end of each execution.

Parameter(s):

  • filename - The name of the file to save a configuration script to. If empty (default), the default configuration script for the running application instance is used - i.e., getAppDataInstancePath() + '/' + “StartupScript.dsa” is used.

Return Value:

  • true if the file was written successfully, otherwise false.

void : writeToLog( MessageSeverity severity, String message, Boolean immediate )

Write a message to the application log.

Parameter(s):

  • severity - The severity of the message to log.
  • message - The message to write.
  • immediate - If true, the message (and any others in the log buffer) will be immediately written to the log file. If false, the message will be written to the log buffer - the log buffer will be automatically flushed (written to file) if it exceeds the maximum defined buffer size.

Example:

//The message will be written to the log
App.writeToLog( DzApp.LogInfo, "Hello World!", true );

See Also:

Since:

  • 4.16.1.26

void : writeToLog( String message, Boolean immediate )

Write a message to the application log.

Parameter(s):

  • message - The message to write.
  • immediate - If true, the message (and any others in the log buffer) will be immediately written to the log file. If false, the message will be written to the log buffer - the log buffer will be automatically flushed (written to file) if it exceeds the maximum defined buffer size.

Example:

//The message will be written to the log
App.writeToLog( "Hello World!", true );

See Also:

Since:

  • 4.14.0.4

void : writeToLog( String message )

Writes a message to the application log.

Parameter(s):

  • message - The message to write.

Example:

//The message will be written to the log
App.writeToLog( "Hello World!" );

See Also:

Since:

  • 4.14.0.4

void : writeToLog( MessageSeverity severity, String category, String message, Boolean immediate )

Write a message to the application log.

Parameter(s):

  • severity - The severity of the message to log.
  • category - The category of the message to log.
  • message - The message to write.
  • immediate - If true, the message (and any others in the log buffer) will be immediately written to the log file. If false, the message will be written to the log buffer - the log buffer will be automatically flushed (written to file) if it exceeds the maximum defined buffer size.

Example:

//The message will be written to the log
App.writeToLog( DzApp.LogInfo, "Hello World!", "", true );

See Also:

Since:

  • 4.16.1.26

DzSaveFilterMgr (deprecated) : getSaveFilterMgr()

Deprecated

Script based presets are deprecated in favor of those in the DAZ Scene Object Notation (DSON) format.

Return Value:

  • The application-wide Save Filter Manager in charge of script-based presets.

See Also:


DzAppSettingsMgr : getAppSettingsMgr()

Deprecated

Exists only to keep old code working. Do not use in new code. Use DzAppSettings instead.

Return Value:

  • The application-wide persistent Settings Manager - used to set and retrieve application settings.

Signals


void : closing()

Signature:“closing()”

Emitted immediately after the main event loop exits.


void : debugMessage( String message, String category )

Signature:“debugMessage(const QString&,const QString&)”

Emitted when a debug message is sent to the application log.

Parameter(s):

  • message - The message that was sent.
  • category - The category for the message (if any).

See Also:

Since:

  • 4.16.1.26

void : errorMessage( String message, String category )

Signature:“errorMessage(const QString&,const QString&)”

Emitted when an error message is sent to the application log.

Parameter(s):

  • message - The message that was sent.
  • category - The category for the message (if any).

See Also:

Since:

  • 4.16.1.26

void : eventLoopStarted()

Signature:“eventLoopStarted()”

Emitted when the event loop is started on the application.


void : fatalMessage( String message, String category )

Signature:“fatalMessage(const QString&,const QString&)”

Emitted when a fatal message is sent to the application log.

Parameter(s):

  • message - The message that was sent.
  • category - The category for the message (if any).

See Also:

Since:

  • 4.16.1.26

void : infoMessage( String message, String category )

Signature:“infoMessage(const QString&,const QString&)”

Emitted when a standard message is sent to the application log.

Parameter(s):

  • message - The message that was sent.
  • category - The category for the message (if any).

See Also:

Since:

  • 4.16.1.26

void : mouseEvent()

Signature:“mouseEvent()”

Emitted when a MouseButtonDblClick or MouseButtonRelease event occurs on the application.


void : multiThreadingChanged( Boolean onOff )

Signature:“multiThreadingChanged(bool)”

Emitted when multi-threading has changed on the application.


void : sceneBuilderAccepted( Array selections )

Signature:“sceneBuilderAccepted(const QStringList&)”

Emitted when the Scene Builder dialog has been rejected by the user, or when none of the files specified in the Scene Builder definition can be found.

Since:

  • 4.6.4.62

void : sceneBuilderRejected()

Signature:“sceneBuilderRejected()”

Emitted when the Scene Builder dialog has been rejected by the user, or when none of the files specified in the Scene Builder definition can be found.

Since:

  • 4.6.4.62

void : starting()

Signature:“starting()”

Emitted after the application has finished its startup just before the main event loop begins.


void : styleAboutToChange()

Signature:“styleAboutToChange()”

Emitted when a the style is about to change on the application.


void : styleChanged( DzStyle newStyle )

Signature:“styleChanged(DzStyle*)”

Emitted when the application wide style has changed.


void : verboseMessage( String message, String category )

Signature:“verboseMessage(const QString&,const QString&)”

Emitted when a verbose message is sent to the application log.

Parameter(s):

  • message - The message that was sent.
  • category - The category for the message (if any).

See Also:

Since:

  • 4.16.1.26

void : warningMessage( String message, String category )

Signature:“warningMessage(const QString&,const QString&)”

Emitted when a warning message is sent to the application log.

Parameter(s):

  • message - The message that was sent.
  • category - The category for the message (if any).

See Also:

Since:

  • 4.16.1.26

void : debugMsg( String message )

Signature:“debugMsg(const QString&)”

Deprecated

Exists only to keep old scripts working. Do not use in new code. Use debugMessage() instead.

See Also:


void : warningMsg( String message )

Signature:“warningMsg(const QString&)”

Deprecated

Exists only to keep old scripts working. Do not use in new code. Use warningMessage() instead.

See Also: