Synopsis

DPK_eval [-doIt string] [-redoIt string] [-undoIt string]

The command is Undoable, NOT Queryable, and NOT Editable

Description

The DPK_eval command is used to allow MEL scripts to have access to the undo queue of Maya. It is used to execute certain scripts only in an undo or redo. You can also execute a script without adding it to the undo queue, even if the script itself contains undoable commands.

Warning

Use this command with great care. It can make Maya really unstable and crash when used in a wrong way.

Flags

Flags (short/long)Argument(s)Return

-d/-doIt

string

 

This script will be executed when the command is called. The difference between an eval call is that the command is not added to the undo queue. If neither the -u nor the -r flag is used, the whole command is considered to not be undoable. Note that even when a redo or undo script is specified, the -doIt script will not be undone in an undo.

-u/-undoIt

string

 

This script will not be executed until this command is undone. Specifying this script will add the command to the undo queue of Maya.

-r/-redoIt

string

 

This script will not be executed until this command is redone. Specifying this script will add the command to the undo queue of Maya.

Examples

// Print a message when the command is undone and redone.
DPK_eval
    -d "print \"\\n// doing things...\\n\\n\""
    -u "print \"\\n// undoing...\\n\\n\""
    -r "print \"\\n// redoing...\\n\\n\"";

// Use undo and redo to see when the scripts are executed.