2.5
authorMichael Fox <mfoxdogg@gmail.com>
Tue, 3 Feb 2009 03:54:03 +0000 (03:54 +0000)
committerMichael Fox <mfoxdogg@gmail.com>
Tue, 3 Feb 2009 03:54:03 +0000 (03:54 +0000)
*******
- rebuilt most of the view menu with a couple empty sub menus
- seperators go all screwy when there is an unknown operator in the menu
- using this method, the operators invoke function is skipped, this is evident with clipping border and border zoom
- original menus are still in the code just if'd out for furture reference and such

- to cater for this menu, view numpad op has been made into much smaller atomic operators, pan and orbit and the ortho/persp toggle has been put into individual operators

- fixed the mem leak in the make parent menu

source/blender/editors/object/object_edit.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_ops.c

index 507d21ac245bfa8d1ae5f984894cfcbd98fd9a80..373bc81b3b1ba1fc62d6fb1d2b8a448e3bee27ed 100644 (file)
@@ -2473,7 +2473,7 @@ static int make_parent_invoke(bContext *C, wmOperator *op, wmEvent *event)
        
        uiPupMenuEnd(C, head);
        
-       return OPERATOR_RUNNING_MODAL;
+       return OPERATOR_CANCELLED;
 }
 
 
index 8b8859d8202d459649aea4eee45ba1730fb10145..145c719105958b75044efdbbaa984b20f7371137 100644 (file)
@@ -1315,16 +1315,7 @@ static EnumPropertyItem prop_view_items[] = {
        {V3D_VIEW_RIGHT, "RIGHT", "Right", "View From the Right"},
        {V3D_VIEW_TOP, "TOP", "Top", "View From the Top"},
        {V3D_VIEW_BOTTOM, "BOTTOM", "Bottom", "View From the Bottom"},
-       {V3D_VIEW_PERSPORTHO, "PERSPORTHO", "Persp-Ortho", "Switch between Perspecive and Orthographic View"},
        {V3D_VIEW_CAMERA, "CAMERA", "Camera", "View From the active amera"},
-       {V3D_VIEW_STEPLEFT, "STEPLEFT", "Step Left", "Step the view around to the Left"},
-       {V3D_VIEW_STEPRIGHT, "STEPRIGHT", "Step Right", "Step the view around to the Right"},
-       {V3D_VIEW_STEPUP, "STEPUP", "Step Up", "Step the view Up"},
-       {V3D_VIEW_STEPDOWN, "STEPDOWN", "Step Down", "Step the view Down"},
-       {V3D_VIEW_PANLEFT, "PANLEFT", "Pan Left", "Pan the view to the Left"},
-       {V3D_VIEW_PANRIGHT, "PANRIGHT", "Pan Right", "Pan the view to the Right"},
-       {V3D_VIEW_PANUP, "PANUP", "Pan Up", "Pan the view Up"},
-       {V3D_VIEW_PANDOWN, "PANDOWN", "Pan Down", "Pan the view Down"},
        {0, NULL, NULL, NULL}};
 
 static void axis_set_view(bContext *C, float q1, float q2, float q3, float q4, short view, int perspo)
@@ -1371,14 +1362,11 @@ static void axis_set_view(bContext *C, float q1, float q2, float q3, float q4, s
 
 }
 
