[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19102] branches/blender2.5/blender/source /blender/editors: Made animation-editor copy/ paste operators use reports-api for reporting errors instead of console prints .

Joshua Leung aligorith at gmail.com
Tue Feb 24 12:23:08 CET 2009


Revision: 19102
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19102
Author:   aligorith
Date:     2009-02-24 12:23:04 +0100 (Tue, 24 Feb 2009)

Log Message:
-----------
Made animation-editor copy/paste operators use reports-api for reporting errors instead of console prints.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/space_action/action_edit.c
    branches/blender2.5/blender/source/blender/editors/space_graph/graph_edit.c

Modified: branches/blender2.5/blender/source/blender/editors/space_action/action_edit.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_action/action_edit.c	2009-02-24 11:18:24 UTC (rev 19101)
+++ branches/blender2.5/blender/source/blender/editors/space_action/action_edit.c	2009-02-24 11:23:04 UTC (rev 19102)
@@ -68,6 +68,7 @@
 #include "BKE_material.h"
 #include "BKE_object.h"
 #include "BKE_context.h"
+#include "BKE_report.h"
 #include "BKE_utildefines.h"
 
 #include "UI_view2d.h"
@@ -290,8 +291,8 @@
 	}
 	else {
 		if (copy_action_keys(&ac)) {	
-			// XXX errors - need a way to inform the user 
-			printf("Action Copy: No keyframes copied to copy-paste buffer\n");
+			BKE_report(op->reports, RPT_ERROR, "No keyframes copied to keyframes copy/paste buffer");
+			return OPERATOR_CANCELLED;
 		}
 	}
 	
@@ -331,8 +332,8 @@
 	}
 	else {
 		if (paste_action_keys(&ac)) {
-			// XXX errors - need a way to inform the user 
-			printf("Action Paste: Nothing to paste, as Copy-Paste buffer was empty.\n");
+			BKE_report(op->reports, RPT_ERROR, "No keyframes to paste");
+			return OPERATOR_CANCELLED;
 		}
 	}
 	

Modified: branches/blender2.5/blender/source/blender/editors/space_graph/graph_edit.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_graph/graph_edit.c	2009-02-24 11:18:24 UTC (rev 19101)
+++ branches/blender2.5/blender/source/blender/editors/space_graph/graph_edit.c	2009-02-24 11:23:04 UTC (rev 19102)
@@ -68,6 +68,7 @@
 #include "BKE_material.h"
 #include "BKE_object.h"
 #include "BKE_context.h"
+#include "BKE_report.h"
 #include "BKE_utildefines.h"
 
 #include "UI_view2d.h"
@@ -294,8 +295,8 @@
 	
 	/* copy keyframes */
 	if (copy_graph_keys(&ac)) {	
-		// XXX errors - need a way to inform the user 
-		printf("Graph Copy: No keyframes copied to copy-paste buffer\n");
+		BKE_report(op->reports, RPT_ERROR, "No keyframes copied to keyframes copy/paste buffer");
+		return OPERATOR_CANCELLED;
 	}
 	
 	/* set notifier tha things have changed */
@@ -330,8 +331,8 @@
 	
 	/* paste keyframes */
 	if (paste_graph_keys(&ac)) {
-		// XXX errors - need a way to inform the user 
-		printf("Graph Paste: Nothing to paste, as Copy-Paste buffer was empty.\n");
+		BKE_report(op->reports, RPT_ERROR, "No keyframes to paste");
+		return OPERATOR_CANCELLED;
 	}
 	
 	/* validate keyframes after editing */





More information about the Bf-blender-cvs mailing list