def appendUI():
"""UI for appendPath script"""
#create window with 3 text fields, buttons call up proc to add path
if cmds.window("appendPath", exists=True):
cmds.deleteUI("appendPath")
widgets["win"] = cmds.window("appendPath", t="zbw_appendPath", w=500, h=5, s=False, rtf=True)
#create some menus for saving and loading
cmds.setParent(widgets["win"])
widgets["menu"] = cmds.menuBarLayout()
widgets["menuFile"] = cmds.menu(label="file")
cmds.menuItem(l='Clear Values', c=clearValues)
cmds.menuItem(l="Save Add Paths", c=saveValues)
cmds.menuItem(l="Load Add Paths", c=loadValues)
widgets["tabLO"] = cmds.tabLayout(h=190)
widgets["columnLO"] = cmds.columnLayout("Add Paths", w=500)
widgets["path1"] = cmds.textFieldButtonGrp(l="path1", cal=[(1, "left"), (2,"left"),(3,"left")], cw3=(40, 410, 50), bl="<<<", bc=partial(addToField, 1))
widgets["path2"] = cmds.textFieldButtonGrp(l="path2", cal=[(1, "left"), (2,"left"),(3,"left")], cw3=(40, 410, 50), bl="<<<", bc=partial(addToField, 2))
widgets["path3"] = cmds.textFieldButtonGrp(l="path3", cal=[(1, "left"), (2,"left"),(3,"left")], cw3=(40, 410, 50), bl="<<<", bc=partial(addToField, 3))
cmds.separator(h=10, st="single")
widgets["buttonRCL"] = cmds.rowColumnLayout(nc=3, w=500, cw=[(1,123),(2,247 ),(3,123)])
widgets["addCloseBut"] = cmds.button(l="Add and Close", w=120, h=30, bgc=(.6, .8, .6), c=applyClose)
widgets["addBut"] = cmds.button(l="Add Paths!", w=245, h=30, bgc=(.8, .8, .6), c=apply)
widgets["closeBut"] = cmds.button(l="Close", w=120, h=30, bgc=(.8,.6,.6), c=close)
cmds.setParent(widgets["columnLO"])
cmds.separator(h=5, style="single")
cmds.text("Click the '<<<' buttons to browse for paths to add. Click the 'Add' button to add those \npaths to the 'sys.path' list. Use the 'ViewPath' tab to view current list of paths.", al="center")
cmds.text("Use 'file->save' to save the selected paths. Use 'file->load' to load previously saved paths")
#back to window
cmds.setParent(widgets["tabLO"])
widgets["columnLO2"] = cmds.columnLayout("View Paths", w=500)
cmds.text("Double-click to display full path in script editor")
widgets["listTSL"] = cmds.textScrollList(w=500, h=100, fn="smallPlainLabelFont", append=["click button below", "to refresh this list!"], dcc=printMe)
refresh()
cmds.separator(h=5, style="single")
widgets["columnLO3"] = cmds.columnLayout(w=500)
widgets["refreshBut"] = cmds.button(l="Refresh Paths", w=500, h=20, bgc=(.5, .5, .6), c=refresh)
cmds.rowColumnLayout(nc=3, cw=[(1,200),(2,150 ),(3,150)])
widgets["removeBut"] = cmds.button(l="Remove Selected", w=180, h=20, bgc=(.7, .5, .5), c=removePath)
widgets["topBut"] = cmds.button(l="Selected To Top", w=130, h=20, bgc=(.7, .5, .5), c=topPath)
widgets["bottomBut"] = cmds.button(l="Selected To Bottom", w=130, h=20, bgc=(.7, .5, .5), c=bottomPath)
#load (and check) previous saves
cmds.showWindow(widgets["win"])
cmds.window(widgets["win"], e=True, w=5, h=5, rtf=True)
评论列表
文章目录