Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2014-01-16 15:00:40 +0400
committerJoshua Leung <aligorith@gmail.com>2014-01-17 05:53:03 +0400
commit607df8090b4eeb2d7762734a2adb83e67e83124f (patch)
tree516441722a4b7174736a9b175d94a312d8f1887a /source/blender/editors/animation/keyframes_draw.c
parentd8fa72bfb187f8091aa22e6acc0b00d254b807db (diff)
Fix for long keyframes not getting faded out with their associated keyframes on protected channels
Diffstat (limited to 'source/blender/editors/animation/keyframes_draw.c')
-rw-r--r--source/blender/editors/animation/keyframes_draw.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index fd350ada15c..859485a55a6 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -660,6 +660,7 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa
{
ActKeyColumn *ak;
ActKeyBlock *ab;
+ float alpha;
float xscale;
float iconsize = U.widget_unit / 4.0f;
glEnable(GL_BLEND);
@@ -667,15 +668,24 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa
/* get View2D scaling factor */
UI_view2d_getscale(v2d, &xscale, NULL);
+ /* locked channels are less strongly shown, as feedback for locked channels in DopeSheet */
+ /* TODO: allow this opacity factor to be themed? */
+ alpha = (channelLocked) ? 0.25f : 1.0f;
+
/* draw keyblocks */
if (blocks) {
for (ab = blocks->first; ab; ab = ab->next) {
if (actkeyblock_is_valid(ab, keys)) {
+ float color[4];
+
/* draw block */
if (ab->sel)
- UI_ThemeColor4(TH_STRIP_SELECT);
+ UI_GetThemeColor4fv(TH_STRIP_SELECT, color);
else
- UI_ThemeColor4(TH_STRIP);
+ UI_GetThemeColor4fv(TH_STRIP, color);
+
+ color[3] *= alpha;
+ glColor4fv(color);
glRectf(ab->start, ypos - iconsize, ab->end, ypos + iconsize);
}
@@ -684,10 +694,6 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa
/* draw keys */
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.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
@@ -698,7 +704,7 @@ static void draw_keylist(View2D *v2d, DLRBT_Tree *keys, DLRBT_Tree *blocks, floa
/* 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; */
- draw_keyframe_shape(ak->cfra, ypos, xscale, iconsize, (ak->sel & SELECT), ak->key_type, KEYFRAME_SHAPE_BOTH, kalpha);
+ draw_keyframe_shape(ak->cfra, ypos, xscale, iconsize, (ak->sel & SELECT), ak->key_type, KEYFRAME_SHAPE_BOTH, alpha);
}
}