Bugfix #17717: IPOs / Sequencer / Markers: deleting an IPO delete also selected markers
authorJoshua Leung <aligorith@gmail.com>
Wed, 1 Oct 2008 00:02:06 +0000 (00:02 +0000)
committerJoshua Leung <aligorith@gmail.com>
Wed, 1 Oct 2008 00:02:06 +0000 (00:02 +0000)
Final attempt at solving this problem. This time I've decided to separate the 'delete markers' from the 'delete keys' hotkeys, as it proved to be too problematic for users.

The new hotkey for deleting markers is "Shift-XKEY". (or Shift-Delkey)
P.S. I know that 'Shift' is usually used for 'add' operations, but this will have to do for now...

----

Also, rearranged button order in Timeline header a bit to group keyframing buttons together more.

source/blender/src/editaction.c
source/blender/src/editnla.c
source/blender/src/header_action.c
source/blender/src/header_ipo.c
source/blender/src/header_nla.c
source/blender/src/header_seq.c
source/blender/src/header_time.c
source/blender/src/space.c

index fbcb78ec066567fa21291cad293950381ef9a45e..d10f354ed7a07548db53f85f1d203382e9674cfb 100644 (file)
@@ -5155,21 +5155,28 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                        
                case DELKEY:
                case XKEY:
