Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_nla/nla_draw.c
| Show First 20 Lines • Show All 335 Lines • ▼ Show 20 Lines | if ((strip->extendmode != NLASTRIP_EXTEND_NOTHING) && (nonSolo == 0)) { | ||||
| glDisable(GL_BLEND); | glDisable(GL_BLEND); | ||||
| } | } | ||||
| /* draw 'inside' of strip itself */ | /* draw 'inside' of strip itself */ | ||||
| if (nonSolo == 0) { | if (nonSolo == 0) { | ||||
| /* strip is in normal track */ | /* strip is in normal track */ | ||||
| glColor3fv(color); | glColor3fv(color); | ||||
| uiSetRoundBox(UI_CNR_ALL); /* all corners rounded */ | UI_draw_roundbox_corner_set(UI_CNR_ALL); /* all corners rounded */ | ||||
| uiDrawBoxShade(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1); | UI_draw_roundbox_shade_x(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1); | ||||
| } | } | ||||
| else { | else { | ||||
| /* strip is in disabled track - make less visible */ | /* strip is in disabled track - make less visible */ | ||||
| glColor4f(color[0], color[1], color[2], 0.1f); | glColor4f(color[0], color[1], color[2], 0.1f); | ||||
| glEnable(GL_BLEND); | glEnable(GL_BLEND); | ||||
| glRectf(strip->start, yminc, strip->end, ymaxc); | glRectf(strip->start, yminc, strip->end, ymaxc); | ||||
| glDisable(GL_BLEND); | glDisable(GL_BLEND); | ||||
| Show All 19 Lines | else { | ||||
| glColor3f(0.0f, 0.0f, 0.0f); | glColor3f(0.0f, 0.0f, 0.0f); | ||||
| } | } | ||||
| /* - line style: dotted for muted */ | /* - line style: dotted for muted */ | ||||
| if (strip->flag & NLASTRIP_FLAG_MUTED) | if (strip->flag & NLASTRIP_FLAG_MUTED) | ||||
| setlinestyle(4); | setlinestyle(4); | ||||
| /* draw outline */ | /* draw outline */ | ||||
| uiDrawBoxShade(GL_LINE_LOOP, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1); | UI_draw_roundbox_shade_x(GL_LINE_LOOP, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1); | ||||
| /* 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) && IS_EQF(strip->repeat, 1.0f) == 0) { | if ((strip->type == NLASTRIP_TYPE_CLIP) && IS_EQF(strip->repeat, 1.0f) == 0) { | ||||
| float repeatLen = (strip->actend - strip->actstart) * strip->scale; | float repeatLen = (strip->actend - strip->actstart) * strip->scale; | ||||
| int i; | int i; | ||||
| /* only draw lines for whole-numbered repeats, starting from the first full-repeat | /* only draw lines for whole-numbered repeats, starting from the first full-repeat | ||||
| * up to the last full repeat (but not if it lies on the end of the strip) | * up to the last full repeat (but not if it lies on the end of the strip) | ||||
| ▲ Show 20 Lines • Show All 274 Lines • ▼ Show 20 Lines | for (ale = anim_data.first; ale; ale = ale->next) { | ||||
| ANIM_channel_draw(ac, ale, yminc, ymaxc); | ANIM_channel_draw(ac, ale, yminc, ymaxc); | ||||
| } | } | ||||
| /* adjust y-position for next one */ | /* adjust y-position for next one */ | ||||
| y -= NLACHANNEL_STEP(snla); | y -= NLACHANNEL_STEP(snla); | ||||
| } | } | ||||
| } | } | ||||
| { /* second pass: UI widgets */ | { /* second pass: UI widgets */ | ||||
| uiBlock *block = uiBeginBlock(C, ar, __func__, UI_EMBOSS); | uiBlock *block = UI_block_begin(C, ar, __func__, UI_EMBOSS); | ||||
| size_t channel_index = 0; | size_t channel_index = 0; | ||||
| y = (float)(-NLACHANNEL_HEIGHT(snla)); | y = (float)(-NLACHANNEL_HEIGHT(snla)); | ||||
| /* set blending again, as may not be set in previous step */ | /* set blending again, as may not be set in previous step */ | ||||
| glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | ||||
| glEnable(GL_BLEND); | glEnable(GL_BLEND); | ||||
| Show All 10 Lines | for (ale = anim_data.first; ale; ale = ale->next) { | ||||
| ANIM_channel_draw_widgets(C, ac, ale, block, yminc, ymaxc, channel_index); | ANIM_channel_draw_widgets(C, ac, ale, block, yminc, ymaxc, channel_index); | ||||
| } | } | ||||
| /* adjust y-position for next one */ | /* adjust y-position for next one */ | ||||
| y -= NLACHANNEL_STEP(snla); | y -= NLACHANNEL_STEP(snla); | ||||
| channel_index++; | channel_index++; | ||||
| } | } | ||||
| uiEndBlock(C, block); | UI_block_end(C, block); | ||||
| uiDrawBlock(C, block); | UI_block_draw(C, block); | ||||
| glDisable(GL_BLEND); | glDisable(GL_BLEND); | ||||
| } | } | ||||
| /* free temporary channels */ | /* free temporary channels */ | ||||
| ANIM_animdata_freelist(&anim_data); | ANIM_animdata_freelist(&anim_data); | ||||
| } | } | ||||
| /* *********************************************** */ | /* *********************************************** */ | ||||