hehe, we think similar I also tried this. But I don’t need this currently so I gave up.
The best I manage was this grabing of desktop with additionally cropping it to Viewer coordinates.
This works fine but it’s a bit slow (with my 2 monitors setup it’s 1-2s), and is hacky.
globalPos = Viewer.mapToGlobal(QPoint(0, 0))
widgetRect = Viewer.geometry()
widgetRect.moveTopLeft(globalPos )
QPixmap.grabWindow(QApplication.desktop().winId(),widgetRect.x(),widgetRect.y(),widgetRect.width(), widgetRect.height()).save('D:\\screenshot.png', 'png')
Grabbing Viewer widget gave me only blank background without models and even Grid. What is interesting, Skeleton parts were captured on the screenshot. Maybe XRay mode in viewport allowed it.
For grabing widget I used QPixmap.grabWidget() function
For what I read, grabing desktop works in different way than grabing praticular windows or widgets. Maybe some additional vieport refresh is needed…
BTW. did you tried to render one frame ? I mean using File->Render option, but from python and as output choosing only one current frame and JPG format. (but probably jpg is not perfect here because it won’t be displayed by QPixmap…)