void acceptUndo | ( | String | caption | ) |
Scripts can call this function to accept and finish a hold on the undo stack started by calling beginUndo().
caption | The brief description for the action that will be displayed to the user |
void beginUndo | ( | ) |
Starts a hold on the undo stack. It is recommended that scripts use this function rather than accessing DzUndoStack directly, since if the script crashes or a logic error results in leaving the undo stack open, calling this function insures that the undo stack will be closed at the end of script execution.
void cancelUndo | ( | ) |
Scripts can call this function to cancel a hold on the undo stack started by calling beginUndo().
void clearBusyCursor | ( | ) |
Clears the application-standard busy cursor and returns the mouse cursor to the previous cursor. Match every call to setBusyCursor() with a call to this function.
setBusyCursor(); // ... do something ... clearBusyCursor();
Connects a signal from an Object to a DAZ Script function (slot). See Signals and Slots in DAZ Script for more information about using signals and slots.
sender | The Object emitting the signal | |
signal | The signal being emitted | |
functionRef | The function to execute when sender emits signal |
// A function to display a message function showMessage(){ MessageBox.information( "Testing \"connect( Object sender, String signal, functionRef );\"", "Test", "&OK" ); } // Create a dialog var wDlg = new DzDialog; var wDlgLyt = new DzVBoxLayout( wDlg ); wDlgLyt.autoAdd = true; var wBtn = new DzPushButton( wDlg ); wBtn.text = "Show Message"; // Connect the DzButton::pressed() signal to the showMessage function connect( wBtn, "pressed()", showMessage ); // Display the dialog wDlg.exec();
Connects a signal from one Object to a function (slot) on another Object. See Signals and Slots in DAZ Script for more information about using signals and slots.
sender | The Object emitting the signal | |
signal | The signal being emitted | |
receiver | The Object that will recieve the signal | |
slot | The method on receiver to execute when sender emits signal |
Boolean ctrlPressed | ( | ) |
This function allows a script to determine what meta keys were pressed when the script was activated.
void debug | ( | expression | ) |
Prints expression to the output console (stderr), followed by a newline.
Disconnects a signal from one Object to a function (slot). See Signals and Slots in DAZ Script for more information about using signals and slots.
sender | The Object emitting the signal | |
signal | The signal being emitted | |
functionRef | The function to disconnect from signal |
Disconnects a signal from one Object to a function (slot) on another Object. See Signals and Slots in DAZ Script for more information about using signals and slots.
sender | The Object emitting the signal | |
signal | The signal being emitted | |
receiver | The Object that will recieve the signal | |
slot | The method on receiver to disconnect from signal |
void finishProgress | ( | ) |
Ends the current progress tracking operation, and closes the progress dialog if no other progress tracking operations are active.
Array getArguments | ( | ) |
This returns the list of arguments passed into the script. By default, this list is empty, however, if arguments were specified to the script when it was executed, they will be contained in this list.
QDesktopWidget getDesktop | ( | ) |
This function access to the desktop widget. This can be useful to get the size of the machine's desktop.
This function converts an error code into a string message.
errCode | The DAZ Studio error code |
DzAuthor getScriptAuthor | ( | ) |
String getScriptFileName | ( | ) |
String getScriptType | ( | ) |
String getScriptVersionString | ( | ) |
void killTimer | ( | Number | timerId | ) |
Stops and deletes the timer with the given id
timerId | The id of the timer to stop. |
void killTimers | ( | ) |
Parses the string and returns the floating point number that it represents or NaN if the parse fails. Leading and trailing whitespace is ignored, and if the string contains a number followed by non-numeric characters, the value of the number is returned and the remainder of the string is ignored.
str | The string to convert to a floating point number. |
Parses the string and returns the integer that it represents or NaN if the parse fails. Leading and trailing whitespace is ignored, and if the string contains a number followed by non-numeric characters, the value of the number is returned and the remainder of the string is ignored.
str | The string to convert to an integer. | |
optBase | The base of the number - if not specified, base is determined as follows:
|
This function allows a script to test if two QObject-derived variables point to the same instance.
ptr1 | The first object | |
ptr2 | The second object |
void print | ( | String | expression | ) |
Prints the expression to the console (if executed from within the Script Editor) or to the log.
expression | The expression to print - the argument will be converted to a string (via toString) if necessary. |
void processEvents | ( | ) |
Pauses execution of the script and allows the GUI thread time to process events.
Boolean progressIsActive | ( | ) |
Boolean progressIsCancelled | ( | ) |
void setBusyCursor | ( | ) |
Sets the application-standard busy cursor. Match every call to this function with a call to clearBusyCursor() to restore the previous cursor.
setBusyCursor(); // ... do something ... clearBusyCursor();
Boolean shiftPressed | ( | ) |
This function allows a script to determine what meta keys were pressed when the script was activated.
void startProgress | ( | String | info, | |
Number | totalSteps = 0 , |
|||
Boolean | isCancellable = false , |
|||
Boolean | showTimeElapsed = false | |||
) |
Displays a progress dialog to the user if one is not already being displayed and starts a progress tracking operation.
info | The string to display in the progress dialog as the current description of the operation. | |
totalSteps | The number of progress steps for the operation to be complete. | |
isCancellable | If true, the user is given the option to cancel the operation. | |
showTimeElapsed | If true, the amount of time since the progress operation was started will be displayed in the dialog. |
Creates a new timer and executes timeoutFunction every interval milliseconds.
interval | The number of milliseconds between signals emitted by the timer. | |
timeoutFunction | The function that is called when the timer times out. |
void stepProgress | ( | Number | numSteps = 1 |
) |
Steps the current progress dialog forward the given number of steps
numSteps | The number of steps to move the progress indicator forward |
void updateProgress | ( | Number | position | ) |
Sets the current progress dialog to the given number of steps
position | The number of steps to set as the current position for the progress indicator |
Global variable giving all DAZ Scripts access to the color picker object.
Global variable giving all DAZ Scripts access to the file dialog object.
Global variable giving all DAZ Scripts access to the geometry object.
A special value used to indicate a division by zero occourance. In DAZ Script, division by zero does not raise an error, instead it assigns the Infinity
value. Use isFinite() to test if a value is finite or not. (Read Only)
var nNum = 1/0;
// nNum: Infinity
Global variable giving all DAZ Scripts access to the interface object.
Global variable giving all DAZ Scripts access to the message box object.
A special value used to indicate that the value of a Number, is "Not a Number". (Read Only)
var nNum = 1/"six"; // nNum: NaN
A special value used to indicate a variable does not have a defined value (e.g. has not yet been assigned). (Read Only)
var nNum;
// nNum: undefined