diff options
author | Sergey Sharybin <sergey@blender.org> | 2020-09-18 17:57:33 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2020-09-21 13:25:45 +0300 |
commit | 216a2218768d005c18032df370c19c1c0f571797 (patch) | |
tree | 20ec81038b82e567fc67f225bc1f7057dcaccb1f /source/blender/editors/animation/anim_markers.c | |
parent | 3791dbea1e796f96440437333e4318066f26bde2 (diff) |
Implement ID properties support for TimeMarker
Allows scripters to store additional information in the marker itself instead
of using work-around approach based on marker names and such.
Differential Revision: https://developer.blender.org/D8944
Diffstat (limited to 'source/blender/editors/animation/anim_markers.c')
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 6298ae16d8b..d60b217593f 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -36,6 +36,7 @@ #include "BKE_context.h" #include "BKE_fcurve.h" +#include "BKE_idprop.h" #include "BKE_layer.h" #include "BKE_main.h" #include "BKE_report.h" @@ -1104,6 +1105,10 @@ static void ed_marker_duplicate_apply(bContext *C) newmarker->camera = marker->camera; #endif + if (marker->prop != NULL) { + newmarker->prop = IDP_CopyProperty(marker->prop); + } + /* new marker is added to the beginning of list */ // FIXME: bad ordering! BLI_addhead(markers, newmarker); @@ -1458,6 +1463,10 @@ static int ed_marker_delete_exec(bContext *C, wmOperator *UNUSED(op)) for (marker = markers->first; marker; marker = nmarker) { nmarker = marker->next; if (marker->flag & SELECT) { + if (marker->prop != NULL) { + IDP_FreePropertyContent(marker->prop); + MEM_freeN(marker->prop); + } BLI_freelinkN(markers, marker); changed = true; } |