//James Parks global proc jpSwapTextures(string $res) { string $startDate = `system("date /T")`; string $startTime = `system("time /T")`; string $texNodes[] = `ls -et "file"`; string $path = ""; if($res == "LO" || $res == "Lo" || $res == "lo" || $res == "LOW" || $res == "Low" || $res == "low") { print "*****STARTING TEXTURE SWAP*****\n"; for($node in $texNodes) { string $initFile = `getAttr ($node + ".fileTextureName")`; if(`size($initFile)` != 0) { string $tokPath[]; int $numPath = `tokenize $initFile "/" $tokPath`; string $initExt = `fileExtension($initFile)`; string $initBaseFile = basename($initFile, ("." + $initExt)); if(!endsWith($initBaseFile, "_LO")) { //Decide between drive letters and UNC /* if(`endsWith($tokPath[0], ":")`) { string $initPath = $tokPath[0]; }//end if else { */ string $initPath = ("\/\/" + $tokPath[0]); // }//end else for($i=1; $i<($numPath - 1); $i++) { $initPath = ($initPath + "/" + $tokPath[$i]); }//end for $newBaseFile = ($initBaseFile + "_LO." + $initExt); $path = ($initPath + "/" + $newBaseFile); setAttr -type "string" ($node + ".fileTextureName") $path; print ($initFile + "\n\t" + $path + "\n"); }//end if }//end if }//end for print "*****ENDING TEXTURE SWAP*****\n"; }//end if else if($res == "HI" || $res == "hi" || $res == "Hi" || $res == "HIGH" || $res == "High" || $res == "high") { print "*****STARTING TEXTURE SWAP*****\n"; for($node in $texNodes) { string $initFile = `getAttr ($node + ".fileTextureName")`; if(`size($initFile)` != 0) { string $tokPath[]; int $numPath = `tokenize $initFile "/" $tokPath`; string $initExt = `fileExtension($initFile)`; string $initBaseFile = basename($initFile, ("." + $initExt)); if(endsWith($initBaseFile, "_LO")) { //string $initPath = $tokPath[0]; string $initPath = ("\/\/" + $tokPath[0]); for($i=1; $i<($numPath - 1); $i++) { $initPath = ($initPath + "/" + $tokPath[$i]); }//end for $newBaseFile = `substitute "_LO" $initBaseFile ""`; $newBaseFile = ($newBaseFile + "." + $initExt); $path = ($initPath + "/" + $newBaseFile); setAttr -type "string" ($node + ".fileTextureName") $path; print ($initFile + "\n\t" + $path + "\n"); }//end if }//end if }//end for print "*****ENDING TEXTURE SWAP*****\n"; }//end else if else if($res == "MAP" || $res == "map" || $res == "Map") { jpSwapTextures("hi"); print "*****STARTING TEXTURE SWAP*****\n"; for($node in $texNodes) { string $initFile = `getAttr ($node + ".fileTextureName")`; if(`size($initFile)` != 0) { if(!endsWith($initFile, ".map")) { $initFile = `substitute "//Nitro" $initFile "C:/Nitro"`; $initFile = `substitute "//nitro" $initFile "C:/Nitro"`; string $newFile = ($initFile + ".map"); setAttr -type "string" ($node + ".fileTextureName") $newFile; print ($initFile + "\n\t" + $newFile + "\n"); }//end if }//end if }//end for print "*****ENDING TEXTURE SWAP*****\n"; }//end else if else if($res == "NOTMAP" || $res == "notmap" || $res == "NotMap" || $res == "notMap") { print "*****STARTING TEXTURE SWAP*****\n"; for($node in $texNodes) { string $initFile = `getAttr ($node + ".fileTextureName")`; if(`size($initFile)` != 0) { if(endsWith($initFile, ".map")) { $initFile = `substitute "C:/Nitro" $initFile "//Nitro"`; $initFile = `substitute "C:/Nitro" $initFile "//nitro"`; string $newFile = `substitute ".map" $initFile ""`; setAttr -type "string" ($node + ".fileTextureName") $newFile; print ($initFile + "\n\t" + $newFile + "\n"); }//end if }//end if }//end for print "*****ENDING TEXTURE SWAP*****\n"; }//end else if else { error "Unrecognized Resolution"; }//end else string $endDate = `system("date /T")`; string $endTime = `system("time /T")`; //print ("Started at " + $startTime + " " + $startDate + "\nEnded at " + $endTime + " " + $endDate); }//end proc: jpSwapTextures