diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2022-03-07 14:31:36 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2022-03-07 14:36:47 +0300 |
commit | 4ffe2fec169c67655aad6a866be3a949b4062108 (patch) | |
tree | 347e8052ee29561beb70225e65499911df8d494a /source/blender/blendthumb | |
parent | 548eabbaa14fb6bcdc927333b7d912eea0c61a59 (diff) |
Python: Add new `annotation_pre` & `annotation_post` handlers
Annotation tool is used as a general mark tool for many add-ons. To be able to detect when an annotation is done is very handy to integrate the annotation tool in add-ons and other studio workflows.
The new callback names are: `annotation_pre` and `annotation_post`
Both callbacks are exposed via the Python module `bpy.app.handlers`
Example use:
```
import bpy
def annotation_starts(gpd):
print("Annotation starts")
def annotation_done(gpd):
print("Annotation done")
bpy.app.handlers.annotation_pre.clear()
bpy.app.handlers.annotation_pre.append(annotation_starts)
bpy.app.handlers.annotation_post.clear()
bpy.app.handlers.annotation_post.append(annotation_done)
```
Note: The handlers are called for any annotation tool, including eraser.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D14221
Diffstat (limited to 'source/blender/blendthumb')
0 files changed, 0 insertions, 0 deletions