Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_nla/nla_draw.c
| Show First 20 Lines • Show All 105 Lines • ▼ Show 20 Lines | static void nla_action_draw_keyframes( | ||||
| if (ED_keylist_is_empty(keylist)) { | if (ED_keylist_is_empty(keylist)) { | ||||
| ED_keylist_free(keylist); | ED_keylist_free(keylist); | ||||
| return; | return; | ||||
| } | } | ||||
| /* draw a darkened region behind the strips | /* draw a darkened region behind the strips | ||||
| * - get and reset the background color, this time without the alpha to stand out better | * - get and reset the background color, this time without the alpha to stand out better | ||||
| * (amplified alpha is used instead) | * (amplified alpha is used instead, but clamped to avoid 100% opacity) | ||||
| */ | */ | ||||
| float color[4]; | float color[4]; | ||||
| nla_action_get_color(adt, act, color); | nla_action_get_color(adt, act, color); | ||||
| color[3] *= 2.5f; | color[3] = min_ff(0.7f, color[3] * 2.5f); | ||||
| GPUVertFormat *format = immVertexFormat(); | GPUVertFormat *format = immVertexFormat(); | ||||
| uint pos_id = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos_id = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | ||||
| immUniformColor4fv(color); | immUniformColor4fv(color); | ||||
| ▲ Show 20 Lines • Show All 654 Lines • ▼ Show 20 Lines | if (IN_RANGE(ymin, v2d->cur.ymin, v2d->cur.ymax) || | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| case ANIMTYPE_NLAACTION: { | case ANIMTYPE_NLAACTION: { | ||||
| AnimData *adt = ale->adt; | AnimData *adt = ale->adt; | ||||
| /* Draw the manually set intended playback frame range highlight. */ | |||||
| if (ale->data) { | |||||
| ANIM_draw_action_framerange(adt, ale->data, v2d, ymin, ymax); | |||||
| } | |||||
| uint pos = GPU_vertformat_attr_add( | uint pos = GPU_vertformat_attr_add( | ||||
| immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | ||||
| /* just draw a semi-shaded rect spanning the width of the viewable area if there's data, | /* just draw a semi-shaded rect spanning the width of the viewable area if there's data, | ||||
| * and a second darker rect within which we draw keyframe indicator dots if there's data | * and a second darker rect within which we draw keyframe indicator dots if there's data | ||||
| */ | */ | ||||
| GPU_blend(GPU_BLEND_ALPHA); | GPU_blend(GPU_BLEND_ALPHA); | ||||
| ▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines | |||||