尝试关闭窗口时似乎是一个问题。
下面是代码:
import maya.cmds as cmds
def shapeTool ():
ram = 'RenamerWin'
if cmds.window(ram, q = True, exists =True):
cmds.deleteUI(ram)
ram = cmds.window("RenamerWin",t = "Shape Tool", w=300, h=300)
cmds.columnLayout(adj = True)
cmds.separator(h=20)
cmds.text("Welcome to the Shape Creator")
cmds.separator(h=20)
cmds.button(label='Close Window',command="cmds.deleteUI('%s')")
cmds.showWindow(ram)
shapeTool()
答案 0 :(得分:3)
你错过了格式:)
cmds.button(label='Close Window',command="cmds.deleteUI('%s')" % ram)