[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14017] trunk/blender/source/blender/src: added snap cursor-> active and adjusted snap menu order in toolbox and header menu's

Campbell Barton ideasman42 at gmail.com
Sat Mar 8 22:57:16 CET 2008


Revision: 14017
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14017
Author:   campbellbarton
Date:     2008-03-08 22:57:15 +0100 (Sat, 08 Mar 2008)

Log Message:
-----------
added snap cursor->active and adjusted snap menu order in toolbox and header menu's

Modified Paths:
--------------
    trunk/blender/source/blender/src/edit.c
    trunk/blender/source/blender/src/header_view3d.c
    trunk/blender/source/blender/src/toolbox.c

Modified: trunk/blender/source/blender/src/edit.c
===================================================================
--- trunk/blender/source/blender/src/edit.c	2008-03-08 21:35:38 UTC (rev 14016)
+++ trunk/blender/source/blender/src/edit.c	2008-03-08 21:57:15 UTC (rev 14017)
@@ -1828,7 +1828,7 @@
 {
 	short event;
 
-	event = pupmenu("Snap %t|Selection -> Grid%x1|Selection -> Cursor%x2|Selection -> Center%x5|%l|Cursor -> Selection%x4|Cursor -> Grid%x3|Cursor -> Active%x6");
+	event = pupmenu("Snap %t|Selection -> Grid%x1|Selection -> Cursor%x2|Selection -> Center%x3|%l|Cursor -> Selection%x4|Cursor -> Grid%x5|Cursor -> Active%x6");
 
 	switch (event) {
 		case 1: /*Selection to grid*/
@@ -1838,16 +1838,16 @@
 		case 2: /*Selection to cursor*/
 		    snap_sel_to_curs();
 			BIF_undo_push("Snap selection to cursor");
-		    break;	    
-		case 3: /*Cursor to grid*/
-		    snap_curs_to_grid();
 		    break;
+		case 3: /*Selection to center of selection*/
+		    snap_to_center();
+			BIF_undo_push("Snap selection to center");
+		    break;
 		case 4: /*Cursor to selection*/
 		    snap_curs_to_sel();
 		    break;
-		case 5: /*Selection to center of selection*/
-		    snap_to_center();
-			BIF_undo_push("Snap selection to center");
+		case 5: /*Cursor to grid*/
+		    snap_curs_to_grid();
 		    break;
 		case 6: /*Cursor to Active*/
 		    snap_curs_to_active();

Modified: trunk/blender/source/blender/src/header_view3d.c
===================================================================
--- trunk/blender/source/blender/src/header_view3d.c	2008-03-08 21:35:38 UTC (rev 14016)
+++ trunk/blender/source/blender/src/header_view3d.c	2008-03-08 21:57:15 UTC (rev 14017)
@@ -1462,22 +1462,29 @@
 
 void do_view3d_edit_snapmenu(void *arg, int event)
 {
-	switch(event) {
-	case 1: /* Selection to grid */
+	switch (event) {
+	case 1: /*Selection to grid*/
 	    snap_sel_to_grid();
+		BIF_undo_push("Snap selection to grid");
 	    break;
-	case 2: /* Selection to cursor */
+	case 2: /*Selection to cursor*/
 	    snap_sel_to_curs();
-	    break;	    
-	case 3: /* Cursor to grid */
-	    snap_curs_to_grid();
+		BIF_undo_push("Snap selection to cursor");
 	    break;
-	case 4: /* Cursor to selection */
+	case 3: /*Selection to center of selection*/
+	    snap_to_center();
+		BIF_undo_push("Snap selection to center");
+	    break;
+	case 4: /*Cursor to selection*/
 	    snap_curs_to_sel();
 	    break;
-	case 5: /* Selection to center of selection*/
-	    snap_to_center();
+	case 5: /*Cursor to grid*/
+	    snap_curs_to_grid();
 	    break;
+	case 6: /*Cursor to Active*/
+	    snap_curs_to_active();
+		BIF_undo_push("Snap selection to center");
+	    break;
 	}
 	allqueue(REDRAWVIEW3D, 0);
 }
@@ -1492,11 +1499,14 @@
 	
 	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Grid|Shift S, 1",			0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
 	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Cursor|Shift S, 2",			0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cursor -> Grid|Shift S, 3",			0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Center|Shift S, 3",			0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
+	uiDefBut(block, SEPR, 0, "",				0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
 	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cursor -> Selection|Shift S, 4",			0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
-	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Selection -> Center|Shift S, 5",			0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
+	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cursor -> Grid|Shift S, 5",				0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
+	uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Cursor -> Active|Shift S, 6",			0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
 	
 	
+	
 	uiBlockSetDirection(block, UI_RIGHT);
 	uiTextBoundsBlock(block, 60);
 	return block;

Modified: trunk/blender/source/blender/src/toolbox.c
===================================================================
--- trunk/blender/source/blender/src/toolbox.c	2008-03-08 21:35:38 UTC (rev 14016)
+++ trunk/blender/source/blender/src/toolbox.c	2008-03-08 21:57:15 UTC (rev 14017)
@@ -1295,9 +1295,10 @@
 static TBitem tb_transform_snap[]= {
 {	0, "Selection -> Grid|Shift S, 1", 		1, NULL},
 {	0, "Selection -> Cursor|Shift S, 2", 	2, NULL},
-{	0, "Cursor -> Grid|Shift S, 3", 		3, NULL},
+{	0, "Selection -> Center|Shift S, 3", 3, NULL},
 {	0, "Cursor -> Selection|Shift S, 4", 4, NULL},
-{	0, "Selection -> Center|Shift S, 5", 5, NULL},
+{	0, "Cursor -> Grid|Shift S, 5", 		5, NULL},
+{	0, "Cursor -> Active|Shift S, 6", 		6, NULL},
 {  -1, "", 			0, do_view3d_edit_snapmenu}};
 
 static void tb_do_transform(void *arg, int event)





More information about the Bf-blender-cvs mailing list