[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34727] trunk/blender/source/blender/ editors/animation/anim_markers.c: Bugfix [#25987] Duplicated markers naming issue

Joshua Leung aligorith at gmail.com
Wed Feb 9 02:05:43 CET 2011


Revision: 34727
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34727
Author:   aligorith
Date:     2011-02-09 01:05:40 +0000 (Wed, 09 Feb 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/animation/anim_markers.c

Modified: trunk/blender/source/blender/editors/animation/anim_markers.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_markers.c	2011-02-09 00:52:53 UTC (rev 34726)
+++ trunk/blender/source/blender/editors/animation/anim_markers.c	2011-02-09 01:05:40 UTC (rev 34727)
@@ -264,6 +264,29 @@
 	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 @@
 #endif
 
 			/* new marker is added to the begining of list */
+			// FIXME: bad ordering!
 			BLI_addhead(markers, newmarker);
 		}
 	}
@@ -996,8 +1020,8 @@
 	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)




More information about the Bf-blender-cvs mailing list