Damn, that's annoying. Are there any workarounds? Should I do something "not so straight forward" to trigger this? :-D
Like create a dummy bin item and delete it again when my script is finished?

I was about to publish an interactive tool for changing the poster frames in the bin (on Nukepedia), but without this working it will flood the undo buffer with useless undoes, which might cause trouble in production.


Cheers,
frank

On 04/25/2016 08:41 PM, Frank Harrison wrote:
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 <mailto: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
    <mailto: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 <http://www.thefoundry.co.uk>
Email: frank.harri...@thefoundry.co.uk <mailto: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

_______________________________________________
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