def saveShaderList(self, *args):
"""
"""
sgs = []
objs = []
connections = {}
#get the shaders
sgs = cmds.ls(type="shadingEngine")
#get the objects assigned to those shaders
for sg in sgs:
objs = cmds.listConnections("%s.dagSetMembers"%sg)
if objs:
connections[sg] = objs
else:
pass
#write these lists out to file
#check if that file exists already . . .
self.path = cmds.textFieldButtonGrp(self.widgets["destinationTFBG"], q=True, tx=True)
#print self.path
file = open(self.path, "w")
#can't write a dictionary
#file.write(connections)
#so. . .
for key in connections.keys():
file.write("%s,%s\n"%(key, connections[key]))
file.close()
评论列表
文章目录