[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28295] trunk/blender/source/blender/ editors/screen/screen_ops.c: Made playback operators use exec() callback instead of invoke(), so that these can be used for Python scripts .

Joshua Leung aligorith at gmail.com
Tue Apr 20 04:39:16 CEST 2010


Revision: 28295
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28295
Author:   aligorith
Date:     2010-04-20 04:39:07 +0200 (Tue, 20 Apr 2010)

Log Message:
-----------
Made playback operators use exec() callback instead of invoke(), so that these can be used for Python scripts. 

Note that this is not the patch by dfelinto on the mailing list, since that fix would cause compiler warnings. Also, the invoke() (with the extra wmEvent* arg) is superfluous here, so there shouldn't be any problems with making this exec() only instead.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/screen/screen_ops.c

Modified: trunk/blender/source/blender/editors/screen/screen_ops.c
===================================================================
--- trunk/blender/source/blender/editors/screen/screen_ops.c	2010-04-20 01:04:00 UTC (rev 28294)
+++ trunk/blender/source/blender/editors/screen/screen_ops.c	2010-04-20 02:39:07 UTC (rev 28295)
@@ -2561,7 +2561,7 @@
 	return OPERATOR_FINISHED;
 }
 
-static int screen_animation_play_invoke(bContext *C, wmOperator *op, wmEvent *event)
+static int screen_animation_play_exec(bContext *C, wmOperator *op)
 {
 	int mode= (RNA_boolean_get(op->ptr, "reverse")) ? -1 : 1;
 	int sync= -1;
@@ -2580,7 +2580,7 @@
 	ot->idname= "SCREEN_OT_animation_play";
 	
 	/* api callbacks */
-	ot->invoke= screen_animation_play_invoke;
+	ot->exec= screen_animation_play_exec;
 	
 	ot->poll= ED_operator_screenactive;
 	
@@ -2588,7 +2588,7 @@
 	RNA_def_boolean(ot->srna, "sync", 0, "Sync", "Drop frames to maintain framerate");
 }
 
-static int screen_animation_cancel(bContext *C, wmOperator *op, wmEvent *event)
+static int screen_animation_cancel_exec(bContext *C, wmOperator *op)
 {
 	bScreen *screen= CTX_wm_screen(C);
 	
@@ -2617,7 +2617,7 @@
 	ot->idname= "SCREEN_OT_animation_cancel";
 	
 	/* api callbacks */
-	ot->invoke= screen_animation_cancel;
+	ot->exec= screen_animation_cancel_exec;
 	
 	ot->poll= ED_operator_screenactive;
 }





More information about the Bf-blender-cvs mailing list