如何使用Maya(使用Python)中的自定义图编辑器手动互动



我一直在练习python/mel编码,并且对创建图形编辑器感兴趣。我在网上进行了大量研究,并发现了一个以前的问题(在3D视图中实际取消选择后,如何在Outliner中选择一个对象?(,这对我有很大帮助。但是,我有一个问题是我无法手动编辑生成的曲线。我不确定为什么会发生这种情况,并且似乎找不到任何清晰的文档。(我在Maya中查找了Mel/Python的命令参考,但似乎没有详细的解释(。

更清楚,我的目标是使用鼠标根据密钥帧数据(就像Maya自己的图形编辑器一样(移动曲线信息。我正在使用上一个示例中的代码解决方案(编辑以包括我自己的选择连接和框架约定(。

因此,经过一些研究,我认为最简单的事情是在我的界面中使用Maya自己的图形编辑器

# GRAPH ROW
# Section for the graph editor to allow the user to change attributes
paneLayout( configuration='single', parent=form, width=620, height=320 )
# queries Maya's graph editor and places it within my frame
graph = cmds.getPanel(scriptType='graphEditor')
cmds.scriptedPanel( graph[0], e=True, unParent=True)
cmds.scriptedPanel( graph[0], e=True, parent=frame1)

最新更新