zbw_messageMapper.py 文件源码

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

项目:zTools 作者: zethwillie 项目源码 文件源码
def zbw_mmUI():
    """the UI for the script"""

    if (cmds.window('`UI', exists=True)):
        cmds.deleteUI('zbw_messageMapperUI', window=True)
        cmds.windowPref('zbw_messageMapperUI', remove=True)
    window=cmds.window('zbw_messageMapperUI', widthHeight=(600,400), title='zbw_messageMapper')

    cmds.tabLayout(h=400)
    cmds.columnLayout("mmAddNewConnections", h=400)
    #2nd small column for the persistant UI
    cmds.columnLayout(w=400, h=100)
    cmds.textFieldButtonGrp('zbw_tfbg_baseObj', cal=(1, "left"), cw3=(75, 200, 75), label="base object", w=400, bl="choose object", bc=partial(zbw_mmAddBase, "zbw_tfbg_baseObj", "clear"))

    #button to create new message/obj field groups
    cmds.separator(h=20, st="single")
    cmds.button(w=150, l="add new message attr/obj", c=zbw_mmAddMObjs)
    cmds.separator(h=20, st="single")

    cmds.setParent(u=True)
    cmds.rowColumnLayout("mmRCLayout", nc=2, co=(2, "left", 30))

    #back up to the 2nd columnLayout
    cmds.setParent(u=True)

    cmds.separator(h=20, st="single")
    #create button to delete last pair of text fields
    cmds.button("deleteLastButton", w=150, bgc=(.5,0,0), l="delete last attr/obj pair", c=zbw_mmDeleteLast)
    cmds.separator(h=20, st="double")

    #button to do connect all the attr/messages
    cmds.button("createMessageButton", w=150, bgc=(0,.5,0), l="create messages", c=zbw_mmConnectM)

    #back up to the main column
    cmds.setParent(u=True)
    #back up to the tab
    cmds.setParent(u=True)
    #new tab
    cmds.columnLayout("existingMessages", w=600, h=400)

    #Here we add stuff to the second tab
    cmds.textFieldButtonGrp("mmListMessages", cal=(1, "left"), cw3=(75,200,75), label="baseObject", w=400, bl="choose object", bc=partial(zbw_mmAddBase,"mmListMessages", "noClear"))
    cmds.separator(h=20, st="double")
    #button to create list of message attrs
    cmds.button(w=200, l="list all message attr for base", bgc = (0,.5,0), c=partial(zbw_mmListCurrentMessages, "mmListMessages"))
    cmds.separator(h=20, st="double")
    cmds.text("rt-click on the attr or object to change the connection")
    cmds.separator(h=20, st="double")

    cmds.rowColumnLayout("mmRCTextLayout", w=600, nc=3, cw=[(1, 200),(2,290),(3,100)])
    cmds.text("ATTR")
    cmds.text("OBJECT")
    cmds.text("DELETE")

    cmds.showWindow(window)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号