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