[Bf-committers] Improved Loop Cut REVISED (CTRL/SHIFT/MMB)

Robert Tiess bf-committers@blender.org
Wed, 18 Feb 2004 18:05:18 -0500

Martin Poirier wrote:

>On that subject, I was talking with someone from the
>french community and we thought that it would be a
>good idea to map Cut to 50% to middle mouse. That way
>you could easily and quickly cut at 50%.
>Right now, Ctrl constrain to 1% incrementations. I
>suggest that to be changed to fit a more
>transform-like standard:
>- Ctrl constrain to 10% increments
>- Shift (or Ctrl-Shift) constraint to 1%

Hi, Martin!  I'm enclosing a patch based on your suggestions.
If you get the chance to check it out let me know if it's what you
wanted.  I have it set right now so that mmb exits the loopoperation
search loop and commits the cut immediately (done by setting
search=0).  If you'd like it instead to be so that the user holds the
mmb for 50% cut preview and then presses lmb or enter/return
to commit the cut, then the search=0 line just needs to be removed.
I like the immediacy of the mmb cut though.  Nice and fast!
BTW, I maintained the indentation of the first CTRLKEY constraint,
although in my editor it looked like this code block should have
been indented once more to the right.  Just wanted to point that out :-)
If anything should be changed let me know.  Thanks!


patch code begins with next line:
Index: editmesh.c
RCS file: /cvsroot/bf-blender/blender/source/blender/src/editmesh.c,v
retrieving revision 1.72
diff -r1.72 editmesh.c
<         if (G.qual & LR_CTRLKEY)
<             percentcut = (int)(percentcut*100.0)/100.0;       
 >         /* 10% loop cut with CTRL KEY */
 >         if (G.qual & LR_CTRLKEY && !(G.qual & LR_SHIFTKEY)) {
 >             percentcut = (int)(percentcut*10.0)/10.0;
 >         }
 >         /* 1% loop cut with SHIFT KEY */
 >         if (G.qual & LR_SHIFTKEY && !(G.qual & LR_CTRLKEY)) {
 >             percentcut = (int)(percentcut*100.0)/100.0;
 >         }
 >         /* 50% loop cut with MIDDLE MOUSE BUTTON */
 >         if (get_mbut()&M_MOUSE) {
 >             percentcut = 0.50;   
 >             searching=0;
 >         }