Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
目前我正在使用maya,我想在关闭窗口时执行命令。到目前为止,我还没有找到任何解决方案来在单击 Windows X 按钮时运行命令,除了创建自定义按钮并使用 deleteUI .. 是否有标志或其他更容易的东西?
您可以使用 scriptJob。它将根据您的条件在后台运行一个进程。
from pymel.core import * win = window() win.show() def uiDel(ui): print ui, "deleted" scriptJob(uid=[win.name(), "uiDel(win.name())"])
现在当 ui 关闭或按下 X 按钮时,它会打印“window1 deleted”。