diff options
author | Joshua Leung <aligorith@gmail.com> | 2012-07-20 16:18:45 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2012-07-20 16:18:45 +0400 |
commit | 54d29215085c687b59272dedf27ce573da62b9b3 (patch) | |
tree | 544301a70cd8d22edc13d8887ebcd6c4b79e9deb /source/blender/editors/animation/keyframes_draw.c | |
parent | 3b26b46631eefe5a38b54c6465dc5dd82f2c6294 (diff) |
Keyframes from lib-linked actions are now drawn ghosted (just like those of
protected/unmodifiable channels),
Diffstat (limited to 'source/blender/editors/animation/keyframes_draw.c')
-rw-r--r-- | source/blender/editors/animation/keyframes_draw.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index 84711b97729..85731933168 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -674,15 +674,15 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa if (keys) { /* locked channels are less strongly shown, as feedback for locked channels in DopeSheet */ /* TODO: allow this opacity factor to be themed? */ - float kalpha = (channelLocked) ? 0.35f : 1.0f; - + float kalpha = (channelLocked) ? 0.25f : 1.0f; + for (ak = keys->first; ak; ak = ak->next) { /* optimization: if keyframe doesn't appear within 5 units (screenspace) in visible area, don't draw * - this might give some improvements, since we current have to flip between view/region matrices */ if (IN_RANGE_INCL(ak->cfra, v2d->cur.xmin, v2d->cur.xmax) == 0) continue; - + /* draw using OpenGL - uglier but faster */ /* NOTE1: a previous version of this didn't work nice for some intel cards * NOTE2: if we wanted to go back to icons, these are icon = (ak->sel & SELECT) ? ICON_SPACE2 : ICON_SPACE3; */ @@ -753,6 +753,10 @@ void draw_fcurve_channel(View2D *v2d, AnimData *adt, FCurve *fcu, float ypos) { DLRBT_Tree keys, blocks; + short locked = (fcu->flag & FCURVE_PROTECTED) || + ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) || + ((adt && adt->action) && (adt->action->id.lib)); + BLI_dlrbTree_init(&keys); BLI_dlrbTree_init(&blocks); @@ -761,7 +765,7 @@ void draw_fcurve_channel(View2D *v2d, AnimData *adt, FCurve *fcu, float ypos) BLI_dlrbTree_linkedlist_sync(&keys); BLI_dlrbTree_linkedlist_sync(&blocks); - draw_keylist(v2d, &keys, &blocks, ypos, (fcu->flag & FCURVE_PROTECTED)); + draw_keylist(v2d, &keys, &blocks, ypos, locked); BLI_dlrbTree_free(&keys); BLI_dlrbTree_free(&blocks); @@ -771,6 +775,9 @@ void draw_agroup_channel(View2D *v2d, AnimData *adt, bActionGroup *agrp, float y { DLRBT_Tree keys, blocks; + short locked = (agrp->flag & AGRP_PROTECTED) || + ((adt && adt->action) && (adt->action->id.lib)); + BLI_dlrbTree_init(&keys); BLI_dlrbTree_init(&blocks); @@ -779,7 +786,7 @@ void draw_agroup_channel(View2D *v2d, AnimData *adt, bActionGroup *agrp, float y BLI_dlrbTree_linkedlist_sync(&keys); BLI_dlrbTree_linkedlist_sync(&blocks); - draw_keylist(v2d, &keys, &blocks, ypos, (agrp->flag & AGRP_PROTECTED)); + draw_keylist(v2d, &keys, &blocks, ypos, locked); BLI_dlrbTree_free(&keys); BLI_dlrbTree_free(&blocks); @@ -789,6 +796,8 @@ void draw_action_channel(View2D *v2d, AnimData *adt, bAction *act, float ypos) { DLRBT_Tree keys, blocks; + short locked = (act->id.lib != 0); + BLI_dlrbTree_init(&keys); BLI_dlrbTree_init(&blocks); @@ -797,7 +806,7 @@ void draw_action_channel(View2D *v2d, AnimData *adt, bAction *act, float ypos) BLI_dlrbTree_linkedlist_sync(&keys); BLI_dlrbTree_linkedlist_sync(&blocks); - draw_keylist(v2d, &keys, &blocks, ypos, 0); + draw_keylist(v2d, &keys, &blocks, ypos, locked); BLI_dlrbTree_free(&keys); BLI_dlrbTree_free(&blocks); |