如何拥有我们自己的脚本编辑器

实现很简单,而且还会自动显示帮助,省去来回切换maya帮助的烦恼了。

1
2
3
4
5
6
7
8
9
10
11
12
import maya.cmds as mc
def myScriptEditor():
 
    if mc.window('myPyScriptEditor', exists=True):
        mc.deleteUI('myPyScriptEditor')
    mc.window("myPyScriptEditor", title="My Python Script Editor")
    mc.columnLayout(adjustableColumn=True)
    mc.cmdScrollFieldReporter(height=200)
    mc.cmdScrollFieldExecuter(height=200, sourceType='python')
    mc.showWindow()
 
myScriptEditor()

把sourceType=’python’ 换成 sourceType=’mel’ 就可以成为mel的编辑器了。

Comments (0)

› No comments yet.

Leave a Reply

*

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>