// Creation Date: Feb-08-2001 // Last Updated: Feb-08-2001 // Revision: 1.0 // Tested on Maya: 4.0 // // Author: Gino Dammers - gdammers@xs4all.nl // // Procedure Name: // // polySmoothControl // // Description: // polySmoothControl looks up all the polySmooth Nodes in your scene and fives // you control over all of them in one panel. // global proc delsmooth(string $currentPolySmooth) { select $currentPolySmooth; string $Eval ="setAttr "+$currentPolySmooth + ".divisions" + " 0;"; // print ( $Eval ); eval($Eval); delete; print ($currentPolySmooth + " Node has been deleted"); } global proc globalDelSmooth() { string $currentPolySmooth[] = `ls -typ polySmoothFace`; for ($current in $currentPolySmooth) { setAttr ($current + ".divisions") 0; select -replace $current; delete; } print "All polySmooth Nodes have been deleted"; } global proc globalPolySmooth() { int $gpSlevel = `intSliderGrp -q -v SetLevel`; string $currentPolySmooth[] = `ls -type polySmoothFace`; for ($current in $currentPolySmooth) { setAttr ($current + ".divisions") $gpSlevel; } } global proc globalPolyTesselation() { int $gpSlevel = `checkBox -q -v keepTess`; string $currentPolySmooth[] = `ls -type polySmoothFace`; for ($current in $currentPolySmooth) { setAttr ($current + ".keepTessellation") $gpSlevel; } } global proc polySmoothControl() { string $polySmooths[] = `ls -type polySmoothFace`; $win="polySmoothControl"; if (`window -exists $win`) { deleteUI -window $win; } window -title "PolySmooth Control V1.0" -w 345 -maximizeButton false polySmoothControl; scrollLayout -hst 16 -childResizable true; columnLayout; frameLayout -label "Global polySmooth Control" -labelAlign "center" -mh 5 -borderStyle "etchedOut" -collapsable 1 ; columnLayout; intSliderGrp -field true -cw 1 120 -cw 2 30 -label "Subdivision Levels" -min 0 -max 4 -s 1 -v 1 SetLevel; checkBox -label "Keep Tesselation" -v 1 keepTess; columnLayout -co "left" 120; button -w 120 -label "Set Level" -c "globalPolySmooth"; button -w 120 -label "Set Keep Tesselation" -c "globalPolyTesselation"; button -w 120 -label "Delete PolySmooth" -c "globalDelSmooth"; setParent ..; setParent ..; setParent ..; separator -height 20 -width 320 -style "double"; for ($currentPolySmooth in $polySmooths) { string $addOn[] = `listConnections -s 0 $currentPolySmooth`; string $namePlus = ($currentPolySmooth + " --->>: " + $addOn[0]); frameLayout -label $namePlus -labelAlign "center" -borderStyle "etchedOut" -collapsable 1 ; columnLayout; $attr1 = $currentPolySmooth + ".divisions"; attrFieldSliderGrp -cw 1 120 -cw 2 30 -min 0 -max 4 -label "Level" -at $attr1; rowColumnLayout -numberOfColumns 2; button -label "Select Node" -c ("select -r " + $currentPolySmooth); button -label "Delete Node" -c ("delsmooth " + $currentPolySmooth); setParent ..; setParent ..; setParent ..; } showWindow polySmoothControl; }