-
 static int viewnumpad_exec(bContext *C, wmOperator *op)
 {
-       ARegion *ar= CTX_wm_region(C);
        View3D *v3d = CTX_wm_view3d(C);
        RegionView3D *rv3d= CTX_wm_region_view3d(C);
        Scene *scene= CTX_data_scene(C);
-       float phi, si, q1[4], vec[3];
        static int perspo=V3D_PERSP;
        int viewnum;
 
@@ -1411,16 +1399,6 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
                        axis_set_view(C, 0.5, -0.5, -0.5, -0.5, viewnum, perspo);
                        break;
 
-               case V3D_VIEW_PERSPORTHO:
-                       if(rv3d->viewlock==0) {
-                               if(rv3d->persp!=V3D_ORTHO) 
-                                       rv3d->persp=V3D_ORTHO;
-                               else rv3d->persp=V3D_PERSP;
-
-                               ED_region_tag_redraw(ar);
-                       }
-                       break;
-
                case V3D_VIEW_CAMERA:
                        if(rv3d->viewlock==0) {
                                /* lastview -  */
@@ -1464,65 +1442,6 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
                        }
                        break;
 
-               case V3D_VIEW_STEPLEFT:
-               case V3D_VIEW_STEPRIGHT:
-               case V3D_VIEW_STEPUP:
-               case V3D_VIEW_STEPDOWN:
-                       if(rv3d->viewlock==0) {
-
-                               if(rv3d->persp != V3D_CAMOB) {
-                                       if(viewnum == V3D_VIEW_STEPLEFT || viewnum == V3D_VIEW_STEPRIGHT) {
-                                               /* z-axis */
-                                               phi= (float)(M_PI/360.0)*U.pad_rot_angle;
-                                               if(viewnum == V3D_VIEW_STEPRIGHT) phi= -phi;
-                                               si= (float)sin(phi);
-                                               q1[0]= (float)cos(phi);
-                                               q1[1]= q1[2]= 0.0;
-                                               q1[3]= si;
-                                               QuatMul(rv3d->viewquat, rv3d->viewquat, q1);
-                                               rv3d->view= 0;
-                                       }
-                                       if(viewnum == V3D_VIEW_STEPDOWN || viewnum == V3D_VIEW_STEPUP) {
-                                               /* horizontal axis */
-                                               VECCOPY(q1+1, rv3d->viewinv[0]);
-
-                                               Normalize(q1+1);
-                                               phi= (float)(M_PI/360.0)*U.pad_rot_angle;
-                                               if(viewnum == V3D_VIEW_STEPDOWN) phi= -phi;
-                                               si= (float)sin(phi);
-                                               q1[0]= (float)cos(phi);
-                                               q1[1]*= si;
-                                               q1[2]*= si;
-                                               q1[3]*= si;
-                                               QuatMul(rv3d->viewquat, rv3d->viewquat, q1);
-                                               rv3d->view= 0;
-                                       }
-                                       ED_region_tag_redraw(ar);
-                               }
-                       }
-                       break;
-
-               case V3D_VIEW_PANRIGHT:
-               case V3D_VIEW_PANLEFT:
-               case V3D_VIEW_PANUP:
-               case V3D_VIEW_PANDOWN:
-
-                       initgrabz(rv3d, 0.0, 0.0, 0.0);
-
-                       if(viewnum == V3D_VIEW_PANRIGHT) window_to_3d_delta(ar, vec, -32, 0);
-                       else if(viewnum == V3D_VIEW_PANLEFT) window_to_3d_delta(ar, vec, 32, 0);
-                       else if(viewnum == V3D_VIEW_PANUP) window_to_3d_delta(ar, vec, 0, -25);
-                       else if(viewnum == V3D_VIEW_PANDOWN) window_to_3d_delta(ar, vec, 0, 25);
-                       rv3d->ofs[0]+= vec[0];
-                       rv3d->ofs[1]+= vec[1];
-                       rv3d->ofs[2]+= vec[2];
-
-                       if(rv3d->viewlock)
-                               view3d_boxview_sync(CTX_wm_area(C), ar);
-
-                       ED_region_tag_redraw(ar);
-                       break;
-
                default :
                        break;
        }
@@ -1531,8 +1450,6 @@ static int viewnumpad_exec(bContext *C, wmOperator *op)
 
        return OPERATOR_FINISHED;
 }
-
-
 void VIEW3D_OT_viewnumpad(wmOperatorType *ot)
 {
        /* identifiers */
@@ -1549,6 +1466,153 @@ void VIEW3D_OT_viewnumpad(wmOperatorType *ot)
        RNA_def_enum(ot->srna, "view", prop_view_items, 0, "View", "");
 }
 
