//===================================== // mapTool v1.0 (3/2002) // by St.John Colón // // The script is freeware. Non-commercial redistribution is permitted as long as this header remains included and unmodified. // Your feedback is always appreciated - if you find the script useful or if you have questions, comments, suggestions, requests // or bug-reports please contact me at: // // scolon@thq.com // // //===================================== // INSTALLATION: Copy the script into your Maya script-directory and start it with the mapTool; command. // // COMPATIBILITY NOTE: Tested only with Maya4.0 // // DESCRIPTION: MapTool is a macro which facilitates the rapid manipulation of faces which use tileable textures. // // USAGE: Select the faces of polygonal geometry and click the MapTool buttons to manipulate the individual UV coordinates corresponding with tileable textures. // global proc mapTool() { global string $toolwin = "mapTool"; if (`window -ex $toolwin`) { deleteUI $toolwin; } window -t "mapTool V1.0" -rtf 1 -w 100 -s 1 -mnb 1 -mxb 0 $toolwin; formLayout UniForm; scrollLayout -hst 8 -vst 8 -cr 1 Scroll; columnLayout -w 100 -columnWidth 100 -rowSpacing 1 -columnAlign "center" -co "both" 2 MainColumn; /// UV Mapping window -widthHeight 300 200 MapTool; string $form = `formLayout -numberOfDivisions 100`; string $b1 = `button -label "-90" -ann "Rotate UVs -90" -command "ConvertSelectionToUVs; PolySelectConvert 4; polyRotateUVs -90; ConvertSelectionToFaces; PolySelectConvert 1" `; string $b2 = `button -label "Up" -ann "Flip UVs Up" -command "polyFlipUV -flipType 1 -local on " `; string $b3 = `button -label "+90" -ann "Rotate UVs +90" -command "ConvertSelectionToUVs; PolySelectConvert 4; polyRotateUVs 90; ConvertSelectionToFaces; PolySelectConvert 1" `; string $b4 = `button -label "Left" -ann "Flip UVs Left" -command "polyFlipUV -flipType 0 -local on " `; string $b5 = `button -label "Normalize" -ann "Normalize UVs" -command "performPolyForceUV normalize 0; polyNormalizeUV -normalizeType 1 -preserveAspectRatio off " `; string $b6 = `button -label "Right" -ann "Flip UVs Right" -command "polyFlipUV -flipType 0 -local on " `; string $b7 = `button -label "Copy UVs" -ann "Copy Shader" -command "polyClipboard -shader -cp; polyClipboard -cp -uv" `; string $b8 = `button -label "Down" -ann "Flip UVs Down" -command "polyFlipUV -flipType 1 -local on " `; string $b9 = `button -label "Paste UVs" -ann "Paste Shader" -command "polyClipboard -shader -ps; polyClipboard -ps -uv" `; string $b10 = `button -label "Unitize" -ann "Unitize UVs" -command "performPolyForceUV unitize 0; polyForceUV -unitize " `; formLayout -edit -attachForm $b1 "top" 5 -attachForm $b1 "left" 5 -attachPosition $b1 "bottom" 5 25 -attachPosition $b1 "right" 5 33 -attachForm $b2 "top" 5 -attachControl $b2 "left" 5 $b1 -attachPosition $b2 "bottom" 5 25 -attachPosition $b2 "right" 5 66 -attachForm $b3 "top" 5 -attachControl $b3 "left" 5 $b2 -attachPosition $b3 "bottom" 5 25 -attachForm $b3 "right" 5 -attachControl $b4 "top" 5 $b1 -attachForm $b4 "left" 5 -attachPosition $b4 "bottom" 5 50 -attachPosition $b4 "right" 5 33 -attachControl $b5 "top" 5 $b1 -attachControl $b5 "left" 5 $b4 -attachPosition $b5 "bottom" 5 50 -attachPosition $b5 "right" 5 66 -attachControl $b6 "top" 5 $b1 -attachControl $b6 "left" 5 $b5 -attachPosition $b6 "bottom" 5 50 -attachForm $b6 "right" 5 -attachControl $b7 "top" 5 $b4 -attachForm $b7 "left" 5 -attachPosition $b7 "bottom" 5 75 -attachPosition $b7 "right" 5 33 -attachControl $b8 "top" 5 $b4 -attachControl $b8 "left" 5 $b7 -attachPosition $b8 "bottom" 5 75 -attachPosition $b8 "right" 5 66 -attachControl $b9 "top" 5 $b4 -attachControl $b9 "left" 5 $b8 -attachPosition $b9 "bottom" 5 75 -attachForm $b9 "right" 5 -attachControl $b10 "top" 5 $b7 -attachForm $b10 "left" 5 -attachForm $b10 "bottom" 5 -attachForm $b10 "right" 5 $form; showWindow MapTool; }