每次我通过MEL在Maya中创建新的IK控制柄时,它都会创建一个名为"effector1“或"effector2”的末端效应器,具体取决于场景中的内容。我不想依赖末端效应器的自动命名,所以我想知道是否有一种方法可以:
a)在创建IK控制柄时命名效应器,或
b)在MEL中选择特定IK控制柄的效应器。
任何帮助都将不胜感激--谢谢!
发布于 2009-09-08 19:16:30
下面介绍如何获取并重命名名为ikHandle1的特定控制柄的末端效应器:
string $ee = `ikHandle -q -endEffector ikHandle1`;
// Result: effector1 //
rename $ee "mynewname";
// Result: mynewname //发布于 2014-05-16 06:12:18
我知道这真的很晚了,但是我在kb答案的帮助下做了一个新的脚本,根据已经命名的内容重命名它。以防将来有人遇到这个问题。
//selects all IKHandles
select `ls -type ikHandle`;
//stores them in an array
string $handles[] = `ls -sl`;
//for each item in the array,
for($handle in $handles)
{
//create a new name by adding "_effector" to the end
string $newName = ($handle + "_effector");
//find the effector and store that name in a variable
string $efName = `ikHandle -q -endEffector $handle`;
//rename the effector
rename $efName $newName;
}如果不想重命名所有IK控制柄,只需注释掉第一行代码,
select `ls -type ikHandle`;选择要重命名的所有句柄,然后运行代码。
https://stackoverflow.com/questions/1386976
复制相似问题