Here's a scipt that I came up with to iterate through referenced files and replace these with a new locations. When I run the script it does what it supposed to but then spits out.....
// Error: File not found.: //tails-server/tails render/Treetop_Studios/Tails_Video_1/Characters/Goose/Susie/scenes/Susie2.mb //
When I copy and paste the above path to the command :file -loadReference Susie2RN -type "mayaBinary" -options "v=0" "//tails-server/tails render/Treetop_Studios/Tails_Video_1/Characters/Goose/Susie/scenes/Susie2.mb";
it runs fine...
What am I doing wrong? The script is shown below. Any help is appreciated.
$foundFiles = (ls -typ "reference");
print $foundFiles;
for ($elem in $foundFiles) {
if (!gmatch $elem "*sharedReferenceNode*" && !gmatch $elem "*UNKNOWN\_REF\_NODE*") {
if (gmatch $elem "*Sky*") {
file -removeReference "T:/Treetop_Studios/Tails_Video_1/Props/Scene_2/UpThereSky/Sky.mb";
}
else {
string $origLocation = (referenceQuery -f $elem);
file -removeReference $origLocation;
string $newLocation = substitute "T:/" $origLocation "//tails-server/tails render/" ;
file -loadReference $elem -type "mayaBinary" -options "v=0" $newLocation;
}
}
}