Callback on bpy.prop undo?

Is there any way to register a function that gets triggered on a property undo event ? Just like you can register a function for property update, get, or set events.

And btw, why properties registered in the WindowManager doesn’t work with undo/redo ?

There is no way to register for a property undo event, because Blender’s undo system does not work per property. It effectively reloads the entire scene on undo, there is no information about which properties specifically changed.

User interface data is not part of the undo system, and the window manager is part of the user interface. Only scene data changes are undone, the UI stays the same. It may be more appropriate to attach the data you want to be undo-able to a scene or object, it depends.

1 Like

Got it, thank you @brecht.

I’m editing the user interface settings from an addon and I was looking for a workaround to make it work with undo/redo. But looks like I’ll have to drop the idea.