+static EnumPropertyItem prop_view_orbit_items[] = {
+       {V3D_VIEW_STEPLEFT, "ORBITLEFT", "Orbit Left", "Orbit the view around to the Left"},
+       {V3D_VIEW_STEPRIGHT, "ORBITRIGHT", "Orbit Right", "Orbit the view around to the Right"},
+       {V3D_VIEW_STEPUP, "ORBITUP", "Orbit Up", "Orbit the view Up"},
+       {V3D_VIEW_STEPDOWN, "ORBITDOWN", "Orbit Down", "Orbit the view Down"},
+       {0, NULL, NULL, NULL}};
+
+static int vieworbit_exec(bContext *C, wmOperator *op)
+{
+       ARegion *ar= CTX_wm_region(C);
+       RegionView3D *rv3d= CTX_wm_region_view3d(C);
+       float phi, si, q1[4];           
+       int orbitdir;
+
+       orbitdir = RNA_enum_get(op->ptr, "type");
+       
+       if(rv3d->viewlock==0) {
+
+               if(rv3d->persp != V3D_CAMOB) {
+                       if(orbitdir == V3D_VIEW_STEPLEFT || orbitdir == V3D_VIEW_STEPRIGHT) {
+                               /* z-axis */
+                               phi= (float)(M_PI/360.0)*U.pad_rot_angle;
+                               if(orbitdir == V3D_VIEW_STEPRIGHT) phi= -phi;
+                               si= (float)sin(phi);
+                               q1[0]= (float)cos(phi);
+                               q1[1]= q1[2]= 0.0;
+                               q1[3]= si;
+                               QuatMul(rv3d->viewquat, rv3d->viewquat, q1);
+                               rv3d->view= 0;
+                       }
+                       if(orbitdir == V3D_VIEW_STEPDOWN || orbitdir == V3D_VIEW_STEPUP) {
+                               /* horizontal axis */
+                               VECCOPY(q1+1, rv3d->viewinv[0]);
+
+                               Normalize(q1+1);
+                               phi= (float)(M_PI/360.0)*U.pad_rot_angle;
+                               if(orbitdir == V3D_VIEW_STEPDOWN) phi= -phi;
+                               si= (float)sin(phi);
+                               q1[0]= (float)cos(phi);
+                               q1[1]*= si;
+                               q1[2]*= si;
+                               q1[3]*= si;
+                               QuatMul(rv3d->viewquat, rv3d->viewquat, q1);
+                               rv3d->view= 0;
+                       }
+                       ED_region_tag_redraw(ar);
+               }
+       }
+
+       return OPERATOR_FINISHED;       
+}
+
+void VIEW3D_OT_view_orbit(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name= "View Orbit";
+       ot->idname= "VIEW3D_OT_view_orbit";
+
+       /* api callbacks */
+       ot->exec= vieworbit_exec;
+       ot->poll= ED_operator_view3d_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
+       RNA_def_enum(ot->srna, "type", prop_view_orbit_items, 0, "Orbit", "Direction of View Orbit");
+}
+
+static EnumPropertyItem prop_view_pan_items[] = {
+       {V3D_VIEW_PANLEFT, "PANLEFT", "Pan Left", "Pan the view to the Left"},
+       {V3D_VIEW_PANRIGHT, "PANRIGHT", "Pan Right", "Pan the view to the Right"},
+       {V3D_VIEW_PANUP, "PANUP", "Pan Up", "Pan the view Up"},
+       {V3D_VIEW_PANDOWN, "PANDOWN", "Pan Down", "Pan the view Down"},
+       {0, NULL, NULL, NULL}};
+
+static int viewpan_exec(bContext *C, wmOperator *op)
+{
+       ARegion *ar= CTX_wm_region(C);
+       RegionView3D *rv3d= CTX_wm_region_view3d(C);    
+       float vec[3];   
+       int pandir;
+
+       pandir = RNA_enum_get(op->ptr, "type");
+       
+       initgrabz(rv3d, 0.0, 0.0, 0.0);
+
+       if(pandir == V3D_VIEW_PANRIGHT) window_to_3d_delta(ar, vec, -32, 0);
+       else if(pandir == V3D_VIEW_PANLEFT) window_to_3d_delta(ar, vec, 32, 0);
+       else if(pandir == V3D_VIEW_PANUP) window_to_3d_delta(ar, vec, 0, -25);
+       else if(pandir == V3D_VIEW_PANDOWN) window_to_3d_delta(ar, vec, 0, 25);
+       rv3d->ofs[0]+= vec[0];
+       rv3d->ofs[1]+= vec[1];
+       rv3d->ofs[2]+= vec[2];
+
+       if(rv3d->viewlock)
+               view3d_boxview_sync(CTX_wm_area(C), ar);
+
+       ED_region_tag_redraw(ar);
+
+       return OPERATOR_FINISHED;       
+}
+
+void VIEW3D_OT_view_pan(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name= "View Pan";
+       ot->idname= "VIEW3D_OT_view_pan";
+
+       /* api callbacks */
+       ot->exec= viewpan_exec;
+       ot->poll= ED_operator_view3d_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
+       RNA_def_enum(ot->srna, "type", prop_view_pan_items, 0, "Pan", "Direction of View Pan");
+}
+
+static int viewpersportho_exec(bContext *C, wmOperator *op)
+{
+       ARegion *ar= CTX_wm_region(C);
+       RegionView3D *rv3d= CTX_wm_region_view3d(C);    
+       
+       if(rv3d->viewlock==0) {
+               if(rv3d->persp!=V3D_ORTHO) 
+                       rv3d->persp=V3D_ORTHO;
+               else rv3d->persp=V3D_PERSP;
+               ED_region_tag_redraw(ar);
+       }
+
+       return OPERATOR_FINISHED;
+       
+}
+
+void VIEW3D_OT_view_persportho(wmOperatorType *ot)
+{
+       /* identifiers */
+       ot->name= "View persp/ortho";
+       ot->idname= "VIEW3D_OT_view_persportho";
+
+       /* api callbacks */
+       ot->exec= viewpersportho_exec;
+       ot->poll= ED_operator_view3d_active;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER;
+}
+
+
 /* ********************* set clipping operator ****************** */
 
 static int view3d_clipping_exec(bContext *C, wmOperator *op)
