def zbw_mmChangeConnectAttr(base, attr, obj, *args):
#get that from the text field
newAttr = cmds.textFieldGrp("zbw_mmChangeAttrTFG", q=True, tx=True)
#delete old attr
cmds.deleteAttr(attr)
#create new attr
cmds.addAttr(base, at="message", ln=newAttr)
#create connection to obj in new attr
cmds.connectAttr((obj+".message"), (base+"."+newAttr), f=True)
#when you delete, then run the whole proc again afterwards (to clean up the nums)
cmds.deleteUI('zbw_mmChangeAttrUI', window=True)
cmds.windowPref('zbw_mmChangeAttrUI', remove=True)
cmds.deleteUI("mmRCListLayout")
zbw_mmListCurrentMessages("mmListMessages")
评论列表
文章目录