[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22134] branches/blender2.5/blender/source /blender/editors: 2.5 - Bugfixes

Joshua Leung aligorith at gmail.com
Sun Aug 2 09:08:51 CEST 2009


Revision: 22134
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22134
Author:   aligorith
Date:     2009-08-02 09:08:51 +0200 (Sun, 02 Aug 2009)

Log Message:
-----------
2.5 - Bugfixes

* Added operator for jumping to the start and end frames. Shift Up/Down
* Fixed bad spacing for buttons in Graph Editor header

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/screen/screen_ops.c
    branches/blender2.5/blender/source/blender/editors/space_graph/graph_header.c
    branches/blender2.5/blender/source/blender/editors/space_time/time_header.c

Modified: branches/blender2.5/blender/source/blender/editors/screen/screen_ops.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/screen/screen_ops.c	2009-08-02 06:22:53 UTC (rev 22133)
+++ branches/blender2.5/blender/source/blender/editors/screen/screen_ops.c	2009-08-02 07:08:51 UTC (rev 22134)
@@ -1411,6 +1411,37 @@
 	RNA_def_int(ot->srna, "delta", 0, INT_MIN, INT_MAX, "Delta", "", INT_MIN, INT_MAX);
 }
 
+
+/* function to be called outside UI context, or for redo */
+static int frame_jump_exec(bContext *C, wmOperator *op)
+{
+	Scene *scene= CTX_data_scene(C);
+	
+	if (RNA_boolean_get(op->ptr, "end"))
+		CFRA= PEFRA;
+	else
+		CFRA= PSFRA;
+
+	WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
+
+	return OPERATOR_FINISHED;
+}
+
+static void SCREEN_OT_frame_jump(wmOperatorType *ot)
+{
+	ot->name = "Jump to Endpoint";
+	ot->idname = "SCREEN_OT_frame_jump";
+
+	ot->exec= frame_jump_exec;
+
+	ot->poll= ED_operator_screenactive;
+	ot->flag= 0;
+
+	/* rna */
+	RNA_def_boolean(ot->srna, "end", 0, "Last Frame", "Jump to the last frame of the frame range.");
+}
+
+
 /* ************** jump to keyframe operator ***************************** */
 
 /* helper function - find actkeycolumn that occurs on cframe, or the nearest one if not found */
@@ -3062,6 +3093,7 @@
 	
 	/*frame changes*/
 	WM_operatortype_append(SCREEN_OT_frame_offset);
+	WM_operatortype_append(SCREEN_OT_frame_jump);
 	WM_operatortype_append(SCREEN_OT_keyframe_jump);
 	
 	WM_operatortype_append(SCREEN_OT_animation_step);
@@ -3174,6 +3206,9 @@
 	RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", LEFTARROWKEY, KM_PRESS, 0, 0)->ptr, "delta", -1);
 	RNA_int_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_offset", RIGHTARROWKEY, KM_PRESS, 0, 0)->ptr, "delta", 1);
 	
+	WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", DOWNARROWKEY, KM_PRESS, KM_SHIFT, 0);
+	RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_frame_jump", UPARROWKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "end", 1);
+	
 	WM_keymap_add_item(keymap, "SCREEN_OT_keyframe_jump", PAGEUPKEY, KM_PRESS, KM_CTRL, 0);
 	RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_keyframe_jump", PAGEDOWNKEY, KM_PRESS, KM_CTRL, 0)->ptr, "next", 0);
 	

Modified: branches/blender2.5/blender/source/blender/editors/space_graph/graph_header.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_graph/graph_header.c	2009-08-02 06:22:53 UTC (rev 22133)
+++ branches/blender2.5/blender/source/blender/editors/space_graph/graph_header.c	2009-08-02 07:08:51 UTC (rev 22134)
@@ -307,11 +307,11 @@
 			uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCUR, B_REDR, ICON_CURVE_DATA,	(short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Curves");
 			uiDefIconButBitI(block, TOGN, ADS_FILTER_NOPART, B_REDR, ICON_PARTICLE_DATA,	(short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Particles");
 		uiBlockEndAlign(block);
-		xco += 15;
+		xco += 30;
 	}
 	else {
 		// XXX this case shouldn't happen at all... for now, just pad out same amount of space
-		xco += 6*XIC + 15;
+		xco += 9*XIC + 30;
 	}
 	
 	/* auto-snap selector */

Modified: branches/blender2.5/blender/source/blender/editors/space_time/time_header.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_time/time_header.c	2009-08-02 06:22:53 UTC (rev 22133)
+++ branches/blender2.5/blender/source/blender/editors/space_time/time_header.c	2009-08-02 07:08:51 UTC (rev 22134)
@@ -360,10 +360,8 @@
 
 
 #define B_REDRAWALL		750
-#define B_TL_REW		751
 #define B_TL_PLAY		752
 #define B_TL_RPLAY		760
-#define B_TL_FF			753
 #define B_TL_STOP		756
 #define B_TL_PREVIEWON	757
 
@@ -385,11 +383,6 @@
 		case B_NEWFRAME:
 			WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
 			break;
-		case B_TL_REW:
-			scene->r.cfra= PSFRA;
-			WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
-			//update_for_newframe();
-			break;
 		case B_TL_PLAY:
 			ED_screen_animation_timer(C, stime->redraws, 1);
 			
@@ -417,12 +410,6 @@
 		case B_TL_STOP:
 			ED_screen_animation_timer(C, 0, 0);
 			break;
-		case B_TL_FF:
-			/* end frame */
-			scene->r.cfra= PEFRA;
-			WM_event_add_notifier(C, NC_SCENE|ND_FRAME, scene);
-			//update_for_newframe();
-			break;
 			
 		case B_TL_PREVIEWON:
 			if (scene->r.psfra) {
@@ -528,9 +515,9 @@
 	xco += (short)(3.5 * XIC);
 	
 	uiBlockBeginAlign(block);
-
-	uiDefIconBut(block, BUT, B_TL_REW, ICON_REW,
-				 xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Skip to Start frame (Shift DownArrow)");
+	
+	but= uiDefIconButO(block, BUT, "SCREEN_OT_frame_jump", WM_OP_INVOKE_REGION_WIN, ICON_REW, xco,yco,XIC,YIC, "Skip to Start frame (Shift DownArrow)");
+		RNA_boolean_set(uiButGetOperatorPtrRNA(but), "end", 0);
 	xco+= XIC;
 	
 	but= uiDefIconButO(block, BUT, "SCREEN_OT_keyframe_jump", WM_OP_INVOKE_REGION_WIN, ICON_PREV_KEYFRAME, xco,yco,XIC,YIC, "Skip to previous keyframe (Ctrl PageDown)");
@@ -559,8 +546,9 @@
 		RNA_boolean_set(uiButGetOperatorPtrRNA(but), "next", 1);
 	xco+= XIC;
 	
-	uiDefIconBut(block, BUT, B_TL_FF, ICON_FF,
-				 xco, yco, XIC, YIC, 0, 0, 0, 0, 0, "Skip to End frame (Shift UpArrow)");
+	but= uiDefIconButO(block, BUT, "SCREEN_OT_frame_jump", WM_OP_INVOKE_REGION_WIN, ICON_FF, xco,yco,XIC,YIC, "Skip to End frame (Shift UpArrow)");
+		RNA_boolean_set(uiButGetOperatorPtrRNA(but), "end", 1);
+	xco+= XIC;
 	uiBlockEndAlign(block);
 
 	xco+= 2*XIC;





More information about the Bf-blender-cvs mailing list