diff options
author | Joshua Leung <aligorith@gmail.com> | 2010-01-31 00:11:46 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2010-01-31 00:11:46 +0300 |
commit | 96daa3348d2ab3bdcc0fbbd3fa685eefe1d01067 (patch) | |
tree | beb9fa501d4c62464f4510e187afd98ba081483e /source/blender/editors/space_graph | |
parent | d7d185ef4ab0070d955650454c865fdbfeab5aa6 (diff) |
Bugfixes:
* Old files imported to 2.5 with curves that got cycles FModifiers added during version patching, would not have their keyframes shown for editing.
* #20893: Can't see/show the Properties area in the NLA
I don't know why this worked on a few of my test files several months ago, and yet now fails for many files today.
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 27 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_utils.c | 19 |
2 files changed, 27 insertions, 19 deletions
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 753aeb78dde..8f0cfea5d64 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -337,15 +337,18 @@ static void draw_fcurve_vertices (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, 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) */ - ) { + /* don't draw handle lines if handles are not to be shown */ + if ( (sipo->flag & SIPO_NOHANDLES) || /* handles shouldn't be shown anywhere */ + (fcu->flag & FCURVE_PROTECTED) || /* keyframes aren't editable */ + (fcu->flag & FCURVE_INT_VALUES) || /* editing the handles here will cause weird/incorrect interpolation issues */ + ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) || /* group that curve belongs to is not editable */ + (fcu->totvert <= 1) /* do not show handles if there is only 1 keyframe, otherwise they all clump together in an ugly ball */ + ) + { return 0; - } else { + } + else + { return 1; } } @@ -427,7 +430,7 @@ static void draw_fcurve_handles (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, } } - glEnd(); // GL_LINES + glEnd(); // GL_LINES } /* Samples ---------------- */ @@ -922,14 +925,14 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri if (fcu->bezt) { int do_handles = draw_fcurve_handles_check(sipo, fcu); - - if(do_handles) { + + 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, do_handles); } else { diff --git a/source/blender/editors/space_graph/graph_utils.c b/source/blender/editors/space_graph/graph_utils.c index f642b284491..ca5af4d4794 100644 --- a/source/blender/editors/space_graph/graph_utils.c +++ b/source/blender/editors/space_graph/graph_utils.c @@ -115,12 +115,24 @@ bAnimListElem *get_active_fcurve_channel (bAnimContext *ac) /* check if any FModifiers to draw controls for - fcm is 'active' modifier * used for the polling callbacks + also for drawing */ +// TODO: restructure these tests +// TODO: maybe for now, just allow editing always for now... short fcurve_needs_draw_fmodifier_controls (FCurve *fcu, FModifier *fcm) { /* don't draw if there aren't any modifiers at all */ if (fcu->modifiers.first == NULL) return 0; + /* if only one modifier + * - don't draw if it is muted or disabled + * - set it as the active one if no active one is present + */ + if (fcu->modifiers.first == fcu->modifiers.last) { + fcm= fcu->modifiers.first; + if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) + return 0; + } + /* if there's an active modifier - don't draw if it doesn't drastically * alter the curve... */ @@ -136,13 +148,6 @@ short fcurve_needs_draw_fmodifier_controls (FCurve *fcu, FModifier *fcm) } } - /* if only one modifier - don't draw if it is muted or disabled */ - if (fcu->modifiers.first == fcu->modifiers.last) { - fcm= fcu->modifiers.first; - if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) - return 0; - } - /* if only active modifier - don't draw if it is muted or disabled */ if (fcm) { if (fcm->flag & (FMODIFIER_FLAG_DISABLED|FMODIFIER_FLAG_MUTED)) |