Maya Python 脚本学习笔记02

Maya Python 脚本学习笔记02

  • 第二个小工具-复制对象并属性连接传递(实例化模型到多个位置)
    • 工具代码

第二个小工具-复制对象并属性连接传递(实例化模型到多个位置)

工具代码

code:
import maya.cmds;
Objs = cmds.ls(selection = 1);
Objs.sort();
l = len(Objs);
cmds.duplicate(Objs[0]);
NewObjs = cmds.ls(selection = True);
Objs = Objs + NewObjs;
cmds.matchTransform(Objs[0],Objs[1]);
for i in range(l-1):
cmds.duplicate(Objs[l]);
NewObjs = cmds.ls(selection = True);
Objs = Objs + NewObjs;
print Objs;
cmds.matchTransform(Objs[l],Objs[i+2]);
print “The %d Time Copy,”;
print "l = ";
print l;
print "i = "
print i;

你可能感兴趣的:(Maya,Python)