Revision: 19636
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19636
Author:   aligorith
Date:     2009-04-10 15:16:50 +0200 (Fri, 10 Apr 2009)

Log Message:
-----------
2.5 Drivers - Widget Colours

* Widgets now get coloured when driven. The colour used is debatable, but I've 
just set it to a purplish colour so that it's easy to distinguish from 
animated/keyframes/highlight colours.

* New drivers are given generator F-Curve modifiers by default so that they at 
least show up in the view.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/animation/drivers.c
    
branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c

Modified: branches/blender2.5/blender/source/blender/editors/animation/drivers.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/animation/drivers.c      
2009-04-10 13:08:12 UTC (rev 19635)
+++ branches/blender2.5/blender/source/blender/editors/animation/drivers.c      
2009-04-10 13:16:50 UTC (rev 19636)
@@ -93,6 +93,9 @@
                /* add some new driver data */
                fcu->driver= MEM_callocN(sizeof(ChannelDriver), 
"ChannelDriver");
                
+               /* add simple generator modifier for driver so that there is 
some visible representation */
+               fcurve_add_modifier(fcu, FMODIFIER_TYPE_GENERATOR);
+               
                /* just add F-Curve to end of driver list */
                BLI_addtail(&adt->drivers, fcu);
        }

Modified: 
branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c
    2009-04-10 13:08:12 UTC (rev 19635)
+++ 
branches/blender2.5/blender/source/blender/editors/interface/interface_widgets.c
    2009-04-10 13:16:50 UTC (rev 19636)
@@ -96,6 +96,8 @@
        float inner_anim_sel[4];
        float inner_key[4];
        float inner_key_sel[4];
+       float inner_driven[4];
+       float inner_driven_sel[4];
        float item[3];
        float text[3];
        float text_sel[3];
@@ -841,6 +843,8 @@
  float inner_anim_sel[4];
  float inner_key[4];
  float inner_key_sel[4];
+ float inner_driven[4];
+ float inner_driven_sel[4];
  float item[3];
  float text[3];
  float text_sel[3];
@@ -857,6 +861,8 @@
        {0.35, 0.65, 0.2f, 1.0f},
        {0.95, 0.9, 0.4f, 1.0f},
        {0.85, 0.8, 0.3f, 1.0f},
+       {0.7f, 0.0, 1.0f, 1.0f},
+       {0.6f, 0.0, 0.9f, 1.0f},
        {0.35f, 0.35f, 0.35f},
        
        {0.0f, 0.0f, 0.0f},
@@ -874,6 +880,8 @@
        {0.35, 0.65, 0.2f, 1.0f},
        {0.95, 0.9, 0.4f, 1.0f},
        {0.85, 0.8, 0.3f, 1.0f},
+       {0.7f, 0.0, 1.0f, 1.0f},
+       {0.6f, 0.0, 0.9f, 1.0f},
        {0.5f, 0.5f, 0.5f},
        
        {0.0f, 0.0f, 0.0f},
@@ -891,6 +899,8 @@
        {0.35, 0.65, 0.2f, 1.0f},
        {0.95, 0.9, 0.4f, 1.0f},
        {0.85, 0.8, 0.3f, 1.0f},
+       {0.7f, 0.0, 1.0f, 1.0f},
+       {0.6f, 0.0, 0.9f, 1.0f},
        {0.35f, 0.35f, 0.35f},
        
        {0.0f, 0.0f, 0.0f},
@@ -908,6 +918,8 @@
        {0.35, 0.65, 0.2f, 1.0f},
        {0.95, 0.9, 0.4f, 1.0f},
        {0.85, 0.8, 0.3f, 1.0f},
+       {0.7f, 0.0, 1.0f, 1.0f},
+       {0.6f, 0.0, 0.9f, 1.0f},
        {1.0f, 1.0f, 1.0f},
        
        {0.0f, 0.0f, 0.0f},
@@ -926,6 +938,8 @@
        {0.35, 0.65, 0.2f, 1.0f},
        {0.95, 0.9, 0.4f, 1.0f},
        {0.85, 0.8, 0.3f, 1.0f},
