diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-02-09 04:05:40 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-02-09 04:05:40 +0300 |
commit | 99c1a9a427f3a1d6f3007ace54aed76966973c6c (patch) | |
tree | 1eaaf9bc596b4045da7d6748ecc05c42f23c278d /source | |
parent | adfbb83cdfc22e44f0226da7a9dd7afa7ebc6e4a (diff) |
Bugfix [#25987] Duplicated markers naming issue
One-liner fix - a missing "OPERATOR_FINISHED" on the select operator
was causing problems renaming markers and potentially with other
operations too!
To find this bug, I added debug method to dump the list of markers to
console. This has revealed some troublesome things about the way
markers are organised, which IMO need to be addressed.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 58dc5008959..4a39534d566 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -264,6 +264,29 @@ TimeMarker *ED_markers_get_first_selected(ListBase *markers) return NULL; } +/* --------------------------------- */ + +/* Print debugging prints of list of markers + * BSI's: do NOT make static or put in if-defs as "unused code". That's too much trouble when we need to use for quick debuggging! + */ +void debug_markers_print_list(ListBase *markers) +{ + TimeMarker *marker; + + if (markers == NULL) { + printf("No markers list to print debug for\n"); + return; + } + + printf("List of markers follows: -----\n"); + + for (marker = markers->first; marker; marker = marker->next) { + printf("\t'%s' on %d at %p with %d\n", marker->name, marker->frame, marker, marker->flag); + } + + printf("End of list ------------------\n"); +} + /* ************* Marker Drawing ************ */ /* function to draw markers */ @@ -868,6 +891,7 @@ static void ed_marker_duplicate_apply(bContext *C) #endif /* new marker is added to the begining of list */ + // FIXME: bad ordering! BLI_addhead(markers, newmarker); } } @@ -996,8 +1020,8 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera) WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL); WM_event_add_notifier(C, NC_ANIMATION|ND_MARKERS, NULL); - /* allowing tweaks */ - return OPERATOR_PASS_THROUGH; + /* allowing tweaks, but needs OPERATOR_FINISHED, otherwise renaming fails... [#25987] */ + return OPERATOR_FINISHED|OPERATOR_PASS_THROUGH; } static int ed_marker_select_invoke(bContext *C, wmOperator *op, wmEvent *evt) |