[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14059] trunk/blender/source/blender: Bugfixes:

Joshua Leung aligorith at gmail.com
Tue Mar 11 12:22:40 CET 2008


Revision: 14059
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14059
Author:   aligorith
Date:     2008-03-11 12:22:27 +0100 (Tue, 11 Mar 2008)

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

* Menus could no longer have their items accessed by number (i.e. W-5 didn't run merge tool in EditMode when accessed by keyboard). This was caused by my commit for BUTM (there was some extra code there that isn't really needed, but was causing havok). 
* NumPad can now be used for the above feature too now
* Typo in error message in Constraints PyAPI  

Modified Paths:
--------------
    trunk/blender/source/blender/python/api2_2x/Constraint.c
    trunk/blender/source/blender/src/interface.c

Modified: trunk/blender/source/blender/python/api2_2x/Constraint.c
===================================================================
--- trunk/blender/source/blender/python/api2_2x/Constraint.c	2008-03-11 09:41:20 UTC (rev 14058)
+++ trunk/blender/source/blender/python/api2_2x/Constraint.c	2008-03-11 11:22:27 UTC (rev 14059)
@@ -588,7 +588,7 @@
 						if (num_tars) {
 							if ((PySequence_Check(value) == 0) || (PySequence_Size(value) != num_tars)) {
 								char errorstr[64];
-								sprintf(errorstr, "expected sequence of %d integers", num_tars);
+								sprintf(errorstr, "expected sequence of %d integer(s)", num_tars);
 								return EXPP_ReturnIntError(PyExc_TypeError, errorstr);
 							}
 							

Modified: trunk/blender/source/blender/src/interface.c
===================================================================
--- trunk/blender/source/blender/src/interface.c	2008-03-11 09:41:20 UTC (rev 14058)
+++ trunk/blender/source/blender/src/interface.c	2008-03-11 11:22:27 UTC (rev 14059)
@@ -2687,8 +2687,7 @@
 
 static int ui_do_but_BUTM(uiBut *but)
 {
-	int activated;
-	
+	/* draw 'pushing-in' when clicked on for use as a normal button in a panel */
 	do {
 		int oflag= but->flag;
 		short mval[2];
@@ -2707,22 +2706,18 @@
 		
 		PIL_sleep_ms(10);
 	} while (get_mbut() & L_MOUSE);
-
-	activated= (but->flag & UI_SELECT);
-
-	if (activated) {
-		ui_set_but_val(but, but->min);
-		UIafterfunc_butm= but->butm_func;
-		UIafterfunc_arg1= but->butm_func_arg;
-		UIafterval= but->a2;
-		
-		uibut_do_func(but);
-	}
 	
+	ui_set_but_val(but, but->min);
+	UIafterfunc_butm= but->butm_func;
+	UIafterfunc_arg1= but->butm_func_arg;
+	UIafterval= but->a2;
+	
+	uibut_do_func(but);
+	
 	but->flag &= ~UI_SELECT;
 	ui_draw_but(but);
 
-	return activated?but->retval:0;
+	return but->retval;
 }
 
 static int ui_do_but_LABEL(uiBut *but)
@@ -4477,21 +4472,13 @@
 		}
 		break;
 	
-	case PAD8: case PAD2:
 	case UPARROWKEY:
 	case DOWNARROWKEY:
 		if(inside || (block->flag & UI_BLOCK_LOOP)) {
 			/* arrowkeys: only handle for block_loop blocks */
 			event= 0;
-			if(block->flag & UI_BLOCK_LOOP) {
+			if(block->flag & UI_BLOCK_LOOP)
 				event= uevent->event;
-				if(event==PAD8) event= UPARROWKEY;
-				if(event==PAD2) event= DOWNARROWKEY;
-			}
-			else {
-				if(uevent->event==PAD8) event= UPARROWKEY;
-				if(uevent->event==PAD2) event= DOWNARROWKEY;
-			}
 			if(event && uevent->val) {
 	
 				for(but= block->buttons.first; but; but= but->next) {
@@ -4520,7 +4507,6 @@
 	
 				/* nothing done */
 				if(but==NULL) {
-				
 					if(event==UPARROWKEY) {
 						if(block->direction & UI_TOP) but= ui_but_first(block);
 						else but= ui_but_last(block);
@@ -4539,16 +4525,26 @@
 		}
 		break;
 	
-	case ONEKEY: act= 1;
-	case TWOKEY: if(act==0) act= 2;
-	case THREEKEY: if(act==0) act= 3;
-	case FOURKEY: if(act==0) act= 4;
-	case FIVEKEY: if(act==0) act= 5;
-	case SIXKEY: if(act==0) act= 6;
-	case SEVENKEY: if(act==0) act= 7;
-	case EIGHTKEY: if(act==0) act= 8;
-	case NINEKEY: if(act==0) act= 9;
-	case ZEROKEY: if(act==0) act= 10;
+	case ONEKEY: 	case PAD1: 
+		act= 1;
+	case TWOKEY: 	case PAD2: 
+		if(act==0) act= 2;
+	case THREEKEY: 	case PAD3: 
+		if(act==0) act= 3;
+	case FOURKEY: 	case PAD4: 
+		if(act==0) act= 4;
+	case FIVEKEY: 	case PAD5: 
+		if(act==0) act= 5;
+	case SIXKEY: 	case PAD6: 
+		if(act==0) act= 6;
+	case SEVENKEY: 	case PAD7: 
+		if(act==0) act= 7;
+	case EIGHTKEY: 	case PAD8: 
+		if(act==0) act= 8;
+	case NINEKEY: 	case PAD9: 
+		if(act==0) act= 9;
+	case ZEROKEY: 	case PAD0: 
+		if(act==0) act= 10;
 	
 		if( block->flag & UI_BLOCK_NUMSELECT ) {
 			
@@ -4758,15 +4754,14 @@
 			if(uevent->val || (block->flag & UI_BLOCK_RET_1)==0) {
 				if ELEM6(uevent->event, LEFTMOUSE, PADENTER, RETKEY, BUT_ACTIVATE, BUT_NEXT, BUT_PREV) {
 					/* when mouse outside, don't do button */
-					if(inside || uevent->event!=LEFTMOUSE) {
-						
+					if(inside || uevent->event!=LEFTMOUSE) {						
 						if ELEM(uevent->event, BUT_NEXT, BUT_PREV) {
 							butevent= ui_act_as_text_but(but);
 							uibut_do_func(but);
 						}
 						else
 							butevent= ui_do_button(block, but, uevent);
-
+						
 						/* add undo pushes if... */
 						if( !(block->flag & UI_BLOCK_LOOP)) {
 							if(!G.obedit) {
@@ -4780,12 +4775,12 @@
 								}
 							}
 						}
-				
+						
 						if(butevent) addqueue(block->winq, UI_BUT_EVENT, (short)butevent);
-
+						
 						/* i doubt about the next line! */
 						/* if(but->func) mywinset(block->win); */
-			
+						
 						if( (block->flag & UI_BLOCK_LOOP) && but->type==BLOCK);
 						else	
 							if (butevent) retval= UI_RETURN_OK;





More information about the Bf-blender-cvs mailing list