diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-30 20:17:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-30 20:17:23 +0300 |
commit | 41861eecd14225015aaaac6e83b29158acbe4cf0 (patch) | |
tree | 98a0ae860ac3d539dea1a552236680cbffd57cbc /source/blender/editors/space_graph | |
parent | 29377db3f1c427d50031a479b2c082a47c6ac163 (diff) |
[#20892] Locking animation curves with Tab Key don't hide the curves handles
drawing handles for fcurves wasnt checking ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED))
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 8642c2d15c5..753aeb78dde 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -300,7 +300,7 @@ static void set_fcurve_vertex_color (SpaceIpo *sipo, FCurve *fcu, short sel) } -void draw_fcurve_vertices (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, FCurve *fcu) +static void draw_fcurve_vertices (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, FCurve *fcu, int do_handles) { View2D *v2d= &ar->v2d; @@ -314,8 +314,7 @@ void draw_fcurve_vertices (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, FCurve glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); /* draw the two handles first (if they're shown, the curve doesn't have just a single keyframe, and the curve is being edited) */ - if ((fcu->flag & FCURVE_PROTECTED)==0 && (fcu->flag & FCURVE_INT_VALUES)==0 && - (sipo->flag & SIPO_NOHANDLES)==0 && (fcu->totvert > 1)) + if (do_handles) { set_fcurve_vertex_color(sipo, fcu, 0); draw_fcurve_vertices_handles(ac, sipo, fcu, v2d, 0); @@ -336,16 +335,28 @@ void draw_fcurve_vertices (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, FCurve /* Handles ---------------- */ -/* draw lines for F-Curve handles only (this is only done in EditMode) */ +static int draw_fcurve_handles_check(SpaceIpo *sipo, FCurve *fcu) +{ + /* don't draw handle lines if handles are not shown */ + if ( (sipo->flag & SIPO_NOHANDLES) || + (fcu->flag & FCURVE_PROTECTED) || + (fcu->flag & FCURVE_INT_VALUES) || + ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) + /* || (fcu->totvert <= 1) */ + ) { + return 0; + } else { + return 1; + } +} + +/* draw lines for F-Curve handles only (this is only done in EditMode) + * note: draw_fcurve_handles_check must be checked before running this. */ static void draw_fcurve_handles (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, FCurve *fcu) { extern unsigned int nurbcol[]; int sel, b; - /* don't draw handle lines if handles are not shown */ - if ((sipo->flag & SIPO_NOHANDLES) || (fcu->flag & FCURVE_PROTECTED) || (fcu->flag & FCURVE_INT_VALUES)) - return; - /* a single call to GL_LINES here around these calls should be sufficient to still * get separate line segments, but which aren't wrapped with GL_LINE_STRIP everytime we * want a single line @@ -910,12 +921,16 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri ANIM_unit_mapping_apply_fcurve(ac->scene, ale->id, fcu, 0); if (fcu->bezt) { - /* only draw handles/vertices on keyframes */ - glEnable(GL_BLEND); + int do_handles = draw_fcurve_handles_check(sipo, fcu); + + if(do_handles) { + /* only draw handles/vertices on keyframes */ + glEnable(GL_BLEND); draw_fcurve_handles(ac, sipo, ar, fcu); - glDisable(GL_BLEND); - - draw_fcurve_vertices(ac, sipo, ar, fcu); + glDisable(GL_BLEND); + } + + draw_fcurve_vertices(ac, sipo, ar, fcu, do_handles); } else { /* samples: only draw two indicators at either end as indicators */ |