maya_warpper.py 文件源码

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

项目:pipeline 作者: liorbenhorin 项目源码 文件源码
def list_referenced_files():
    results = []
    links = cmds.filePathEditor(query=True, listDirectories="")
    for link in links:
        pairs =  cmds.filePathEditor(query=True, listFiles=link, withAttribute=True, status=True)
        '''
        paris: list of strings ["file_name node status ...", "file_name node status ...",...]
        we need to make this large list of ugly strings (good inforamtion seperated by white space) into a dictionry we can use
        '''        
        l = len(pairs)
        items = l/3
        order = {}
        index = 0

        '''
        order: dict of {node: [file_name, status],...}
        '''

        for i in range(0,items):
            order[pairs[index+1]] = [os.path.join(link,pairs[index]),pairs[index+1],pairs[index+2]]
            index = index + 3  

        for key in order:            
            # for each item in the dict, if the status is 0, repath it
            if order[key][2] == "1": 
                results.append([order[key][0],cmds.nodeType(order[key][1])])

    return results
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号