嗨,我正在使用Pyqt4在Maya中制作UI,但我希望当用户打开或更改场景时,UI关闭或刷新。
在python中有没有一种方法可以检测到这种变化?
发布于 2013-05-23 03:07:08
scriptJob就是您所需要的。
下面的一些自定义可能会有所帮助。
import maya.cmds as cmds
def refresher():
# the function which does the closing/refreshing
pass
cmds.scriptJob(e=["NewSceneOpened", refresher])
cmds.scriptJob(e=["SceneOpened", refresher])
cmds.scriptJob(e=["flushingScene", refresher])https://stackoverflow.com/questions/16698560
复制相似问题