User Tools

Site Tools


DzScriptContext

Encapsulates a DAZ Script script context.

More...

Inherits :

Methods

Detailed Description

All DzScripts are executed in the context of a DzScriptContext instance - therefore, all the properties and methods on DzScriptContext are accessible to a script as global functions and variables. It will usually not be necessary for a script to create or use this class directly.

Methods


void : acceptUndo( String caption )

Accept and finish a hold on the undo stack started by calling beginUndo().

See Also:


Boolean : backgroundProgressIsActive()

Return Value:

  • true if there is an active background progress operation in the application, otherwise false.

See Also:


Boolean : backgroundProgressIsCancelled()

Return Value:

  • true if the user canceled the current background progress operation in the application, otherwise false.

See Also:


void : beginNodeSelectionHold()

Captures a view of scene seletion.

See Also:

Since:

  • 4.9.4.109

void : beginUndo()

Starts a hold on the undo stack.

See Also:


void : cancelUndo()

Cancel a hold on the undo stack started by calling beginUndo().

See Also:


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.

See Also:


void : clearNodeSelectionHolds()

Clears all selection holds without restoring the selection.

See Also:

Since:

  • 4.9.4.109

void : clearOverrideCursor()

Clears the override cursor stack.

See Also:

  • Global::clearOverrideCursor()

Since:

  • 4.6.4.30

void : clearUndoStack()

Clears the undo stack.

See Also:


void : dropNodeSelectionHold()

Removes a scene node selection hold on scene selection without restoring the selection.

See Also:

Since:

  • 4.9.4.109

void : dropUndo()

Drops a hold on the undo stack started by calling beginUndo().

See Also:


void : finishBackgroundProgress()

Ends the current background progress operation in the application from script.

See Also:


void : finishProgress()

Ends the current progress operation in the application from script.

See Also:


Array : getArguments()

Return Value:

  • The list of arguments for the current script execution.

See Also:


String : getErrorMessage( Number errCode )

This function converts an error code into a string message.

Return Value:

  • A user-readable message that describes the error represented by the error code.

See Also:


QObject : getObjectParent( QObject obj )

Return Value:


DzAuthor : getScriptAuthor()

Return Value:

  • The author of the current script (if any), otheriwse and empty string.

See Also:


String : getScriptFileName()

Return Value:

  • The file name of the current script (if any), otherwise an empty string.

See Also:


String : getScriptType()

Return Value:

  • The file type that this script was saved out as.

See Also:


String : getScriptVersionString()

Return Value:

  • The version of the current script (if any).

See Also:


Boolean : pointersAreEqual( QObject ptr1, QObject ptr2 )

This function allows a script to test if two QObject-derived variables point to the same instance.

Return Value:

  • true if the pointers point to the same object, otherwise false.

See Also:


void : processEvents()

Pauses execution of the script and allows the GUI thread time to process events.

See Also:


Boolean : progressIsActive()

Return Value:

  • true if there is an active progress operation in the application, otherwise false.

See Also:


Boolean : progressIsCancelled()

Return Value:

  • true if the user cancelled the current progress operation in the application, otherwise false.

See Also:


void : restoreNodeSelectionHold()

Restores the scene selection to the view at last call to beginNodeSelectionHold().

See Also:

Since:

  • 4.9.4.109

void : setBusyCursor()

Sets the application-standard busy cursor. Match every call to this function with a call to clearBusyCursor() to restore the previous cursor.

See Also:


void : sleep( Number milliseconds )

Pauses the script for the specified number of milliseconds without blocking the application event loop.

See Also:

Since:

  • 4.8.0.45

void : startBackgroundProgress( String info, Number totalSteps=0, Boolean isCancellable=false )

Starts a background progress operation in the application from script.

See Also:


void : startProgress( String info, Number totalSteps=0, Boolean isCancellable=false, Boolean showTimeElapsed=false )

Starts a progress operation in the application from script.

See Also:


void : stepBackgroundProgress( Number numSteps=1 )

Steps the current background progress operation in the application from script.

See Also:


void : stepProgress( Number numSteps=1 )

Steps the current progress operation in the application from script.

See Also:


void : updateBackgroundProgress( Number position )

Updates the background current progress operation in the application from script.

See Also:


void : updateProgress( Number position )

Updates the current progress operation in the application from script.

See Also:


Boolean : shiftPressed()

Deprecated

Exists only to keep old code working. Do not use in new code. Use DzApp::modifierKeyState() instead.

var bShiftPressed = App.modifierKeyState() & 0x02000000;

Boolean : ctrlPressed()

Deprecated

Exists only to keep old code working. Do not use in new code. Use DzApp::modifierKeyState() instead.

var bControlPressed = App.modifierKeyState() & 0x04000000;

QDesktopWidget (deprecated) : getDesktop()

Deprecated

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

var wDesktop = new DzDesktopWidget();