Accessing the undo blocks

Hello,

Is this possible to access the undo blocks from the ui.undo class ?

I found that you can list the stack but it only returns a list of string :

>>> ui.undo.undoStack
['Parameter Change: Global OP Shortcut', 'Move Node', 'Create Sub-Network', 'Move Node', 'Move Node', 'Move Node', 'Move Node', 'Move Node', 'Create TOP:Noise']

I’m trying to create a tool to view the changes of the file. It could also create a changelog file that could be committed when working with git.

Thanks in advance,

It’s not a super-robust system, so those strings are pretty much what you get. What else would you want to access in the undo blocks?

Here’s a component I made that might be of some interest.
historyStack.tox (35.6 KB)

1 Like

I would like to know which OP the change is refered to and by extension which parameter did change, did I just change a value or did I entered a expression for example.

I think of theses use cases when working in teams and versioning tools (git) :

  • I know my project is dirty (with the * in the header after the filename) but to know if there was significant changes would help decide to save it or not.
  • If there is a change log It could help merging project together or decide a version over an other
  • It would be a great help when writing commit messages to remember what has been modified.

For now, the only information is the undoStack list and the dirty member from the COMP class. It could be nice to have a dirty member in the OP class as well.

Python doesn’t have that level of access to the undo info, currently. I’ve asked about similar features, but it is not currently a high priority.

1 Like