Access to the history stack

Hi,

I’m working with on a Blender add-on for Mozilla Hubs, and we are doing some things in the add-on that require access to the history stack to know both the previous and current undo step types (whether it’s an undo or a redo) and their names. We know that there are undo_post and redo_post handlers but they don’t expose any information about the history stack so that’s not useful in our case. To work around this, we’ve ended up redirecting the C level stdout to bring the output of window_manager.print_undo_steps() back into Python in order to read the stack, but that has it’s own set of issues. Hooking into native DNA structs doesn’t seem to be the best thing to do either as that can change at anytime and that would also break things. So we are wondering if adding some more information to the undo_post and redo_post handlers would be something that you would be open to considering as an API enhancement. We are happy to contribute that work but we want to first make sure that this is something you are open to having, or see if there is another, better approach that you can think of or have discussed in the past that we could help with.

Thanks!

5 Likes