我有问题。我正在编写一个Python-Maya脚本。我正在尝试将对象列表挤出到另一个对象列表,但是当我尝试执行此操作时出现以下错误(错误不是我启动for循环的行):
Error: line 1: TypeError: file <maya console> line 45: range() integer end argument expected, got list.
#
def extrude_():
for i in range(listOfCircles):
mc.select(listOfCurves[0], all=True)
mc.select(listOfCircles[0], all=True)
mc.extrude(listOfCurves[0]+str(i), listOfCircles[0]+str(i), et=2)
return
listOfCircles和listOfCurves是全局变量,所以我认为我不需要将它们传递给函数..
答案 0 :(得分:0)
Based on how I understood what you explained you want to achieve your code could be as following:
def extrude():
for i in range(len(listOfCircles)):
mc.extrude(listOfCurves[i], listOfCircles[i], et=2)