zbw_anim_import.py 文件源码

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

项目:zTools 作者: zethwillie 项目源码 文件源码
def import_anim_UI():
    width = 400

    if cmds.window("impAnimWin", exists=True):
        cmds.deleteUI("impAnimWin")

    widgets["win"] = cmds.window("impAnimWin", t="Import anim files", w=width, h=400, rtf=True)
    # widgets["clo"] = cmds.columnLayout()
    widgets["mainTLO"] = cmds.tabLayout()
    widgets["impCLO"] = cmds.columnLayout("Import Anim")
    cmds.text("1. choose the folder where your anim clips live,\n2. select the objs in scene to apply to\n3. 'random' will start anim in frame range\n4. select anim clips from list to randomly apply to objs\n5. press button to apply",al="left")
    cmds.separator(h=10)    
    widgets["impPathTFG"] = cmds.textFieldButtonGrp(l="Anim Path:", bl="<<<", cal = ([1, "left"], [2, "left"], [3, "right"]), cw=([1, 75], [2, 275], [3, 40]), bc=partial(get_path, "import", "impPathTFG"), cc=populate_tsl)
    widgets["randRBG"] = cmds.radioButtonGrp(l="Insert Placement:", nrb=2, l1="Random Start", l2="At current Frame", sl=1, cal=([1, "left"], [2,"left"], [3,"left"]), cw=([1,100], [2, 100], [3, 100]), cc=partial(toggle_enable, "randRBG", "rangeIFG"))
    widgets["rangeIFG"] = cmds.intFieldGrp(l="Random Start Range:", nf=2, v1=0, v2=100, cw=([1, 120], [2, 50], [3, 50]), cal=([1, "left"], [2, "left"], [3, "left"]))
    widgets["delCBG"] = cmds.checkBoxGrp(l="Delete subsequent keys?", v1=True, cal=([1, "left"], [2, "left"]), cw=([1, 130], [2, 20]))
    cmds.separator(h=10)    
    widgets["animTSL"] = cmds.textScrollList(w=400, h=150, allowMultiSelection=True)
    cmds.separator(h=10)    
    widgets["importBut"] = cmds.button(l="Import random anim from selection", h=40, w=width, bgc=(.5, .8, .5), c=import_animation)

    cmds.setParent(widgets["mainTLO"])
    widgets["expCLO"] = cmds.columnLayout("Export Anim")
    cmds.text("1. Select the obj 2. choose a path and name the anim\n3. choose range and hierarchy 4. press button!", al="left")
    cmds.separator(h=10)
    widgets["expPathTFG"] = cmds.textFieldButtonGrp(l="Export Path:", bl="<<<", cal = ([1, "left"], [2, "left"], [3, "right"]), cw=([1, 75], [2, 275], [3, 40]), bc=partial(get_path, "export", "expPathTFG"))
    widgets["nameTFG"] = cmds.textFieldGrp(l="Animation Name:", cw=([1, 100], [2, 250]), cal=([1, "left"], [2, "left"]))    
    widgets["selRBG"] = cmds.radioButtonGrp(l="Hierarchy:", nrb=2, l1="Selection Only", l2="Below", sl=2, cal=([1, "left"], [2,"left"], [3,"left"]), cw=([1,75], [2, 100], [3, 100]))
    widgets["expRngRBG"] = cmds.radioButtonGrp(l="Time Range:", nrb=2, l1="Start_End", l2="All", sl=2, cal=([1, "left"], [2,"left"], [3,"left"]), cw=([1,75], [2, 100], [3, 100]), cc=partial(toggle_enable, "expRngRBG", "expRngIFG"))
    widgets["expRngIFG"] = cmds.intFieldGrp(nf=2, en=False, l="Start_End", v1=1, v2=10, cal=([1, "left"], [2,"left"], [3,"left"]), cw=([1,75], [2, 100], [3, 100]))
    cmds.separator(h=10)    
    widgets["exportBut"] = cmds.button(l="Export anim from selection", h=40, w=width, bgc=(.5, .8, .5), c=export_animation)

    cmds.window(widgets["win"], e=True, w=5, h=5, rtf=True)
    cmds.showWindow(widgets["win"])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号