In there any API method to perform undo edits?

Hi,
I would like to perform undo edits from my Python script. However, in Gimp.Image, despite the existence of the undo_enable, undo_disable, undo_freeze, undo_thaw, undo_group_start, and undo_group_end methods, there does not appear to be a perform undo method.

Does anyone know how to execute undo edits from a Python script?

Hi! It looks like there’s a feature request for this: Ability to Undo/Redo in a Script (#999) · Issues · GNOME / GIMP · GitLab

It’s implied to be pretty simple, so I’ll see if I can implement it and submit a merge request.

1 Like

Thank you. I’m looking forward it.

It did turn out to be pretty simple: Issue #999: Add PDB to undo/redo actions (!2288) · Merge requests · GNOME / GIMP · GitLab

I’ll wait for Jehan’s confirmation, since any public API we create we’ll be stuck with until GIMP 4, but at least it’s a start. :slight_smile:

2 Likes