zbw_scriptList.py 文件源码

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

项目:zTools 作者: zethwillie 项目源码 文件源码
def getScripts(*args):

    #### here we should search all possible places, create a separate tab for each location (folder name?)

    #get the script path
    usd = cmds.internalVar(usd=True)
    print usd
    #get list of files there
    fls = os.listdir(usd)
    fls.sort()

########### check whether the thing is a folder or not, should really just sort for .mel and .py, not exclude as I'm doing
########### sort files (by name)
    counter = 1
    for fl in fls:
        print fl
        if (fl.rpartition(".")[2] != "pyc") and (fl[-1] != "~"):
            #if not in our dictionary, color it red
            if (fl.rpartition(".")[0] in pythonRun):
                cmds.textScrollList(widgets["list"], e=True, a=fl, lf = (counter, "boldLabelFont"))

            elif (fl.rpartition(".")[2] == "mel"): 
                cmds.textScrollList(widgets["list"], e=True, a=fl, lf = (counter, "boldLabelFont"))

            else:
                #print "%s doesn't have its' shit together"%fl
                cmds.textScrollList(widgets["list"], e=True, a=fl, lf = (counter, "smallObliqueLabelFont"))

            counter +=1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号