global proc string[] jpLocatorize(string $allObjs[]) { string $names[]; int $i = 0; for($obj in $allObjs) { string $locName[] = `spaceLocator`; select $obj; select -add $locName[0]; pointConstraint -n tempPoint -weight 1; orientConstraint -n tempOrient -weight 1; scaleConstraint -n tempScale -weight 1; select tempPoint tempOrient tempScale; delete; string $curName = `rename $locName[0] ($obj + "_loc")`; string $tokFuckUp[]; int $numOfTokens = `tokenize $curName ":" $tokFuckUp`; string $newName; if($numOfTokens > 1) { $newName = ($tokFuckUp[0] + "_" + $tokFuckUp[1]); }//end if else { $newName = $curName; }//end else catch(`rename $curName $newName`); $names[$i] = $newName; $i = $i + 1; } return $names; }//end proc locatorize