=bmesh= undo loopcut commit, for some reason the recent merge didn't catch it
authorJoseph Eagar <joeedh@gmail.com>
Mon, 9 May 2011 20:43:05 +0000 (20:43 +0000)
committerJoseph Eagar <joeedh@gmail.com>
Mon, 9 May 2011 20:43:05 +0000 (20:43 +0000)
source/blender/editors/mesh/knifetool.c
source/blender/editors/mesh/loopcut.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_ops.c
source/blender/makesdna/DNA_windowmanager_types.h
source/blender/windowmanager/intern/wm_operators.c

index 9d907a824822635af180cb82dfc2ce6c0708b20b..0315fa805067792e9acf4beecd9dcdbc1209a681 100755 (executable)
@@ -1707,6 +1707,8 @@ static int knifetool_init (bContext *C, wmOperator *op, int UNUSED(do_cut))
        kcd->vthresh = KMAXDIST-1;
        kcd->ethresh = KMAXDIST;
        
+       kcd->extend = 1;
+       
        knife_recalc_projmat(kcd);
        
        ED_region_tag_redraw(kcd->ar);
@@ -1825,7 +1827,11 @@ static int knifetool_modal (bContext *C, wmOperator *op, wmEvent *event)
                        return OPERATOR_RUNNING_MODAL;
                        
                case EKEY:
-                       kcd->extend = event->val!=KM_RELEASE;
+                       kcd->extend = event->val==KM_RELEASE;
+                       if (event->val == KM_RELEASE) {
+                               knife_finish_cut(kcd);
+                               kcd->mode = MODE_IDLE;
+                       }
                        return OPERATOR_RUNNING_MODAL;
                case LEFTCTRLKEY:
                case RIGHTCTRLKEY:
index 6c6d4e3bd4ab78b793b2064b772c982d54c2345f..58d3ce71ad8eafb45913673983e60225f2ccc362 100644 (file)
@@ -104,9 +104,6 @@ typedef struct tringselOpData {
 
        int extend;
        int do_cut;
-       
-       double leftmouse_time;
-       wmTimer *timer;
 } tringselOpData;
 
 /* modal loop selection drawing callback */
