Fix #30489: Loop Cut by Typing Numbers Is Limited to 32?
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 8 Mar 2012 13:20:06 +0000 (13:20 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 8 Mar 2012 13:20:06 +0000 (13:20 +0000)
Increase numbering input of number of loop cuts to 130 as it was in 2.49.
Also display count of cuts in a header.

source/blender/editors/mesh/loopcut.c

index 5104ed02f536df6c4bc690cb049cc660c0d5b385..86469ae54614d5f12d559ca6ece7ebfd8def9a4c 100644 (file)
@@ -431,6 +431,7 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
 {
        int cuts= RNA_int_get(op->ptr,"number_cuts");
        tringselOpData *lcd= op->customdata;
+       int show_cuts = 0;
 
        view3d_operator_needs_opengl(C);
 
@@ -477,6 +478,7 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
                        cuts++;
                        RNA_int_set(op->ptr,"number_cuts",cuts);
                        ringsel_find_edge(lcd, cuts);
+                       show_cuts = TRUE;
                        
                        ED_region_tag_redraw(lcd->ar);
                        break;
@@ -489,6 +491,7 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
                        cuts=MAX2(cuts-1,1);
                        RNA_int_set(op->ptr,"number_cuts",cuts);
                        ringsel_find_edge(lcd, cuts);
+                       show_cuts = TRUE;
                        
                        ED_region_tag_redraw(lcd->ar);
                        break;
@@ -517,15 +520,22 @@ static int loopcut_modal (bContext *C, wmOperator *op, wmEvent *event)
                if (handleNumInput(&lcd->num, event)) {
                        applyNumInput(&lcd->num, &value);
                        
-                       cuts= CLAMPIS(value, 1, 32);
+                       cuts= CLAMPIS(value, 1, 130);
                        
                        RNA_int_set(op->ptr,"number_cuts",cuts);
                        ringsel_find_edge(lcd, cuts);
+                       show_cuts = TRUE;
                        
                        ED_region_tag_redraw(lcd->ar);
                }
        }
        
+       if (show_cuts) {
+               char buf[64];
+               BLI_snprintf(buf, sizeof(buf), "Number of Cuts: %d", cuts);
+               ED_area_headerprint(CTX_wm_area(C), buf);
+       }
+       
        /* keep going until the user confirms */
        return OPERATOR_RUNNING_MODAL;
 }