zbw_typeFinder.py 文件源码

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

项目:zTools 作者: zethwillie 项目源码 文件源码
def typeFinderUI(*args):
    if cmds.window("typeFinderWin", exists=True):
        cmds.deleteUI("typeFinderWin")

    widgets["win"] = cmds.window("typeFinderWin", w=400, h=400, t="zbw_typeFinder")
    widgets["mainCLO"] = cmds.columnLayout(w=400, h=400, bgc=(.2, .2,.2))

#---------------- right click on an item and get option to replace with parent or go down to shape

    cmds.text(l="Note: Rt-click on the below field to get suggestions from your sub-string")
    cmds.separator(h=10)

    widgets["typeTFBG"] = cmds.textFieldButtonGrp(l="Node Type", bl="Find", cal=[(1,"left"),(2,"left"),(3,"left")], cw=[(1, 75), (2,250), (3, 50)], bc=getObjectList)
    widgets["searchPUM"] = cmds.popupMenu(postMenuCommand=populateMenuItems)

    widgets["searchSelCB"] = cmds.checkBox(l="Only search current selection?", v=0)
    widgets["shpsToXformCB"] = cmds.checkBox(l="List transforms of found shapes (mesh, etc)?", v=1)

    widgets["stringMatchCB"] = cmds.checkBox(l="Additional name/string search?", v=0, changeCommand=toggleStringSearchEnable)
    widgets["stringSearchTFG"] = cmds.textFieldGrp(l="String:", en=False, cal=[(1,"left"),(2,"left")], cw=[(1, 75), (2,250)], changeCommand=getObjectList)


    cmds.separator(h=10)

    widgets["resultsTSL"] = cmds.textScrollList(w=400, h=200, bgc=(0,0,0), allowMultiSelection=True)
#---------------- checkbox here to expand selection? for sets (true-select objects in set, false - just seletc the set)

    widgets["selectAllBut"] = cmds.button(l="Select All in List", h= 30)
    widgets["selectSelBut"] = cmds.button(l="Select Selected in List", h= 30)
    widgets["selectParOfSelBut"] = cmds.button(l="Select Parent/Transform of Selected in List", h= 30)
    widgets["deleteAllBut"] = cmds.button(l="Delete All in List", h= 30)
    widgets["deleteSelBut"] = cmds.button(l="Delete Selected in List", h= 30)
    widgets["clearListBut"] = cmds.button(l="Clear List", h= 30, c=clearScrollList)
    #widgets["connectDecompBut"] = cmds.button(l="Clear List", h= 30, c=clearList)
#---------------- button to promote all shape to transforms?
#---------------- button to select shapes of all in list

    cmds.showWindow(widgets["win"])

#---------------- FUNCTIONS:
#---------------- get current selection (to filter our list)
#---------------- filter our list based on another list
#---------------- promote shapes: given an obj, is it a shape node? if it is, return it's parent
#---------------- stop the process if the list count is more than 100? or 1000?
#---------------- create a confirm dialog func (in zbw_rig?), args = message, buttons? 
#---------------- populate the buttons and related functions
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号