Go to: Synopsis. Return value. Flags. MEL examples.
condition [-delete] [-dependency string] [-initialize] [-script string] [-state boolean]
string
condition is undoable, queryable, and editable.
This command creates a new named condition object whose true/false value is calculated by running a mel script. This new condition can then be used for dimming, or controlling other scripts, or whatever.
None
In query mode, return type is based on queried flag.
| Long name (short name) | Argument types | Properties | ||
|---|---|---|---|---|
-delete(-del)
|
|
|
||
|
||||
-dependency(-d)
|
string
|
|
||
|
||||
-initialize(-i)
|
|
|
||
|
||||
-script(-s)
|
string
|
|
||
|
||||
-state(-st)
|
boolean
|
|
||
|
||||
// Create a new condition, called "UndoNorRedo", which is true if
// and only if undo is not available and redo is not available:
global proc int isUndoNorRedo()
{
return (!`isTrue UndoAvailable` && !`isTrue RedoAvailable`);
}
condition
-initialize
-d UndoAvailable
-d RedoAvailable
-s "isUndoNorRedo"
UndoNorRedo;
// Try out the new condition
//
if ( `isTrue UndoNorRedo` ) {
print ( "Neither undo nor redo is available\n" );
} else {
print ( "Undo or redo is available\n" );
}
// Get rid of the condition again
//
condition -delete UndoNorRedo;