How can I clear the Maya Script Editor programatically?

戏子无情 提交于 2021-02-07 20:35:45

问题


While creating and debugging scripts, I generate lots of feedback for myself, but if I don't clear the Script Editor, I can get confused about which attempt the feedback I'm looking at came from.

Is there a way (preferably with PyMEL, but MEL is ok) to clear the Script Editor History?


回答1:


Try:

cmds.scriptEditorInfo(ch=True)

Or (PyMEL version):

import pymel.core as pm
pm.scriptEditorInfo(clearHistory=True)

You should also take a look at python's built-in logging module. It allows you to define logging formatters which include the file name and line number where the log message was generated so you can see precisely where things came from.



来源:https://stackoverflow.com/questions/35313339/how-can-i-clear-the-maya-script-editor-programatically

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!