Skip to content

Instantly share code, notes, and snippets.

@zeffii
Created January 6, 2019 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeffii/5ab3c3ceb513b147c106846cd92a49fe to your computer and use it in GitHub Desktop.
Save zeffii/5ab3c3ceb513b147c106846cd92a49fe to your computer and use it in GitHub Desktop.
import bpy
from bpy.app.handlers import persistent
@persistent
def handler_undo_pre(scene):
print('pre')
@persistent
def handler_undo_post(scene):
print('post')
if __name__ == '__main__':
bpy.app.handlers.undo_pre.append(handler_undo_pre)
bpy.app.handlers.undo_post.append(handler_undo_post)
# bpy.app.handlers.undo_pre.remove(handler_undo_pre)
# bpy.app.handlers.undo_post.remove(handler_undo_post)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment