ここで紹介するコマンドを使用すると、スクリプトを一時停止してユーザの入力を取得することができます。複雑なカスタム ユーザ インタフェースを作成する場合は、「インタフェースを作成する」を参照してください。
confirmDialog コマンドは、メッセージおよび任意の数のボタンを設定したモーダル ウィンドウを作成します。
このウィンドウは、いずれかのボタンを押すかウィンドウの閉じるボタンをクリックすると消えます。
confirmDialog -title "Confirm" -message "Are you sure?" -button "OK" -button "Cancel" -defaultButton "OK" -cancelButton "Cancel" -dismissString "Cancel";
fileDialog コマンドは、ファイル オープン ダイアログ ウィンドウを表示します。Maya MEL コマンドのドキュメントで fileDialog を参照してください
文字列にはパス名を含めることはできますが、「*.cc」、「/usr/u/*」などのように、必ずワイルドカードでファイルを指定する必要があります。
fileDialog -directoryMask "*.txt"
promptDialog コマンドは、メッセージ、テキスト フィールド、および任意の数のボタンを設定したウィンドウを作成します。Maya MEL コマンドのドキュメントで promptDialog を参照してください。
// Show the dialog box: string $text; string $result = `promptDialog -title "Rename Object" -message "Enter Name:" -button "OK" -button "Cancel" -defaultButton "OK" -cancelButton "Cancel" -dismissString "Cancel"`; // Use the command again in query mode to // get the text: if ($result == "OK") { $text = `promptDialog -query -text`; }