概要
MayaのMELのシンプルなサンプルスクリプト。
MEL
string $toolCreate = "createTool"; string $toolName = "UI Tool"; if( `window -exists $toolCreate`) { deleteUI $toolCreate; } window -t $toolName -w 500 -h 500 $toolCreate; frameLayout -label "UI CTRLS" -bs "etchedIn" -cll 1 -cl 1; gridLayout -nc 3 -cwh 90 50; button -label "Ctrl Maker" -c "button_CtrlMaker_Clicked"; setParent ..; showWindow $toolCreate; global proc button_CtrlMaker_Clicked () { circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.01 -s 8 -ch 1; }
覚えたコマンド
- windowで新しいウィンドウを作成する。showWindowで表示
- buttonの -c でコールバック
button_CtrlMaker_Clicked
を登録 - frameLayoutから setParent ..; までがひとかたまり
- frameLayoutの -cll 1 -cl 1 でCollapse表示(折りたたみ表示)になる