我为一条腿做了一个关节链并命名了每个关节,"大腿","膝盖","脚踝","球&#34 ;和" toe。"我希望此代码复制链,然后添加" _FK"到每个名字的末尾。现在它只会正确更改名字,然后其余的不会改变。它给出错误消息"错误:没有对象匹配名称。"什么阻止for循环工作?当我拿出复制行时,这段代码非常有效。
duplicate -rr;
string $currentSelection[] = `ls -sl -fl`; //get name of selected objects//
int $theArraySize = size($currentSelection);
int $counter = 0;
string $newName = "";
for ( $i = 0 ; $i < $theArraySize; $i++ )
{
$newName = $currentSelection[$i] + "_FK" ;
rename $currentSelection[$i] $newName;
$counter += 1;
}