0
我只想知道如何將多個代理添加到我的Maya場景中引用的文件中。將多個代理添加到場景中的引用
情景: 我們選用含有「_v001」對象:
select -r "*_v001";
我們創造增加代理每個引用文件的功能:
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;
我要的是找到一張每個引用文件中的字符串「v001」並將其更改爲「v002」(對於proxyName,命名空間和文件路徑)。
謝謝! :)
如果您的上次編輯是解決方案,請將其從中刪除,並將其添加到下面的答案部分。如果可能的話還有一些解釋,這對社區有幫助。稍後接受(適當的)答案。 –
謝謝你的評論! ;) – mickaelb91