I currently have a script as a WIP, and its all going well since i got the first part to work with selection, and I’m moving onto trying to get the objects to triangulate, Quadrangulate or Do nothing to the meshes.
the issue i have is that in trying to add these together it seems like how I’m working is incredibly inefficient I was hoping you guys could take a look at my script and give me some pointers in making this script work better, and easier for adding other functions within it.
-as always thanks a ton for your help, much apperciated
global proc Kc_Lowres()
{
if(window -q -exists "kc_Window"
)
deleteUI -window “kc_Window”;
string $window = window -title "Kc_Poly_Reduction" -tlb 1 "kc_Window"
;
window -e -width 100 -height 250 $window;
columnLayout;
columnLayout;
// button -label “Whole Scene” -w 107 -c “WholeScn()”;
// button -label “Selected Objects” -w 107 -c “SelectObj()”;
radioButtonGrp -nrb 2 -la2 “Whole Scene” “Selected” -sl 1 radioButtonGrp_setSelectionMethod;
radioButtonGrp -nrb 3 -la3 “Triangulate” “Quadrangulate” “Do Nothing”-sl 1 radioButtonGrp_georeduction;
button -label “smooth” -w 215 -c “smooth()”;
showWindow “kc_Window”;
}
global proc smooth()
{
string $selectall[] = ls -type "mesh"
;
string $selectobjects[] = ls -sl
;
{
int $sel_mode = radioButtonGrp -q -sl radioButtonGrp_setSelectionMethod
;
if($sel_mode == 1)
{
{
select $selectall;
}
for( $items in $selectall)
{
polySmooth -mth 0 -dv 1 -c 1 -kb 1 -ksb 1 -khe 0 -kt 1 -kmb 1 -suv 1 -peh 0 -sl 1 -dpe 1 -ps 0.1 -ro 1 -ch 1 $items;
}
}
else
select $selectobjects;
}
for( $items2 in $selectobjects)
{
polySmooth -mth 0 -dv 1 -c 1 -kb 1 -ksb 1 -khe 0 -kt 1 -kmb 1 -suv 1 -peh 0 -sl 1 -dpe 1 -ps 0.1 -ro 1 -ch 1 $items2;
}
}
/*
int $sel_cleanupmode = radioButtonGrp -q -sl radioButtonGrp_georeduction
;
if($cleanupmode == 1)
{
polyTriangulate -ch 1 pPipe11;
}
if($cleanupmode == 2)
{
polyQuad -a 30 -kgb 0 -ktb 0 -khe 0 -ws 0 -ch 1 pPipe11;
}
else
//nothing