ジャンプ先: 概要. 戻り値. フラグ. MEL 例.

概要

melOptions [-duplicateVariableWarnings boolean]

melOptions は、取り消し不可能、照会可能、および編集不可能です。

Maya の埋め込み言語(MEL)の動作に影響を与える設定および照会のオプションです。

戻り値

なし

照会モードでは、戻り値のタイプは照会されたフラグに基づきます。

フラグ

duplicateVariableWarnings
ロング ネーム(ショート ネーム) 引数タイプ プロパティ
-duplicateVariableWarnings(-dvw) boolean createquery
このオプションがオンの場合、MEL 変数が同じ名前を持つ別の変数と同じ範囲内で宣言されていると、警告が生成されます。この警告は、スクリプトの実行時でなく、スクリプトの送信時に生成されます。通常、これらの警告はスクリプト内のエラーを示します。

照会時は、オプションの現在の設定が返されます。

対応するプリファレンス optionVar は melDuplicateVariableWarnings です。


フラグはコマンドの作成モードで表示できます フラグはコマンドの編集モードで表示できます
フラグはコマンドの照会モードで表示できます コマンド内でフラグを複数回使用できます。

MEL 例

//	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;