+       {0.7f, 0.0, 1.0f, 1.0f},
+       {0.6f, 0.0, 0.9f, 1.0f},
        {1.0f, 1.0f, 1.0f},
        
        {1.0f, 1.0f, 1.0f},
@@ -944,6 +958,8 @@
        {0.35, 0.65, 0.2f, 1.0f},
        {0.95, 0.9, 0.4f, 1.0f},
        {0.85, 0.8, 0.3f, 1.0f},
+       {0.7f, 0.0, 1.0f, 1.0f},
+       {0.6f, 0.0, 0.9f, 1.0f},
        {1.0f, 1.0f, 1.0f},
        
        {1.0f, 1.0f, 1.0f},
@@ -962,6 +978,8 @@
        {0.35, 0.65, 0.2f, 1.0f},
        {0.95, 0.9, 0.4f, 1.0f},
        {0.85, 0.8, 0.3f, 1.0f},
+       {0.7f, 0.0, 1.0f, 1.0f},
+       {0.6f, 0.0, 0.9f, 1.0f},
        {1.0f, 1.0f, 1.0f},
        
        {1.0f, 1.0f, 1.0f},
@@ -980,6 +998,8 @@
        {0.35, 0.65, 0.2f, 1.0f},
        {0.95, 0.9, 0.4f, 1.0f},
        {0.85, 0.8, 0.3f, 1.0f},
+       {0.7f, 0.0, 1.0f, 1.0f},
+       {0.6f, 0.0, 0.9f, 1.0f},
        {1.0f, 1.0f, 1.0f},
        
        {1.0f, 1.0f, 1.0f},
@@ -998,6 +1018,8 @@
        {0.35, 0.65, 0.2f, 1.0f},
        {0.95, 0.9, 0.4f, 1.0f},
        {0.85, 0.8, 0.3f, 1.0f},
+       {0.7f, 0.0, 1.0f, 1.0f},
+       {0.6f, 0.0, 0.9f, 1.0f},
        {1.0f, 1.0f, 1.0f},
        
        {1.0f, 1.0f, 1.0f},
@@ -1015,6 +1037,8 @@
        {0.35, 0.65, 0.2f, 1.0f},
        {0.95, 0.9, 0.4f, 1.0f},
        {0.85, 0.8, 0.3f, 1.0f},
+       {0.7f, 0.0, 1.0f, 1.0f},
+       {0.6f, 0.0, 0.9f, 1.0f},
        {0.1f, 0.1f, 0.1f},
        
        {0.0f, 0.0f, 0.0f},
@@ -1032,6 +1056,8 @@
        {0.35, 0.65, 0.2f, 1.0f},
        {0.95, 0.9, 0.4f, 1.0f},
        {0.85, 0.8, 0.3f, 1.0f},
+       {0.7f, 0.0, 1.0f, 1.0f},
+       {0.6f, 0.0, 0.9f, 1.0f},
        {0.1f, 0.1f, 0.1f},
        
        {0.0f, 0.0f, 0.0f},
@@ -1053,8 +1079,8 @@
                        QUATCOPY(wt->wcol.inner, wt->wcol.inner_key_sel)
                else if(state & UI_BUT_ANIMATED)
                        QUATCOPY(wt->wcol.inner, wt->wcol.inner_anim_sel)
-               //else if(state & UI_BUT_DRIVEN)
-               //      QUATCOPY(wt->wcol.inner, wt->wcol.inner_driven_sel)
+               else if(state & UI_BUT_DRIVEN)
+                       QUATCOPY(wt->wcol.inner, wt->wcol.inner_driven_sel)
                else
                        QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel)
 
@@ -1070,6 +1096,8 @@
                        QUATCOPY(wt->wcol.inner, wt->wcol.inner_key)
                else if(state & UI_BUT_ANIMATED)
                        QUATCOPY(wt->wcol.inner, wt->wcol.inner_anim)
+               else if(state & UI_BUT_DRIVEN)
+                       QUATCOPY(wt->wcol.inner, wt->wcol.inner_driven)
 
                if(state & UI_ACTIVE) /* mouse over? */
                        VecMulf(wt->wcol.inner, 1.1f);


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to