diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-12-16 13:26:21 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-12-16 13:26:21 +0300 |
commit | 21c7689b777ff5f46a3cecbda21f6afa012bdb28 (patch) | |
tree | 8a85b6432f5796733024dc8996ffbb6ea8c7da39 /source/blender/python | |
parent | 18181104592ffee9d21433e0e21f85e2b7f277b1 (diff) |
Animation: send notifier when keyframe is inserted
`<some_id>.keyframe_insert()` now sends a notifier that animation data
was changed, so that animation-related editors can properly refresh.
Since this function is quite high-level (if necessary it creates the
Action and FCurves), I thought this would be a suitable location for the
notifier. If high keyframing speed is required, it is still recommended
to use `FCurveKeyframePoints.insert(options={'FAST'})` instead.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_rna_anim.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index 2096734ef96..9a6339c0a89 100644 --- a/source/blender/python/intern/bpy_rna_anim.c +++ b/source/blender/python/intern/bpy_rna_anim.c @@ -401,6 +401,10 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb return NULL; } + if (result) { + WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL); + } + return PyBool_FromLong(result); } |