I just want to know how I can add multiple proxies to referenced files in my Maya scene.
Scenario : We select objects which contain "_v001" :
select -r "*_v001";
We create the function to add proxies for each referenced files :
global proc proxyAddition() {
string $selectionList[] = `ls -sl`;
if(size($selectionList)) {
string $object = $selectionList[0];
string $currentRN = `referenceQuery -rfn $object`;
string $currentFilePath = `referenceQuery -filename $object`;
string $currentNamespace = `referenceQuery -namespace $object`;
if(endsWith($currentRN, "v001RN") == 1) {
string $newRN = `substitute "v001RN" $currentRN "v002"`;
string $newFilePath = `substitute "v001" $currentFilePath "v002"`;
string $newNamespace = `substitute "v001" $currentNamespace "v002"`;
proxyAdd $currentRN $newFilePath "HD";
print "Opération effectuée avec succès.";
}
} else {
warning "Aucun objet de type v001 dans la scène.";
}
}
proxyAddition;
What I want is find the piece of string "v001" in each referenced files and change it to "v002" (for the proxyName, the namespace and the file path).
Thank you.