@@ -346,9 +343,6 @@ static void ringsel_exit(bContext *C, wmOperator *op)
 {
        tringselOpData *lcd= op->customdata;
        
-       if (lcd->timer)
-               WM_event_remove_timer(CTX_wm_manager(C), CTX_wm_window(C), lcd->timer);
-       
        /* deactivate the extra drawing stuff in 3D-View */
        ED_region_draw_cb_exit(lcd->ar->type, lcd->draw_handle);
        
@@ -431,10 +425,6 @@ static int ringcut_invoke (bContext *C, wmOperator *op, wmEvent *evt)
        BMEdge *edge;
        int dist = 75;
 
-       /*if we're in the cut-n-slide macro, set release_confirm based on user pref*/
-       if (op->opm)
-               RNA_boolean_set(op->next->ptr, "release_confirm", U.loopcut_finish_on_release);
-       
        if(modifiers_isDeformedByLattice(obedit) || modifiers_isDeformedByArmature(obedit))
                BKE_report(op->reports, RPT_WARNING, "Loop cut doesn't work well on deformed edit mesh display");
        
@@ -470,7 +460,7 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
        switch (event->type) {
                case RETKEY:
                case LEFTMOUSE: /* confirm */ // XXX hardcoded
-                       if (event->val == KM_RELEASE) {
+                       if (event->val == KM_PRESS) {
                                /* finish */
                                ED_region_tag_redraw(lcd->ar);
                                
@@ -479,24 +469,11 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
                                
                                ED_area_headerprint(CTX_wm_area(C), NULL);
                                
-                               return OPERATOR_FINISHED|OPERATOR_ABORT_MACRO;
-                       } else {
-                               lcd->timer = WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER2, 0.12);
+                               return OPERATOR_FINISHED;
                        }
                        
                        ED_region_tag_redraw(lcd->ar);
                        break;
-               case TIMER2: 
-                       /* finish */
-                       ED_region_tag_redraw(lcd->ar);
-                       
-                       ringsel_finish(C, op);
-                       ringsel_exit(C, op);
-                       
-                       ED_area_headerprint(CTX_wm_area(C), NULL);
-
-                       return OPERATOR_FINISHED;
-               
                case RIGHTMOUSE: /* abort */ // XXX hardcoded
                        ED_region_tag_redraw(lcd->ar);
                        ringsel_exit(C, op);
index fd2bb59294bb81840a010272d33f391c0b756d3b..a9792ebaca3bcb668a4d5d4c8854024d172ce330 100644 (file)
@@ -1525,8 +1525,6 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
        t->mode = mode;
 
        t->launch_event = event ? event->type : -1;
-       if (RNA_property_is_set(op->ptr, "launch_event"))
-               t->launch_event = RNA_int_get(op->ptr, "launch_event");
 
        if (t->launch_event == EVT_TWEAK_R)
        {
index 0cb81a3d4ccf6d8c4449bc29dceb912f0b24ba8d..4edaabb9508c3bd933f2db00c00fc40ae5003475 100644 (file)
@@ -499,8 +499,6 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
        // Add confirm method all the time. At the end because it's not really that important and should be hidden only in log, not in keymap edit
        /*prop =*/ RNA_def_boolean(ot->srna, "release_confirm", 0, "Confirm on Release", "Always confirm operation when releasing button");
        //RNA_def_property_flag(prop, PROP_HIDDEN);
-
-       RNA_def_int(ot->srna, "launch_event", -1, 0, INT_MAX, "", "", -1, INT_MAX);
 }
 
 void TRANSFORM_OT_translate(struct wmOperatorType *ot)
index 6c3e52004c0d268785da35bad4a410cda18152d7..769f0ad17db3f145a1c913ec251480c173d5d5ce 100644 (file)
@@ -313,7 +313,6 @@ typedef struct wmOperator {
 #define OPERATOR_PASS_THROUGH  8
 /* in case operator got executed outside WM code... like via fileselect */
 #define OPERATOR_HANDLED               16
-#define OPERATOR_ABORT_MACRO   32
 
 /* wmOperator flag */
 #define OP_GRAB_POINTER                        1
index b2f3eb52ecd4a769abef2bc2530a10ec8f1075fd..dc1ef324d6142eda127c9e8ca2c7317c94257b94 100644 (file)
@@ -208,7 +208,7 @@ static int wm_macro_exec(bContext *C, wmOperator *op)
                if(opm->type->exec) {
                        retval= opm->type->exec(C, opm);
                
-                       if ((retval & OPERATOR_FINISHED) && !(retval & OPERATOR_ABORT_MACRO)) {
+                       if (retval & OPERATOR_FINISHED) {
                                MacroData *md = op->customdata;
                                md->retval = OPERATOR_FINISHED; /* keep in mind that at least one operator finished */
                        } else {
@@ -233,7 +233,7 @@ static int wm_macro_invoke_internal(bContext *C, wmOperator *op, wmEvent *event,
 
                BLI_movelisttolist(&op->reports->list, &opm->reports->list);
                
-               if ((retval & OPERATOR_FINISHED) && !(retval & OPERATOR_ABORT_MACRO)) {
+               if (retval & OPERATOR_FINISHED) {
                        MacroData *md = op->customdata;
                        md->retval = OPERATOR_FINISHED; /* keep in mind that at least one operator finished */
                } else {
@@ -261,7 +261,7 @@ static int wm_macro_modal(bContext *C, wmOperator *op, wmEvent *event)
                retval = opm->type->modal(C, opm, event);
 
                /* if this one is done but it's not the last operator in the macro */
-               if (opm->next && (retval & OPERATOR_FINISHED) && !(retval & OPERATOR_ABORT_MACRO)) {
+               if (opm->next && (retval & OPERATOR_FINISHED)) {
                        MacroData *md = op->customdata;
 
                        md->retval = OPERATOR_FINISHED; /* keep in mind that at least one operator finished */