maya_warpper.py 文件源码

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

项目:pipeline 作者: liorbenhorin 项目源码 文件源码
def repath(node, file, project_path):
    matches = []
    for root, dirnames, filenames in os.walk(project_path):
        for x in filenames:
            if x == file:
                matches.append([root,os.path.join(root, x)]) 
            elif x.split(".")[0] == file.split(".")[0]: #---> this second option is used when a file is useing ##### padding, we can match by name only

                x_ext = x.split(".")[len(x.split("."))-1]
                file_ext = file.split(".")[len(file.split("."))-1]
                if x_ext == file_ext:
                    matches.append([root,os.path.join(root, x)])


    if len(matches)>0:   
        return cmds.filePathEditor(node, repath=matches[0][0])      

    return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号