def spaceMatchUI():
if (cmds.window("spaceMatchWin", exists=True)):
cmds.deleteUI("spaceMatchWin", window=True)
widgets["window"] = cmds.window("spaceMatchWin", title="Space Matcher", w=250, h=300)
widgets["mainLO"] = cmds.columnLayout()
widgets["tabLO"] = cmds.tabLayout()
widgets["getObjCLO"] = cmds.columnLayout()
widgets["instruct"] = cmds.text("get obj, then attr, then space then do it")
cmds.separator(h=10)
#----------fill with selection automatically?
widgets["objTFG"] = cmds.textFieldGrp(l="select obj", cw=([1,50],[2,150],[3,50]), cal=([1,"left"], [2,"left"],[3,"left"]), cc=clearList)
widgets["matchObjButton"] = cmds.button(l="select object", c=partial(getObj, widgets["objTFG"]))
cmds.separator(h=10)
#-----------maybe here have it catch the selected obj by default
#-----------and/or have a field for the attribute (default to "follow")
widgets["getAttrButton"] = cmds.button(w=250, al="center", h=20, l="select enum space attr from obj", bgc= (.5, .5, 0), c=getAttr)
#-----------when the attr is selected list the attrs automagically,
widgets["spacesTSL"] = cmds.textScrollList(w=250, h=200, nr=8, ams=False, bgc=(.2, .2, .2))
widgets["matchButton"] = cmds.button(w=250, al="center", h=40, bgc= (0,.5,0), l="space switch/match", c= doSpaceMatch)
#tab for creation/setup of matching
cmds.setParent(widgets["tabLO"])
#----------in this tab, create frames. One (closable) to create constraint and fill items, check boxes for orient, position (with user selecting objects), one frame (maybe already filled out) (always open) for setting up attrs (message, strings)
widgets["setupCLO"] = cmds.columnLayout()
#frame layout for creating the constraints
widgets["createFrameLO"] = cmds.frameLayout(l="create Constrants", collapsable=True, w=250)
cmds.text("have em select for constraint")
widgets["posRotCBG"] = cmds.checkBoxGrp(ncb=2, l1="translation", v1=True, l2="rotation", v2=True)
#----------this button should just create the constraints on the objects in question, but then fill in what parts of the lower half it can
widgets["createSetupButton"] = cmds.button(l="create constraints")
cmds.setParent(widgets["setupCLO"])
#frameLayout for setting up the attrs
widgets["setupFrameLO"] = cmds.frameLayout(l="setup matching", collapsable=False, w=250, h=250)
widgets["setupObjTFG"] = cmds.textFieldGrp(l="select ctrl obj", cw=([1,100],[2,150]), cal=([1,"left"], [2,"left"]))
widgets["setupObjButton"] = cmds.button(l="get ctrl object", h=40, c= partial(getObj, widgets["setupObjTFG"]))
widgets["setupConstrTFG"] = cmds.textFieldGrp(l="constraint", cw=([1,100],[2,150]), cal=([1,"left"], [2,"left"]))
widgets["setupConstrButton"] = cmds.button(l="get constraint", h=40, c= partial(getObj, widgets["setupConstrTFG"]))
#create list of attrs on constraint
#attr = cmds.listAttr(sel,ud=True )
#create list of spaces on obj attr
cmds.tabLayout(widgets["tabLO"], e=True, tabLabel = ((widgets["getObjCLO"], "change spaces"),(widgets["setupCLO"], "setup matching")))
cmds.showWindow(widgets["window"])
cmds.window(widgets["window"], e=True, w=250, h=300)
评论列表
文章目录