ジャンプ先: 概要. 戻り値. フラグ. Python 例.
melOptions([duplicateVariableWarnings=boolean])
注: オブジェクトの名前と引数を表す文字列は、カンマで区切る必要があります。これはシノプシスに示されていません。
melOptions は、取り消し不可能、照会可能、および編集不可能です。
Maya の埋め込み言語(MEL)の動作に影響を与える設定および照会のオプションです。なし
照会モードでは、戻り値のタイプは照会されたフラグに基づきます。
| ロング ネーム(ショート ネーム) | 引数タイプ | プロパティ | ||
|---|---|---|---|---|
duplicateVariableWarnings(dvw)
|
boolean
|
|
||
|
||||
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)