zbw_shaderSaver.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:zTools 作者: zethwillie 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号