我已经使用Maya文档中的命令从头创建了一个ui。 ,我已经写了下面的功能适用两种scenerios:maya关闭窗口信号
- 当用户点击到另一个按钮 - 导入,其中还会像它写的代码,然后用下面的关闭关闭功能(请参阅
readFile
函数) - 当用户点击按钮时关闭UI而不运行任何内容。
在我的剧本,以应付上述两种情况下,我写为下面的其中closeWindow
是迎合Scenario1和cancelWindow
是迎合Scenario2
def ui(self):
...
cancelButton = cmds.button(label='Cancel', command=self.cancelWindow, width=150, height=35)
def closeWindow(self, *args):
cmds.deleteUI(self.window, window=True)
def cancelWindow(self, *args):
cmds.delete(camSel[0])
cmds.deleteUI(self.window, window=True)
def readFile(self, *args):
...
self.closeWindow()
这样,是有可能创造一些通过结合上述2(自动+手动),看到类似于PyQt(clicked(),returnPressed()等)的信号,看到deleteUI
命令的用法是相同的?