Hey Frank, We have the following bug logged for this issue
Bug 29363 Sequences of straightforward operations via Python API fail when in Undo group Sorry for the inconvenience, that's a pretty bad bug from the Hiero days by the looks of things. I'll escalate this internally as we should try and fix this. F. On 25 April 2016 at 08:26, Frank Rueter|OHUfx <fr...@ohufx.com> wrote: > 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 > Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python > -- Frank Harrison Senior Nuke Software Engineer The Foundry Tel: +44 (0)20 7968 6828 - Fax: +44 (0)20 7930 8906 Web: www.thefoundry.co.uk Email: frank.harri...@thefoundry.co.uk
_______________________________________________ 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