1

我找到了一个 SAFRONOV 3D 的脚本(在 youtube 上),它允许他使图形编辑器在 Maya 中透明......问题是它适用于 Maya 2014,我正在尝试将其更新到 2017。

我对 opne maya 知之甚少,我是 pymel 的初学者,一些帮助会很棒。怎么了?:

import maya.cmds as cmds
import maya.OpenMayaUI as mui
import shiboken2
import maya.mel as mel
from PySide2 import QtGui
mel.eval('GraphEditor')

def getGraphEditor():
    ptr2 = mui.MQtUtil.findLayout("graphEditor1Window|TearOffPane")
    return shiboken2.wrapInstance(long(ptr2), QtGui.QWidget)

graphEditor = getGraphEditor()
graphEditor.setWindowOpacity(0.5)

def ref(value):
    graphEditor.setWindowOpacity(value)

cmds.floatSlider(p="graphEditor1Window|TearOffPane|graphEditor", min = 0.1 , max = 1.0, v = 0.7, dc = lambda x:ref(x))
4

1 回答 1

2

这是我更新的脚本:

import maya.cmds as cmds
import maya.OpenMayaUI as mui
from PySide2 import QtWidgets
import shiboken2

if cmds.window("GEW", exists=True): cmds.deleteUI("GEW", window=True) 
cmds.window( "GEW", title="Graph Editor +" )
cmds.paneLayout( configuration='single' )
cmds.scriptedPanel( type='graphEditor' )
cmds.columnLayout (adj=1)
cmds.floatSlider(min=0.1, max=1.0, v=0.7, dc=lambda x:ref(x))
cmds.showWindow("GEW")

GEQ = shiboken2.wrapInstance(long(mui.MQtUtil.findWindow( "GEW" )), QtWidgets.QWidget)
def ref(value): GEQ.setWindowOpacity(value)
GEQ.setWindowOpacity(0.7)
于 2017-08-27T14:56:16.533 回答