diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-02-09 13:33:05 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-02-09 13:33:05 +0300 |
commit | 2b818935fe708f5f386375d484faa35b9163b4c7 (patch) | |
tree | 094c11ab4f05b62005711732172aaf424bf53275 | |
parent | 59736af8fc39246b82213ff0e9c8f917ed36a34c (diff) |
Graph Editor: Drawing tweaks for previous commit
* Group channels are drawn with better indention now
* Colors for group channels in Graph Editor are now initialised properly
* When selecting individual keyframes in Graph Editor, it is now possible to see which curve it belonged to, as the 'active' and 'selected' flags are set on that curve only.
-rw-r--r-- | source/blender/editors/interface/resources.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_select.c | 35 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 11 |
5 files changed, 37 insertions, 15 deletions
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 33e738cfc68..d55a40f9bbb 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -452,6 +452,8 @@ void ui_theme_init_userdef(void) SETCOL(btheme->tipo.ds_channel, 82, 96, 110, 255); SETCOL(btheme->tipo.ds_subchannel, 124, 137, 150, 255); + SETCOL(btheme->tipo.group, 22, 112, 0, 255); + SETCOL(btheme->tipo.group_active, 125, 233, 96, 255); /* space file */ /* to have something initialized */ diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 2908d3b8e33..4fb0690572e 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -594,7 +594,7 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar) indent= 0; special= -1; - offset= (ale->id) ? 18 : 0; + offset= (ale->id) ? 16 : 0; /* only show expand if there are any channels */ if (agrp->channels.first) { diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index a6424c8f5b6..f05606fbfa6 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -875,7 +875,7 @@ void graph_draw_channel_names(bAnimContext *ac, SpaceIpo *sipo, ARegion *ar) indent= 0; special= -1; - offset= (ale->id) ? 18 : 0; + offset= (ale->id) ? 16 : 0; /* only show expand if there are any channels */ if (agrp->channels.first) { diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 2a9cab17e3a..be2f6dda0e0 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -121,7 +121,6 @@ static void deselect_graph_keys (bAnimContext *ac, short test, short sel) test_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED); /* See if we should be selecting or deselecting */ - // xxx check for curves too if (test) { for (ale= anim_data.first; ale; ale= ale->next) { if (ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, test_cb, NULL)) { @@ -135,9 +134,21 @@ static void deselect_graph_keys (bAnimContext *ac, short test, short sel) sel_cb= ANIM_editkeyframes_select(sel); /* Now set the flags */ - // xxx check for curves too - for (ale= anim_data.first; ale; ale= ale->next) + for (ale= anim_data.first; ale; ale= ale->next) { + FCurve *fcu= (FCurve *)ale->key_data; + + /* Keyframes First */ ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, sel_cb, NULL); + + /* Curve Selection too */ + if (sel == SELECT_ADD) + fcu->flag |= FCURVE_SELECTED; + else if (sel == SELECT_SUBTRACT) + fcu->flag &= ~FCURVE_SELECTED; + else + fcu->flag ^= FCURVE_SELECTED; + fcu->flag &= ~FCURVE_ACTIVE; + } /* Cleanup */ BLI_freelistN(&anim_data); @@ -664,12 +675,6 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short selectmode) selectmode= SELECT_ADD; } - /* select or deselect? */ - if (selectmode == SELECT_ADD) - fcu->flag |= (FCURVE_ACTIVE|FCURVE_SELECTED); - else if (selectmode == SELECT_INVERT) - fcu->flag ^= (FCURVE_ACTIVE|FCURVE_SELECTED); - /* if we're selecting points too */ if ( ((fcu->flag & FCURVE_PROTECTED)==0) /*|| (curvesonly == 0) */) { /* only if there's keyframe */ @@ -712,6 +717,18 @@ static void mouse_graph_keys (bAnimContext *ac, int mval[], short selectmode) } } } + + /* select or deselect curve? */ + if (selectmode == SELECT_INVERT) { + fcu->flag ^= FCURVE_SELECTED; + + if (fcu->flag & FCURVE_SELECTED) + fcu->flag |= FCURVE_ACTIVE; + else + fcu->flag &= ~FCURVE_ACTIVE; + } + else if (selectmode == SELECT_ADD) + fcu->flag |= (FCURVE_ACTIVE|FCURVE_SELECTED); } /* Option 2) Selects all the keyframes on either side of the current frame (depends on which side the mouse is on) */ diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 04583c45ec0..484d97e7b71 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -331,12 +331,15 @@ static void init_userdef_themes(void) /* adjust themes */ for (btheme= U.themes.first; btheme; btheme= btheme->next) { /* DopeSheet - (Object) Channel color */ - SETCOL(btheme->tact.ds_channel, 0x36, 0x13, 0xca, 255); - SETCOL(btheme->tact.ds_subchannel, 0x60, 0x43, 0xd2, 255); + SETCOL(btheme->tact.ds_channel, 82, 96, 110, 255); + SETCOL(btheme->tact.ds_subchannel, 124, 137, 150, 255); /* Graph Editor - (Object) Channel color */ - SETCOL(btheme->tipo.ds_channel, 0x36, 0x13, 0xca, 255); - SETCOL(btheme->tipo.ds_subchannel, 0x60, 0x43, 0xd2, 255); + SETCOL(btheme->tipo.ds_channel, 82, 96, 110, 255); + SETCOL(btheme->tipo.ds_subchannel, 124, 137, 150, 255); + /* Graph Editor - Group Channel color */ + SETCOL(btheme->tipo.group, 22, 112, 0, 255); + SETCOL(btheme->tipo.group_active, 125, 233, 96, 255); } /* adjust grease-pencil distances */ |