Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/anim_channels_defines.c
| Show First 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | static void acf_generic_dataexpand_backdrop(bAnimContext *ac, | ||||
| short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0; | short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0; | ||||
| float color[3]; | float color[3]; | ||||
| uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| /* set backdrop drawing color */ | /* set backdrop drawing color */ | ||||
| acf->get_backdrop_color(ac, ale, color); | acf->get_backdrop_color(ac, ale, color); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immUniformColor3fv(color); | immUniformColor3fv(color); | ||||
| /* no rounded corner - just rectangular box */ | /* no rounded corner - just rectangular box */ | ||||
| immRectf(pos, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc); | immRectf(pos, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | static void acf_generic_channel_backdrop(bAnimContext *ac, | ||||
| short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0; | short offset = (acf->get_offset) ? acf->get_offset(ac, ale) : 0; | ||||
| float color[3]; | float color[3]; | ||||
| uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| /* set backdrop drawing color */ | /* set backdrop drawing color */ | ||||
| acf->get_backdrop_color(ac, ale, color); | acf->get_backdrop_color(ac, ale, color); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| immUniformColor3fv(color); | immUniformColor3fv(color); | ||||
| /* no rounded corners - just rectangular box */ | /* no rounded corners - just rectangular box */ | ||||
| immRectf(pos, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc); | immRectf(pos, offset, yminc, v2d->cur.xmax + EXTRA_SCROLL_PAD, ymaxc); | ||||
| immUnbindProgram(); | immUnbindProgram(); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 4,186 Lines • ▼ Show 20 Lines | if ((ac->spacetype == SPACE_GRAPH) && | ||||
| (acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE) || | (acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE) || | ||||
| acf->has_setting(ac, ale, ACHANNEL_SETTING_ALWAYS_VISIBLE))) { | acf->has_setting(ac, ale, ACHANNEL_SETTING_ALWAYS_VISIBLE))) { | ||||
| /* for F-Curves, draw color-preview of curve left to the visibility icon */ | /* for F-Curves, draw color-preview of curve left to the visibility icon */ | ||||
| if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE)) { | if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE)) { | ||||
| FCurve *fcu = (FCurve *)ale->data; | FCurve *fcu = (FCurve *)ale->data; | ||||
| 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_3D_UNIFORM_COLOR); | ||||
| /* F-Curve channels need to have a special 'color code' box drawn, | /* F-Curve channels need to have a special 'color code' box drawn, | ||||
| * which is colored with whatever color the curve has stored. | * which is colored with whatever color the curve has stored. | ||||
| */ | */ | ||||
| /* If the curve is hidden, make the rect less opaque. */ | /* If the curve is hidden, make the rect less opaque. */ | ||||
| float rect_alpha = (fcu->flag & FCURVE_VISIBLE) ? 1 : 0.3f; | float rect_alpha = (fcu->flag & FCURVE_VISIBLE) ? 1 : 0.3f; | ||||
| immUniformColor3fvAlpha(fcu->color, rect_alpha); | immUniformColor3fvAlpha(fcu->color, rect_alpha); | ||||
| ▲ Show 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | if (acf->name && !achannel_is_being_renamed(ac, acf, channel_index)) { | ||||
| offset += 3; | offset += 3; | ||||
| UI_fontstyle_draw_simple(fstyle, offset, ytext, name, col); | UI_fontstyle_draw_simple(fstyle, offset, ytext, name, col); | ||||
| /* draw red underline if channel is disabled */ | /* draw red underline if channel is disabled */ | ||||
| if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE) && (ale->flag & FCURVE_DISABLED)) { | if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE) && (ale->flag & FCURVE_DISABLED)) { | ||||
| 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_3D_UNIFORM_COLOR); | ||||
| /* FIXME: replace hardcoded color here, and check on extents! */ | /* FIXME: replace hardcoded color here, and check on extents! */ | ||||
| immUniformColor3f(1.0f, 0.0f, 0.0f); | immUniformColor3f(1.0f, 0.0f, 0.0f); | ||||
| GPU_line_width(2.0f); | GPU_line_width(2.0f); | ||||
| immBegin(GPU_PRIM_LINES, 2); | immBegin(GPU_PRIM_LINES, 2); | ||||
| immVertex2f(pos, (float)offset, yminc); | immVertex2f(pos, (float)offset, yminc); | ||||
| Show All 19 Lines | void ANIM_channel_draw( | ||||
| /* TODO: when drawing sliders, make those draw instead of these toggles if not enough space */ | /* TODO: when drawing sliders, make those draw instead of these toggles if not enough space */ | ||||
| if (v2d) { | if (v2d) { | ||||
| short draw_sliders = 0; | short draw_sliders = 0; | ||||
| float ymin_ofs = 0.0f; | float ymin_ofs = 0.0f; | ||||
| float color[3]; | float color[3]; | ||||
| uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); | immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| /* get and set backdrop color */ | /* get and set backdrop color */ | ||||
| acf->get_backdrop_color(ac, ale, color); | acf->get_backdrop_color(ac, ale, color); | ||||
| immUniformColor3fv(color); | immUniformColor3fv(color); | ||||
| /* check if we need to show the sliders */ | /* check if we need to show the sliders */ | ||||
| if ((ac->sl) && ELEM(ac->spacetype, SPACE_ACTION, SPACE_GRAPH)) { | if ((ac->sl) && ELEM(ac->spacetype, SPACE_ACTION, SPACE_GRAPH)) { | ||||
| switch (ac->spacetype) { | switch (ac->spacetype) { | ||||
| ▲ Show 20 Lines • Show All 992 Lines • Show Last 20 Lines | |||||