Bugfix #17717: IPOs / Sequencer / Markers: deleting an IPO delete also selected markers

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.
This commit is contained in:
Joshua Leung
2008-10-01 00:02:06 +00:00
parent 808d6197cf
commit c3602099c8
8 changed files with 62 additions and 40 deletions

View 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
delete_action_keys();
if (mval[0] >= NAMEWIDTH)
remove_marker();
allqueue(REDRAWMARKER, 0);
}
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();
}
}
allqueue(REDRAWMARKER, 0);
break;
case ACCENTGRAVEKEY:

View 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;

View 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, "");

View 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, "");

View 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, "");

View 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, "");

View 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

View 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);