-3
這是一個瑪雅Python問題。兩個列表在Python中交互
如何創建一個for循環,使這個
創建兩個列表,一個緩衝區,一個用於MM。 使用此命令,cmds.connectAttr(MM + 'messeage',緩衝區+」。renderPass',F = TRUE)
您可以連接MM緩衝
這是我目前的有:
import maya.cmds as cmds
import maya.mel as mel
import random as rand
import math
bufferls=[]
MMls=[]
for i in range(5):
writeToColor=mel.eval('mrCreateCustomNode -asUtility "" writeToColorBuffer;')
cmds.rename(writeToColor, 'buffer'+str(i))
bufferls.append('buffer'+str(i))
for i in range(2):
MutiMatte = cmds.createNode('renderPass', name=('MM'+str(i)))
cmds.setRenderPassType('MM'+str(i),type='CSTCOL')
MMls.append(MutiMatte)
def n_split(bufferls, n=3):
num_extra = len(bufferls) % n
zipped = zip(*[iter(bufferls)] * n)
return zipped if not num_extra else zipped + [bufferls[-num_extra:], ]
for buffer in n_split(bufferls, 3):
newlists =list(buffer)
print newlists