Graph Editor: Bugfixes

* Fixed bug with curves sometimes not being displayed. Will investigate further tomorrow.
* Copy/Paste buttons in header now work. I've ported these over to use operator buttons
* Ctrl-Alt-Shift-RMB now selects all the keyframes in multiple F-Curves at once
This commit is contained in:
Joshua Leung
2009-04-12 13:19:21 +00:00
parent 2db495d4e3
commit 1fec143198
5 changed files with 12 additions and 10 deletions

View File

@@ -563,7 +563,7 @@ static int animdata_filter_action (ListBase *anim_data, bAction *act, int filter
lastchan= agrp->channels.last;
/* there are some situations, where only the channels of the animive group should get considered */
/* there are some situations, where only the channels of the action group should get considered */
if (!(filter_mode & ANIMFILTER_ACTGROUPED) || (agrp->flag & AGRP_ACTIVE)) {
/* filters here are a bit convoulted...
* - groups show a "summary" of keyframes beside their name which must accessable for tools which handle keyframes
@@ -574,8 +574,9 @@ static int animdata_filter_action (ListBase *anim_data, bAction *act, int filter
* - group is expanded
* - we're interested in keyframes, but not if they appear in selected channels
*/
// XXX what was the selection check here for again?
if ( (!(filter_mode & ANIMFILTER_VISIBLE) || EXPANDED_AGRP(agrp)) ||
( ANIMCHANNEL_SELOK(SEL_AGRP(agrp)) && (filter_mode & ANIMFILTER_CURVESONLY) ) )
( /*ANIMCHANNEL_SELOK(SEL_AGRP(agrp)) &&*/ (filter_mode & ANIMFILTER_CURVESONLY) ) )
{
if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_AGRP(agrp)) {
// XXX the 'owner' info here needs review...

View File

@@ -786,7 +786,7 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri
/* build list of curves to draw */
filter= (ANIMFILTER_VISIBLE|ANIMFILTER_CURVESONLY|ANIMFILTER_CURVEVISIBLE);
filter |= (sel) ? (ANIMFILTER_SEL) : (ANIMFILTER_UNSEL);
filter |= ((sel) ? (ANIMFILTER_SEL) : (ANIMFILTER_UNSEL));
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* for each curve:

View File

@@ -66,8 +66,6 @@
enum {
B_REDR = 0,
B_MODECHANGE,
B_GRAPHCOPYKEYS,
B_GRAPHPASTEKEYS,
} eActHeader_ButEvents;
/* ************************ header area region *********************** */
@@ -198,17 +196,17 @@ void graph_header_buttons(const bContext *C, ARegion *ar)
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCAM, B_REDR, ICON_CAMERA_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Cameras");
uiDefIconButBitI(block, TOGN, ADS_FILTER_NOCUR, B_REDR, ICON_CURVE_DATA, (short)(xco+=XIC),yco,XIC,YIC, &(sipo->ads->filterflag), 0, 0, 0, 0, "Display Curves");
uiBlockEndAlign(block);
xco += 30;
xco += 15;
}
else {
// XXX this case shouldn't happen at all... for now, just pad out same amount of space
xco += 6*XIC + 35;
xco += 6*XIC + 15;
}
/* copy + paste */
uiBlockBeginAlign(block);
uiDefIconBut(block, BUT, B_GRAPHCOPYKEYS, ICON_COPYDOWN, xco,yco,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected keyframes from the selected channel(s) to the buffer");
uiDefIconBut(block, BUT, B_GRAPHPASTEKEYS, ICON_PASTEDOWN, xco+=XIC,yco,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the keyframes from the buffer");
uiDefIconButO(block, BUT, "GRAPHEDIT_OT_keyframes_copy", WM_OP_INVOKE_REGION_WIN, ICON_COPYDOWN, xco+=XIC,yco,XIC,YIC, "Copies the selected keyframes from the selected channel(s) to the buffer");
uiDefIconButO(block, BUT, "GRAPHEDIT_OT_keyframes_paste", WM_OP_INVOKE_REGION_WIN, ICON_PASTEDOWN, xco+=XIC,yco,XIC,YIC, "Pastes the keyframes from the buffer");
uiBlockEndAlign(block);
xco += (XIC + 8);

View File

@@ -160,6 +160,9 @@ static void graphedit_keymap_keyframes (wmWindowManager *wm, ListBase *keymap)
RNA_enum_set(kmi->ptr, "left_right", GRAPHKEYS_LRSEL_TEST);
kmi= WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT, 0);
RNA_boolean_set(kmi->ptr, "curves", 1);
kmi= WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_clickselect", SELECTMOUSE, KM_PRESS, KM_CTRL|KM_ALT|KM_SHIFT, 0);
RNA_boolean_set(kmi->ptr, "curves", 1);
RNA_boolean_set(kmi->ptr, "extend", 1);
/* deselect all */
WM_keymap_add_item(keymap, "GRAPHEDIT_OT_keyframes_select_all_toggle", AKEY, KM_PRESS, 0, 0);

View File

@@ -671,7 +671,7 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short select_mode, s
select_mode= SELECT_ADD;
/* deselect all other channels and keyframes */
ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
//ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
deselect_graph_keys(ac, 0, SELECT_SUBTRACT);
}