// ---- EVEN More Better Combine V2.3 ----- // // Combines Polygons deletes history and keeps it within it's Group if it is in one. // Also Keeps the name of the first Poly selected. // Now it merges verts and Centers the pivot as requested. =D // the initial Tolerance of the merge vert can be changed below or you can change it in the history after. { // --------------------- Change these values for the Merge Vert Tolorance ---------------------- // string $onOff = "on"; float $k = 0.001; // --------------------- Change these values for the Merge Vert Tolorance ---------------------- // string $sel[]=`ls -sl -fl`; string $fpo = `firstParentOf $sel[0]`; string $buffer[]; string $selBuffer[]; int $numTokens = `tokenize $fpo "|" $buffer`; string $newPoly[] = `polyUnite -ch 0 -n $sel[0] $sel`; int $j=0; int $i=0; if ($fpo != "") { while ($j<= $numTokens) { if (!`objExists $buffer[$j]`) { if($j != 0) { $j--; } //group -em -n $buffer[$j]; if (`objExists $buffer[$j]`) { parent $newPoly $buffer[$j]; } break; } $j++; } } int $selNumTokens = `tokenize $sel[0] "|" $selBuffer`; $i = $selNumTokens -1; $newPoly[0] = `rename $newPoly $selBuffer[$i]`; if ($onOff == "on") { polyMergeVertex -d $k -am 1 -ch 0 $newPoly; } xform -cp $newPoly; select -r $newPoly; }