Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command to generate image of a UI session directly from a .gfr script #143

Closed
bentoogood opened this issue Apr 8, 2013 · 3 comments
Closed
Labels
core Issues with core Gaffer functionality docs New user documentation should be created or existing documentation needs to be updated

Comments

@bentoogood
Copy link
Contributor

To automate generation of images for the documentation, it would be nice to be able to call a command from the Gaffer api that reads a .gfr script and generates a 'screen capture' of the UI.
Should avoid actually launching the gaffer UI application if possible.
Some flags would be useful:

  • whether to load the UI layout from the .gfr script or not (default to loading from script)
  • whether to grab the entire UI or just the contents of a single panel or tab (default to entire UI)

how would be handle layouts with floating panels?

@bentoogood
Copy link
Contributor Author

possibly using QtGui.QPixmap.grabWindow/Widget?

example for maya:

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('/tmp/test.png')

@bentoogood
Copy link
Contributor Author

this worked for me in gaffer:

from PyQt4 import QtCore, QtGui
pm = QtGui.QPixmap.grabWindow( QtGui.QApplication.activeWindow().winId() )
pm.save('/tmp/foo.png')

@bentoogood
Copy link
Contributor Author

Addressed by screengrab app #350 #336

Plan is to save gui state as per #306 - saving individual panels maximised if only one editor is required (rather than adding functionality to grab specific widgets).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues with core Gaffer functionality docs New user documentation should be created or existing documentation needs to be updated
Projects
None yet
Development

No branches or pull requests

1 participant