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.
在创建和调试脚本时,我会为自己生成大量反馈,但如果我不清除脚本编辑器,我可能会对我正在查看的反馈来自哪个尝试感到困惑。
有没有办法(最好使用 PyMEL,但 MEL 可以)清除脚本编辑器历史记录?
尝试:
cmds.scriptEditorInfo(ch=True)
或者(PyMEL 版本):
import pymel.core as pm pm.scriptEditorInfo(clearHistory=True)
您还应该看看 python 的内置日志记录模块。它允许您定义日志格式化程序,其中包括生成日志消息的文件名和行号,以便您可以准确地看到事情的来源。