// rt v1.0 // Revision Date: 8-22-05 // Author: Lee Lanier // Description: Automatically replaces texture paths // Usage: source script // Note: Will return a non-fatal error if procedural textures, // such a fractal, are encountered. global proc rt (){ string $windowname = `window -menuBar false -title "rt"`; columnLayout -adjustableColumn true; // store texture list in array string $texturelist [] = `ls -tex`; // get path of first tetxure string $firstpath = `getAttr ($texturelist[0] + ".ftn")`; text -label "First Texture Entry..."; text -label $firstpath; text -label " "; text -label "Enter New Path..."; // create entry field textField -text "" pathentry; // create button which jumps to next proc button -label "GO" -c executeReload; showWindow $windowname; } global proc executeReload (){ // store texture list in array string $texturelist [] = `ls -tex`; // retreive text entered into field string $newpath = `textField -q -text pathentry`; // step through texture list array for ($i = 0; $i < size($texturelist); $i++) { string $channel = ($texturelist[$i] + ".ftn"); // retrieve texture path string $pathname = `getAttr ($texturelist[$i] + ".ftn")`; // extract file name string $filename = basenameEx($pathname); // extract file type string $ext = endString($pathname, 4); // create new path string $finalpath = ($newpath + $filename + $ext); // test to see if channel is valid string $test = `getAttr $channel`; if ($test != ""){ // assign new new texture AEassignTextureCB $channel $finalpath "image"; print ($pathname + " converted to " + $finalpath + " "); } } } rt;