def zbw_mmChangeConnectAttrUI(base, attr, obj, *args):
if (cmds.window('zbw_mmChangeAttrUI', exists=True)):
cmds.deleteUI('zbw_mmChangeAttrUI', window=True)
cmds.windowPref('zbw_mmChangeAttrUI', remove=True)
window=cmds.window('zbw_mmChangeAttrUI', widthHeight=(400,80), title='zbw_messageMapper_changeAttrName')
cmds.columnLayout()
#show old attr name
cmds.text("old attribute name: " + attr)
#asks for the new attr name
cmds.textFieldGrp("zbw_mmChangeAttrTFG", l="new attr name (just attr name)")
#button to do it (pass along attr, obj)
cmds.button("zbw_mmChangeAttrB", l="change attr!", c=partial(zbw_mmChangeConnectAttr, base, attr, obj))
cmds.showWindow(window)
#force window to size
cmds.window('zbw_mmChangeAttrUI', e=True, widthHeight = (400,80))
pass
评论列表
文章目录