Go to: Synopsis. Return value. Flags. MEL examples.
melOptions [-duplicateVariableWarnings boolean]
melOptions is NOT undoable, queryable, and NOT editable.
Set and query options that affect the behavior of Maya's Embedded Language (MEL).None
In query mode, return type is based on queried flag.
Long name (short name) | Argument types | Properties | ||
---|---|---|---|---|
-duplicateVariableWarnings(-dvw)
|
boolean
|
|||
|
Flag can appear in Create mode of command | Flag can appear in Edit mode of command |
Flag can appear in Query mode of command | Flag can be used more than once in a command. |
// To find out if there are any duplicate variable declarations in // a script: // Save the current setting of the duplicateVariableWarnings option. int $optionVal = `melOptions -q -duplicateVariableWarnings`; // Turn the option on. melOptions -duplicateVariableWarnings on; // Source the script and see all the warnings generated. eval() is // needed to ensure that the 'source' command is not processed before // the warnings have been turned on. eval("source \"myScript.mel\""); // Warning: line 13: int $i; // // Warning: line 13: "myScript.mel" line 5.8 : Redeclaration of variable "$i" shadows previous declaration at line 3. Previous value will be retained. // // Restore the option to its original value. melOptions -duplicateVariableWarnings $optionVal;