import maya.cmds as cm
import random as rand
def vertQuery(List = [] , *arg):
myList = cm.ls(sl = True)
for i in myList:
List.append(cm.ls('%s.cv[:]'%i, flatten = True))
return List
a = vertQuery()
def randMaker(randList = [] , x = 0 , y = 0 ,*arg):
for i in range(len(a)):
for j in range(len[x][y]):
randList.append(rand.uniform(-1,1))
y+=1
if y == len[x][-1]:
x+=1
b = randMaker()
第一个函数获取曲线的所有 cvs 并将它们放在一个列表中
第二个函数读取基本列表中列表的 len 并产生随机数
但我得到这个错误
# Error: line 1: 'builtin_function_or_method' object has no attribute '__getitem__'
# Traceback (most recent call last):
# File "<maya console>", line 9, in <module>
# File "<maya console>", line 3, in randMaker
# TypeError: 'builtin_function_or_method' object has no attribute '__getitem__' #
我没有使用课程。
有人告诉我我的脚本是否正确?
此致