How can I capture maya 3d view with QPixmap?
-
29-10-2019 - |
Question
I make a screen capture script for maya. So, I deal the job with QPixmap class.
I write the script like that.
from PyQt4 import QtCore, QtGui
import sip
import maya.cmds as cmds
import maya.OpenMayaUI as mui
def getMayaWindow():
ptr = mui.MQtUtil.mainWindow()
return sip.wrapinstance(long(ptr), QtCore.QObject)
pm = QtGui.QPixmap.grabWindow(getMayaWindow().winId())
pm.save('c:/test.png')
but, it can't grab the 3Dview, so it can't work.
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow