Graph Editor: Experimental variations of curve display
authorJoshua Leung <aligorith@gmail.com>
Thu, 12 Feb 2009 01:47:45 +0000 (01:47 +0000)
committerJoshua Leung <aligorith@gmail.com>
Thu, 12 Feb 2009 01:47:45 +0000 (01:47 +0000)
* Uneditable F-Curves are drawn with dotted lines (and no handles)
* Muted F-Curves are drawn with a greyish colour. I'm not sure how visible this will be under some other colour schemes. Perhaps this needs as separate theme colour?

source/blender/editors/space_graph/graph_draw.c

index 8df483b9048c9f1bfb4a1de3dde67790fd7d5337..077706f0c2b79054308608afa6abe3633448a45f 100644 (file)
@@ -707,11 +707,29 @@ void graph_draw_curves (bAnimContext *ac, SpaceIpo *sipo, ARegion *ar)
                
                /* draw curve - we currently calculate colour on the fly, but that should probably be done in advance instead */
                if ( ((fcu->bezt) || (fcu->fpt)) && (fcu->totvert) ) { 
-                       col= ipo_rainbow(i, items);
-                       cpack(col);
+                       /* set color/drawing style for curve itself */
+                       if (fcu->flag & FCURVE_PROTECTED) {
+                               /* protected curves (non editable) are drawn with dotted lines */
+                               setlinestyle(2);
+                       }
+                       if (fcu->flag & FCURVE_MUTED) {
+                               /* muted curves are drawn in a greyish hue */
+                               // XXX should we have some variations?
+                               UI_ThemeColorShade(TH_HEADER, 50);
+                       }
+                       else {
+                               // XXX color calculation here really needs to be done in advance instead
+                               col= ipo_rainbow(i, items);
+                               cpack(col);
+                       }
                        
+                       /* draw F-Curve */
                        draw_fcurve_repeat(fcu, &ar->v2d, 0, 0, &fac); // XXX this call still needs a lot more work
                        
+                       /* restore settings */
+                       setlinestyle(0);
+                       
+                       
                        /* draw handles and vertices as appropriate */
                        if (fcu->bezt) {
                                /* only draw handles/vertices on keyframes */