Edited version :)
Di Maya, ketika sebuah window dipanggil dengan shortcut key, maka biasanya tidak ada jalan laen selaen click tanda 'x' di bagian kanan atas untuk menutup windows itu. Karena saya males, dan Maya adalah sebuah program yg fleksibel...saya buatin aja biar bisa toggle on off windownya gitu dengan simple MEL.
Pada dasarnya concept toggle on off ini sama antara 1 window dengan window yg laen:
//toggle_graphEditor, gw assign ke 'alt+2'if ( `window -exists graphEditor1Window` )
deleteUI -window graphEditor1Window;
else
tearOffPanel "Graph Editor" "graphEditor" true;
//toggle DopeSheet, gw assign ke '2'
if ( `window -exists dopeSheetPanel1Window` )
deleteUI -window dopeSheetPanel1Window;
else
tearOffPanel "Dope Sheet" "dopeSheetPanel" true;
//toggle Outliner, assign ke '1'
if ( `window -exists outlinerPanel1Window` )
deleteUI -window outlinerPanel1Window;
else
OutlinerWindow;
//toggle HyperGraph, gw assign ke 'alt+1'
if ( `window -exists hyperGraphPanel1Window` )
deleteUI -window hyperGraphPanel1Window;
else
tearOffPanel "Hypergraph" "hyperGraphPanel" true;
//toggle HyperShade, assign ke 'm', just like material editor in max :)
if ( `window -exists hyperShadePanel1Window` )
deleteUI -window hyperShadePanel1Window;
else
tearOffPanel "Hypershade" "hyperShadePanel" true;
//toggleAttributeEditor, still 'ctrl+a'
string $panel = `getPanel -withFocus`;
if (`window -exists AEWindow`)
{
deleteUI -window "AEWindow";
/*window -e -visible false AEWindow;*/
}
else
/*ShowAttributeEditorOrChannelBox;*/
openAEWindow;
setFocus $panel;
//toggle RenderView, gw assign ke '3'
if ( `window -exists renderViewWindow` )
deleteUI -window renderViewWindow;
else
tearOffPanel "Render View" "renderWindowPanel" true;
//toggle Shelf, gw assign ke 'alt+`'
{
setShelfVisible 1; //turn on shelf
global string $gShelfTopLevel;
string $switchTab;
string $children[] = `tabLayout -q -ca $gShelfTopLevel`;
$children[size($children)] = $children[0];
string $currentShelf = `tabLayout -q -st $gShelfTopLevel`;
for($i=0; $i<`size($children)`; $i++)
{
if($children[$i] == $currentShelf)
{
$switchTab = $children[$i+1];
break;
}
}
tabLayout -edit -st $switchTab $gShelfTopLevel;
}
//toggle WireFrameShade, 'ctrl+4'
$currentPanel = `getPanel -withFocus`;
$state = `modelEditor -q -wos $currentPanel`;
modelEditor -edit -wos (!$state) $currentPanel;
/*toggle backface DISPLAY culling, 'ctrl+5'*/
ToggleBackfaceCulling;
/*toggle backface GEOMETRY culling, 'shift+5'*/
ToggleBackfaceGeometry;
Sedikit info ttg perbedaan display culling dan geometry culling yg pernah saya posting di indocg :
technorati tags:maya, ui, toggle, script
Blogged with Flock