Maya Python Toggle(Hotkey)命令

时间:2015-09-15 21:04:02

标签: python maya

我有两行代码如下:

隐藏未选中的所有曲线:

mel.eval('isolateAnimCurve true graphEditor1FromOutliner graphEditor1GraphEd;')

带回所有曲线:

mel.eval('isolateAnimCurve false graphEditor1FromOutliner graphEditor1GraphEd;')

需要放入一个可以切换的函数(python),所以我可以将它用作maya中的热键。

1 个答案:

答案 0 :(得分:0)

def hideCurves():
    mel.eval('isolateAnimCurve true graphEditor1FromOutliner graphEditor1GraphEd;')

cmds.nameCommand( 'hideAllCurves', annotation='Hide Curves', command='python("hideCurves()")')
cmds.hotkey( k='F5', alt=True, name='hideAllCurves' )

这是纯粹的python方式,但我严重怀疑你想要调查hotkey editor