@@ -1635,7 +1699,7 @@ void VIEW3D_OT_clipping(wmOperatorType *ot)
 {
 
        /* identifiers */
-       ot->name= "Border Select";
+       ot->name= "Clipping Border";
        ot->idname= "VIEW3D_OT_clipping";
 
        /* api callbacks */
index b607e87ec2d4bd36dbf812586baa7a353a0f555d..59ac4e3675d6fc76d4ce993daea84e05129252f4 100644 (file)
@@ -278,6 +278,7 @@ static void do_view3d_view_camerasmenu(bContext *C, void *arg, int event)
        allqueue(REDRAWVIEW3D, 0);
 }
 
+#if 0
 static uiBlock *view3d_view_camerasmenu(bContext *C, ARegion *ar, void *arg_unused)
 {
        Scene *scene= CTX_data_scene(C);
@@ -309,7 +310,7 @@ static uiBlock *view3d_view_camerasmenu(bContext *C, ARegion *ar, void *arg_unus
        uiTextBoundsBlock(block, 50);
        return block;
 }
-
+#endif
 static void do_view3d_view_cameracontrolsmenu(bContext *C, void *arg, int event)
 {
        switch(event) {
@@ -455,7 +456,7 @@ static void do_view3d_view_alignviewmenu(bContext *C, void *arg, int event)
        }
        allqueue(REDRAWVIEW3D, 0);
 }
-
+#if 0
 static uiBlock *view3d_view_alignviewmenu(bContext *C, ARegion *ar, void *arg_unused)
 {
 /*             static short tog=0; */
@@ -487,7 +488,7 @@ static uiBlock *view3d_view_alignviewmenu(bContext *C, ARegion *ar, void *arg_un
 // XXX static void do_view3d_view_spacehandlers(bContext *C, void *arg, int event)
 //{
 //}
-
+#endif
 static uiBlock *view3d_view_spacehandlers(bContext *C, ARegion *ar, void *arg_unused)
 {
        /* XXX */
@@ -553,6 +554,91 @@ static void do_view3d_viewmenu(bContext *C, void *arg, int event)
        allqueue(REDRAWVIEW3D, 1);
 }
 
+static void view3d_view_viewnavmenu(bContext *C, uiMenuItem *head, void *arg_unused)
+{
+       uiMenuItemO(head, "VIEW3D_OT_view_fly_mode", ICON_BLANK1);
+       
+       uiMenuSeparator(head);
+       
+       uiMenuItemEnumO(head, "VIEW3D_OT_view_orbit", "type", V3D_VIEW_STEPLEFT);
+       uiMenuItemEnumO(head, "VIEW3D_OT_view_orbit", "type", V3D_VIEW_STEPRIGHT);
+       uiMenuItemEnumO(head, "VIEW3D_OT_view_orbit", "type", V3D_VIEW_STEPUP);
+       uiMenuItemEnumO(head, "VIEW3D_OT_view_orbit", "type", V3D_VIEW_STEPDOWN);
+       
+       uiMenuSeparator(head);
+       
+       uiMenuItemEnumO(head, "VIEW3D_OT_view_pan", "type", V3D_VIEW_PANLEFT);
+       uiMenuItemEnumO(head, "VIEW3D_OT_view_pan", "type", V3D_VIEW_PANRIGHT);
+       uiMenuItemEnumO(head, "VIEW3D_OT_view_pan", "type", V3D_VIEW_PANUP);
+       uiMenuItemEnumO(head, "VIEW3D_OT_view_pan", "type", V3D_VIEW_PANDOWN);
+       
+       uiMenuSeparator(head);
+       
+       uiMenuItemFloatO(head, "Zoom in", "VIEW3D_OT_viewzoom", "delta", 1.0f);
+       uiMenuItemFloatO(head, "Zoom out", "VIEW3D_OT_viewzoom", "delta", -1.0f);
+       
+}
+static void view3d_view_alignviewmenu(bContext *C, uiMenuItem *head, void *arg_unused)
+{
+       
+}
+static void view3d_view_camerasmenu(bContext *C, uiMenuItem *head, void *arg_unused)
+{
+       
+}
+static void view3d_viewmenu(bContext *C, uiMenuItem *head, void *arg_unused)
+{
+       ScrArea *sa= CTX_wm_area(C);
+       
+       uiMenuItemO(head, "VIEW3D_OT_toggle_transform_orientations_panel", ICON_MENU_PANEL); // Transform Orientations...
+       uiMenuItemO(head, "VIEW3D_OT_toggle_render_preview_panel", ICON_MENU_PANEL); // render preview...
+       uiMenuItemO(head, "VIEW3D_OT_toggle_view_properties_panel", ICON_MENU_PANEL); // View Properties....
+       uiMenuItemO(head, "VIEW3D_OT_toggle_background_image_panel", ICON_MENU_PANEL); // Background Image....
+       uiMenuItemO(head, "VIEW3D_OT_toggle_grease_pencil_panel", ICON_MENU_PANEL); // Grease Pencil....
+       
+       uiMenuSeparator(head);
+       
+       uiMenuItemEnumO(head, "VIEW3D_OT_viewnumpad", "view", V3D_VIEW_CAMERA);
+       uiMenuItemEnumO(head, "VIEW3D_OT_viewnumpad", "view", V3D_VIEW_TOP);
+       uiMenuItemEnumO(head, "VIEW3D_OT_viewnumpad", "view", V3D_VIEW_FRONT);
+       uiMenuItemEnumO(head, "VIEW3D_OT_viewnumpad", "view", V3D_VIEW_RIGHT);
+       
+       uiMenuLevel(head, "Cameras", view3d_view_camerasmenu);
+       
+       uiMenuSeparator(head);
+
+       uiMenuItemO(head, "VIEW3D_OT_view_persportho", ICON_BLANK1);
+       
+       uiMenuSeparator(head);
+       
+       uiMenuItemO(head, "VIEW3D_OT_view_show_all_layers", ICON_BLANK1);       
+       
+       uiMenuSeparator(head);
+       
+       uiMenuItemO(head, "VIEW3D_OT_view_local_view", ICON_BLANK1);
+       uiMenuItemO(head, "VIEW3D_OT_view_global_view", ICON_BLANK1);
+       
+       uiMenuSeparator(head);
+       
+       uiMenuLevel(head, "View Navigation", view3d_view_viewnavmenu);
+       uiMenuLevel(head, "Align View", view3d_view_alignviewmenu);
+       
+       uiMenuSeparator(head);
+       
+       uiMenuItemO(head, "VIEW3D_OT_clipping", ICON_BLANK1);
+       uiMenuItemO(head, "VIEW3D_OT_border_zoom", ICON_BLANK1);
+       
+       uiMenuSeparator(head);
+       
+       uiMenuItemO(head, "VIEW3D_OT_viewcenter", ICON_BLANK1);
+       uiMenuItemO(head, "VIEW3D_OT_viewhome", ICON_BLANK1);
+       
+       uiMenuSeparator(head);
+       
+       if(sa->full) uiMenuItemO(head, "SCREEN_OT_screen_full_area", ICON_BLANK1); // "Tile Window", Ctrl UpArrow
+       else uiMenuItemO(head, "SCREEN_OT_screen_full_area", ICON_BLANK1); // "Maximize Window", Ctr DownArrow
+}
+#if 0
 static uiBlock *view3d_viewmenu(bContext *C, ARegion *ar, void *arg_unused)
 {
        ScrArea *sa= CTX_wm_area(C);
@@ -642,6 +728,7 @@ static uiBlock *view3d_viewmenu(bContext *C, ARegion *ar, void *arg_unused)
        
        return block;
 }
+#endif
 
 #if 0
 void do_view3d_select_object_typemenu(bContext *C, void *arg, int event)
@@ -5559,7 +5646,8 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o
         * height of the header */
        
        xmax= GetButStringLength("View");
-       uiDefPulldownBut(block, view3d_viewmenu, NULL, "View", xco, yco-2, xmax-3, 24, "");
+       uiDefMenuBut(block, view3d_viewmenu, NULL, "View", xco, yco-2, xmax-3, 24, "");
+       //uiDefPulldownBut(block, view3d_viewmenu, NULL, "View", xco, yco-2, xmax-3, 24, "");
        xco+= xmax;
        
        xmax= GetButStringLength("Select");
index f200464e38d7bcbb67a185ac0d0d3e2ace3c754d..9d75fcceed46d008baffb3253d7f2e7ca4bf00d1 100644 (file)
@@ -67,6 +67,9 @@ void VIEW3D_OT_viewrotate(struct wmOperatorType *ot);
 void VIEW3D_OT_viewhome(struct wmOperatorType *ot);
 void VIEW3D_OT_viewnumpad(struct wmOperatorType *ot);
 void VIEW3D_OT_viewcenter(struct wmOperatorType *ot);
+void VIEW3D_OT_view_pan(struct wmOperatorType *ot);
+void VIEW3D_OT_view_persportho(struct wmOperatorType *ot);
+void VIEW3D_OT_view_orbit(struct wmOperatorType *ot);
 void VIEW3D_OT_clipping(struct wmOperatorType *ot);
 void VIEW3D_OT_cursor3d(struct wmOperatorType *ot);
 void VIEW3D_OT_render_border(struct wmOperatorType *ot);
index fe550724cc864abd81d87ec1856e8801979f48fd..69c3b4e76cd4300f3f7df790fdaadd4ea9a667a5 100644 (file)
@@ -68,6 +68,9 @@ void view3d_operatortypes(void)
        WM_operatortype_append(VIEW3D_OT_viewzoom);
        WM_operatortype_append(VIEW3D_OT_viewhome);
        WM_operatortype_append(VIEW3D_OT_viewnumpad);
+       WM_operatortype_append(VIEW3D_OT_view_orbit);
+       WM_operatortype_append(VIEW3D_OT_view_pan);
+       WM_operatortype_append(VIEW3D_OT_view_persportho);
        WM_operatortype_append(VIEW3D_OT_viewcenter);
        WM_operatortype_append(VIEW3D_OT_select);
        WM_operatortype_append(VIEW3D_OT_borderselect);
@@ -123,20 +126,21 @@ void view3d_keymap(wmWindowManager *wm)
        /* numpad view hotkeys*/
        RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD0, KM_PRESS, 0, 0)->ptr, "view", V3D_VIEW_CAMERA);
        RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, 0, 0)->ptr, "view", V3D_VIEW_FRONT);
