如何以编程方式清除 Maya 脚本编辑器? [英] How can I clear the Maya Script Editor programatically?

查看:102
本文介绍了如何以编程方式清除 Maya 脚本编辑器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在创建和调试脚本时,我为自己生成了大量反馈,但如果我不清除脚本编辑器,我可能会混淆我正在查看的反馈来自哪个尝试.

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.

有没有办法(最好使用 PyMEL,但 MEL 可以)清除脚本编辑器历史记录?

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

推荐答案

尝试:

cmds.scriptEditorInfo(ch=True)

或(PyMEL 版本):

Or (PyMEL version):

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

您还应该查看 python 的内置日志记录模块.它允许您定义日志格式化程序,其中包括生成日志消息的文件名和行号,以便您可以准确地查看事物的来源.

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.

这篇关于如何以编程方式清除 Maya 脚本编辑器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