GNOME Bugzilla – Bug 773796
Ability to Undo/Redo in a Script
Last modified: 2018-05-24 17:08:23 UTC
Right now in Python & Scheme scripting you can freeze/thaw, disable/enable, and group the undo history. However, despite all of this there's no way to actually navigate the undo history. Example: Say I made a Python plugin that moves some layers around on the canvas. If I wanted to revert the movement for whatever reason, I'd have to move all of the layers a second time in reverse, which is not only messy, but lossy if interpolation was used somewhere (like rotation). It'd be much better to simply type image.undo() (or use the PDB function), like how you can already type image.undo_freeze() and such.
Looks to me like having some undo/redo functions in our API (and even functions for "viewing" the history) would be useful indeed. There are use cases. That should also not be too hard to implement, so I set the "newcomers" keyword.
Hi, I would like to help with this. Is this still available and if so, is there a good starting point to go from? Thank you
Hello Rahul, Yes this is still not implemented. I'd say that the first step would be to check up with us on IRC, just to be sure. Personally I think this could be useful, but I think there was at least one person who doubted the usefulness of such an API. Technically, just grep in our code to find our undo internal API, and then just make this available under libgimp/. I see we already have a `libgimp/gimpimageundo_pdb.c` (where we can do undo groups, freeze and thaw the undo, etc.). I guess a new undo-related function could go in there.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/999.