Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_nla/nla_draw.c
| Show First 20 Lines • Show All 487 Lines • ▼ Show 20 Lines | static void nla_draw_strip(SpaceNla *snla, | ||||
| } | } | ||||
| /* draw 'inside' of strip itself */ | /* draw 'inside' of strip itself */ | ||||
| if (non_solo == 0 && is_nlastrip_enabled(adt, nlt, strip)) { | if (non_solo == 0 && is_nlastrip_enabled(adt, nlt, strip)) { | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| /* strip is in normal track */ | /* strip is in normal track */ | ||||
| UI_draw_roundbox_corner_set(UI_CNR_ALL); /* all corners rounded */ | UI_draw_roundbox_corner_set(UI_CNR_ALL); /* all corners rounded */ | ||||
| UI_draw_roundbox_shade_x(true, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1, color); | UI_draw_roundbox_shade_x( | ||||
| &(const rctf){ | |||||
| .xmin = strip->start, | |||||
| .xmax = strip->end, | |||||
| .ymin = yminc, | |||||
| .ymax = ymaxc, | |||||
| }, | |||||
| true, | |||||
| 0.0, | |||||
| 0.5, | |||||
| 0.1, | |||||
| color); | |||||
| /* restore current vertex format & program (roundbox trashes it) */ | /* restore current vertex format & program (roundbox trashes it) */ | ||||
| shdr_pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | shdr_pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | ||||
| } | } | ||||
| else { | else { | ||||
| /* strip is in disabled track - make less visible */ | /* strip is in disabled track - make less visible */ | ||||
| immUniformColor3fvAlpha(color, 0.1f); | immUniformColor3fvAlpha(color, 0.1f); | ||||
| Show All 37 Lines | static void nla_draw_strip(SpaceNla *snla, | ||||
| */ | */ | ||||
| if (muted) { | if (muted) { | ||||
| /* muted - draw dotted, squarish outline (for simplicity) */ | /* muted - draw dotted, squarish outline (for simplicity) */ | ||||
| shdr_pos = nla_draw_use_dashed_outlines(color, muted); | shdr_pos = nla_draw_use_dashed_outlines(color, muted); | ||||
| imm_draw_box_wire_2d(shdr_pos, strip->start, yminc, strip->end, ymaxc); | imm_draw_box_wire_2d(shdr_pos, strip->start, yminc, strip->end, ymaxc); | ||||
| } | } | ||||
| else { | else { | ||||
| /* non-muted - draw solid, rounded outline */ | /* non-muted - draw solid, rounded outline */ | ||||
| UI_draw_roundbox_shade_x(false, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1, color); | UI_draw_roundbox_shade_x( | ||||
| &(const rctf){ | |||||
| .xmin = strip->start, | |||||
| .xmax = strip->end, | |||||
| .ymin = yminc, | |||||
| .ymax = ymaxc, | |||||
| }, | |||||
| false, | |||||
| 0.0, | |||||
| 0.0, | |||||
| 0.1, | |||||
| color); | |||||
| /* restore current vertex format & program (roundbox trashes it) */ | /* restore current vertex format & program (roundbox trashes it) */ | ||||
| shdr_pos = nla_draw_use_dashed_outlines(color, muted); | shdr_pos = nla_draw_use_dashed_outlines(color, muted); | ||||
| } | } | ||||
| /* if action-clip strip, draw lines delimiting repeats too (in the same color as outline) */ | /* if action-clip strip, draw lines delimiting repeats too (in the same color as outline) */ | ||||
| if ((strip->type == NLASTRIP_TYPE_CLIP) && strip->repeat > 1.0f) { | if ((strip->type == NLASTRIP_TYPE_CLIP) && strip->repeat > 1.0f) { | ||||
| float repeatLen = (strip->actend - strip->actstart) * strip->scale; | float repeatLen = (strip->actend - strip->actstart) * strip->scale; | ||||
| ▲ Show 20 Lines • Show All 340 Lines • Show Last 20 Lines | |||||