【问题标题】:Execute command when UI window is closed | Maya/PythonUI 窗口关闭时执行命令 |玛雅/蟒蛇
【发布时间】:2021-12-02 07:13:10
【问题描述】:

这是我希望应该很简单的一个:

当用户关闭窗口时,如何让我的 UI 窗口执行命令? 我创建了一个在窗口打开时运行的 scriptJob,我想在窗口关闭时运行一个命令来终止它,并避免在不使用该工具时运行任何 scriptJobs。

在 Maya2020 中使用 Python 任何指针都非常感谢

【问题讨论】:

  • 请发布您的代码的相关部分以创建窗口并绑定您的scriptJob

标签: python user-interface maya autodesk


【解决方案1】:

您可以在 scriptJob 命令中添加 parentparameter 以将 scriptJob 附加到 UI 元素,请查看文档:parent - Attaches this job to a piece of maya UI. When the UI is destroyed, the job will be killed along with it.

【讨论】:

  • 谢谢!这正是我所需要的。
猜你喜欢
  • 2018-07-26
  • 2018-03-01
  • 1970-01-01
  • 2013-09-24
  • 1970-01-01
  • 1970-01-01
  • 2018-06-28
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多