diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-03-09 00:57:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-03-09 00:57:15 +0300 |
commit | 6f1b47d6af4c30c46821a99d7ce4b8a4b3e3d186 (patch) | |
tree | e47f5aae4de67100b049259f4071d66998db7b71 /source | |
parent | 027277fce0565f8518cf1fc3a0b3b34b8d0b3cda (diff) |
added snap cursor->active and adjusted snap menu order in toolbox and header menu's
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/src/edit.c | 14 | ||||
-rw-r--r-- | source/blender/src/header_view3d.c | 32 | ||||
-rw-r--r-- | source/blender/src/toolbox.c | 5 |
3 files changed, 31 insertions, 20 deletions
diff --git a/source/blender/src/edit.c b/source/blender/src/edit.c index b78131ec2ea..ecd546a6780 100644 --- a/source/blender/src/edit.c +++ b/source/blender/src/edit.c @@ -1828,7 +1828,7 @@ void snapmenu() { 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 @@ void snapmenu() 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(); diff --git a/source/blender/src/header_view3d.c b/source/blender/src/header_view3d.c index f3ac698c9d8..1ea9d43afd8 100644 --- a/source/blender/src/header_view3d.c +++ b/source/blender/src/header_view3d.c @@ -1462,21 +1462,28 @@ static uiBlock *view3d_select_faceselmenu(void *arg_unused) 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 3: /*Selection to center of selection*/ + snap_to_center(); + BIF_undo_push("Snap selection to center"); break; - case 4: /* Cursor to selection */ + 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,9 +1499,12 @@ static uiBlock *view3d_edit_snapmenu(void *arg_unused) 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); diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c index bbf991411c4..8b0df0322ab 100644 --- a/source/blender/src/toolbox.c +++ b/source/blender/src/toolbox.c @@ -1295,9 +1295,10 @@ static TBitem tb_transform_clearapply[]= { 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) |