Added K Menu for Loop Select, Loop Cut, and Knife tools.
authorRobert Wenzlaff <rwenzlaff@soylent-green.com>
Sun, 26 Oct 2003 21:22:32 +0000 (21:22 +0000)
committerRobert Wenzlaff <rwenzlaff@soylent-green.com>
Sun, 26 Oct 2003 21:22:32 +0000 (21:22 +0000)
source/blender/include/BIF_editmesh.h
source/blender/src/editmesh.c
source/blender/src/space.c

index f5103d70934831a7700b5f1753134945992c1d98..7fa501a79304a848fbed017abed2a58bb98b0238 100644 (file)
@@ -66,6 +66,8 @@ CutCurve *get_mouse_trail(int * length, char mode);
 #define TRAIL_AUTO     4 
 
 short seg_intersect(struct EditEdge * e, CutCurve *c, int len);
+
+void LoopMenu(void);
 /* End Knife Subdiv */
 
        /** Aligns the selected TFace's of @a me to the @a v3d,
index 53dc18137bf2c6a7ed16b188400947a6c9d2ca14..96c8251891086bf2f419296ab6460adb8452e571 100644 (file)
@@ -7494,6 +7494,29 @@ short seg_intersect(EditEdge *e, CutCurve *c, int len){
 } 
 
 
+void LoopMenu(){ /* Called by KKey */
+
+       short ret;
+       
+       ret=pupmenu("Loop/Cut Menu %t|Loop Select %x1|Loop Cut %x2|"
+                               "Knife (Exact) %x3|Knife (Centers)%x4|");
+                               
+       switch (ret){
+               case 1:
+                       loop('s');
+                       break;
+               case 2:
+                       loop('c');
+                       break;
+               case 3: 
+                       KnifeSubdivide(KNIFE_EXACT);
+                       break;
+               case 4:
+                       KnifeSubdivide(KNIFE_MIDPOINT);
+       }
+
+}
+
 /*********************** EDITMESH UNDO ********************************/
 /* Mesh Edit undo by Alexander Ewring,                                */
 /* ported by Robert Wenzlaff                                          */
@@ -7644,4 +7667,4 @@ void undo_menu_mesh(void)
 
        if (event==1) remake_editMesh();
        else undo_pop_mesh(G.undo_edit_level-event+3);
-}
\ No newline at end of file
+}
index 6502fcc6ea0a4c94599adca5482e20321c048d16..dc196c661f3082a2856e812f1c0ba18db22b9f8b 100644 (file)
@@ -1020,8 +1020,9 @@ void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                break;
                        case KKEY:
                                if(G.obedit) {
-                                       if (G.qual & LR_SHIFTKEY ){
-                                               if (G.obedit->type==OB_MESH) KnifeSubdivide(KNIFE_PROMPT);
+                                       if (G.obedit->type==OB_MESH) {
+                                               if (G.qual & LR_SHIFTKEY) KnifeSubdivide(KNIFE_PROMPT);
+                                               else LoopMenu();
                                        }
                                        else if(G.obedit->type==OB_SURF) printknots();
                                }