DAZ Script | |
---|---|
String | durationToString ( Number mSecs, Boolean simplified=false, Boolean useLocale=true ) |
DzVersion | getPlatformVersion () |
DzVersion | getVersion () |
Boolean | hasActiveModalWidget () |
void | closing () |
void | debugMessage ( String message, String category ) |
void | errorMessage ( String message, String category ) |
void | eventLoopStarted () |
void | fatalMessage ( String message, String category ) |
void | infoMessage ( String message, String category ) |
void | mouseEvent () |
void | multiThreadingChanged ( Boolean onOff ) |
void | sceneBuilderAccepted ( Array selections ) |
void | sceneBuilderRejected () |
void | starting () |
void | styleAboutToChange () |
void | styleChanged ( DzStyle newStyle ) |
void | verboseMessage ( String message, String category ) |
void | warningMessage ( String message, String category ) |
Deprecated | |
---|---|
void | debugMsg ( String message ) |
void | warningMsg ( String message ) |
Derived from QApplication, this class embodies the main event loop, and owns application-wide settings and objects not directly related to the user interface.
The current graphical systems available in the application.
—–
The severity of a message sent to the application log.
Since:
—–
Enumerated values representing the Operating System under which the application is currently running.
—–
Enumerated values representing the hardware/software environment on which the application is currently running.
—–
Enumerated values representing the release cycles (channels) for the application.
—–
Enumerated values representing a set of features in the application.
Holds the name of the application; i.e., “DAZ Studio”. (Read Only)
Holds the name of the cloud service; i.e., “Daz Connect”. (Read Only)
Since:
Holds the exit code returned by the application. (Read Only)
Since:
Holds the size, in bytes, of the log file.
Attention:
Since:
Holds a string representation of the full product version number; i.e., major.minor.revision.build. (Read Only)
Holds the name of the organization; i.e., “DAZ 3D”. (Read Only)
Since:
Holds the arguments passed to the application on launch. (Read Only)
Attention:
Since:
Holds the name of the system locale in the form of a two-letter ISO 639 language code, followed by an underscore, followed by an uppercase two or three-letter ISO 3166 country code - e.g., en_US. (Read Only)
Since:
Holds the full product version number as an encoded 32-bit integer. (Read Only) Deprecated
Use version64 instead.
Holds the full product version number as an encoded 64-bit integer. (Read Only)
Holds a string representation of the product version number; i.e., major.minor. (Read Only)
String : durationToString( Number mSecs, Boolean simplified=false, Boolean useLocale=true )
Parameter(s):
true
, the return value will be in the system locale. If false
, the return value will be suitable for logging.Return Value:
Since:
DzVersion : getPlatformVersion()
Return Value:
Since:
DzVersion : getVersion()
Return Value:
Since:
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:
Return Value:
String : bitArchitectureString()
Return Value:
String : byteSizeToString( Number bytes )
Parameter(s):
Return Value:
Example:
// The message will be written to the log print( App.byteSizeToString( 1073741824 ) ); //1.0 GB
Boolean : canShowSceneBuilder( Object definition=undefined )
Parameter(s):
Return Value:
true
if the Scene Builder dialog would be displayed, otherwise false
.Since:
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):
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:
Return Value:
Since:
String : createDigest( Array tokens )
Parameter(s):
Return Value:
String : createDigest( ByteArray data )
Parameter(s):
Return Value:
String : createUuid()
Return Value:
void : debug( String message )
Writes a debug message to the application log.
Parameter(s):
See Also:
void : delayedExit( Number exitCode=0 )
Posts an event that causes the application to exit.
Parameter(s):
Since:
void : enableMultiThreading( Boolean onOff )
Parameter(s):
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):
See Also:
Since:
void : fatal( String message )
Writes a fatal error message to the application log.
Parameter(s):
See Also:
Since:
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):
Return Value:
See Also:
String : getAppDataInstancePath()
Return Value:
Attention:
See Also:
Since:
String : getAppDataPath()
Return Value:
Attention:
See Also:
String : getApplicationBaseName()
Return Value:
Since:
String : getApplicationDataName()
Return Value:
Since:
DzAssetIOMgr : getAssetIOMgr()
Return Value:
Return Value:
DzAuthenticationMgr : getAuthenticationMgr()
Return Value:
DzCallBackMgr : getCallBackMgr()
Return Value:
String : getCloudLogFilename()
Return Value:
Since:
String : getCommonUserDocumentPath()
Return Value:
Attention:
DzContentMgr : getContentMgr()
Return Value:
Return Value:
Return Value:
Return Value:
String : getDataFolderPathBase()
Return Value:
String : getDAZDataPath()
Return Value:
Attention:
See Also:
Return Value:
See Also:
Since:
Return Value:
Return Value:
String : getDocumentationPath()
Return Value:
See Also:
String : getDocumentationUrl()
Return Value:
Since:
Return Value:
Attention:
Return Value:
DzFileIOPresetMgr : getFileIOPresetMgr()
Return Value:
String : getGeneratedScriptsPath()
Return Value:
See Also:
String : getGeneratedShadersPath()
Return Value:
See Also:
GraphicsMode : getGraphicsMode()
Return Value:
DzHelpMgr : getHelpMgr()
Return Value:
String : getHomePath()
Return Value:
Return Value:
Return Value:
Return Value:
See Also:
Last directory that files were loaded or saved to/from.
See Also:
String : getLogFilename()
Return Value:
See Also:
Since:
DzMultiMediaMgr : getMultiMediaMgr()
Return Value:
Return Value:
String : getPluginsPath()
Return Value:
See Also:
String : getProgramDataAppInstancePath()
Return Value:
Attention:
See Also:
Since:
String : getProgramDataAppPath()
Return Value:
Attention:
See Also:
Return Value:
Attention:
See Also:
Return Value:
Return Value:
See Also:
String : getScriptsPath()
Return Value:
See Also:
String : getShadersPath()
Return Value:
See Also:
DzSimulationMgr : getSimulationMgr()
Return Value:
Since:
Return Value:
Return Value:
Array : getStyleDefinitionList()
Return Value:
Get a filename for temporary storage.
Return Value:
Attention:
String : getTempPath()
Return Value:
See Also:
String : getTempRenderFilename()
Get a filename for temporary storage of rendered images.
Return Value:
Attention:
Return Value:
See Also:
Return Value:
See Also:
String : instanceName()
Return Value:
Attention:
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:
Return Value:
Since:
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:
Boolean : isKeyDown( Number key=-1 )
Parameter(s):
Return Value:
true
if key
is currently pressed, otherwise false
.Boolean : isKeySequenceDown( String sequence=“Any” )
Parameter(s):
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
.Return Value:
true
if the main event loop is running and events that are posted can be expected to be delivered, otherwise false
.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):
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:
Writes a normal operational message to the application log.
Parameter(s):
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):
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:
void : logPathInfo( String label, String path )
Writes a message containing information about the specified path to the application log.
Parameter(s):
Since:
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:
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:
String : operatingSystemString()
Return Value:
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:
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):
script
is actual code, set this to true
, otherwise set this to false
.evaluate
must also be set to true
.Since:
Return Value:
String : releaseCycleInstanceString()
Return Value:
Since:
String : releaseCycleInstanceSuffix()
Return Value:
Since:
String : releaseCycleInstanceSuffixStripped()
Return Value:
Since:
String : releaseCycleLocaleString()
Return Value:
Since:
Return Value:
Return Value:
String : releaseCycleSuffixStripped()
Return Value:
ReleaseEdition : releaseEdition()
Return Value:
String : releaseEditionLocaleString()
Return Value:
Since:
String : releaseEditionString()
Return Value:
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):
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):
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):
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 file/directory in the OS file browser.
Parameter(s):
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:
See Also:
Since:
Array : showSceneBuilder( Object definition=undefined, Boolean asEvent=false )
Displays the Scene Builder dialog.
Parameter(s):
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:
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:
A convenience method for browsing to a given URL.
Parameter(s):
Example:
void : statusLine( String message, Boolean addToLog=true )
Display a message in the current status interface.
Parameter(s):
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:
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):
See Also:
Since:
void : warning( String message )
Writes a warning message to the application log.
Parameter(s):
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):
Return Value:
true
if the file was written successfully, otherwise false
.void : writeToLog( String message )
Writes a message to the application log.
Parameter(s):
Example:
//The message will be written to the log App.writeToLog( "Hello World!" );
See Also:
Since:
void : writeToLog( MessageSeverity severity, String category, String message, Boolean immediate )
Write a message to the application log.
Parameter(s):
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:
void : writeToLog( String message, Boolean immediate )
Write a message to the application log.
Parameter(s):
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:
void : writeToLog( MessageSeverity severity, String message, Boolean immediate )
Write a message to the application log.
Parameter(s):
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:
DzSaveFilterMgr (deprecated) : getSaveFilterMgr()
Deprecated
Script based presets are deprecated in favor of those in the DAZ Scene Object Notation (DSON) format.
Return Value:
See Also:
DzAppSettingsMgr : getAppSettingsMgr()
Deprecated
Exists only to keep old code working. Do not use in new code. Use DzAppSettings instead.
Return Value:
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):
See Also:
Since:
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):
See Also:
Since:
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):
See Also:
Since:
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):
See Also:
Since:
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:
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:
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):
See Also:
Since:
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):
See Also:
Since:
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: