Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-07-28 10:50:30 +0400
committerJoshua Leung <aligorith@gmail.com>2009-07-28 10:50:30 +0400
commit61178b19eabdc3e3833c167cdc8128db8994f9ca (patch)
tree3f1e666d11155d74b83fa427d6233f63dd22db24 /source/blender/editors/space_graph/graph_draw.c
parent9cbdf73cf0ce53bdf256b1b28efbb066a71e43b9 (diff)
2.5 - Anim Editor cleanups + Graph Editor Clutter Reduction
* Cleaned up some parts of the code that were unused/could be done a bit nicer * Added a new option for only showing the keyframes of the selected F-Curves in the Graph Editor, as another way of reducing the clutter.
Diffstat (limited to 'source/blender/editors/space_graph/graph_draw.c')
-rw-r--r--source/blender/editors/space_graph/graph_draw.c58
1 files changed, 22 insertions, 36 deletions
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index 67a93b2e786..105ecf23c3e 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -723,24 +723,6 @@ static void draw_fcurve_curve_bezts (FCurve *fcu, View2D *v2d, View2DGrid *grid)
glEnd();
}
-#if 0
-static void draw_ipokey(SpaceIpo *sipo, ARegion *ar)
-{
- View2D *v2d= &ar->v2d;
- IpoKey *ik;
-
- glBegin(GL_LINES);
- for (ik= sipo->ipokey.first; ik; ik= ik->next) {
- if (ik->flag & SELECT) glColor3ub(0xFF, 0xFF, 0x99);
- else glColor3ub(0xAA, 0xAA, 0x55);
-
- glVertex2f(ik->val, v2d->cur.ymin);
- glVertex2f(ik->val, v2d->cur.ymax);
- }
- glEnd();
-}
-#endif
-
/* Public Curve-Drawing API ---------------- */
/* Draw the 'ghost' F-Curves (i.e. snapshots of the curve) */
@@ -855,26 +837,30 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar, View2DGri
glDisable(GL_BLEND);
}
- /* 2) draw handles and vertices as appropriate based on active */
- if (fcurve_needs_draw_fmodifier_controls(fcu, fcm)) {
- /* only draw controls if this is the active modifier */
- if ((fcu->flag & FCURVE_ACTIVE) && (fcm)) {
- switch (fcm->type) {
- case FMODIFIER_TYPE_ENVELOPE: /* envelope */
- draw_fcurve_modifier_controls_envelope(fcu, fcm, &ar->v2d);
- break;
+ /* 2) draw handles and vertices as appropriate based on active
+ * - if the option to only show controls if the F-Curve is selected is enabled, we must obey this
+ */
+ if (!(sipo->flag & SIPO_SELCUVERTSONLY) || (fcu->flag & FCURVE_SELECTED)) {
+ if (fcurve_needs_draw_fmodifier_controls(fcu, fcm)) {
+ /* only draw controls if this is the active modifier */
+ if ((fcu->flag & FCURVE_ACTIVE) && (fcm)) {
+ switch (fcm->type) {
+ case FMODIFIER_TYPE_ENVELOPE: /* envelope */
+ draw_fcurve_modifier_controls_envelope(fcu, fcm, &ar->v2d);
+ break;
+ }
}
}
- }
- else if ( ((fcu->bezt) || (fcu->fpt)) && (fcu->totvert) ) {
- if (fcu->bezt) {
- /* only draw handles/vertices on keyframes */
- draw_fcurve_handles(sipo, ar, fcu);
- draw_fcurve_vertices(sipo, ar, fcu);
- }
- else {
- /* samples: should we only draw two indicators at either end as indicators? */
- draw_fcurve_samples(sipo, ar, fcu);
+ else if ( ((fcu->bezt) || (fcu->fpt)) && (fcu->totvert) ) {
+ if (fcu->bezt) {
+ /* only draw handles/vertices on keyframes */
+ draw_fcurve_handles(sipo, ar, fcu);
+ draw_fcurve_vertices(sipo, ar, fcu);
+ }
+ else {
+ /* samples: should we only draw two indicators at either end as indicators? */
+ draw_fcurve_samples(sipo, ar, fcu);
+ }
}
}