Go to: Synopsis. Return value. Flags. Python examples.
melOptions([duplicateVariableWarnings=boolean])
Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.
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 have multiple arguments, passed either as a tuple or a list. |
import maya.cmds as cmds # To find out if there are any duplicate variable declarations in # a script: # Save the current setting of the duplicateVariableWarnings option. optionVal = cmds.melOptions(q=True, duplicateVariableWarnings=True) # Turn the option on. cmds.melOptions(duplicateVariableWarnings=True) # Source the script and see all the warnings generated. import maya.mel as mm mm.eval('source "myScript.mel"') // Warning: int $i; // // Warning: "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. cmds.melOptions(duplicateVariableWarnings=optionVal)