I played around with something similar to dump the viewer's GL texture to a file. The ugliest part is grabbing the widget you want, as the hierarchy of widgets in the UI will be completely different depending on the the Nuke layout. I haven't tried all the tricks in the book, but at this point, I think the only way to grab to the one you want is to recurse through the object hierarchy until you find the one you want:

from PySide import QtGui

def findDagWidget():
   stack = QtGui.qApp.topLevelWidgets()
   while stack:
       widget = stack.pop()
       if widget.windowTitle() == 'Node Graph':
# You should probably be a little safer with this return, but the actual DAG widget # seems to be here consistently... if not, it should be the only child of 'widget'
           # that's a QWidget instance.
           return widget.children()[-1]
       stack.extend(c for c in widget.children() if c.isWidgetType())


Also, in the case of Viewer widgets, any layout changes destroy the underlying C++ object. This may not be the case with the DAG, since I think there can only be one per group, but I would definitely play with that. Also, if you're just installing an event handler, that shouldn't be much of an issue.

I've tested simple keypress and PaintEvent handlers, and both seem to work fine. I can send along the basic code if you're interested, but I imagine you're probably familiar with what you want to do at that point.

Anyway, hope this helps some.

-Nathan


-----Original Message----- From: Ben Dickson
Sent: Thursday, March 14, 2013 2:07 AM
To: Nuke Python discussion
Subject: [Nuke-python] PySide painting over nodegraph?

Almost certain the answer is "nope", but:

Is it possible to do custom drawing on the node graph? In the same way
you can have a PySide knob in a node or Panel, and implement a custom
'paint' method for that knob

I'm looking for some hacky method of doing this (since there's no
supported way), maybe along the lines of an eventFilter to intercept the
paint event from the nodegraph widget. Any ideas?
--
ben dickson
2D TD | ben.dick...@rsp.com.au
rising sun pictures | www.rsp.com.au
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to