Has anybody managed to get the undo to work in Hiero?
It works fine when running the example in the script editor, but once the undo block is triggered from a QAction it doesn't seem to register at all. Below is some example code to show what I'm doing. The custom dialog drives poster frames in the bin while it's open.
Any ideas how to get this to work?

Cheers,
frank

class DoCustomStuff(QtGui.QAction):

    def __init__(self):
        QtGui.QAction.__init__(self, "Do Custom Stuff", None)
        self._selection = None
        self.triggered.connect(self.doStuff)
hiero.core.events.registerInterest("kShowContextMenu/kBin", self.eventHandler)

    def eventHandler(self, event):
        view = event.sender
        event.menu.addAction(self)

    def doStuff(self):
        view = hiero.ui.activeView()
        selectedBinItems = view.selection()
selectedClipItems = [(item.activeItem() if hasattr(item,'activeItem') else item) for item in selectedBinItems]
        project = selectedClipItems[0].project()
        project.beginUndo('franks stuff') # THIS DOES NOT WORK
        dialog = CustomDialog(selectedClipItems)
dialog.exec_() # poster frames are changed interactively while the custom dialog is up.
        project.endUndo() # THIS DOES NOT WORK



_______________________________________________
Nuke-python mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python

Reply via email to