-       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD2, KM_PRESS, 0, 0)->ptr, "view", V3D_VIEW_STEPDOWN);
+       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", PAD2, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_STEPDOWN);
        RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, 0, 0)->ptr, "view", V3D_VIEW_RIGHT);
-       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD4, KM_PRESS, 0, 0)->ptr, "view", V3D_VIEW_STEPLEFT);
-       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD5, KM_PRESS, 0, 0)->ptr, "view", V3D_VIEW_PERSPORTHO);
-       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD6, KM_PRESS, 0, 0)->ptr, "view", V3D_VIEW_STEPRIGHT);
+       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", PAD4, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_STEPLEFT);
+       WM_keymap_add_item(keymap, "VIEW3D_OT_view_persportho", PAD5, KM_PRESS, 0, 0);
+       
+       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", PAD6, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_STEPRIGHT);
        RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, 0, 0)->ptr, "view", V3D_VIEW_TOP);
-       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD8, KM_PRESS, 0, 0)->ptr, "view", V3D_VIEW_STEPUP);
+       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_orbit", PAD8, KM_PRESS, 0, 0)->ptr, "type", V3D_VIEW_STEPUP);
        RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD1, KM_PRESS, KM_CTRL, 0)->ptr, "view", V3D_VIEW_BACK);
        RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD3, KM_PRESS, KM_CTRL, 0)->ptr, "view", V3D_VIEW_LEFT);
        RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD7, KM_PRESS, KM_CTRL, 0)->ptr, "view", V3D_VIEW_BOTTOM);
-       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD2, KM_PRESS, KM_CTRL, 0)->ptr, "view", V3D_VIEW_PANDOWN);
-       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD4, KM_PRESS, KM_CTRL, 0)->ptr, "view", V3D_VIEW_PANLEFT);
-       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD6, KM_PRESS, KM_CTRL, 0)->ptr, "view", V3D_VIEW_PANRIGHT);
-       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD8, KM_PRESS, KM_CTRL, 0)->ptr, "view", V3D_VIEW_PANUP);
+       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_pan", PAD2, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_PANDOWN);
+       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_pan", PAD4, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_PANLEFT);
+       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_pan", PAD6, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_PANRIGHT);
+       RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_pan", PAD8, KM_PRESS, KM_CTRL, 0)->ptr, "type", V3D_VIEW_PANUP);
 
        /* drawtype */
        km = WM_keymap_add_item(keymap, "VIEW3D_OT_drawtype", ZKEY, KM_PRESS, 0, 0);