This is slightly askew to the topic, but does anyone have a way to grab a
"non" active window?
The goal is to take a snapshot of the hypergraph/hypershade etc... during a
shader network export.
So the tool does all this super cool export than fires up the hypershade to
grab a screen shot of the network.
I've currently "cheated" using QT by looping for the widget, then using
QPixmap to save off the widget internals as an image.
Works fine, just messy, and also requires that the window (shade/graph) be
open prior to running i.e. only works on second use.
Cheers for anything you guys may suggest.
On Tuesday, November 27, 2012 3:17:52 PM UTC-8, Python inside Maya wrote:
>
> I am using the following code to screen grab a custom viewport (thanks
> Nathan Horne)
> #Import api modules
> import maya.OpenMaya as api
> import maya.OpenMayaUI as apiUI
>
> #Grab the last active 3d viewport
> view = apiUI.M3dView.active3dView()
>
> #read the color buffer from the view, and save the MImage to disk
> image = api.MImage()
> view.readColorBuffer(image, True)
>
> image.writeToFile('C:/test.png', 'png')
>
> Is there any way to include alpha in the image? I just want the background
> alpha'd out.
> I don't have a lot of API experience in this area and would love any
> pointer (no pun intended) I can get.
>
> Thanks,
> /Christian
>
--
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings:
http://groups.google.com/group/python_inside_maya/subscribe