Scripting Summative
UI tool for Maya
{
// Window
if (`window -ex lizUI`) deleteUI lizUI;
windowPref -remove lizUI;
window -menuBar true -width 50 -title "Liz UI v1.0" lizUI;
string $form = `formLayout`;
string $tabs = `tabLayout -innerMarginWidth 40 -innerMarginHeight 20`;
formLayout -edit
-attachForm $tabs "top" 0
-attachForm $tabs "left" 0
-attachForm $tabs "bottom" 0
-attachForm $tabs "right" 0
$form;
// Menu
menu -label "Programs" -tearOff true;
menuItem -label "Photoshop" -command "openPhotoShop";
menuItem -label "Max"-command "openMax";
// Modelling Layout
string $child1 = `rowColumnLayout
-numberOfColumns 2`;
// Create tools
text -label "Create";
separator -height 12-width 100 -style "doubleDash";
symbolButton -image "sphere.xpm" -command "polySphere" ;
symbolButton -image "cube.xpm" -command "polyCube";
symbolButton -image "cylinder.xpm" -command "polyCylinder";
symbolButton -image "plane.xpm" -command "polyPlane";
// Editing Tools
text -label "Edit Mesh";
separator -height 12-width 100 -style "doubleDash";
button -label "Extrude" -command "PolyExtrude";
button -label "Split Polygon" -command "SplitPolygonTool";
button-label "Insert Edge Loop" -command "SplitEdgeRingTool";
button-label "Merge to centre" -command "MergeToCenter";
setParent ..;
// Tools Layout
string $child2 = `rowColumnLayout -numberOfColumns 2`;
text -label "Edit";
separator -height 12-width 100 -style "doubleDash";
button -label "centre Pivot" -command "CenterPivot";
button -label "Delete history" -command "DeleteHistory";
button-label "FreezeTransformations" -command "FreezeTransformations";
button-label "Attributes Editor" -command "ShowAttributeEditorOrChannelBox";
// Display tools
text -label "Display";
separator -height 12-width 100 -style "doubleDash";
button -label "Face Normals" -command "ToggleFaceNormalDisplay";
button -label "Face Centre" -command "TogglePolygonFaceCenters";
button-label "BaceFace Culling" -command "ToggleBackfaceGeometry";
// Tab Names
tabLayout -edit
-tabLabel $child1 "Modeling" -tabLabel $child2 "Tools" $tabs;
showWindow lizUI;
};
// External Software
global proc openPhotoShop()
{
system ("start C:/Program Files (x86)/Adobe/Adobe Photoshop CS5.1/Photoshop.exe");
}
global proc openMax()
{
system ("start C:/Program Files/Autodesk/3ds Max 2013/3dsmax.exe");
}
No comments:
Post a Comment