-                       if (okee("Erase selected")) {
-                               if (mval[0] < NAMEWIDTH) {
-                                       if (datatype == ACTCONT_ACTION)
-                                               delete_action_channels();
-                                       else if (datatype == ACTCONT_GPENCIL)
-                                               delete_gpencil_layers();
+                       /* markers are incorported under shift-modifier (it does go against conventions, but oh well :/) */
+                       if (G.qual == LR_SHIFTKEY) {
+                               if (okee("Erase selected marker(s)?")) {
+                                       if (mval[0] >= NAMEWIDTH)
+                                               remove_marker();
+                               }
+                       }
+                       else {
+                               if (okee("Erase selected?")) {
+                                       if (mval[0] < NAMEWIDTH) {
+                                               if (datatype == ACTCONT_ACTION)
+                                                       delete_action_channels();
+                                               else if (datatype == ACTCONT_GPENCIL)
+                                                       delete_gpencil_layers();
+                                       }
+                                       else
+                                               delete_action_keys();
                                }
-                               else
-                                       delete_action_keys();
-                               
-                               if (mval[0] >= NAMEWIDTH)
-                                       remove_marker();
-                               
-                               allqueue(REDRAWMARKER, 0);
                        }
+                       
+                       allqueue(REDRAWMARKER, 0);
+                       
                        break;
                
                case ACCENTGRAVEKEY:
index dbc0deecb2cae140def1e887f362347c3d67e03a..2c17b20735b3ff9bbe3749224609ed3e6aefa53e 100644 (file)
@@ -1940,15 +1940,20 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                
                        case DELKEY:
                        case XKEY:
-                               if (mval[0]>=NLAWIDTH) {
-                                       if (okee("Erase selected?")) {
-                                               delete_nlachannel_keys();
-                                               update_for_newframe_muted();
-                                               
-                                               remove_marker();
-                                               
-                                               allqueue(REDRAWMARKER, 0);
+                               if (mval[0] >= NLAWIDTH) {
+                                       /* markers are incorported under shift-modifier (it does go against conventions, but oh well :/) */
+                                       if (G.qual == LR_SHIFTKEY) {
+                                               if (okee("Erase selected marker(s)?"))
+                                                       remove_marker();
                                        }
+                                       else {
+                                               if (okee("Erase selected?")) {
+                                                       delete_nlachannel_keys();
+                                                       update_for_newframe_muted();
+                                               }
+                                       }
+                                       
+                                       allqueue(REDRAWMARKER, 0);
                                }
                                break;
                                
index 4bb7bb9677e2e51e13e08d041e22d8d291fdb3ed..2834a41e9ecfe0d3ed0b84f577871197c95c4444 100644 (file)
@@ -1568,7 +1568,7 @@ static uiBlock *action_markermenu(void *arg_unused)
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_ADD, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20, 
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_DUPLICATE, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20,
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|Shift X", 0, yco-=20,
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_DELETE, "");
                                        
        uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
index c2f84e1c4444dcfb84daf4ec4857e1594097f5e3..27549a5b5020f1dacd0f10eb71f7fc1691739fc3 100644 (file)
@@ -923,7 +923,7 @@ static uiBlock *ipo_markermenu(void *arg_unused)
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20, 
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20,
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|Shift X", 0, yco-=20,
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
                                         
        uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
index 13bbf0a399973fb4104e7196644b9e94be8c834f..d0031b2db7cae3c83510a19ed9257adc708fa8d3 100644 (file)
@@ -441,7 +441,7 @@ static uiBlock *nla_markermenu(void *arg_unused)
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20, 
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20,
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|Shift X", 0, yco-=20,
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
                                         
        uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
index e5a63b9fe458d8fbc42d458d96c4ece1d9598b65..8138918877f1e101f749ea528d8f4bbbab70eddb 100644 (file)
@@ -600,7 +600,7 @@ static uiBlock *seq_markermenu(void *arg_unused)
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20, 
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker", 0, yco-=20,
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|Shift X", 0, yco-=20,
                                         menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
                                         
        uiDefBut(block, SEPR, 0, "",        0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
index 5de4d744a0a781d023244c2a858ed69593181bcb..51f71e5bdab078d6d2c2985122f9db7f461cbc90 100644 (file)
@@ -559,17 +559,12 @@ void time_buttons(ScrArea *sa)
        if (IS_AUTOKEY_ON) {
                uiDefButS(block, MENU, REDRAWINFO, 
                                        "Auto-Keying Mode %t|Add/Replace Keys%x3|Replace Keys %x5", 
-                                       xco, 0, 3*XIC, YIC, &(G.scene->autokey_mode), 0, 1, 0, 0, 
+                                       xco, 0, 3.5*XIC, YIC, &(G.scene->autokey_mode), 0, 1, 0, 0, 
                                        "Mode of automatic keyframe insertion for Objects and Bones");
                xco+= (4*XIC);
        }
        
        xco+= 16;
-
-       uiDefIconButBitI(block, TOG, TIME_WITH_SEQ_AUDIO, B_DIFF, ICON_SPEAKER,
-                                        xco, 0, XIC, YIC, &(stime->redraws), 0, 0, 0, 0, "Play back and sync with audio from Sequence Editor");
-       
-       xco+= XIC+16;
        
        uiDefIconBut(block, BUT, B_TL_INSERTKEY, ICON_KEY_HLT,
                        xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Insert Keyframe for the context of the largest area (IKEY)");
@@ -578,6 +573,12 @@ void time_buttons(ScrArea *sa)
                        xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Delete Keyframe for the context of the largest area (ALTKEY-IKEY)");
        xco+= XIC+4;
        
+       xco+= 16;
+       
+       uiDefIconButBitI(block, TOG, TIME_WITH_SEQ_AUDIO, B_DIFF, ICON_SPEAKER,
+                                        xco, 0, XIC, YIC, &(stime->redraws), 0, 0, 0, 0, "Play back and sync with audio from Sequence Editor");
+       
+       
        /* always as last  */
        sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon
 
index 76ba4275c1a3498b13914f148813befd183318a5..0339747ec667fb4d169ec8b206752962c75ad195 100644 (file)
@@ -3255,16 +3255,21 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                        break;
                case XKEY:
                case DELKEY:
-                       if (okee("Erase selected")) {
-                               remove_marker();
-                               del_ipo(0);
-                               
-                               /* note: don't update the other spaces (in particular ipo)
-                                *               or else curves disappear.
-                                */
-                               allqueue(REDRAWTIME, 0);
-                               allqueue(REDRAWSOUND, 0);
+                       /* markers are incorported under shift-modifier (it does go against conventions, but oh well :/) */
+                       if (G.qual == LR_SHIFTKEY) {
+                               if (okee("Erase selected marker(s)?"))
+                                       remove_marker();
+                       }
+                       else {
+                               if (okee("Erase selected?"))
+                                       del_ipo(0);
                        }
+                       
+                       /* note: don't update the other spaces (in particular ipo)
+                        *               or else curves disappear.
+                        */
+                       allqueue(REDRAWTIME, 0);
+                       allqueue(REDRAWSOUND, 0);
                        break;
                case ACCENTGRAVEKEY:
                        if((G.qual==0)) {
@@ -5206,6 +5211,10 @@ static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
                                if(sseq->mainb)
                                        gpencil_delete_menu();
                        }
+                       else if(G.qual==LR_SHIFTKEY) {
+                               /* markers are incorported under shift-modifier (it does go against conventions, but oh well :/) */
+                               remove_marker();
+                       }
                        break;
                case PAD1: case PAD2: case PAD4: case PAD8:
                        seq_viewzoom(event, (G.qual & LR_SHIFTKEY)==0);